QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
dimensionwidget.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 The QElectroTech Team
3 This file is part of QElectroTech.
4
5 QElectroTech is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 QElectroTech is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef TITLEBLOCK_SLASH_DIMENSION_WIDGET_H
19#define TITLEBLOCK_SLASH_DIMENSION_WIDGET_H
20#include <QtWidgets>
21#include "dimension.h"
22
27class TitleBlockDimensionWidget : public QDialog {
28 Q_OBJECT
29
30 // constructors, destructor
31 public:
32 TitleBlockDimensionWidget(bool, QWidget * parent = nullptr);
34 private:
36
37 // methods
38 public:
39 bool isComplete() const;
40 QLabel *label() const;
41 QSpinBox *spinbox() const;
43 void setValue(const TitleBlockDimension &);
44 bool isReadOnly() const;
45 void setReadOnly(bool);
46
47 private:
48 void initWidgets();
49 void initLayouts();
50
51 private slots:
53
54 // attributes
55 private:
56 bool complete_;
57 QSpinBox *spinbox_;
59 QRadioButton *absolute_button_;
60 QRadioButton *relative_button_;
61 QRadioButton *remaining_button_;
62 QButtonGroup *dimension_type_;
63 QDialogButtonBox *buttons_;
65};
66#endif
Definition dimensionwidget.h:27
QRadioButton * remaining_button_
Radio button to indicate the length is relative to the remaining length.
Definition dimensionwidget.h:61
~TitleBlockDimensionWidget() override
Definition dimensionwidget.cpp:39
QLabel * spinbox_label_
Label shown right before the spinbox.
Definition dimensionwidget.h:58
bool read_only_
Whether or not this widget allow edition of the displayed dimension.
Definition dimensionwidget.h:64
QDialogButtonBox * buttons_
Buttons to validate the dialog.
Definition dimensionwidget.h:63
QSpinBox * spinbox() const
Definition dimensionwidget.cpp:64
bool complete_
Whether or not this dialog is required to be complete, i.e. displaying also.
Definition dimensionwidget.h:56
QLabel * label() const
Definition dimensionwidget.cpp:55
void updateSpinBoxSuffix()
Definition dimensionwidget.cpp:179
void initLayouts()
Definition dimensionwidget.cpp:160
bool isReadOnly() const
Definition dimensionwidget.cpp:98
QRadioButton * relative_button_
Radio button to indicate the length is relative to the total length.
Definition dimensionwidget.h:60
bool isComplete() const
Definition dimensionwidget.cpp:46
TitleBlockDimension value() const
Definition dimensionwidget.cpp:72
void setReadOnly(bool)
Definition dimensionwidget.cpp:107
QButtonGroup * dimension_type_
QButtonGroup for the three radio buttons.
Definition dimensionwidget.h:62
QSpinBox * spinbox_
Spinbox displaying the length.
Definition dimensionwidget.h:57
void initWidgets()
Definition dimensionwidget.cpp:122
void setValue(const TitleBlockDimension &)
Definition dimensionwidget.cpp:84
TitleBlockDimensionWidget(const TitleBlockDimensionWidget &)
QRadioButton * absolute_button_
Radio button to indicate the length is absolute.
Definition dimensionwidget.h:59
Definition dimension.h:26