| 1 |
// Copyright (C) 2016 The Qt Company Ltd. |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 |
#ifndef PENTOOL_H |
| 4 |
#define PENTOOL_H |
| 5 |
|
| 6 |
#include <QtWidgets/QWidget> |
| 7 |
#include <QtGui/QPen> |
| 8 |
|
| 9 |
QT_BEGIN_NAMESPACE |
| 10 |
class QPushButton; |
| 11 |
class QDoubleSpinBox; |
| 12 |
class QComboBox; |
| 13 |
QT_END_NAMESPACE |
| 14 |
|
| 15 |
class PenTool : public QWidget |
| 16 |
{ |
| 17 |
Q_OBJECT |
| 18 |
|
| 19 |
public: |
| 20 |
explicit PenTool(QString title, QWidget *parent = 0); |
| 21 |
void setPen(const QPen &pen); |
| 22 |
QPen pen() const; |
| 23 |
QString name(); |
| 24 |
static QString name(const QPen &pen); |
| 25 |
|
| 26 |
Q_SIGNALS: |
| 27 |
void changed(); |
| 28 |
|
| 29 |
public Q_SLOTS: |
| 30 |
void showColorDialog(); |
| 31 |
void updateWidth(double width); |
| 32 |
void updateStyle(int style); |
| 33 |
void updateCapStyle(int index); |
| 34 |
void updateJoinStyle(int index); |
| 35 |
|
| 36 |
private: |
| 37 |
QPen m_pen; |
| 38 |
QPushButton *m_colorButton; |
| 39 |
QDoubleSpinBox *m_widthSpinBox; |
| 40 |
QComboBox *m_styleCombo; |
| 41 |
QComboBox *m_capStyleCombo; |
| 42 |
QComboBox *m_joinStyleCombo; |
| 43 |
}; |
| 44 |
|
| 45 |
#endif // PENTOOL_H |