QElectroTech
0.70
|
#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_ |
TitleBlockCell * | edited_cell_ |
This class implements an edition widget for cells that compose a title block template.
Definition at line 31 of file templatecellwidget.h.
TitleBlockTemplateCellWidget::TitleBlockTemplateCellWidget | ( | TitleBlockTemplate * | parent_template = nullptr , |
QWidget * | parent = nullptr |
||
) |
Constructor
parent | Parent QWidget |
Definition at line 32 of file templatecellwidget.cpp.
References initWidgets(), and updateLogosComboBox().
|
override |
Destructor
Definition at line 43 of file templatecellwidget.cpp.
|
private |
int TitleBlockTemplateCellWidget::alignment | ( | ) | const |
Definition at line 360 of file templatecellwidget.cpp.
References horizontalAlignment(), and verticalAlignment().
Referenced by editAlignment().
|
signal |
Referenced by emitModification().
|
protected |
Definition at line 422 of file templatecellwidget.cpp.
References QET::Icons::tr.
Referenced by editTranslatableValue().
|
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.
cell | Title 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_.
|
slot |
Emit a modification command stating whether the text should be adjusted if needed.
Definition at line 284 of file templatecellwidget.cpp.
References emitModification(), and font_adjust_input_.
Referenced by initWidgets().
|
slot |
Emit an alignment modification command.
Definition at line 268 of file templatecellwidget.cpp.
References alignment(), and emitModification().
Referenced by initWidgets().
|
slot |
Emit a font size modification command.
Definition at line 276 of file templatecellwidget.cpp.
References emitModification(), and font_size_input_.
Referenced by initWidgets().
|
slot |
Emit a label modification command.
Definition at line 248 of file templatecellwidget.cpp.
References edited_cell_, editTranslatableValue(), label_input_, and QET::Icons::tr.
Referenced by initWidgets().
|
slot |
Emit a modification command stating whether the label should be displayed or not.
Definition at line 240 of file templatecellwidget.cpp.
References emitModification(), and label_checkbox_.
Referenced by initWidgets().
|
slot |
Emit a logo modification command.
Definition at line 292 of file templatecellwidget.cpp.
References emitModification(), and logo_input_.
Referenced by initWidgets().
|
slot |
Emit a name modification command.
Definition at line 232 of file templatecellwidget.cpp.
References emitModification(), and name_input_.
Referenced by initWidgets().
|
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.
names | Translatable string to be edited |
attribute | Name of the edited cell attribute |
title | Title 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().
|
slot |
Emit a type modification command.
Definition at line 224 of file templatecellwidget.cpp.
References cell_type_input_, and emitModification().
Referenced by initWidgets().
|
slot |
Emit a value modification command.
Definition at line 258 of file templatecellwidget.cpp.
References edited_cell_, editTranslatableValue(), QET::Icons::tr, and value_input_.
Referenced by initWidgets().
|
protected |
Create a ModifyTitleBlockCellCommand object to change attribute to new_value. This object is then emitted through the cellModified() signal.
attribute | Modified cell attribute |
new_value | New 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().
int TitleBlockTemplateCellWidget::horizontalAlignment | ( | ) | const |
Emit a horizontal alignment modification command.
Definition at line 345 of file templatecellwidget.cpp.
References horiz_align_indexes_, and horiz_align_input_.
Referenced by alignment().
|
private |
Initialize layout and widgets.
Definition at line 49 of file templatecellwidget.cpp.
References add_logo_input_, align_label_, cell_editor_layout_, cell_editor_text_layout_, cell_editor_type_and_name_layout_, cell_type_input_, cell_type_label_, editAdjust(), editAlignment(), editFontSize(), editLabel(), editLabelDisplayed(), editLogo(), editName(), editType(), editValue(), empty_label_, TitleBlockCell::EmptyCell, font_adjust_input_, font_size_input_, font_size_label_, horiz_align_indexes_, horiz_align_input_, horiz_align_label_, QET::Icons::InsertImage, label_checkbox_, label_edit_, label_input_, logo_input_, logo_label_, TitleBlockCell::LogoCell, logoEditionRequested(), name_input_, name_label_, setReadOnly(), TitleBlockCell::TextCell, QET::Icons::tr, updateFormType(), value_edit_, value_input_, value_label_, vert_align_indexes_, vert_align_input_, and vert_align_label_.
Referenced by TitleBlockTemplateCellWidget().
bool TitleBlockTemplateCellWidget::isReadOnly | ( | ) | const |
Definition at line 367 of file templatecellwidget.cpp.
References read_only_.
|
protected |
Definition at line 454 of file templatecellwidget.cpp.
References QET::Icons::tr.
Referenced by editTranslatableValue().
|
signal |
Referenced by initWidgets().
|
slot |
read_only | whether 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().
|
slot |
Shows or hides various widgets depending on the selected cell type
Definition at line 162 of file templatecellwidget.cpp.
References add_logo_input_, align_label_, cell_type_input_, empty_label_, TitleBlockCell::EmptyCell, font_adjust_input_, font_size_input_, font_size_label_, horiz_align_input_, horiz_align_label_, label_checkbox_, label_edit_, label_input_, logo_input_, logo_label_, TitleBlockCell::LogoCell, name_input_, name_label_, TitleBlockCell::TextCell, value_edit_, value_input_, value_label_, vert_align_input_, and vert_align_label_.
Referenced by edit(), and initWidgets().
|
slot |
Updates the list of available logos
parent_template | The 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().
int TitleBlockTemplateCellWidget::verticalAlignment | ( | ) | const |
Emit a vertical alignment modification command.
Definition at line 353 of file templatecellwidget.cpp.
References vert_align_indexes_, and vert_align_input_.
Referenced by alignment().
|
private |
Definition at line 52 of file templatecellwidget.h.
Referenced by initWidgets(), and updateFormType().
|
private |
Definition at line 62 of file templatecellwidget.h.
Referenced by initWidgets(), and updateFormType().
|
private |
Definition at line 75 of file templatecellwidget.h.
|
private |
Definition at line 72 of file templatecellwidget.h.
Referenced by initWidgets().
|
private |
Definition at line 74 of file templatecellwidget.h.
Referenced by initWidgets().
|
private |
Definition at line 73 of file templatecellwidget.h.
Referenced by initWidgets().
|
private |
Definition at line 46 of file templatecellwidget.h.
Referenced by editType(), initWidgets(), setReadOnly(), and updateFormType().
|
private |
Definition at line 45 of file templatecellwidget.h.
Referenced by initWidgets().
|
private |
Definition at line 77 of file templatecellwidget.h.
Referenced by edit(), editLabel(), editValue(), and emitModification().
|
private |
Definition at line 48 of file templatecellwidget.h.
Referenced by initWidgets(), and updateFormType().
|
private |
Definition at line 71 of file templatecellwidget.h.
Referenced by edit(), editAdjust(), initWidgets(), setReadOnly(), and updateFormType().
|
private |
Definition at line 70 of file templatecellwidget.h.
Referenced by edit(), editFontSize(), initWidgets(), setReadOnly(), and updateFormType().
|
private |
Definition at line 69 of file templatecellwidget.h.
Referenced by initWidgets(), and updateFormType().
|
private |
Definition at line 65 of file templatecellwidget.h.
Referenced by edit(), horizontalAlignment(), and initWidgets().
|
private |
Definition at line 64 of file templatecellwidget.h.
Referenced by edit(), horizontalAlignment(), initWidgets(), setReadOnly(), and updateFormType().
|
private |
Definition at line 63 of file templatecellwidget.h.
Referenced by initWidgets(), and updateFormType().
|
private |
Definition at line 56 of file templatecellwidget.h.
Referenced by edit(), editLabelDisplayed(), initWidgets(), setReadOnly(), and updateFormType().
|
private |
Definition at line 58 of file templatecellwidget.h.
Referenced by initWidgets(), setReadOnly(), and updateFormType().
|
private |
Definition at line 57 of file templatecellwidget.h.
Referenced by edit(), editLabel(), initWidgets(), and updateFormType().
|
private |
Definition at line 51 of file templatecellwidget.h.
Referenced by edit(), editLogo(), initWidgets(), setReadOnly(), updateFormType(), and updateLogosComboBox().
|
private |
Definition at line 50 of file templatecellwidget.h.
Referenced by initWidgets(), and updateFormType().
|
private |
Definition at line 55 of file templatecellwidget.h.
Referenced by edit(), editName(), initWidgets(), setReadOnly(), and updateFormType().
|
private |
Definition at line 54 of file templatecellwidget.h.
Referenced by initWidgets(), and updateFormType().
|
private |
is the template read-only?
Definition at line 44 of file templatecellwidget.h.
Referenced by isReadOnly(), and setReadOnly().
|
private |
Definition at line 61 of file templatecellwidget.h.
Referenced by initWidgets(), setReadOnly(), and updateFormType().
|
private |
Definition at line 60 of file templatecellwidget.h.
Referenced by edit(), editValue(), initWidgets(), and updateFormType().
|
private |
Definition at line 59 of file templatecellwidget.h.
Referenced by initWidgets(), and updateFormType().
|
private |
Definition at line 68 of file templatecellwidget.h.
Referenced by edit(), initWidgets(), and verticalAlignment().
|
private |
Definition at line 67 of file templatecellwidget.h.
Referenced by edit(), initWidgets(), setReadOnly(), updateFormType(), and verticalAlignment().
|
private |
Definition at line 66 of file templatecellwidget.h.
Referenced by initWidgets(), and updateFormType().