Seamly2D
Code documentation
pen_toolbar.h
Go to the documentation of this file.
1
/******************************************************************************
2
* @file pen_toolbar.h
3
** @author DS Caskey
4
** @date Jan 16, 2023
5
**
6
** @brief
7
** @copyright
8
** This source code is part of the Seamly2D project, a pattern making
9
** program, whose allow create and modeling patterns of clothing.
10
** Copyright (C) 2017-2023 Seamly2D project
11
** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
12
**
13
** Seamly2D is free software: you can redistribute it and/or modify
14
** it under the terms of the GNU General Public License as published by
15
** the Free Software Foundation, either version 3 of the License, or
16
** (at your option) any later version.
17
**
18
** Seamly2D is distributed in the hope that it will be useful,
19
** but WITHOUT ANY WARRANTY; without even the implied warranty of
20
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
** GNU General Public License for more details.
22
**
23
** You should have received a copy of the GNU General Public License
24
** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
25
**
26
*************************************************************************/
27
28
#ifndef PEN_TOOLBAR_H
29
#define PEN_TOOLBAR_H
30
31
#include <memory>
32
#include <QToolBar>
33
#include <QToolButton>
34
#include <QAction>
35
#include <QObject>
36
#include <QPointer>
37
38
#include "
color_combobox.h
"
39
#include "
lineweight_combobox.h
"
40
#include "
linetype_combobox.h
"
41
42
class
QAction;
43
class
QToolButton;
44
45
class
ColorComboBox
;
46
class
LineWeightComboBox
;
47
class
LineTypeComboBox
;
48
49
struct
Pen
50
{
51
QString
color
{QString(
"black"
)};
52
qreal
lineWeight
{1.20};
53
QString
lineType
{QString(
"solidline"
)};
54
};
55
56
class
PenToolBar
:
public
QToolBar
57
{
58
59
Q_OBJECT
60
61
public
:
62
PenToolBar
(
const
QString &title, QWidget *parent = 0);
63
virtual
~PenToolBar
();
64
65
Pen
getPen
()
const
;
66
Pen
currentPen
;
67
QPointer<ColorComboBox>
colorBox
;
68
QPointer<LineTypeComboBox>
lineTypeBox
;
69
QPointer<LineWeightComboBox>
lineWeightBox
;
70
71
public
slots:
72
void
colorChanged
(
const
QString &color);
73
void
lineWeightChanged
(
const
qreal &weight);
74
void
lineTypeChanged
(
const
QString &type);
75
void
penReset
();
76
void
savePreset
();
77
78
signals:
79
void
penChanged
(
Pen
pen);
80
81
private
:
82
QAction *
resetAction
;
83
QAction *
savePresetAction
;
84
};
85
86
#endif
ColorComboBox
Definition:
color_combobox.h:17
LineTypeComboBox
Definition:
linetype_combobox.h:39
LineWeightComboBox
Definition:
lineweight_combobox.h:35
PenToolBar
Definition:
pen_toolbar.h:57
PenToolBar::penReset
void penReset()
penReset resets the current pen to the preferred defaults.
Definition:
pen_toolbar.cpp:138
PenToolBar::getPen
Pen getPen() const
Definition:
pen_toolbar.cpp:97
PenToolBar::lineWeightBox
QPointer< LineWeightComboBox > lineWeightBox
Definition:
pen_toolbar.h:69
PenToolBar::savePreset
void savePreset()
Definition:
pen_toolbar.cpp:169
PenToolBar::lineTypeBox
QPointer< LineTypeComboBox > lineTypeBox
Definition:
pen_toolbar.h:68
PenToolBar::penChanged
void penChanged(Pen pen)
PenToolBar::currentPen
Pen currentPen
Definition:
pen_toolbar.h:66
PenToolBar::PenToolBar
PenToolBar(const QString &title, QWidget *parent=0)
Definition:
pen_toolbar.cpp:39
PenToolBar::colorBox
QPointer< ColorComboBox > colorBox
Definition:
pen_toolbar.h:67
PenToolBar::savePresetAction
QAction * savePresetAction
Definition:
pen_toolbar.h:83
PenToolBar::~PenToolBar
virtual ~PenToolBar()
PenToolBar::resetAction
QAction * resetAction
Definition:
pen_toolbar.h:82
PenToolBar::colorChanged
void colorChanged(const QString &color)
Definition:
pen_toolbar.cpp:116
PenToolBar::lineTypeChanged
void lineTypeChanged(const QString &type)
Definition:
pen_toolbar.cpp:105
PenToolBar::lineWeightChanged
void lineWeightChanged(const qreal &weight)
Definition:
pen_toolbar.cpp:127
Pen
Definition:
pen.h:37
Pen::color
QString color
Definition:
pen_toolbar.h:51
Pen::lineWeight
qreal lineWeight
Definition:
pen_toolbar.h:52
Pen::lineType
QString lineType
Definition:
pen_toolbar.h:53
color_combobox.h
linetype_combobox.h
lineweight_combobox.h
src
libs
vwidgets
pen_toolbar.h
Generated by
1.9.1