QElectroTech  0.70
Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
TitleBlockDimensionWidget Class Reference

#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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TitleBlockDimensionWidget() [1/2]

TitleBlockDimensionWidget::TitleBlockDimensionWidget ( bool  complete,
QWidget *  parent = nullptr 
)

Constructor

Parameters
completeTrue 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.
parentParent QWidget

Definition at line 27 of file dimensionwidget.cpp.

References initLayouts(), and initWidgets().

◆ ~TitleBlockDimensionWidget()

TitleBlockDimensionWidget::~TitleBlockDimensionWidget ( )
override

Destructor

Definition at line 39 of file dimensionwidget.cpp.

◆ TitleBlockDimensionWidget() [2/2]

TitleBlockDimensionWidget::TitleBlockDimensionWidget ( const TitleBlockDimensionWidget )
private

Member Function Documentation

◆ initLayouts()

void TitleBlockDimensionWidget::initLayouts ( )
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().

◆ initWidgets()

void TitleBlockDimensionWidget::initWidgets ( )
private

◆ isComplete()

bool TitleBlockDimensionWidget::isComplete ( ) const
Returns
true if this dialog shows the optional radio buttons

Definition at line 45 of file dimensionwidget.cpp.

References complete_.

◆ isReadOnly()

bool TitleBlockDimensionWidget::isReadOnly ( ) const
Returns
Whether or not this widget should allow edition of the displayed dimension.

Definition at line 93 of file dimensionwidget.cpp.

References read_only_.

◆ label()

QLabel * TitleBlockDimensionWidget::label ( ) const
Returns
a pointer to the label displayed right before the spinbox. Useful to specify a custom text.

Definition at line 53 of file dimensionwidget.cpp.

References spinbox_label_.

Referenced by TitleBlockTemplateView::changePreviewWidth(), TitleBlockTemplateView::editColumn(), and TitleBlockTemplateView::editRow().

◆ setReadOnly()

void TitleBlockDimensionWidget::setReadOnly ( bool  read_only)
Parameters
read_onlyWhether 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().

◆ setValue()

void TitleBlockDimensionWidget::setValue ( const TitleBlockDimension dim)

◆ spinbox()

QSpinBox * TitleBlockDimensionWidget::spinbox ( ) const
Returns
a pointer to the spinbox Useful to specify custom parameters, such as the minimum value

Definition at line 61 of file dimensionwidget.cpp.

References spinbox_.

◆ updateSpinBoxSuffix

void TitleBlockDimensionWidget::updateSpinBoxSuffix ( )
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().

◆ value()

TitleBlockDimension TitleBlockDimensionWidget::value ( ) const
Returns
The dimension as currently shown by the dialog

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().

Member Data Documentation

◆ absolute_button_

QRadioButton* TitleBlockDimensionWidget::absolute_button_
private

Radio button to indicate the length is absolute.

Definition at line 59 of file dimensionwidget.h.

Referenced by initLayouts(), initWidgets(), and setReadOnly().

◆ buttons_

QDialogButtonBox* TitleBlockDimensionWidget::buttons_
private

Buttons to validate the dialog.

Definition at line 63 of file dimensionwidget.h.

Referenced by initLayouts(), and initWidgets().

◆ complete_

bool TitleBlockDimensionWidget::complete_
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().

◆ dimension_type_

QButtonGroup* TitleBlockDimensionWidget::dimension_type_
private

QButtonGroup for the three radio buttons.

Definition at line 62 of file dimensionwidget.h.

Referenced by initWidgets(), setValue(), updateSpinBoxSuffix(), and value().

◆ read_only_

bool TitleBlockDimensionWidget::read_only_
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().

◆ relative_button_

QRadioButton* TitleBlockDimensionWidget::relative_button_
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().

◆ remaining_button_

QRadioButton* TitleBlockDimensionWidget::remaining_button_
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().

◆ spinbox_

QSpinBox* TitleBlockDimensionWidget::spinbox_
private

Spinbox displaying the length.

Definition at line 57 of file dimensionwidget.h.

Referenced by initLayouts(), initWidgets(), setReadOnly(), setValue(), spinbox(), updateSpinBoxSuffix(), and value().

◆ spinbox_label_

QLabel* TitleBlockDimensionWidget::spinbox_label_
private

Label shown right before the spinbox.

Definition at line 58 of file dimensionwidget.h.

Referenced by initLayouts(), initWidgets(), and label().


The documentation for this class was generated from the following files: