QElectroTech  0.70
Public Slots | Signals | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
TitleBlockTemplateCellWidget Class Reference

#include <templatecellwidget.h>

Public Slots

void updateFormType (int)
 
void edit (TitleBlockCell *)
 
void editType ()
 
void editName ()
 
void editLabelDisplayed ()
 
void editLabel ()
 
void editValue ()
 
void editAlignment ()
 
void editFontSize ()
 
void editAdjust ()
 
void editLogo ()
 
void updateLogosComboBox (const TitleBlockTemplate *)
 
void setReadOnly (bool)
 

Signals

void logoEditionRequested ()
 
void cellModified (ModifyTitleBlockCellCommand *) const
 

Public Member Functions

 TitleBlockTemplateCellWidget (TitleBlockTemplate *=nullptr, QWidget *=nullptr)
 
 ~TitleBlockTemplateCellWidget () override
 
int horizontalAlignment () const
 
int verticalAlignment () const
 
int alignment () const
 
bool isReadOnly () const
 

Protected Member Functions

void editTranslatableValue (NamesList &, const QString &, const QString &) const
 
void emitModification (const QString &, const QVariant &) const
 
QString defaultVariablesString () const
 
QString labelValueInformationString () const
 

Private Member Functions

 TitleBlockTemplateCellWidget (const TitleBlockTemplateCellWidget &)
 
void initWidgets ()
 

Private Attributes

bool read_only_
 is the template read-only? More...
 
QLabel * cell_type_label_
 
QComboBox * cell_type_input_
 
QLabel * empty_label_
 
QLabel * logo_label_
 
QComboBox * logo_input_
 
QPushButton * add_logo_input_
 
QLabel * name_label_
 
QLineEdit * name_input_
 
QCheckBox * label_checkbox_
 
QLineEdit * label_input_
 
QPushButton * label_edit_
 
QLabel * value_label_
 
QLineEdit * value_input_
 
QPushButton * value_edit_
 
QLabel * align_label_
 
QLabel * horiz_align_label_
 
QComboBox * horiz_align_input_
 
QHash< int, int > horiz_align_indexes_
 
QLabel * vert_align_label_
 
QComboBox * vert_align_input_
 
QHash< int, int > vert_align_indexes_
 
QLabel * font_size_label_
 
QSpinBox * font_size_input_
 
QCheckBox * font_adjust_input_
 
QVBoxLayout * cell_editor_layout_
 
QHBoxLayout * cell_editor_type_and_name_layout_
 
QGridLayout * cell_editor_text_layout_
 
QHBoxLayout * cell_editor_image_layout_
 
TitleBlockCelledited_cell_
 

Detailed Description

This class implements an edition widget for cells that compose a title block template.

Definition at line 31 of file templatecellwidget.h.

Constructor & Destructor Documentation

◆ TitleBlockTemplateCellWidget() [1/2]

TitleBlockTemplateCellWidget::TitleBlockTemplateCellWidget ( TitleBlockTemplate parent_template = nullptr,
QWidget *  parent = nullptr 
)

Constructor

Parameters
parentParent QWidget

Definition at line 32 of file templatecellwidget.cpp.

References initWidgets(), and updateLogosComboBox().

◆ ~TitleBlockTemplateCellWidget()

TitleBlockTemplateCellWidget::~TitleBlockTemplateCellWidget ( )
override

Destructor

Definition at line 43 of file templatecellwidget.cpp.

◆ TitleBlockTemplateCellWidget() [2/2]

TitleBlockTemplateCellWidget::TitleBlockTemplateCellWidget ( const TitleBlockTemplateCellWidget )
private

Member Function Documentation

◆ alignment()

int TitleBlockTemplateCellWidget::alignment ( ) const
Returns
the currently selected alignment.

Definition at line 360 of file templatecellwidget.cpp.

References horizontalAlignment(), and verticalAlignment().

Referenced by editAlignment().

◆ cellModified

void TitleBlockTemplateCellWidget::cellModified ( ModifyTitleBlockCellCommand ) const
signal

Referenced by emitModification().

◆ defaultVariablesString()

QString TitleBlockTemplateCellWidget::defaultVariablesString ( ) const
protected
Returns
a string describing the various variables provided by default by the application.

Definition at line 422 of file templatecellwidget.cpp.

References QET::Icons::tr.

Referenced by editTranslatableValue().

◆ edit

void TitleBlockTemplateCellWidget::edit ( TitleBlockCell cell)
slot

Set the title block cell to be edited. The cell pointer is stored by this class; however, modifications made by the user are packaged as ModifyTitleBlockCellCommand objects and emitted through the cellModified() signal.

Parameters
cellTitle block cell to be edited

Definition at line 199 of file templatecellwidget.cpp.

References edited_cell_, font_adjust_input_, font_size_input_, TitleBlockTemplate::fontForCell(), horiz_align_indexes_, horiz_align_input_, label_checkbox_, label_input_, logo_input_, name_input_, updateFormType(), value_input_, vert_align_indexes_, and vert_align_input_.

◆ editAdjust

void TitleBlockTemplateCellWidget::editAdjust ( )
slot

Emit a modification command stating whether the text should be adjusted if needed.

See also
ModifyTitleBlockCellCommand

Definition at line 284 of file templatecellwidget.cpp.

References emitModification(), and font_adjust_input_.

Referenced by initWidgets().

◆ editAlignment

void TitleBlockTemplateCellWidget::editAlignment ( )
slot

Emit an alignment modification command.

See also
ModifyTitleBlockCellCommand

Definition at line 268 of file templatecellwidget.cpp.

References alignment(), and emitModification().

Referenced by initWidgets().

◆ editFontSize

void TitleBlockTemplateCellWidget::editFontSize ( )
slot

Emit a font size modification command.

See also
ModifyTitleBlockCellCommand

Definition at line 276 of file templatecellwidget.cpp.

References emitModification(), and font_size_input_.

Referenced by initWidgets().

◆ editLabel

void TitleBlockTemplateCellWidget::editLabel ( )
slot

Emit a label modification command.

See also
ModifyTitleBlockCellCommand

Definition at line 248 of file templatecellwidget.cpp.

References edited_cell_, editTranslatableValue(), label_input_, and QET::Icons::tr.

Referenced by initWidgets().

◆ editLabelDisplayed

void TitleBlockTemplateCellWidget::editLabelDisplayed ( )
slot

Emit a modification command stating whether the label should be displayed or not.

See also
ModifyTitleBlockCellCommand

Definition at line 240 of file templatecellwidget.cpp.

References emitModification(), and label_checkbox_.

Referenced by initWidgets().

◆ editLogo

void TitleBlockTemplateCellWidget::editLogo ( )
slot

Emit a logo modification command.

See also
ModifyTitleBlockCellCommand

Definition at line 292 of file templatecellwidget.cpp.

References emitModification(), and logo_input_.

Referenced by initWidgets().

◆ editName

void TitleBlockTemplateCellWidget::editName ( )
slot

Emit a name modification command.

See also
ModifyTitleBlockCellCommand

Definition at line 232 of file templatecellwidget.cpp.

References emitModification(), and name_input_.

Referenced by initWidgets().

◆ editTranslatableValue()

void TitleBlockTemplateCellWidget::editTranslatableValue ( NamesList names,
const QString &  attribute,
const QString &  title 
) const
protected

Allow the user to edit a translatable string (e.g. value or label). If the user modified the string, this method emits a ModifyTitleBlockCellCommand object through the cellModified() signal.

Parameters
namesTranslatable string to be edited
attributeName of the edited cell attribute
titleTitle of the dialog window

Definition at line 379 of file templatecellwidget.cpp.

References defaultVariablesString(), emitModification(), labelValueInformationString(), NameListDialog::namelistWidget(), NameListWidget::names(), NameListWidget::setClipboardValue(), NameListDialog::setHelpText(), NameListDialog::setInformationText(), NameListWidget::setNames(), and QETInformation::titleblockTranslatedKeyHashVar().

Referenced by editLabel(), and editValue().

◆ editType

void TitleBlockTemplateCellWidget::editType ( )
slot

Emit a type modification command.

See also
ModifyTitleBlockCellCommand

Definition at line 224 of file templatecellwidget.cpp.

References cell_type_input_, and emitModification().

Referenced by initWidgets().

◆ editValue

void TitleBlockTemplateCellWidget::editValue ( )
slot

Emit a value modification command.

See also
ModifyTitleBlockCellCommand

Definition at line 258 of file templatecellwidget.cpp.

References edited_cell_, editTranslatableValue(), QET::Icons::tr, and value_input_.

Referenced by initWidgets().

◆ emitModification()

void TitleBlockTemplateCellWidget::emitModification ( const QString &  attribute,
const QVariant &  new_value 
) const
protected

Create a ModifyTitleBlockCellCommand object to change attribute to new_value. This object is then emitted through the cellModified() signal.

See also
ModifyTitleBlockCellCommand
Parameters
attributeModified cell attribute
new_valueNew value for the modified cell attribute

Definition at line 403 of file templatecellwidget.cpp.

References TitleBlockCell::attributeName(), cellModified(), edited_cell_, and QET::Icons::tr.

Referenced by editAdjust(), editAlignment(), editFontSize(), editLabelDisplayed(), editLogo(), editName(), editTranslatableValue(), and editType().

◆ horizontalAlignment()

int TitleBlockTemplateCellWidget::horizontalAlignment ( ) const

Emit a horizontal alignment modification command.

See also
ModifyTitleBlockCellCommand

Definition at line 345 of file templatecellwidget.cpp.

References horiz_align_indexes_, and horiz_align_input_.

Referenced by alignment().

◆ initWidgets()

void TitleBlockTemplateCellWidget::initWidgets ( )
private

◆ isReadOnly()

bool TitleBlockTemplateCellWidget::isReadOnly ( ) const
Returns
whether this edition widget is read only

Definition at line 367 of file templatecellwidget.cpp.

References read_only_.

◆ labelValueInformationString()

QString TitleBlockTemplateCellWidget::labelValueInformationString ( ) const
protected
Returns
a string describing what the user may enter as cell label / value.

Definition at line 454 of file templatecellwidget.cpp.

References QET::Icons::tr.

Referenced by editTranslatableValue().

◆ logoEditionRequested

void TitleBlockTemplateCellWidget::logoEditionRequested ( )
signal

Referenced by initWidgets().

◆ setReadOnly

void TitleBlockTemplateCellWidget::setReadOnly ( bool  read_only)
slot
Parameters
read_onlywhether this edition widget should be read only

Definition at line 325 of file templatecellwidget.cpp.

References cell_type_input_, font_adjust_input_, font_size_input_, horiz_align_input_, label_checkbox_, label_edit_, logo_input_, name_input_, read_only_, value_edit_, and vert_align_input_.

Referenced by initWidgets().

◆ updateFormType

void TitleBlockTemplateCellWidget::updateFormType ( int  cell_type)
slot

◆ updateLogosComboBox

void TitleBlockTemplateCellWidget::updateLogosComboBox ( const TitleBlockTemplate parent_template)
slot

Updates the list of available logos

Parameters
parent_templateThe title block template which contains the currently edited cell

Definition at line 300 of file templatecellwidget.cpp.

References logo_input_, and QET::Icons::tr.

Referenced by TitleBlockTemplateCellWidget().

◆ verticalAlignment()

int TitleBlockTemplateCellWidget::verticalAlignment ( ) const

Emit a vertical alignment modification command.

See also
ModifyTitleBlockCellCommand

Definition at line 353 of file templatecellwidget.cpp.

References vert_align_indexes_, and vert_align_input_.

Referenced by alignment().

Member Data Documentation

◆ add_logo_input_

QPushButton* TitleBlockTemplateCellWidget::add_logo_input_
private

Definition at line 52 of file templatecellwidget.h.

Referenced by initWidgets(), and updateFormType().

◆ align_label_

QLabel* TitleBlockTemplateCellWidget::align_label_
private

Definition at line 62 of file templatecellwidget.h.

Referenced by initWidgets(), and updateFormType().

◆ cell_editor_image_layout_

QHBoxLayout* TitleBlockTemplateCellWidget::cell_editor_image_layout_
private

Definition at line 75 of file templatecellwidget.h.

◆ cell_editor_layout_

QVBoxLayout* TitleBlockTemplateCellWidget::cell_editor_layout_
private

Definition at line 72 of file templatecellwidget.h.

Referenced by initWidgets().

◆ cell_editor_text_layout_

QGridLayout* TitleBlockTemplateCellWidget::cell_editor_text_layout_
private

Definition at line 74 of file templatecellwidget.h.

Referenced by initWidgets().

◆ cell_editor_type_and_name_layout_

QHBoxLayout* TitleBlockTemplateCellWidget::cell_editor_type_and_name_layout_
private

Definition at line 73 of file templatecellwidget.h.

Referenced by initWidgets().

◆ cell_type_input_

QComboBox* TitleBlockTemplateCellWidget::cell_type_input_
private

Definition at line 46 of file templatecellwidget.h.

Referenced by editType(), initWidgets(), setReadOnly(), and updateFormType().

◆ cell_type_label_

