QElectroTech  0.70
dimensionwidget.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 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 
27 class TitleBlockDimensionWidget : public QDialog {
28  Q_OBJECT
29 
30  // constructors, destructor
31  public:
32  TitleBlockDimensionWidget(bool, QWidget * parent = nullptr);
33  ~TitleBlockDimensionWidget() override;
34  private:
36 
37  // methods
38  public:
39  bool isComplete() const;
40  QLabel *label() const;
41  QSpinBox *spinbox() const;
42  TitleBlockDimension value() 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:
52  void updateSpinBoxSuffix();
53 
54  // attributes
55  private:
56  bool complete_;
57  QSpinBox *spinbox_;
58  QLabel *spinbox_label_;
59  QRadioButton *absolute_button_;
60  QRadioButton *relative_button_;
61  QRadioButton *remaining_button_;
62  QButtonGroup *dimension_type_;
63  QDialogButtonBox *buttons_;
64  bool read_only_;
65 };
66 #endif
QLabel * spinbox_label_
Label shown right before the spinbox.
TitleBlockDimension value() const
bool read_only_
Whether or not this widget allow edition of the displayed dimension.
QSpinBox * spinbox_
Spinbox displaying the length.
QSpinBox * spinbox() const
void setValue(const TitleBlockDimension &)
QRadioButton * relative_button_
Radio button to indicate the length is relative to the total length.
TitleBlockDimensionWidget(bool, QWidget *parent=nullptr)
QRadioButton * absolute_button_
Radio button to indicate the length is absolute.
bool complete_
Whether or not this dialog is required to be complete, i.e. displaying also.
QDialogButtonBox * buttons_
Buttons to validate the dialog.
QRadioButton * remaining_button_
Radio button to indicate the length is relative to the remaining length.
QButtonGroup * dimension_type_
QButtonGroup for the three radio buttons.