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 
74 
76 
78 
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  void on_radioSteps_toggled(bool checked);
88 
89  void on_radioStepsInv_toggled(bool checked);
90 
91 private:
92  Ui::PlotWidgetEditor* ui;
93 
99 
100  std::set<QWidget*> _connected_transform_widgets;
101 
102  void setupColorWidget();
103  void setupTable();
104  void updateLimits();
105  void onDeleteRow(QWidget* w);
106  void disableWidgets();
107 
108  std::unordered_map<std::string, std::shared_ptr<TransformFunction>> _transforms;
109 };
110 
111 #endif // PLOTWIDGET_EDITOR_H
PlotwidgetEditor::on_radioPoints_toggled
void on_radioPoints_toggled(bool checked)
Definition: plotwidget_editor.cpp:295
color
color
Definition: color.h:16
PlotwidgetEditor::onDeleteRow
void onDeleteRow(QWidget *w)
Definition: plotwidget_editor.cpp:175
PlotwidgetEditor::_transforms
std::unordered_map< std::string, std::shared_ptr< TransformFunction > > _transforms
Definition: plotwidget_editor.h:108
EditorRowWidget::color
QColor color() const
Definition: plotwidget_editor.cpp:441
PlotwidgetEditor::on_radioStepsInv_toggled
void on_radioStepsInv_toggled(bool checked)
Definition: plotwidget_editor.cpp:327
plotwidget.h
PlotwidgetEditor::on_lineLimitMax_textChanged
void on_lineLimitMax_textChanged(const QString &text)
Definition: plotwidget_editor.cpp:362
PlotwidgetEditor
Definition: plotwidget_editor.h:48
EditorRowWidget::setColor
void setColor(QColor color)
Definition: plotwidget_editor.cpp:435
PlotwidgetEditor::on_checkBoxMin_toggled
void on_checkBoxMin_toggled(bool checked)
Definition: plotwidget_editor.cpp:341
color_preview.hpp
PlotwidgetEditor::updateLimits
void updateLimits()
Definition: plotwidget_editor.cpp:238
EditorRowWidget::leaveEvent
void leaveEvent(QEvent *ev) override
Definition: plotwidget_editor.cpp:424
PlotwidgetEditor::on_radioSticks_toggled
void on_radioSticks_toggled(bool checked)
Definition: plotwidget_editor.cpp:311
EditorRowWidget::_delete_button
QPushButton * _delete_button
Definition: plotwidget_editor.h:44
PlotwidgetEditor::PlotwidgetEditor
PlotwidgetEditor(PlotWidget *plotwidget, QWidget *parent=nullptr)
Definition: plotwidget_editor.cpp:22
EditorRowWidget::text
QString text() const
Definition: plotwidget_editor.cpp:430
EditorRowWidget::_text
QLabel * _text
Definition: plotwidget_editor.h:42
PlotwidgetEditor::on_lineLimitMin_textChanged
void on_lineLimitMin_textChanged(const QString &text)
Definition: plotwidget_editor.cpp:367
PlotWidget
Definition: plotwidget.h:38
PlotwidgetEditor::on_pushButtonReset_clicked
void on_pushButtonReset_clicked()
Definition: plotwidget_editor.cpp:347
transform_function.h
PlotwidgetEditor::on_pushButtonSave_pressed
void on_pushButtonSave_pressed()
Definition: plotwidget_editor.cpp:377
PlotwidgetEditor::setupTable
void setupTable()
Definition: plotwidget_editor.cpp:210
PlotwidgetEditor::on_listWidget_itemSelectionChanged
void on_listWidget_itemSelectionChanged()
Definition: plotwidget_editor.cpp:446
EditorRowWidget
Definition: plotwidget_editor.h:22
color_widgets::ColorWheel
Display an analog widget that allows the selection of a HSV color.
Definition: color_wheel.hpp:35
Ui
Definition: cheatsheet_dialog.h:6
PlotwidgetEditor::_color_wheel
color_widgets::ColorWheel * _color_wheel
Definition: plotwidget_editor.h:94
color_wheel.hpp
PlotwidgetEditor::on_editColotText_textChanged
void on_editColotText_textChanged(const QString &arg1)
Definition: plotwidget_editor.cpp:277
PlotwidgetEditor::_plotwidget_origin
PlotWidget * _plotwidget_origin
Definition: plotwidget_editor.h:97
EditorRowWidget::_empty_spacer
QWidget * _empty_spacer
Definition: plotwidget_editor.h:45
PlotwidgetEditor::setupColorWidget
void setupColorWidget()
Definition: plotwidget_editor.cpp:146
EditorRowWidget::enterEvent
void enterEvent(QEvent *ev) override
Definition: plotwidget_editor.cpp:418
EditorRowWidget::_color
QColor _color
Definition: plotwidget_editor.h:43
PlotwidgetEditor::_connected_transform_widgets
std::set< QWidget * > _connected_transform_widgets
Definition: plotwidget_editor.h:100
PlotwidgetEditor::_plotwidget
PlotWidget * _plotwidget
Definition: plotwidget_editor.h:96
EditorRowWidget::EditorRowWidget
EditorRowWidget(QString text, QColor color)
Definition: plotwidget_editor.cpp:386
color_widgets::ColorPreview
Definition: color_preview.hpp:33
PlotwidgetEditor::~PlotwidgetEditor
~PlotwidgetEditor()
Definition: plotwidget_editor.cpp:116
EditorRowWidget::deleteRow
void deleteRow(QWidget *_this)
PlotwidgetEditor::onColorChanged
void onColorChanged(QColor c)
Definition: plotwidget_editor.cpp:125
PlotwidgetEditor::on_checkBoxMax_toggled
void on_checkBoxMax_toggled(bool checked)
Definition: plotwidget_editor.cpp:335
PlotwidgetEditor::on_radioLines_toggled
void on_radioLines_toggled(bool checked)
Definition: plotwidget_editor.cpp:287
PlotwidgetEditor::disableWidgets
void disableWidgets()
Definition: plotwidget_editor.cpp:200
PlotwidgetEditor::on_pushButtonCancel_pressed
void on_pushButtonCancel_pressed()
Definition: plotwidget_editor.cpp:372
PlotwidgetEditor::_bounding_rect_original
QRectF _bounding_rect_original
Definition: plotwidget_editor.h:98
PlotwidgetEditor::on_radioSteps_toggled
void on_radioSteps_toggled(bool checked)
Definition: plotwidget_editor.cpp:319
PlotwidgetEditor::on_radioBoth_toggled
void on_radioBoth_toggled(bool checked)
Definition: plotwidget_editor.cpp:303
PlotwidgetEditor::ui
Ui::PlotWidgetEditor * ui
Definition: plotwidget_editor.h:92
PlotwidgetEditor::_color_preview
color_widgets::ColorPreview * _color_preview
Definition: plotwidget_editor.h:95


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:45