Seamly2D
Code documentation
fill_combobox.h
Go to the documentation of this file.
1 /***************************************************************************
2  ** @file fill_combobox.h
3  ** @author Douglas S Caskey
4  ** @date Dec 28, 2022
5  **
6  ** @copyright
7  ** Copyright (C) 2017 - 2022 Seamly, LLC
8  ** https://github.com/fashionfreedom/seamly2d
9  **
10  ** @brief
11  ** Seamly2D is free software: you can redistribute it and/or modify
12  ** it under the terms of the GNU General Public License as published by
13  ** the Free Software Foundation, either version 3 of the License, or
14  ** (at your option) any later version.
15  **
16  ** Seamly2D is distributed in the hope that it will be useful,
17  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  ** GNU General Public License for more details.
20  **
21  ** You should have received a copy of the GNU General Public License
22  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
23  **************************************************************************/
24 
25 #ifndef FILL_COMBOBOX_H
26 #define FILL_COMBOBOX_H
27 
28 #include <QComboBox>
29 #include <QString>
30 #include <memory>
31 
32 /**
33  * A comboBox for choosing a fill pattern.
34  */
35 class PieceFillComboBox: public QComboBox
36 {
37  Q_OBJECT
38 
39 public:
40  PieceFillComboBox(QWidget *parent = nullptr, const char *name = nullptr);
41  PieceFillComboBox(int width, int height, QWidget *parent = nullptr, const char *name = nullptr);
42  virtual ~PieceFillComboBox();
43 
44 
45 
46  QString getFill() const;
47  void setFill(const QString &fill);
48  QPixmap createFillIcon(const int w, const int h, Qt::BrushStyle style);
49  int getIconWidth();
50  int getIconHeight();
51 
52 private slots:
53  void fillChanged(int index);
54 
55 signals:
56  void fillChangedSignal(const QString &fill);
57 
58 private:
59  void init();
60  QString m_currentFill;
63 };
64 
65 #endif
void fillChangedSignal(const QString &fill)
QString getFill() const
void setFill(const QString &fill)
virtual ~PieceFillComboBox()
void fillChanged(int index)
QPixmap createFillIcon(const int w, const int h, Qt::BrushStyle style)
PieceFillComboBox(QWidget *parent=nullptr, const char *name=nullptr)