2018-12-19 00:13:18 +08:00
|
|
|
/*
|
2022-07-19 19:40:43 +08:00
|
|
|
Copyright (c) 2008-2022 Jan W. Krieger (<jan@jkrieger.de>)
|
2018-12-19 00:13:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This software is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License (LGPL) as published by
|
2019-02-08 00:24:46 +08:00
|
|
|
the Free Software Foundation, either version 2.1 of the License, or
|
2018-12-19 00:13:18 +08:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Lesser General Public License (LGPL) for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License (LGPL)
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-06-20 21:18:58 +08:00
|
|
|
#include "jkqtplotter/gui/jkqtpcomboboxes.h"
|
2018-12-19 00:13:18 +08:00
|
|
|
#include "jkqtplotter/jkqtpbaseplotter.h"
|
2019-05-30 04:40:02 +08:00
|
|
|
#include "jkqtplotter/jkqtptools.h"
|
2018-12-19 00:13:18 +08:00
|
|
|
#include <QImage>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JKQTPMathImageColorPaletteComboBox::JKQTPMathImageColorPaletteComboBox(QWidget *parent):
|
|
|
|
QComboBox(parent)
|
|
|
|
{
|
2019-02-08 00:24:46 +08:00
|
|
|
setIconSize(QSize(JKQTPImageTools::PALETTE_ICON_WIDTH,16));
|
* reworked color-palette-system:
1. added several new (JKQTPMathImageBone, JKQTPMathImageCool, JKQTPMathImageCopper, JKQTPMathImageAutumn, JKQTPMathImageSeismic, JKQTPMathImageTerrain, JKQTPMathImageViridis, JKQTPMathImageMagma, JKQTPMathImageInferno, JKQTPMathImagePlasma)
2. reworked LUT-types (now a QVector, instead of a C-array, suing malloc)
3. reworked available functions to build LUTs (cleanup, more options, clearer names)
4. added functions to load palettes from files
5. Improved documentation
* added example for user-controlled color palettes
2019-07-28 20:59:09 +08:00
|
|
|
QStringList pal=JKQTPImageTools::getPredefinedPalettes();
|
2018-12-19 00:13:18 +08:00
|
|
|
clear();
|
|
|
|
for (int i=0; i<pal.size(); i++) {
|
* reworked color-palette-system:
1. added several new (JKQTPMathImageBone, JKQTPMathImageCool, JKQTPMathImageCopper, JKQTPMathImageAutumn, JKQTPMathImageSeismic, JKQTPMathImageTerrain, JKQTPMathImageViridis, JKQTPMathImageMagma, JKQTPMathImageInferno, JKQTPMathImagePlasma)
2. reworked LUT-types (now a QVector, instead of a C-array, suing malloc)
3. reworked available functions to build LUTs (cleanup, more options, clearer names)
4. added functions to load palettes from files
5. Improved documentation
* added example for user-controlled color palettes
2019-07-28 20:59:09 +08:00
|
|
|
addItem(JKQTPImageTools::GetPaletteIcon(i), pal[i]);
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(intIndexChanged(int)));
|
|
|
|
}
|
|
|
|
|
|
|
|
JKQTPMathImageColorPalette JKQTPMathImageColorPaletteComboBox::colorPalette() const
|
|
|
|
{
|
|
|
|
return JKQTPMathImageColorPalette(currentIndex());
|
|
|
|
}
|
|
|
|
|
|
|
|
JKQTPMathImageColorPalette JKQTPMathImageColorPaletteComboBox::currentColorPalette() const
|
|
|
|
{
|
|
|
|
return colorPalette();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
JKQTPMathImageColorPalette JKQTPMathImageColorPaletteComboBox::getColorPalette() const
|
|
|
|
{
|
|
|
|
return colorPalette();
|
|
|
|
}
|
|
|
|
|
|
|
|
void JKQTPMathImageColorPaletteComboBox::setColorPalette(JKQTPMathImageColorPalette palette)
|
|
|
|
{
|
|
|
|
setCurrentIndex(int(palette));
|
|
|
|
}
|
|
|
|
|
|
|
|
void JKQTPMathImageColorPaletteComboBox::setCurrentColorPalette(JKQTPMathImageColorPalette palette)
|
|
|
|
{
|
|
|
|
setCurrentIndex(int(palette));
|
|
|
|
}
|
|
|
|
|
|
|
|
void JKQTPMathImageColorPaletteComboBox::intIndexChanged(int i)
|
|
|
|
{
|
|
|
|
emit currentPaletteChanged(JKQTPMathImageColorPalette(i));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JKQTPSymbolComboBox::JKQTPSymbolComboBox(QWidget *parent):
|
|
|
|
QComboBox(parent)
|
|
|
|
{
|
|
|
|
clear();
|
|
|
|
setEditable(false);
|
2019-01-20 17:49:29 +08:00
|
|
|
for (int i=0; i<=JKQTPMaxSymbolID; i++) {
|
|
|
|
addSymbol(static_cast<JKQTPGraphSymbols>(i), JKQTPGraphSymbols2NameString(static_cast<JKQTPGraphSymbols>(i)));
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
setCurrentIndex(0);
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPGraphSymbols JKQTPSymbolComboBox::getSymbol() const
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
return String2JKQTPGraphSymbols(itemData(currentIndex()).toString());
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
2019-04-22 19:27:50 +08:00
|
|
|
void JKQTPSymbolComboBox::setSymbolType(JKQTPGraphSymbols symbol)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
int i=findData(JKQTPGraphSymbols2String(symbol));
|
2018-12-19 00:13:18 +08:00
|
|
|
if (i>=0) setCurrentIndex(i);
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPSymbolComboBox::setCurrentSymbol(JKQTPGraphSymbols symbol)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-04-22 19:27:50 +08:00
|
|
|
setSymbolType(symbol);
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPSymbolComboBox::addSymbol(JKQTPGraphSymbols symbol, const QString &name)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2022-09-02 03:37:50 +08:00
|
|
|
const qreal dpr = devicePixelRatioF();
|
|
|
|
QPixmap pix(12*dpr,12*dpr);
|
|
|
|
pix.setDevicePixelRatio(dpr);
|
2018-12-19 00:13:18 +08:00
|
|
|
pix.fill(Qt::transparent);
|
|
|
|
JKQTPEnhancedPainter p;
|
|
|
|
p.begin(&pix);
|
|
|
|
p.setRenderHint(JKQTPEnhancedPainter::Antialiasing);
|
|
|
|
p.setRenderHint(JKQTPEnhancedPainter::TextAntialiasing);
|
2022-09-02 20:19:47 +08:00
|
|
|
JKQTPPlotSymbol(p, 6.0*dpr,6.0*dpr,symbol,10.0*dpr,1,QColor("blue"), QColor("blue").lighter(),font().family());
|
2018-12-19 00:13:18 +08:00
|
|
|
p.end();
|
2019-01-20 17:49:29 +08:00
|
|
|
addItem(QIcon(pix), name, JKQTPGraphSymbols2String(symbol));
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JKQTPLinePlotStyleComboBox::JKQTPLinePlotStyleComboBox(QWidget *parent):
|
|
|
|
QComboBox(parent)
|
|
|
|
{
|
|
|
|
setEditable(false);
|
2019-01-20 17:49:29 +08:00
|
|
|
defaultSymbol=JKQTPCross;
|
2018-12-19 00:13:18 +08:00
|
|
|
refill();
|
|
|
|
setCurrentIndex(0);
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPLinePlotStyleComboBox::setDefaultSymbol(JKQTPGraphSymbols symbol)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
|
|
|
defaultSymbol=symbol;
|
|
|
|
refill();
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPLinePlotStyleComboBox::addUsedSymbol(JKQTPGraphSymbols symbol)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
|
|
|
if (!symbols.contains(symbol)) symbols.append(symbol);
|
|
|
|
refill();
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPGraphSymbols JKQTPLinePlotStyleComboBox::getSymbol() const
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
|
|
|
bool ok=true;
|
|
|
|
int idx=itemData(currentIndex()).toInt(&ok);
|
2019-01-20 17:49:29 +08:00
|
|
|
if (idx==-2) return JKQTPNoSymbol;
|
2018-12-19 00:13:18 +08:00
|
|
|
if (idx>=0&&ok) return symbols.value(idx, defaultSymbol);
|
|
|
|
return defaultSymbol;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool JKQTPLinePlotStyleComboBox::getDrawLine() const
|
|
|
|
{
|
|
|
|
return currentIndex()%2==0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void JKQTPLinePlotStyleComboBox::refill()
|
|
|
|
{
|
|
|
|
QString txt=currentText();
|
|
|
|
setUpdatesEnabled(false);
|
|
|
|
clear();
|
2019-01-20 17:49:29 +08:00
|
|
|
addSymbol(JKQTPNoSymbol, true, tr("line"), -2);
|
|
|
|
addSymbol(defaultSymbol, false, JKQTPGraphSymbols2NameString(defaultSymbol), -1);
|
|
|
|
addSymbol(defaultSymbol, true, JKQTPGraphSymbols2NameString(defaultSymbol)+tr("+line"), -1);
|
2018-12-19 00:13:18 +08:00
|
|
|
for (int i=0; i<symbols.size(); i++) {
|
|
|
|
if (symbols[i]!=defaultSymbol) {
|
2019-01-20 17:49:29 +08:00
|
|
|
addSymbol(symbols[i], false, JKQTPGraphSymbols2NameString(symbols[i]), i);
|
|
|
|
addSymbol(symbols[i], true, JKQTPGraphSymbols2NameString(symbols[i])+tr("+line"), i);
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
}
|
2019-01-20 17:49:29 +08:00
|
|
|
addSymbol(JKQTPNoSymbol, false, "none", -2);
|
2018-12-19 00:13:18 +08:00
|
|
|
int idx=findText(txt);
|
|
|
|
if (idx>=0) setCurrentIndex(idx);
|
|
|
|
else setCurrentIndex(0);
|
|
|
|
setUpdatesEnabled(true);
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPLinePlotStyleComboBox::addSymbol(JKQTPGraphSymbols symbol, bool line, const QString &name, const QVariant &data)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2022-09-02 03:37:50 +08:00
|
|
|
const qreal dpr = devicePixelRatioF();
|
|
|
|
QPixmap pix(12*dpr,12*dpr);
|
|
|
|
pix.setDevicePixelRatio(dpr);
|
2018-12-19 00:13:18 +08:00
|
|
|
pix.fill(Qt::transparent);
|
|
|
|
JKQTPEnhancedPainter p;
|
|
|
|
p.begin(&pix);
|
|
|
|
p.setRenderHint(JKQTPEnhancedPainter::Antialiasing);
|
|
|
|
p.setRenderHint(JKQTPEnhancedPainter::TextAntialiasing);
|
2022-09-02 20:19:47 +08:00
|
|
|
JKQTPPlotSymbol(p, 6.0*dpr,6.0*dpr,symbol,7.0*dpr,1,QColor("blue"), QColor("blue").lighter(), font().family());
|
2018-12-19 00:13:18 +08:00
|
|
|
p.setPen(QColor("blue"));
|
2022-09-02 03:37:50 +08:00
|
|
|
if (line) p.drawLine(0,6*dpr,12*dpr,6*dpr);
|
2018-12-19 00:13:18 +08:00
|
|
|
p.end();
|
|
|
|
addItem(QIcon(pix), name, data);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPErrorPlotstyleComboBox::JKQTPErrorPlotstyleComboBox(QWidget *parent):
|
2018-12-19 00:13:18 +08:00
|
|
|
QComboBox(parent)
|
|
|
|
{
|
|
|
|
setEditable(false);
|
2019-01-20 23:15:10 +08:00
|
|
|
addSymbol(JKQTPNoError, tr("none"), QIcon(":/JKQTPlotter/jkqtp_enone.png"));
|
|
|
|
addSymbol(JKQTPErrorLines, tr("error lines"), QIcon(":/JKQTPlotter/jkqtp_elines.png"));
|
|
|
|
addSymbol(JKQTPErrorBars, tr("error bars"), QIcon(":/JKQTPlotter/jkqtp_ebars.png"));
|
|
|
|
addSymbol(JKQTPErrorSimpleBars, tr("simple error bars"), QIcon(":/JKQTPlotter/jkqtp_esbars.png"));
|
|
|
|
addSymbol(JKQTPErrorPolygons, tr("error polygons"), QIcon(":/JKQTPlotter/jkqtp_epoly.png"));
|
|
|
|
addSymbol(JKQTPErrorBarsLines, tr("bars + lines"), QIcon(":/JKQTPlotter/jkqtp_elinesbars.png"));
|
|
|
|
addSymbol(JKQTPErrorBarsPolygons, tr("bars + polygons"), QIcon(":/JKQTPlotter/jkqtp_epolybars.png"));
|
|
|
|
addSymbol(JKQTPErrorSimpleBarsLines, tr("simple bars + lines"), QIcon(":/JKQTPlotter/jkqtp_elinessbars.png"));
|
|
|
|
addSymbol(JKQTPErrorSimpleBarsPolygons, tr("simple bars + polygons"), QIcon(":/JKQTPlotter/jkqtp_epolysbars.png"));
|
|
|
|
addSymbol(JKQTPErrorBoxes, tr("boxes"), QIcon(":/JKQTPlotter/jkqtp_eboxes.png"));
|
|
|
|
addSymbol(JKQTPErrorEllipses, tr("ellipses"), QIcon(":/JKQTPlotter/jkqtp_eellipses.png"));
|
2018-12-19 00:13:18 +08:00
|
|
|
setCurrentIndex(2);
|
|
|
|
}
|
|
|
|
|
2019-05-06 01:31:20 +08:00
|
|
|
JKQTPErrorPlotstyle JKQTPErrorPlotstyleComboBox::getErrorLineStyle() const
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
return String2JKQTPErrorPlotstyle(itemData(currentIndex()).toString());
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
2019-04-22 19:27:50 +08:00
|
|
|
void JKQTPErrorPlotstyleComboBox::setSymbolType(JKQTPErrorPlotstyle symbol)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
int i=findData(JKQTPErrorPlotstyle2String(symbol));
|
2018-12-19 00:13:18 +08:00
|
|
|
if (i>=0) setCurrentIndex(i);
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPErrorPlotstyleComboBox::setCurrentErrorStyle(JKQTPErrorPlotstyle symbol)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
int i=findData(JKQTPErrorPlotstyle2String(symbol));
|
2018-12-19 00:13:18 +08:00
|
|
|
if (i>=0) setCurrentIndex(i);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPErrorPlotstyleComboBox::addSymbol(JKQTPErrorPlotstyle symbol, const QString &name, const QIcon& icon)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
addItem(icon, name, JKQTPErrorPlotstyle2String(symbol));
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPKeyPositionComboBox::JKQTPKeyPositionComboBox(QWidget *parent):
|
2018-12-19 00:13:18 +08:00
|
|
|
QComboBox(parent)
|
|
|
|
{
|
|
|
|
setEditable(false);
|
2019-01-20 23:15:10 +08:00
|
|
|
addPosition(JKQTPKeyInsideTopRight, tr("inside, top-right"), QIcon(":/JKQTPlotter/jkqtp_key_itr.png"));
|
|
|
|
addPosition(JKQTPKeyInsideTopLeft, tr("inside, top-left"), QIcon(":/JKQTPlotter/jkqtp_key_itl.png"));
|
|
|
|
addPosition(JKQTPKeyInsideBottomLeft, tr("inside, bottom-left"), QIcon(":/JKQTPlotter/jkqtp_key_ibl.png"));
|
|
|
|
addPosition(JKQTPKeyInsideBottomRight, tr("inside, bottom-right"), QIcon(":/JKQTPlotter/jkqtp_key_ibr.png"));
|
|
|
|
addPosition(JKQTPKeyOutsideTopRight, tr("outside, top-right"), QIcon(":/JKQTPlotter/jkqtp_key_otr.png"));
|
|
|
|
addPosition(JKQTPKeyOutsideTopLeft, tr("outside, top-left"), QIcon(":/JKQTPlotter/jkqtp_key_otl.png"));
|
|
|
|
addPosition(JKQTPKeyOutsideLeftTop, tr("outside, left-top"), QIcon(":/JKQTPlotter/jkqtp_key_olt.png"));
|
|
|
|
addPosition(JKQTPKeyOutsideLeftBottom, tr("outside, left-bottom"), QIcon(":/JKQTPlotter/jkqtp_key_olb.png"));
|
|
|
|
addPosition(JKQTPKeyOutsideBottomRight, tr("outside, bottom-right"), QIcon(":/JKQTPlotter/jkqtp_key_obr.png"));
|
|
|
|
addPosition(JKQTPKeyOutsideBottomLeft, tr("outside, bottom-left"), QIcon(":/JKQTPlotter/jkqtp_key_obl.png"));
|
|
|
|
addPosition(JKQTPKeyOutsideRightTop, tr("outside, right-top"), QIcon(":/JKQTPlotter/jkqtp_key_ort.png"));
|
|
|
|
addPosition(JKQTPKeyOutsideRightBottom, tr("outside, right-bottom"), QIcon(":/JKQTPlotter/jkqtp_key_orb.png"));
|
2018-12-19 00:13:18 +08:00
|
|
|
setCurrentIndex(0);
|
|
|
|
connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(posChanged(int)));
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPKeyPosition JKQTPKeyPositionComboBox::getPosition() const
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
return String2JKQTPKeyPosition(itemData(currentIndex()).toString());
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPKeyPositionComboBox::setPosition(JKQTPKeyPosition position)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
int i=findData(JKQTPKeyPosition2String(position));
|
2018-12-19 00:13:18 +08:00
|
|
|
if (i>=0) setCurrentIndex(i);
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPKeyPositionComboBox::addPosition(JKQTPKeyPosition position, const QString &name, const QIcon &icon)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
addItem(icon, name, JKQTPKeyPosition2String(position));
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPKeyPositionComboBox::posChanged(int index)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
emit currentPositionChanged(String2JKQTPKeyPosition(itemData(index).toString()));
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPKeyLayoutComboBox::JKQTPKeyLayoutComboBox(QWidget *parent):
|
2018-12-19 00:13:18 +08:00
|
|
|
QComboBox(parent)
|
|
|
|
{
|
|
|
|
setEditable(false);
|
2019-01-20 17:49:29 +08:00
|
|
|
addKeyLayout(JKQTPKeyLayoutOneColumn, tr("one column"));
|
|
|
|
addKeyLayout(JKQTPKeyLayoutOneRow, tr("one row"));
|
|
|
|
addKeyLayout(JKQTPKeyLayoutMultiColumn, tr("multiple columns"));
|
2018-12-19 00:13:18 +08:00
|
|
|
setCurrentIndex(0);
|
|
|
|
connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(currentIndexChangedP(int)));
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPKeyLayout JKQTPKeyLayoutComboBox::getKeyLayout() const
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
return String2JKQTPKeyLayout(itemData(currentIndex()).toString());
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPKeyLayoutComboBox::setKeyLayout(JKQTPKeyLayout position)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
int i=findData(JKQTPKeyLayout2String(position));
|
2018-12-19 00:13:18 +08:00
|
|
|
if (i>=0) setCurrentIndex(i);
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPKeyLayoutComboBox::addKeyLayout(JKQTPKeyLayout position, const QString &name)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
addItem(name, JKQTPKeyLayout2String(position));
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPKeyLayoutComboBox::currentIndexChangedP(int index)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
emit currentLayoutChanged(String2JKQTPKeyLayout(itemData(index).toString()));
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPLabelPositionComboBox::JKQTPLabelPositionComboBox(QWidget *parent):
|
2018-12-19 00:13:18 +08:00
|
|
|
QComboBox(parent)
|
|
|
|
{
|
|
|
|
setEditable(false);
|
2019-01-20 17:49:29 +08:00
|
|
|
addPosition(JKQTPLabelCenter, tr("center"));
|
|
|
|
addPosition(JKQTPLabelMin, tr("left"));
|
|
|
|
addPosition(JKQTPLabelMax, tr("right"));
|
2018-12-19 00:13:18 +08:00
|
|
|
setCurrentIndex(0);
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPLabelPosition JKQTPLabelPositionComboBox::getPosition() const
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
return String2JKQTPLabelPosition(itemData(currentIndex()).toString());
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPLabelPositionComboBox::setPosition(JKQTPLabelPosition position)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
int i=findData(JKQTPLabelPosition2String(position));
|
2018-12-19 00:13:18 +08:00
|
|
|
if (i>=0) setCurrentIndex(i);
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPLabelPositionComboBox::addPosition(JKQTPLabelPosition position, const QString &name, const QIcon &icon)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
addItem(icon, name, JKQTPLabelPosition2String(position));
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPCALabelTypeComboBox::JKQTPCALabelTypeComboBox(QWidget *parent):
|
2018-12-19 00:13:18 +08:00
|
|
|
QComboBox(parent)
|
|
|
|
{
|
|
|
|
setEditable(false);
|
2019-01-20 23:15:10 +08:00
|
|
|
addLabelType(JKQTPCALTexponent, tr("exponent"), QIcon(":/JKQTPlotter/jkqtp_ticks_exp.png"));
|
|
|
|
addLabelType(JKQTPCALTdefault, tr("default"), QIcon(":/JKQTPlotter/jkqtp_ticks_default.png"));
|
2022-09-24 06:16:57 +08:00
|
|
|
addLabelType(JKQTPCALTscientific, tr("scientific"), QIcon(":/JKQTPlotter/jkqtp_ticks_scientific.png"));
|
2019-01-20 23:15:10 +08:00
|
|
|
addLabelType(JKQTPCALTexponentCharacter, tr("character"), QIcon(":/JKQTPlotter/jkqtp_ticks_expchar.png"));
|
2022-09-24 06:16:57 +08:00
|
|
|
addLabelType(JKQTPCALTprintf, tr("printf"), QIcon(":/JKQTPlotter/jkqtp_ticks_printf.png"));
|
2019-01-20 23:15:10 +08:00
|
|
|
addLabelType(JKQTPCALTtime, tr("time"), QIcon(":/JKQTPlotter/jkqtp_ticks_time.png"));
|
|
|
|
addLabelType(JKQTPCALTdate, tr("date"), QIcon(":/JKQTPlotter/jkqtp_ticks_date.png"));
|
|
|
|
addLabelType(JKQTPCALTdatetime, tr("datetime"), QIcon(":/JKQTPlotter/jkqtp_ticks_datetime.png"));
|
2022-09-22 06:44:54 +08:00
|
|
|
addLabelType(JKQTPCALTfrac, tr("fraction"), QIcon(":/JKQTPlotter/jkqtp_ticks_frac.png"));
|
|
|
|
addLabelType(JKQTPCALTsfrac, tr("\\sfrac fraction"), QIcon(":/JKQTPlotter/jkqtp_ticks_sfrac.png"));
|
|
|
|
addLabelType(JKQTPCALTslashfrac, tr("slash fraction"), QIcon(":/JKQTPlotter/jkqtp_ticks_slashfrac.png"));
|
2018-12-19 00:13:18 +08:00
|
|
|
setCurrentIndex(0);
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPCALabelType JKQTPCALabelTypeComboBox::getLabelType() const
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
return String2JKQTPCALabelType(itemData(currentIndex()).toString());
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPCALabelTypeComboBox::setLabelType(JKQTPCALabelType position)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
int i=findData(JKQTPCALabelType2String(position));
|
2018-12-19 00:13:18 +08:00
|
|
|
if (i>=0) setCurrentIndex(i);
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPCALabelTypeComboBox::addLabelType(JKQTPCALabelType position, const QString &name, const QIcon& icon)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
addItem(icon, name, JKQTPCALabelType2String(position));
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPCADrawModeComboBox::JKQTPCADrawModeComboBox(QWidget *parent):
|
2018-12-19 00:13:18 +08:00
|
|
|
QComboBox(parent)
|
|
|
|
{
|
|
|
|
setEditable(false);
|
2019-01-20 23:15:10 +08:00
|
|
|
addDrawMode(JKQTPCADMcomplete, tr("complete"), QIcon(":/JKQTPlotter/jkqtp_axis_complete.png"));
|
2022-09-24 02:43:53 +08:00
|
|
|
addDrawMode(JKQTPCADMcompleteMaxArrow, tr("complete with max arrow"), QIcon(":/JKQTPlotter/jkqtp_axis_complete_maxarrow.png"));
|
|
|
|
addDrawMode(JKQTPCADMcompleteMinMaxArrow, tr("complete wih min&max arrows"), QIcon(":/JKQTPlotter/jkqtp_axis_complete_minmaxarrow.png"));
|
2019-02-08 00:24:46 +08:00
|
|
|
addDrawMode(JKQTPCADMLineTicksTickLabels, tr("line+tick+labels"), QIcon(":/JKQTPlotter/jkqtp_axis_ticksandlabels.png"));
|
|
|
|
addDrawMode(JKQTPCADMLineTicks, tr("line+tick"), QIcon(":/JKQTPlotter/jkqtp_axis_ticks.png"));
|
|
|
|
addDrawMode(JKQTPCADMLine, tr("line"), QIcon(":/JKQTPlotter/jkqtp_axis_line.png"));
|
|
|
|
addDrawMode(JKQTPCADMLineTicksTickLabels, tr("line+tick+labels"), QIcon(":/JKQTPlotter/jkqtp_axis_ticksandlabels.png"));
|
|
|
|
addDrawMode(JKQTPCADMLineTicks, tr("line+tick"), QIcon(":/JKQTPlotter/jkqtp_axis_ticks.png"));
|
|
|
|
addDrawMode(JKQTPCADMTicksTickLabelsAxisLabel, tr("ticks+labels+axis label"));
|
|
|
|
addDrawMode(JKQTPCADMTicksTickLabels, tr("ticks+labels"));
|
|
|
|
addDrawMode(JKQTPCADMTicks, tr("ticks"));
|
|
|
|
addDrawMode(JKQTPCADMTickLabelsAxisLabel, tr("labels+axis label"));
|
|
|
|
addDrawMode(JKQTPCADMTickLabels, tr("labels"));
|
2019-01-20 23:15:10 +08:00
|
|
|
addDrawMode(JKQTPCADMnone, tr("none"), QIcon(":/JKQTPlotter/jkqtp_axis_none.png"));
|
2018-12-19 00:13:18 +08:00
|
|
|
setCurrentIndex(0);
|
|
|
|
}
|
|
|
|
|
2019-02-08 00:24:46 +08:00
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPCADrawMode JKQTPCADrawModeComboBox::getDrawMode() const
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
return String2JKQTPCADrawMode(itemData(currentIndex()).toString());
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPCADrawModeComboBox::setDrawMode(JKQTPCADrawMode position)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
int i=findData(JKQTPCADrawMode2String(position));
|
2018-12-19 00:13:18 +08:00
|
|
|
if (i>=0) setCurrentIndex(i);
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPCADrawModeComboBox::addDrawMode(JKQTPCADrawMode position, const QString &name, const QIcon &icon)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-20 17:49:29 +08:00
|
|
|
addItem(icon, name, JKQTPCADrawMode2String(position));
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JKQTPLinePlotStyleWithSymbolSizeComboBox::JKQTPLinePlotStyleWithSymbolSizeComboBox(QWidget *parent):
|
|
|
|
QComboBox(parent)
|
|
|
|
{
|
|
|
|
setEditable(false);
|
2019-01-20 17:49:29 +08:00
|
|
|
defaultSymbol=JKQTPCross;
|
2018-12-19 00:13:18 +08:00
|
|
|
defaultSize=10;
|
|
|
|
refill();
|
|
|
|
setCurrentIndex(0);
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPLinePlotStyleWithSymbolSizeComboBox::setDefaultSymbol(JKQTPGraphSymbols symbol, double size)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
|
|
|
defaultSymbol=symbol;
|
|
|
|
defaultSize=size;
|
|
|
|
refill();
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPLinePlotStyleWithSymbolSizeComboBox::addUsedSymbol(JKQTPGraphSymbols symbol, double symbolSize, bool line)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
|
|
|
styleData d;
|
|
|
|
d.symbol=symbol;
|
|
|
|
d.symbolSize=symbolSize;
|
|
|
|
d.line=line;
|
|
|
|
if (!symbols.contains(d)) symbols.append(d);
|
|
|
|
refill();
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPGraphSymbols JKQTPLinePlotStyleWithSymbolSizeComboBox::getSymbol() const
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
|
|
|
QVariant idxV=itemData(currentIndex());
|
|
|
|
bool ok=false;
|
|
|
|
int idx=idxV.toInt(&ok);
|
|
|
|
if (idxV.isValid() && ok) {
|
|
|
|
if (idx>=0 && idx<symbols.size()) return symbols[idx].symbol;
|
2019-01-20 17:49:29 +08:00
|
|
|
if (idx==-4) return JKQTPNoSymbol;
|
|
|
|
if (idx==-3) return JKQTPNoSymbol;
|
2018-12-19 00:13:18 +08:00
|
|
|
return defaultSymbol;
|
|
|
|
}
|
2019-01-20 17:49:29 +08:00
|
|
|
return JKQTPNoSymbol;
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool JKQTPLinePlotStyleWithSymbolSizeComboBox::getDrawLine() const
|
|
|
|
{
|
|
|
|
QVariant idxV=itemData(currentIndex());
|
|
|
|
bool ok=false;
|
|
|
|
int idx=idxV.toInt(&ok);
|
|
|
|
if (idxV.isValid() && ok) {
|
|
|
|
if (idx==-3) return true;
|
|
|
|
if (idx==-1) return true;
|
|
|
|
if (idx>=0 && idx<symbols.size()) return symbols[idx].line;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
double JKQTPLinePlotStyleWithSymbolSizeComboBox::getSymbolSize() const
|
|
|
|
{
|
|
|
|
QVariant idxV=itemData(currentIndex());
|
|
|
|
bool ok=false;
|
|
|
|
int idx=idxV.toInt(&ok);
|
|
|
|
if (idxV.isValid() && ok) {
|
|
|
|
if (idx>=0 && idx<symbols.size()) return symbols[idx].symbolSize;
|
|
|
|
return defaultSize;
|
|
|
|
}
|
|
|
|
return defaultSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
void JKQTPLinePlotStyleWithSymbolSizeComboBox::refill()
|
|
|
|
{
|
|
|
|
QString txt=currentText();
|
|
|
|
setUpdatesEnabled(false);
|
|
|
|
clear();
|
2019-01-20 17:49:29 +08:00
|
|
|
addSymbol(JKQTPNoSymbol, true, defaultSize, tr("line"), -3);
|
|
|
|
addSymbol(defaultSymbol, false, defaultSize, JKQTPGraphSymbols2NameString(defaultSymbol), -2);
|
|
|
|
addSymbol(defaultSymbol, true, defaultSize, JKQTPGraphSymbols2NameString(defaultSymbol)+tr("+line"), -1);
|
2018-12-19 00:13:18 +08:00
|
|
|
for (int i=0; i<symbols.size(); i++) {
|
|
|
|
if (symbols[i].symbol!=defaultSymbol||symbols[i].symbolSize!=defaultSize) {
|
2019-01-20 17:49:29 +08:00
|
|
|
addSymbol(symbols[i].symbol, symbols[i].line, symbols[i].symbolSize, JKQTPGraphSymbols2NameString(symbols[i].symbol), i);
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
}
|
2019-01-20 17:49:29 +08:00
|
|
|
addSymbol(JKQTPNoSymbol, false, defaultSize, "none", -4);
|
2018-12-19 00:13:18 +08:00
|
|
|
int idx=findText(txt);
|
|
|
|
if (idx>=0) setCurrentIndex(idx);
|
|
|
|
else setCurrentIndex(0);
|
|
|
|
setUpdatesEnabled(true);
|
|
|
|
}
|
|
|
|
|
2019-01-20 17:49:29 +08:00
|
|
|
void JKQTPLinePlotStyleWithSymbolSizeComboBox::addSymbol(JKQTPGraphSymbols symbol, bool line, double symbolSize, const QString &name, const QVariant &data)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2022-09-02 03:37:50 +08:00
|
|
|
const qreal dpr = devicePixelRatioF();
|
|
|
|
int pixSize=qMax(16.0, 1.2*symbolSize)*dpr;
|
2018-12-19 00:13:18 +08:00
|
|
|
QPixmap pix(pixSize, pixSize);
|
2022-09-02 03:37:50 +08:00
|
|
|
pix.setDevicePixelRatio(dpr);
|
2018-12-19 00:13:18 +08:00
|
|
|
pix.fill(Qt::transparent);
|
|
|
|
JKQTPEnhancedPainter p;
|
|
|
|
p.begin(&pix);
|
|
|
|
p.setRenderHint(JKQTPEnhancedPainter::Antialiasing);
|
|
|
|
p.setRenderHint(JKQTPEnhancedPainter::TextAntialiasing);
|
2022-09-02 20:19:47 +08:00
|
|
|
JKQTPPlotSymbol(p, double(pixSize)/2.0,double(pixSize)/2.0,symbol,symbolSize,1,QColor("blue"), QColor("blue").lighter(), font().family());
|
2018-12-19 00:13:18 +08:00
|
|
|
p.setPen(QColor("blue"));
|
|
|
|
if (line) p.drawLine(QLineF(0,double(pixSize)/2.0,pixSize,double(pixSize)/2.0));
|
|
|
|
p.end();
|
|
|
|
addItem(QIcon(pix), name, data);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool JKQTPLinePlotStyleWithSymbolSizeComboBox::styleData::operator==(const JKQTPLinePlotStyleWithSymbolSizeComboBox::styleData &other) const
|
|
|
|
{
|
|
|
|
return (symbol==other.symbol && symbolSize==other.symbolSize && line==other.line);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-04-22 19:27:50 +08:00
|
|
|
JKQTPSpecialLineTypeComboBox::JKQTPSpecialLineTypeComboBox(QWidget *parent):
|
2018-12-19 00:13:18 +08:00
|
|
|
QComboBox(parent)
|
|
|
|
{
|
|
|
|
clear();
|
|
|
|
setEditable(false);
|
2019-04-22 19:27:50 +08:00
|
|
|
addStep(JKQTPSpecialLineType::JKQTPStepLeft, JKQTPSpecialLineType2String(JKQTPSpecialLineType::JKQTPStepLeft));
|
|
|
|
addStep(JKQTPSpecialLineType::JKQTPStepCenter, JKQTPSpecialLineType2String(JKQTPSpecialLineType::JKQTPStepCenter));
|
|
|
|
addStep(JKQTPSpecialLineType::JKQTPStepRight, JKQTPSpecialLineType2String(JKQTPSpecialLineType::JKQTPStepRight));
|
|
|
|
addStep(JKQTPSpecialLineType::JKQTPStepAverage, JKQTPSpecialLineType2String(JKQTPSpecialLineType::JKQTPStepAverage));
|
|
|
|
addStep(JKQTPSpecialLineType::JKQTPDirectLine, JKQTPSpecialLineType2String(JKQTPSpecialLineType::JKQTPDirectLine));
|
2018-12-19 00:13:18 +08:00
|
|
|
setCurrentIndex(0);
|
|
|
|
}
|
|
|
|
|
2019-04-22 19:27:50 +08:00
|
|
|
JKQTPSpecialLineType JKQTPSpecialLineTypeComboBox::getSpecialLineType() const
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-04-22 19:27:50 +08:00
|
|
|
return String2JKQTPSpecialLineType(itemData(currentIndex()).toString());
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
2019-04-22 19:27:50 +08:00
|
|
|
void JKQTPSpecialLineTypeComboBox::setSpecialLineType(JKQTPSpecialLineType step)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-04-22 19:27:50 +08:00
|
|
|
int i=findData(JKQTPSpecialLineType2String(step));
|
2018-12-19 00:13:18 +08:00
|
|
|
if (i>=0) setCurrentIndex(i);
|
|
|
|
}
|
|
|
|
|
2019-04-22 19:27:50 +08:00
|
|
|
void JKQTPSpecialLineTypeComboBox::setCurrentStepType(JKQTPSpecialLineType step)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-04-22 19:27:50 +08:00
|
|
|
setSpecialLineType(step);
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
2019-04-22 19:27:50 +08:00
|
|
|
void JKQTPSpecialLineTypeComboBox::addStep(JKQTPSpecialLineType step, const QString &name, const QIcon &icon)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-04-22 19:27:50 +08:00
|
|
|
addItem(icon, name, JKQTPSpecialLineType2String(step));
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
JKQTPImageModifierModeComboBox::JKQTPImageModifierModeComboBox(QWidget * /*parent*/)
|
|
|
|
{
|
2019-08-01 04:10:26 +08:00
|
|
|
addMode(JKQTPMathImageModifierMode::ModifyNone, tr("none"));
|
|
|
|
addMode(JKQTPMathImageModifierMode::ModifyValue, tr("value"));
|
|
|
|
addMode(JKQTPMathImageModifierMode::ModifySaturation, tr("saturation"));
|
|
|
|
addMode(JKQTPMathImageModifierMode::ModifyAlpha, tr("alpha/transparency"));
|
|
|
|
addMode(JKQTPMathImageModifierMode::ModifyLuminance, tr("luminance"));
|
|
|
|
addMode(JKQTPMathImageModifierMode::ModifyHue, tr("hue"));
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
2019-08-01 04:10:26 +08:00
|
|
|
JKQTPMathImageModifierMode JKQTPImageModifierModeComboBox::getModifierMode() const
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
|
|
|
bool ok=false;
|
2019-08-01 04:10:26 +08:00
|
|
|
JKQTPMathImageModifierMode m=JKQTPMathImageModifierMode::ModifyNone;
|
|
|
|
if (currentIndex()>=0) m=JKQTPMathImageModifierMode(itemData(currentIndex()).toInt(&ok));
|
|
|
|
if (!ok) m=JKQTPMathImageModifierMode::ModifyNone;
|
2018-12-19 00:13:18 +08:00
|
|
|
return m;
|
|
|
|
}
|
|
|
|
|
2019-08-01 04:10:26 +08:00
|
|
|
void JKQTPImageModifierModeComboBox::setModifierMode(JKQTPMathImageModifierMode mode)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-26 20:00:40 +08:00
|
|
|
setCurrentIndex(findData(static_cast<int>(mode)));
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|
|
|
|
|
2019-08-01 04:10:26 +08:00
|
|
|
void JKQTPImageModifierModeComboBox::addMode(JKQTPMathImageModifierMode mode, const QString &name, const QIcon &icon)
|
2018-12-19 00:13:18 +08:00
|
|
|
{
|
2019-01-26 20:00:40 +08:00
|
|
|
addItem(icon, name, static_cast<int>(mode));
|
2018-12-19 00:13:18 +08:00
|
|
|
}
|