Seamly2D
Code documentation
lineweight_combobox.h
Go to the documentation of this file.
1 /******************************************************************************
2  * @file lineweight_combobox.h
3  ** @author DS Caskey
4  ** @date Nov 2, 2021
5  **
6  ** @brief
7  ** @copyright
8  **
9  ** Seamly2D is free software: you can redistribute it and/or modify
10  ** it under the terms of the GNU General Public License as published by
11  ** the Free Software Foundation, either version 3 of the License, or
12  ** (at your option) any later version.
13  **
14  ** Seamly2D is distributed in the hope that it will be useful,
15  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  ** GNU General Public License for more details.
18  **
19  ** You should have received a copy of the GNU General Public License
20  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
21  **
22  *****************************************************************************/
23 
24 
25 #ifndef LINEWEIGHT_COMBOBOX_H
26 #define LINEWEIGHT_COMBOBOX_H
27 
28 #include <QComboBox>
29 #include <QWidget>
30 
31 /**
32  * A comboBox for choosing a line weight.
33  */
34 class LineWeightComboBox: public QComboBox
35 {
36  Q_OBJECT
37 
38 public:
39  LineWeightComboBox(QWidget *parent = nullptr, const char *name = nullptr);
40  LineWeightComboBox(int width, int height, QWidget *parent = nullptr, const char *name=nullptr);
41  virtual ~LineWeightComboBox();
42 
43  void init();
44 
45  qreal getLineWeight() const;
46  void setLineWeight(const qreal &weight);
47 
48 private slots:
49  void updateLineWeight(int index);
50 
51 signals:
52  void lineWeightChanged(const qreal &weight);
53 
54 private:
55  QIcon createIcon(const qreal &width);
59 };
60 
61 #endif
void updateLineWeight(int index)
QIcon createIcon(const qreal &width)
LineWeightComboBox(QWidget *parent=nullptr, const char *name=nullptr)
void setLineWeight(const qreal &weight)
void lineWeightChanged(const qreal &weight)