QElectroTech
0.70
|
#include <dimensionwidget.h>
Public Member Functions | |
TitleBlockDimensionWidget (bool, QWidget *parent=nullptr) | |
~TitleBlockDimensionWidget () override | |
bool | isComplete () const |
QLabel * | label () const |
QSpinBox * | spinbox () const |
TitleBlockDimension | value () const |
void | setValue (const TitleBlockDimension &) |
bool | isReadOnly () const |
void | setReadOnly (bool) |
Private Slots | |
void | updateSpinBoxSuffix () |
Private Member Functions | |
TitleBlockDimensionWidget (const TitleBlockDimensionWidget &) | |
void | initWidgets () |
void | initLayouts () |
Private Attributes | |
bool | complete_ |
Whether or not this dialog is required to be complete, i.e. displaying also. More... | |
QSpinBox * | spinbox_ |
Spinbox displaying the length. More... | |
QLabel * | spinbox_label_ |
Label shown right before the spinbox. More... | |
QRadioButton * | absolute_button_ |
Radio button to indicate the length is absolute. More... | |
QRadioButton * | relative_button_ |
Radio button to indicate the length is relative to the total length. More... | |
QRadioButton * | remaining_button_ |
Radio button to indicate the length is relative to the remaining length. More... | |
QButtonGroup * | dimension_type_ |
QButtonGroup for the three radio buttons. More... | |
QDialogButtonBox * | buttons_ |
Buttons to validate the dialog. More... | |
bool | read_only_ |
Whether or not this widget allow edition of the displayed dimension. More... | |
This class represents a dialog for the user to input a dimension: a row height, a column width, etc.
Definition at line 27 of file dimensionwidget.h.
TitleBlockDimensionWidget::TitleBlockDimensionWidget | ( | bool | complete, |
QWidget * | parent = nullptr |
||
) |
Constructor
complete | True for this dialog to show the radio buttons that allow the user to specify whether the dimension is absolute, relative to the total width or relative to the remaining width. |
parent | Parent QWidget |
Definition at line 27 of file dimensionwidget.cpp.
References initLayouts(), and initWidgets().
|
override |
Destructor
Definition at line 39 of file dimensionwidget.cpp.
|
private |
|
private |
Initialize the layout of the dialog.
Definition at line 147 of file dimensionwidget.cpp.
References absolute_button_, buttons_, complete_, relative_button_, remaining_button_, spinbox_, and spinbox_label_.
Referenced by TitleBlockDimensionWidget().
|
private |
Initialize the widgets composing the dialog.
Definition at line 116 of file dimensionwidget.cpp.
References QET::Absolute, absolute_button_, buttons_, QET::Icons::Cancel, complete_, dimension_type_, relative_button_, QET::RelativeToRemainingLength, QET::RelativeToTotalLength, remaining_button_, setValue(), spinbox_, spinbox_label_, QET::Icons::tr, and updateSpinBoxSuffix().
Referenced by TitleBlockDimensionWidget().
bool TitleBlockDimensionWidget::isComplete | ( | ) | const |
Definition at line 45 of file dimensionwidget.cpp.
References complete_.
bool TitleBlockDimensionWidget::isReadOnly | ( | ) | const |
Definition at line 93 of file dimensionwidget.cpp.
References read_only_.
QLabel * TitleBlockDimensionWidget::label | ( | ) | const |
Definition at line 53 of file dimensionwidget.cpp.
References spinbox_label_.
Referenced by TitleBlockTemplateView::changePreviewWidth(), TitleBlockTemplateView::editColumn(), and TitleBlockTemplateView::editRow().
void TitleBlockDimensionWidget::setReadOnly | ( | bool | read_only | ) |
read_only | Whether or not this widget should allow edition of the displayed dimension. |
Definition at line 101 of file dimensionwidget.cpp.
References absolute_button_, complete_, read_only_, relative_button_, remaining_button_, and spinbox_.
Referenced by TitleBlockTemplateView::editColumn(), and TitleBlockTemplateView::editRow().
void TitleBlockDimensionWidget::setValue | ( | const TitleBlockDimension & | dim | ) |
dim | Dimension to be displayed and edited by this dialog |
Definition at line 79 of file dimensionwidget.cpp.
References complete_, dimension_type_, spinbox_, TitleBlockDimension::type, updateSpinBoxSuffix(), and TitleBlockDimension::value.
Referenced by TitleBlockTemplateView::changePreviewWidth(), TitleBlockTemplateView::editColumn(), TitleBlockTemplateView::editRow(), and initWidgets().
QSpinBox * TitleBlockDimensionWidget::spinbox | ( | ) | const |
Definition at line 61 of file dimensionwidget.cpp.
References spinbox_.
|
privateslot |
Ensure the suffix displayed by the spinbox matches the selected kind of length.
Definition at line 165 of file dimensionwidget.cpp.
References QET::Absolute, complete_, dimension_type_, spinbox_, and QET::Icons::tr.
Referenced by initWidgets(), and setValue().
TitleBlockDimension TitleBlockDimensionWidget::value | ( | ) | const |
Definition at line 68 of file dimensionwidget.cpp.
References QET::Absolute, complete_, dimension_type_, and spinbox_.
Referenced by TitleBlockTemplateView::changePreviewWidth(), TitleBlockTemplateView::editColumn(), and TitleBlockTemplateView::editRow().
|
private |
Radio button to indicate the length is absolute.
Definition at line 59 of file dimensionwidget.h.
Referenced by initLayouts(), initWidgets(), and setReadOnly().
|
private |
Buttons to validate the dialog.
Definition at line 63 of file dimensionwidget.h.
Referenced by initLayouts(), and initWidgets().
|
private |
Whether or not this dialog is required to be complete, i.e. displaying also.
Definition at line 56 of file dimensionwidget.h.
Referenced by initLayouts(), initWidgets(), isComplete(), setReadOnly(), setValue(), updateSpinBoxSuffix(), and value().
|
private |
QButtonGroup for the three radio buttons.
Definition at line 62 of file dimensionwidget.h.
Referenced by initWidgets(), setValue(), updateSpinBoxSuffix(), and value().
|
private |
Whether or not this widget allow edition of the displayed dimension.
Definition at line 64 of file dimensionwidget.h.
Referenced by isReadOnly(), and setReadOnly().
|
private |
Radio button to indicate the length is relative to the total length.
Definition at line 60 of file dimensionwidget.h.
Referenced by initLayouts(), initWidgets(), and setReadOnly().
|
private |
Radio button to indicate the length is relative to the remaining length.
Definition at line 61 of file dimensionwidget.h.
Referenced by initLayouts(), initWidgets(), and setReadOnly().
|
private |
Spinbox displaying the length.
Definition at line 57 of file dimensionwidget.h.
Referenced by initLayouts(), initWidgets(), setReadOnly(), setValue(), spinbox(), updateSpinBoxSuffix(), and value().
|
private |
Label shown right before the spinbox.
Definition at line 58 of file dimensionwidget.h.
Referenced by initLayouts(), initWidgets(), and label().