QLabel* TitleBlockTemplateCellWidget::cell_type_label_
private

Definition at line 45 of file templatecellwidget.h.

Referenced by initWidgets().

◆ edited_cell_

TitleBlockCell* TitleBlockTemplateCellWidget::edited_cell_
private

Definition at line 77 of file templatecellwidget.h.

Referenced by edit(), editLabel(), editValue(), and emitModification().

◆ empty_label_

QLabel* TitleBlockTemplateCellWidget::empty_label_
private

Definition at line 48 of file templatecellwidget.h.

Referenced by initWidgets(), and updateFormType().

◆ font_adjust_input_

QCheckBox* TitleBlockTemplateCellWidget::font_adjust_input_
private

Definition at line 71 of file templatecellwidget.h.

Referenced by edit(), editAdjust(), initWidgets(), setReadOnly(), and updateFormType().

◆ font_size_input_

QSpinBox* TitleBlockTemplateCellWidget::font_size_input_
private

Definition at line 70 of file templatecellwidget.h.

Referenced by edit(), editFontSize(), initWidgets(), setReadOnly(), and updateFormType().

◆ font_size_label_

QLabel* TitleBlockTemplateCellWidget::font_size_label_
private

Definition at line 69 of file templatecellwidget.h.

Referenced by initWidgets(), and updateFormType().

◆ horiz_align_indexes_

QHash<int, int> TitleBlockTemplateCellWidget::horiz_align_indexes_
private

Definition at line 65 of file templatecellwidget.h.

Referenced by edit(), horizontalAlignment(), and initWidgets().

◆ horiz_align_input_

QComboBox* TitleBlockTemplateCellWidget::horiz_align_input_
private

◆ horiz_align_label_

QLabel* TitleBlockTemplateCellWidget::horiz_align_label_
private

Definition at line 63 of file templatecellwidget.h.

Referenced by initWidgets(), and updateFormType().

◆ label_checkbox_

QCheckBox* TitleBlockTemplateCellWidget::label_checkbox_
private

◆ label_edit_

QPushButton* TitleBlockTemplateCellWidget::label_edit_
private

Definition at line 58 of file templatecellwidget.h.

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

◆ label_input_

QLineEdit* TitleBlockTemplateCellWidget::label_input_
private

Definition at line 57 of file templatecellwidget.h.

Referenced by edit(), editLabel(), initWidgets(), and updateFormType().

◆ logo_input_

QComboBox* TitleBlockTemplateCellWidget::logo_input_
private

◆ logo_label_

QLabel* TitleBlockTemplateCellWidget::logo_label_
private

Definition at line 50 of file templatecellwidget.h.

Referenced by initWidgets(), and updateFormType().

◆ name_input_

QLineEdit* TitleBlockTemplateCellWidget::name_input_
private

Definition at line 55 of file templatecellwidget.h.

Referenced by edit(), editName(), initWidgets(), setReadOnly(), and updateFormType().

◆ name_label_

QLabel* TitleBlockTemplateCellWidget::name_label_
private

Definition at line 54 of file templatecellwidget.h.

Referenced by initWidgets(), and updateFormType().

◆ read_only_

bool TitleBlockTemplateCellWidget::read_only_
private

is the template read-only?

Definition at line 44 of file templatecellwidget.h.

Referenced by isReadOnly(), and setReadOnly().

◆ value_edit_

QPushButton* TitleBlockTemplateCellWidget::value_edit_
private

Definition at line 61 of file templatecellwidget.h.

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

◆ value_input_

QLineEdit* TitleBlockTemplateCellWidget::value_input_
private

Definition at line 60 of file templatecellwidget.h.

Referenced by edit(), editValue(), initWidgets(), and updateFormType().

◆ value_label_

QLabel* TitleBlockTemplateCellWidget::value_label_
private

Definition at line 59 of file templatecellwidget.h.

Referenced by initWidgets(), and updateFormType().

◆ vert_align_indexes_

QHash<int, int> TitleBlockTemplateCellWidget::vert_align_indexes_
private

Definition at line 68 of file templatecellwidget.h.

Referenced by edit(), initWidgets(), and verticalAlignment().

◆ vert_align_input_

QComboBox* TitleBlockTemplateCellWidget::vert_align_input_
private

◆ vert_align_label_

QLabel* TitleBlockTemplateCellWidget::vert_align_label_
private

Definition at line 66 of file templatecellwidget.h.

Referenced by initWidgets(), and updateFormType().


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