-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqformattool.h
More file actions
94 lines (74 loc) · 3.15 KB
/
qformattool.h
File metadata and controls
94 lines (74 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
* This file is part of the GreasePad distribution (https://github.com/FraunhoferIOSB/GreasePad).
* Copyright (c) 2022-2025 Jochen Meidow, Fraunhofer IOSB
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef QFORMATTOOL_H
#define QFORMATTOOL_H
#include "global.h"
#include <QDialog>
#include <QObject>
#include "qtmetamacros.h"
#include <memory>
class QCheckBox;
class QColorDialog;
class QComboBox;
class QDialogButtonBox;
class QFormLayout;
class QSpinBox;
namespace GUI {
//! Format tool
class FormatTool : public QDialog {
Q_OBJECT
public:
FormatTool( const QString &title, QWidget *); //!< Value constructor
FormatTool( const FormatTool &) = delete; //!< Copy constructor
FormatTool( const FormatTool &&) = delete;
FormatTool & operator= ( FormatTool & ) = delete; //!< Copy assignment constructor
FormatTool & operator= ( FormatTool && ) = delete;
~FormatTool() override;
private:
void createElements();
void establishConnections();
void createLayout();
std::unique_ptr<QFormLayout> m_layout;
std::unique_ptr<QColorDialog> m_colorDialog;
std::unique_ptr<QPushButton> m_colorPushButton;
std::unique_ptr<QComboBox> m_styleCombo;
std::unique_ptr<QSpinBox> m_lineWidthSpinBox;
std::unique_ptr<QSpinBox> m_markerSizeSpinBox;
std::unique_ptr<QCheckBox> m_checkBoxDefaultConstrained;
std::unique_ptr<QCheckBox> m_checkBoxDefaultUnconstrained;
std::unique_ptr<QCheckBox> m_checkBoxDefaultRequired;
std::unique_ptr<QCheckBox> m_checkBoxDefaultRedundant;
std::unique_ptr<QCheckBox> m_checkBoxDefaultStroke;
std::unique_ptr<QCheckBox> m_checkBoxScribblePen;
std::unique_ptr<QDialogButtonBox> m_buttonBox;
Q_SIGNALS:
void signalColorChanged( const QColor &); //!< Color changed
void signalMarkerSizeChanged( int); //!< Marker size changed
void signalLineWidthChanged( int); //!< Line width changed
void signalLineStyleChanged( int); //!< Line style changed
public Q_SLOTS:
void showColorDialog(); //!< Show color dialog
void slotUpdateColor( const QColor & col); //!< Update color
void updateLineWidth( int w) { Q_EMIT signalLineWidthChanged(w); } //!< Update line widt
void updateLineStyle( int s) { Q_EMIT signalLineStyleChanged(s); } //!< Update line style
void updateMarkerSize( int s) { Q_EMIT signalMarkerSizeChanged(s); } //!< Update marker size
// void slotDiscard() { } //!< slot discard dialog
void slotApply(); //!< slot apply selection
};
} // namespace GUI
#endif // QFORMATTOOL_H