Seamly2D
Code documentation
vformulapropertyeditor.h
Go to the documentation of this file.
1 /******************************************************************************
2  * @file vformulapropertyeditor.h
3  ** @author DS Caskey
4  ** @date Feb 18, 2023
5  **
6  ** @brief
7  ** @copyright
8  ** This source code is part of the Seamly2D project, a pattern making
9  ** program, whose allow create and modeling patterns of clothing.
10  ** Copyright (C) 2017-2023 Seamly2D project
11  ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
12  **
13  ** Seamly2D is free software: you can redistribute it and/or modify
14  ** it under the terms of the GNU General Public License as published by
15  ** the Free Software Foundation, either version 3 of the License, or
16  ** (at your option) any later version.
17  **
18  ** Seamly2D is distributed in the hope that it will be useful,
19  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
20  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  ** GNU General Public License for more details.
22  **
23  ** You should have received a copy of the GNU General Public License
24  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
25  **
26  *************************************************************************/
27 
28 
29 /************************************************************************
30  **
31  ** @file vformulapropertyeditor.h
32  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
33  ** @date 28 8, 2014
34  **
35  ** @brief
36  ** @copyright
37  ** This source code is part of the Valentina project, a pattern making
38  ** program, whose allow create and modeling patterns of clothing.
39  ** Copyright (C) 2014 Valentina project
40  ** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
41  **
42  ** Valentina is free software: you can redistribute it and/or modify
43  ** it under the terms of the GNU General Public License as published by
44  ** the Free Software Foundation, either version 3 of the License, or
45  ** (at your option) any later version.
46  **
47  ** Valentina is distributed in the hope that it will be useful,
48  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
49  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50  ** GNU General Public License for more details.
51  **
52  ** You should have received a copy of the GNU General Public License
53  ** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
54  **
55  *************************************************************************/
56 
57 #ifndef VFORMULAPROPERTYEDITOR_H
58 #define VFORMULAPROPERTYEDITOR_H
59 
60 #include <QWidget>
61 #include <QToolButton>
62 #include <QLineEdit>
63 #include <QLabel>
64 #include <QSpacerItem>
65 
66 #include "../vpatterndb/vformula.h"
67 
68 class VFormulaPropertyEditor : public QWidget
69 {
70  Q_OBJECT
71 
72 public:
73  //! Constructor taking a widget as parent
74  explicit VFormulaPropertyEditor(QWidget *parent);
75 
76  //! Destructor
77  virtual ~VFormulaPropertyEditor() Q_DECL_EQ_DEFAULT;
78 
79  //! Returns the formula currently set
80  VFormula GetFormula() const;
81 
82  //! Needed for proper event handling
83  virtual bool eventFilter(QObject *obj, QEvent *ev) Q_DECL_OVERRIDE;
84 
85 signals:
86  //! This is emitted, when the user changes the color
88 
89  void dataChanged();
90 
91 public slots:
92  //! Sets the color of the widget
93  void SetFormula(const VFormula &formula);
94 
95 private slots:
96  void onToolButtonClicked();
97 
98 private:
99  Q_DISABLE_COPY(VFormulaPropertyEditor)
101  QToolButton *toolButton;
102  QLabel *textLabel;
103  QSpacerItem *spacer;
104 };
105 
106 
107 #endif // VFORMULAPROPERTYEDITOR_H
void SetFormula(const VFormula &formula)
Sets the color of the widget.
void dataChangedByUser(const VFormula &GetFormula, VFormulaPropertyEditor *editor)
This is emitted, when the user changes the color.
virtual bool eventFilter(QObject *obj, QEvent *ev) Q_DECL_OVERRIDE
Needed for proper event handling.
VFormulaPropertyEditor(QWidget *parent)
Constructor taking a widget as parent.
virtual ~VFormulaPropertyEditor() Q_DECL_EQ_DEFAULT
Destructor.
VFormula GetFormula() const
Returns the formula currently set.