plotwidget_editor.h
Go to the documentation of this file.
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5  */
6 
7 #ifndef PLOTWIDGET_EDITOR_H
8 #define PLOTWIDGET_EDITOR_H
9 
10 #include <QDialog>
11 #include <QKeyEvent>
12 #include "plotwidget.h"
13 #include "color_wheel.hpp"
14 #include "color_preview.hpp"
16 
17 namespace Ui
18 {
19 class PlotWidgetEditor;
20 }
21 
22 class EditorRowWidget : public QWidget
23 {
24  Q_OBJECT
25 
26 public:
27  EditorRowWidget(QString text, QColor color);
28 
29  void enterEvent(QEvent* ev) override;
30  void leaveEvent(QEvent* ev) override;
31 
32  QString text() const;
33 
34  void setColor(QColor color);
35  QColor color() const;
36 
37 signals:
38 
39  void deleteRow(QWidget* _this);
40 
41 private:
42  QLabel* _text;
43  QColor _color;
44  QPushButton* _delete_button;
45  QWidget* _empty_spacer;
46 };
47 
48 class PlotwidgetEditor : public QDialog
49 {
50  Q_OBJECT
51 
52 public:
53  explicit PlotwidgetEditor(PlotWidget* plotwidget, QWidget* parent = nullptr);
55 
56 public slots:
57  void onColorChanged(QColor c);
58 
59 private slots:
60 
61  void on_editColotText_textChanged(const QString& arg1);
62 
63  void on_radioLines_toggled(bool checked);
64 
65  void on_radioPoints_toggled(bool checked);
66 
67  void on_radioBoth_toggled(bool checked);
68 
69  void on_checkBoxMax_toggled(bool checked);
70 
71  void on_checkBoxMin_toggled(bool checked);
72 
73  void on_pushButtonReset_clicked();
74 
75  void on_pushButtonCancel_pressed();
76 
77  void on_pushButtonSave_pressed();
78 
79  void on_listWidget_itemSelectionChanged();
80 
81  void on_lineLimitMin_textChanged(const QString& text);
82 
83  void on_lineLimitMax_textChanged(const QString& text);
84 
85  void on_radioSticks_toggled(bool checked);
86 
87 private:
88  Ui::PlotWidgetEditor* ui;
89 
95 
96  std::set<QWidget*> _connected_transform_widgets;
97 
98  void setupColorWidget();
99  void setupTable();
100  void updateLimits();
101  void onDeleteRow(QWidget* w);
102  void disableWidgets();
103 
104  std::unordered_map<std::string, std::shared_ptr<TransformFunction>> _transforms;
105 };
106 
107 #endif // PLOTWIDGET_EDITOR_H
Display an analog widget that allows the selection of a HSV color.
Definition: color_wheel.hpp:35
PlotWidget * _plotwidget_origin
PlotWidget * _plotwidget
QPushButton * _delete_button
std::set< QWidget * > _connected_transform_widgets
Ui::PlotWidgetEditor * ui
QRectF _bounding_rect_original
color_widgets::ColorPreview * _color_preview
std::unordered_map< std::string, std::shared_ptr< TransformFunction > > _transforms
QWidget * _empty_spacer
color
Definition: color.h:23
color_widgets::ColorWheel * _color_wheel


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Jun 19 2023 03:01:38