Seamly2D
Code documentation
linetype_combobox.h
Go to the documentation of this file.
1 /******************************************************************************
2  * linetype_combobox.h
3  ** @author DS Caskey
4  ** @date April 6, 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 #ifndef LINETYPE_COMBOBOX_H
25 #define LINETYPE_COMBOBOX_H
26 
27 #include <QComboBox>
28 #include <QWidget>
29 #include <QPen>
30 #include <QIcon>
31 #include <memory>
32 
33 class QIcon;
34 
35 /**
36  * A comboBox for choosing a line type.
37  */
38 class LineTypeComboBox: public QComboBox
39 {
40  Q_OBJECT
41 
42 public:
43  LineTypeComboBox(QWidget *parent = nullptr);
44  LineTypeComboBox(int width, int height, QWidget *parent = nullptr , const char *name = nullptr );
45 
46  virtual ~LineTypeComboBox();
47 
48  QString getLineType() { return m_currentLineType; }
49  void setLineType(const QString &type);
50 
51  void init();
52 
53 private slots:
54  void updateLineType(int index);
55 
56 signals:
57  void lineTypeChanged(const QString &type);
58 
59 private:
60  QIcon createIcon(const QString &type);
64 };
65 
66 #endif
void setLineType(const QString &type)
void lineTypeChanged(const QString &type)
void updateLineType(int index)
QIcon createIcon(const QString &type)
LineTypeComboBox(QWidget *parent=nullptr)