2018-12-19 00:13:18 +08:00
/*
2019-01-12 23:01:55 +08:00
Copyright ( c ) 2008 - 2019 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
the Free Software Foundation , either version 2 of the License , or
( 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/>.
*/
/** \file jkqtpcomboboxes.h
2019-01-19 16:40:52 +08:00
* \ ingroup jkqtpcomboboxes
2018-12-19 00:13:18 +08:00
*/
# ifndef JKQTPCOMBOBOXES_H
# define JKQTPCOMBOBOXES_H
# include "jkqtplotter/jkqtpbaseplotter.h"
# include "jkqtplottertools/jkqtp_imexport.h"
2018-12-28 05:52:00 +08:00
# include "jkqtplotter/jkqtpgraphsimage.h"
2018-12-19 00:13:18 +08:00
# include <QComboBox>
# include "jkqtplottertools/jkqtpimagetools.h"
2018-12-28 05:52:00 +08:00
# include "jkqtplottertools/jkqtptools.h"
2018-12-19 00:13:18 +08:00
/*! \brief class to plot an image from an 2-dimensional array of values
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2018-12-19 00:13:18 +08:00
2019-01-13 01:53:16 +08:00
\ image html JKQTPMathImageColorPaletteComboBox . png
2018-12-19 00:13:18 +08:00
*/
class LIB_EXPORT JKQTPMathImageColorPaletteComboBox : public QComboBox {
Q_OBJECT
public :
JKQTPMathImageColorPaletteComboBox ( QWidget * parent = nullptr ) ;
JKQTPMathImageColorPalette colorPalette ( ) const ;
JKQTPMathImageColorPalette currentColorPalette ( ) const ;
JKQTPMathImageColorPalette getColorPalette ( ) const ;
void setColorPalette ( JKQTPMathImageColorPalette palette ) ;
void setCurrentColorPalette ( JKQTPMathImageColorPalette palette ) ;
signals :
void currentPaletteChanged ( JKQTPMathImageColorPalette palette ) ;
protected slots :
void intIndexChanged ( int i ) ;
} ;
/*! \brief a QComboBox which shows JKQTPCAdrawMode
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2018-12-19 00:13:18 +08:00
*/
class LIB_EXPORT JKQTPCAdrawModeComboBox : public QComboBox {
Q_OBJECT
public :
JKQTPCAdrawModeComboBox ( QWidget * parent = nullptr ) ;
JKQTPCAdrawMode getDrawMode ( ) const ;
void setDrawMode ( JKQTPCAdrawMode position ) ;
protected :
void addDrawMode ( JKQTPCAdrawMode position , const QString & name , const QIcon & icon = QIcon ( ) ) ;
} ;
/*! \brief a QComboBox which shows JKQTPCAlabelType
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2018-12-19 00:13:18 +08:00
*/
class LIB_EXPORT JKQTPCAlabelTypeComboBox : public QComboBox {
Q_OBJECT
public :
JKQTPCAlabelTypeComboBox ( QWidget * parent = nullptr ) ;
JKQTPCAlabelType getLabelType ( ) const ;
void setLabelType ( JKQTPCAlabelType position ) ;
protected :
void addLabelType ( JKQTPCAlabelType position , const QString & name , const QIcon & icon = QIcon ( ) ) ;
} ;
/*! \brief a QComboBox which shows JKQTPlabelPosition
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2018-12-19 00:13:18 +08:00
*/
class LIB_EXPORT JKQTPlabelPositionComboBox : public QComboBox {
Q_OBJECT
public :
JKQTPlabelPositionComboBox ( QWidget * parent = nullptr ) ;
JKQTPlabelPosition getPosition ( ) const ;
void setPosition ( JKQTPlabelPosition position ) ;
protected :
void addPosition ( JKQTPlabelPosition position , const QString & name , const QIcon & icon = QIcon ( ) ) ;
} ;
/*! \brief a QComboBox which shows JKQTPkeyPosition
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
\ image html JKQTPkeyPositionComboBox . png
2018-12-19 00:13:18 +08:00
*/
class LIB_EXPORT JKQTPkeyPositionComboBox : public QComboBox {
Q_OBJECT
public :
JKQTPkeyPositionComboBox ( QWidget * parent = nullptr ) ;
JKQTPkeyPosition getPosition ( ) const ;
void setPosition ( JKQTPkeyPosition position ) ;
signals :
void currentPositionChanged ( JKQTPkeyPosition pos ) ;
protected :
void addPosition ( JKQTPkeyPosition position , const QString & name , const QIcon & icon = QIcon ( ) ) ;
protected slots :
void posChanged ( int index ) ;
} ;
/*! \brief a QComboBox which shows JKQTPkeyPosition
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2018-12-19 00:13:18 +08:00
*/
class LIB_EXPORT JKQTPkeyLayoutComboBox : public QComboBox {
Q_OBJECT
public :
JKQTPkeyLayoutComboBox ( QWidget * parent = nullptr ) ;
JKQTPkeyLayout getKeyLayout ( ) const ;
void setKeyLayout ( JKQTPkeyLayout layout ) ;
signals :
void currentLayoutChanged ( JKQTPkeyLayout layout ) ;
protected :
void addKeyLayout ( JKQTPkeyLayout layout , const QString & name ) ;
protected slots :
void currentIndexChangedP ( int index ) ;
} ;
/*! \brief a QComboBox which shows JKQTPerrorPlotstyle
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
\ image html JKQTPerrorPlotstyleComboBox . png
2018-12-19 00:13:18 +08:00
*/
class LIB_EXPORT JKQTPerrorPlotstyleComboBox : public QComboBox {
Q_OBJECT
public :
JKQTPerrorPlotstyleComboBox ( QWidget * parent = nullptr ) ;
JKQTPerrorPlotstyle getErrorStyle ( ) const ;
void setSymbol ( JKQTPerrorPlotstyle symbol ) ;
void setCurrentErrorStyle ( JKQTPerrorPlotstyle symbol ) ;
protected :
void addSymbol ( JKQTPerrorPlotstyle symbol , const QString & name , const QIcon & icon = QIcon ( ) ) ;
} ;
/*! \brief a QComboBox which shows JKQTPgraphSymbols
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
\ image html JKQTPSymbolComboBox . png
2018-12-19 00:13:18 +08:00
*/
class LIB_EXPORT JKQTPSymbolComboBox : public QComboBox {
Q_OBJECT
public :
JKQTPSymbolComboBox ( QWidget * parent = nullptr ) ;
JKQTPgraphSymbols getSymbol ( ) const ;
void setSymbol ( JKQTPgraphSymbols symbol ) ;
void setCurrentSymbol ( JKQTPgraphSymbols symbol ) ;
protected :
void addSymbol ( JKQTPgraphSymbols symbol , const QString & name ) ;
} ;
/*! \brief a QComboBox to select whether a line, symbols or both should be displayed
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2018-12-19 00:13:18 +08:00
*/
class LIB_EXPORT JKQTPLinePlotStyleComboBox : public QComboBox {
Q_OBJECT
public :
JKQTPLinePlotStyleComboBox ( QWidget * parent = nullptr ) ;
void setDefaultSymbol ( JKQTPgraphSymbols symbol ) ;
void addUsedSymbol ( JKQTPgraphSymbols symbol ) ;
JKQTPgraphSymbols getSymbol ( ) const ;
bool getDrawLine ( ) const ;
protected :
void refill ( ) ;
void addSymbol ( JKQTPgraphSymbols symbol , bool line , const QString & name = QString ( " " ) , const QVariant & data = QVariant ( ) ) ;
QList < JKQTPgraphSymbols > symbols ;
JKQTPgraphSymbols defaultSymbol ;
} ;
/*! \brief a QComboBox to select whether a line, symbols or both should be displayed, in addition to JKQTPLinePlotStyleComboBox this may also have different symbol sizes!
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2018-12-19 00:13:18 +08:00
*/
class LIB_EXPORT JKQTPLinePlotStyleWithSymbolSizeComboBox : public QComboBox {
Q_OBJECT
public :
JKQTPLinePlotStyleWithSymbolSizeComboBox ( QWidget * parent = nullptr ) ;
void setDefaultSymbol ( JKQTPgraphSymbols symbol , double size ) ;
void addUsedSymbol ( JKQTPgraphSymbols symbol , double symbolSize , bool line ) ;
JKQTPgraphSymbols getSymbol ( ) const ;
bool getDrawLine ( ) const ;
double getSymbolSize ( ) const ;
protected :
void refill ( ) ;
void addSymbol ( JKQTPgraphSymbols symbol , bool line , double symbolSize , const QString & name = QString ( " " ) , const QVariant & data = QVariant ( ) ) ;
struct styleData {
JKQTPgraphSymbols symbol ;
bool line ;
double symbolSize ;
bool operator = = ( const styleData & other ) const ;
} ;
QList < styleData > symbols ;
JKQTPgraphSymbols defaultSymbol ;
double defaultSize ;
} ;
/*! \brief a QComboBox which shows JKQTPstepType
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2018-12-19 00:13:18 +08:00
*/
class LIB_EXPORT JKQTPstepTypeComboBox : public QComboBox {
Q_OBJECT
public :
JKQTPstepTypeComboBox ( QWidget * parent = nullptr ) ;
JKQTPstepType getStepType ( ) const ;
void setStepType ( JKQTPstepType step ) ;
void setCurrentStepType ( JKQTPstepType step ) ;
protected :
void addStep ( JKQTPstepType step , const QString & name , const QIcon & icon = QIcon ( ) ) ;
} ;
/*! \brief a QComboBox which shows JKQTPMathImageBase::ModifierMode
2019-01-13 01:53:16 +08:00
\ ingroup jkqtpcomboboxes
2018-12-19 00:13:18 +08:00
*/
class LIB_EXPORT JKQTPImageModifierModeComboBox : public QComboBox {
Q_OBJECT
public :
JKQTPImageModifierModeComboBox ( QWidget * parent = nullptr ) ;
JKQTPMathImageBase : : ModifierMode getModifierMode ( ) const ;
void setModifierMode ( JKQTPMathImageBase : : ModifierMode mode ) ;
protected :
void addMode ( JKQTPMathImageBase : : ModifierMode mode , const QString & name , const QIcon & icon = QIcon ( ) ) ;
} ;
# endif // JKQTPCOMBOBOXES_H