ColorScaleEditor.h
54 lines
| 1.4 KiB
| text/x-c
|
CLexer
Alexandre Leroux
|
r1001 | #ifndef SCIQLOP_COLORSCALEEDITOR_H | ||
#define SCIQLOP_COLORSCALEEDITOR_H | ||||
Alexandre Leroux
|
r1003 | #include <QButtonGroup> | ||
Alexandre Leroux
|
r1001 | #include <QDialog> | ||
namespace Ui { | ||||
class ColorScaleEditor; | ||||
} // Ui | ||||
Alexandre Leroux
|
r1010 | class SqpColorScale; | ||
Alexandre Leroux
|
r1006 | class QCPColorScale; | ||
Alexandre Leroux
|
r1001 | /** | ||
* @brief The ColorScaleEditor class represents the widget to set properties of color scale's graphs | ||||
*/ | ||||
class ColorScaleEditor : public QDialog { | ||||
Q_OBJECT | ||||
public: | ||||
Alexandre Leroux
|
r1010 | explicit ColorScaleEditor(SqpColorScale &scale, QWidget *parent = 0); | ||
Alexandre Leroux
|
r1001 | virtual ~ColorScaleEditor() noexcept; | ||
private: | ||||
Alexandre Leroux
|
r1011 | /// Fills the editor fields from color scale data | ||
void loadScale(); | ||||
Alexandre Leroux
|
r1012 | /// Updates the color scale from editor fields | ||
void saveScale(); | ||||
Alexandre Leroux
|
r1001 | Ui::ColorScaleEditor *ui; | ||
Alexandre Leroux
|
r1003 | QButtonGroup *m_ThresholdGroup; | ||
Alexandre Leroux
|
r1010 | /// Scale in editing | ||
/// @remarks reference must remain valid throughout the existence of the ColorScaleEditor | ||||
/// instance | ||||
SqpColorScale &m_Scale; | ||||
/// Scale shown as preview | ||||
QCPColorScale *m_PreviewScale; | ||||
Alexandre Leroux
|
r1003 | |||
private slots: | ||||
Alexandre Leroux
|
r1012 | /// @sa QDialog::accept() | ||
void accept() override; | ||||
Alexandre Leroux
|
r1004 | /// Slot called when max threshold value changes | ||
void onMaxChanged(); | ||||
/// Slot called when min threshold value changes | ||||
void onMinChanged(); | ||||
Alexandre Leroux
|
r1003 | /// Slot called when the threshold mode (auto or manual) changes | ||
void onThresholdChanged(bool checked); | ||||
Alexandre Leroux
|
r1007 | |||
/// Slot called when a property of the color scale changed | ||||
void updatePreview(); | ||||
Alexandre Leroux
|
r1001 | }; | ||
#endif // SCIQLOP_COLORSCALEEDITOR_H | ||||