##// END OF EJS Templates
Adds the color scale in edting in color scale editor
Alexandre Leroux -
r1010:9df64e6c645d
parent child
Show More
@@ -8,6 +8,7 namespace Ui {
8 class ColorScaleEditor;
8 class ColorScaleEditor;
9 } // Ui
9 } // Ui
10
10
11 class SqpColorScale;
11 class QCPColorScale;
12 class QCPColorScale;
12
13
13 /**
14 /**
@@ -17,13 +18,18 class ColorScaleEditor : public QDialog {
17 Q_OBJECT
18 Q_OBJECT
18
19
19 public:
20 public:
20 explicit ColorScaleEditor(QWidget *parent = 0);
21 explicit ColorScaleEditor(SqpColorScale &scale, QWidget *parent = 0);
21 virtual ~ColorScaleEditor() noexcept;
22 virtual ~ColorScaleEditor() noexcept;
22
23
23 private:
24 private:
24 Ui::ColorScaleEditor *ui;
25 Ui::ColorScaleEditor *ui;
25 QButtonGroup *m_ThresholdGroup;
26 QButtonGroup *m_ThresholdGroup;
26 QCPColorScale *m_PreviewScale; ///< Scale shown as preview
27 /// Scale in editing
28 /// @remarks reference must remain valid throughout the existence of the ColorScaleEditor
29 /// instance
30 SqpColorScale &m_Scale;
31 /// Scale shown as preview
32 QCPColorScale *m_PreviewScale;
27
33
28 private slots:
34 private slots:
29 /// Slot called when max threshold value changes
35 /// Slot called when max threshold value changes
@@ -1,5 +1,5
1 #include "Visualization/ColorScaleEditor.h"
1 #include "Visualization/ColorScaleEditor.h"
2 #include "Visualization/qcustomplot.h"
2 #include "Visualization/SqpColorScale.h"
3
3
4 #include "ui_ColorScaleEditor.h"
4 #include "ui_ColorScaleEditor.h"
5
5
@@ -20,8 +20,11 const auto GRADIENTS = QVariantMap{{"Candy", QCPColorGradient::gpCandy},
20
20
21 } // namespace
21 } // namespace
22
22
23 ColorScaleEditor::ColorScaleEditor(QWidget *parent)
23 ColorScaleEditor::ColorScaleEditor(SqpColorScale &scale, QWidget *parent)
24 : QDialog{parent}, ui{new Ui::ColorScaleEditor}, m_ThresholdGroup{new QButtonGroup{this}}
24 : QDialog{parent},
25 ui{new Ui::ColorScaleEditor},
26 m_Scale{scale},
27 m_ThresholdGroup{new QButtonGroup{this}}
25 {
28 {
26 ui->setupUi(this);
29 ui->setupUi(this);
27
30
General Comments 0
You need to be logged in to leave comments. Login now