QElectroTech
0.70
|
The DynamicElementTextModel class A model to use with QtView. This model display and can edit the value of dynamic text of an element. Set the delegate DynamicTextItemDelegate as delegate of this model. More...
#include <dynamicelementtextmodel.h>
Public Types | |
enum | ValueType { textFrom =1, userText, infoText, compositeText, txtAlignment, size, font, color, pos, frame, rotation, textWidth, grpAlignment, grpPos, grpRotation, grpVAdjust, grpName, grpHoldBottom, grpFrame } |
Signals | |
void | dataChanged () |
Private Member Functions | |
QList< QStandardItem * > | itemsForText (DynamicElementTextItem *deti) |
DynamicElementTextModel::itemsForText. More... | |
void | addText (DynamicElementTextItem *deti) |
DynamicElementTextModel::addText. More... | |
void | removeText (DynamicElementTextItem *deti) |
DynamicElementTextModel::removeText. More... | |
void | addGroup (ElementTextItemGroup *group) |
DynamicElementTextModel::AddGroup Add a text item group to this model. More... | |
void | removeGroup (ElementTextItemGroup *group) |
DynamicElementTextModel::removeGroup Remove the text item group from this model. More... | |
void | addTextToGroup (DynamicElementTextItem *deti, ElementTextItemGroup *group) |
DynamicElementTextModel::textAddedToGroup Add the text to the group . More... | |
void | removeTextFromGroup (DynamicElementTextItem *deti, ElementTextItemGroup *group) |
void | enableSourceText (DynamicElementTextItem *deti, DynamicElementTextItem::TextFrom tf) |
DynamicElementTextModel::enableSourceText Enable the good field, according to the current source of text, for the edited text . More... | |
void | enableGroupRotationAndPos (ElementTextItemGroup *group) |
DynamicElementTextModel::enableGroupRotation Enable/disable the item "group rotation" according the option hold to bottom. More... | |
void | itemDataChanged (QStandardItem *qsi) |
void | setConnection (DynamicElementTextItem *deti, bool set) |
DynamicElementTextModel::setConnection Set up the connection for to keep up to date the data of this model and the text. Is notably use with the use of QUndoCommand. More... | |
void | setConnection (ElementTextItemGroup *group, bool set) |
DynamicElementTextModel::setConnection Set up the connection for to keep up to date the data of this model and the group. Is notably use with the use of QUndoCommand. More... | |
void | updateDataFromText (DynamicElementTextItem *deti, DynamicElementTextModel::ValueType type) |
void | updateDataFromGroup (ElementTextItemGroup *group, DynamicElementTextModel::ValueType type) |
Private Attributes | |
QPointer< Element > | m_element |
QHash< DynamicElementTextItem *, QStandardItem * > | m_texts_list |
QHash< ElementTextItemGroup *, QStandardItem * > | m_groups_list |
QHash< DynamicElementTextItem *, QList< QMetaObject::Connection > > | m_hash_text_connect |
QHash< ElementTextItemGroup *, QList< QMetaObject::Connection > > | m_hash_group_connect |
bool | m_block_dataChanged = false |
The DynamicElementTextModel class A model to use with QtView. This model display and can edit the value of dynamic text of an element. Set the delegate DynamicTextItemDelegate as delegate of this model.
Definition at line 35 of file dynamicelementtextmodel.h.
Enumerator | |
---|---|
textFrom | |
userText | |
infoText | |
compositeText | |
txtAlignment | |
size | |
font | |
color | |
pos | |
frame | |
rotation | |
textWidth | |
grpAlignment | |
grpPos | |
grpRotation | |
grpVAdjust | |
grpName | |
grpHoldBottom | |
grpFrame |
Definition at line 40 of file dynamicelementtextmodel.h.
DynamicElementTextModel::DynamicElementTextModel | ( | Element * | element, |
QObject * | parent = nullptr |
||
) |
Definition at line 60 of file dynamicelementtextmodel.cpp.
References addGroup(), addText(), addTextToGroup(), QET::Horizontal, itemDataChanged(), itemsForText(), m_element, removeGroup(), removeText(), removeTextFromGroup(), Element::textAdded(), Element::textAddedToGroup(), Element::textRemoved(), Element::textRemovedFromGroup(), Element::textsGroupAboutToBeRemoved(), Element::textsGroupAdded(), and QET::Icons::tr.
|
override |
Definition at line 84 of file dynamicelementtextmodel.cpp.
References m_hash_group_connect, m_hash_text_connect, and setConnection().
|
private |
DynamicElementTextModel::AddGroup Add a text item group to this model.
group |
Definition at line 636 of file dynamicelementtextmodel.cpp.
References ElementTextItemGroup::alignment, enableGroupRotationAndPos(), ElementTextItemGroup::frame, grpAlignment, grpFrame, grpHoldBottom, grpPos, grpRotation, grpVAdjust, ElementTextItemGroup::holdToBottomPage, itemsForText(), m_groups_list, ElementTextItemGroup::name, ElementTextItemGroup::pos, ElementTextItemGroup::rotation, setConnection(), QET::Icons::textGroup, ElementTextItemGroup::texts(), QET::Icons::tr, and ElementTextItemGroup::verticalAdjustment.
Referenced by DynamicElementTextModel().
|
private |
DynamicElementTextModel::addText.
deti |
Definition at line 334 of file dynamicelementtextmodel.cpp.
References itemsForText().
Referenced by DynamicElementTextModel().
|
private |
DynamicElementTextModel::textAddedToGroup Add the text to the group .
deti | |
group |
Definition at line 783 of file dynamicelementtextmodel.cpp.
References itemsForText(), and m_groups_list.
Referenced by DynamicElementTextModel().
|
override |
Definition at line 913 of file dynamicelementtextmodel.cpp.
References indexIsInGroup(), and m_element.
|
signal |
Referenced by itemDataChanged(), and DynamicElementTextItemEditor::setElement().
|
override |
DynamicElementTextModel::dropMimeData.
data | |
action | |
row | |
column | |
parent |
Definition at line 968 of file dynamicelementtextmodel.cpp.
References groupFromIndex(), indexIsInGroup(), m_element, and QET::Icons::tr.
|
private |
DynamicElementTextModel::enableGroupRotation Enable/disable the item "group rotation" according the option hold to bottom.
group |
Definition at line 1131 of file dynamicelementtextmodel.cpp.
References ElementTextItemGroup::holdToBottomPage, m_groups_list, rot_grp_row, x_grp_row, and y_grp_row.
Referenced by addGroup(), and updateDataFromGroup().
|
private |
DynamicElementTextModel::enableSourceText Enable the good field, according to the current source of text, for the edited text .
deti | |
tf |
Definition at line 1100 of file dynamicelementtextmodel.cpp.
References compo_txt_row, DynamicElementTextItem::CompositeText, DynamicElementTextItem::ElementInfo, info_txt_row, m_texts_list, DynamicElementTextItem::UserText, and usr_txt_row.
Referenced by itemDataChanged(), itemsForText(), and updateDataFromText().
ElementTextItemGroup * DynamicElementTextModel::groupFromIndex | ( | const QModelIndex & | index | ) | const |
DynamicElementTextModel::groupFromIndex.
index |
Definition at line 808 of file dynamicelementtextmodel.cpp.
References groupFromItem().
Referenced by dropMimeData(), and DynamicElementTextItemEditor::on_m_remove_selection_clicked().
ElementTextItemGroup * DynamicElementTextModel::groupFromItem | ( | QStandardItem * | item | ) | const |
DynamicElementTextModel::groupFromItem.
item |
Definition at line 825 of file dynamicelementtextmodel.cpp.
References m_groups_list.
Referenced by groupFromIndex(), and itemDataChanged().
QModelIndex DynamicElementTextModel::indexFromGroup | ( | ElementTextItemGroup * | group | ) | const |
DynamicElementTextModel::indexFromGroup.
group |
Definition at line 851 of file dynamicelementtextmodel.cpp.
References m_groups_list.
Referenced by DynamicElementTextItemEditor::setCurrentGroup().
QModelIndex DynamicElementTextModel::indexFromText | ( | DynamicElementTextItem * | text | ) | const |
DynamicElementTextModel::indexFromText.
text |
Definition at line 431 of file dynamicelementtextmodel.cpp.
References m_texts_list.
Referenced by DynamicElementTextItemEditor::setCurrentText().
bool DynamicElementTextModel::indexIsGroup | ( | const QModelIndex & | index | ) | const |
DynamicElementTextModel::indexIsGroup.
index |
Definition at line 892 of file dynamicelementtextmodel.cpp.
References m_groups_list.
Referenced by DynamicElementTextItemEditor::on_m_tree_view_clicked().
bool DynamicElementTextModel::indexIsInGroup | ( | const QModelIndex & | index | ) | const |
DynamicElementTextModel::indexIsInGroup.
index |
Definition at line 99 of file dynamicelementtextmodel.cpp.
References m_groups_list.
Referenced by canDropMimeData(), and dropMimeData().
bool DynamicElementTextModel::indexIsText | ( | const QModelIndex & | index | ) | const |
DynamicElementTextModel::indexIsText.
index |
Definition at line 865 of file dynamicelementtextmodel.cpp.
References m_texts_list.
Referenced by DynamicElementTextItemEditor::on_m_tree_view_clicked().
|
private |
Definition at line 1158 of file dynamicelementtextmodel.cpp.
References compo_txt_row, compositeText, DynamicElementTextItem::CompositeText, dataChanged(), DynamicElementTextItem::ElementInfo, Element::elementInformations(), DynamicElementTextItem::elementUseForInfo(), enableSourceText(), groupFromItem(), info_txt_row, infoText, m_block_dataChanged, m_groups_list, m_texts_list, autonum::AssignVariables::replaceVariable(), textFrom, textFromItem(), QET::Icons::tr, userText, DynamicElementTextItem::UserText, usr_txt_row, and DiagramContext::value().
Referenced by DynamicElementTextModel().
|
private |
DynamicElementTextModel::itemsForText.
deti |
Definition at line 122 of file dynamicelementtextmodel.cpp.
References DiagramTextItem::alignment, color, DiagramTextItem::color, DynamicElementTextItem::compositeText, compositeText, DynamicElementTextItem::ElementInfo, Element::elementInformations(), QETApp::elementTranslatedInfoKey(), DynamicElementTextItem::elementUseForInfo(), enableSourceText(), font, DiagramTextItem::font, DynamicElementTextItem::frame, frame, DynamicElementTextItem::infoName, infoText, m_texts_list, DynamicElementTextItem::parentGroup(), QET::Icons::PartText, pos, autonum::AssignVariables::replaceVariable(), rotation, setConnection(), size, textFrom, DynamicElementTextItem::textFrom, DynamicElementTextItem::textWidth, textWidth, QET::Icons::tr, txtAlignment, userText, and DynamicElementTextItem::UserText.
Referenced by addGroup(), addText(), addTextToGroup(), and DynamicElementTextModel().
|
override |
Definition at line 1061 of file dynamicelementtextmodel.cpp.
References m_texts_list, and DynamicElementTextItem::uuid().
|
override |
DynamicElementTextModel::mimeTypes.
Definition at line 1087 of file dynamicelementtextmodel.cpp.
|
private |
DynamicElementTextModel::removeGroup Remove the text item group from this model.
group |
Definition at line 766 of file dynamicelementtextmodel.cpp.
References m_groups_list, and setConnection().
Referenced by DynamicElementTextModel().
|
private |
DynamicElementTextModel::removeText.
deti |
Definition at line 343 of file dynamicelementtextmodel.cpp.
References m_texts_list, and setConnection().
Referenced by DynamicElementTextModel().
|
private |
Definition at line 789 of file dynamicelementtextmodel.cpp.
References m_texts_list.
Referenced by DynamicElementTextModel().
|
private |
DynamicElementTextModel::setConnection Set up the connection for to keep up to date the data of this model and the text. Is notably use with the use of QUndoCommand.
deti | - text to setup connection |
set | - true = set connection - false unset connection |
Definition at line 1226 of file dynamicelementtextmodel.cpp.
References color, DiagramTextItem::colorChanged(), compositeText, DynamicElementTextItem::compositeTextChanged(), font, DiagramTextItem::fontChanged(), frame, DynamicElementTextItem::frameChanged(), DynamicElementTextItem::infoNameChanged(), infoText, m_hash_text_connect, pos, rotation, DynamicElementTextItem::textChanged(), textFrom, DynamicElementTextItem::textFromChanged(), textWidth, DynamicElementTextItem::textWidthChanged(), updateDataFromText(), and userText.
Referenced by addGroup(), itemsForText(), removeGroup(), removeText(), and ~DynamicElementTextModel().
|
private |
DynamicElementTextModel::setConnection Set up the connection for to keep up to date the data of this model and the group. Is notably use with the use of QUndoCommand.
group | group to setup the connection |
set | true = set connection - false unset connection |
Definition at line 1266 of file dynamicelementtextmodel.cpp.
References ElementTextItemGroup::alignmentChanged(), ElementTextItemGroup::frameChanged(), grpAlignment, grpFrame, grpHoldBottom, grpName, grpPos, grpRotation, grpVAdjust, ElementTextItemGroup::holdToBottomPageChanged(), m_hash_group_connect, ElementTextItemGroup::rotationChanged(), updateDataFromGroup(), ElementTextItemGroup::verticalAdjustmentChanged(), ElementTextItemGroup::xChanged(), and ElementTextItemGroup::yChanged().
DynamicElementTextItem * DynamicElementTextModel::textFromIndex | ( | const QModelIndex & | index | ) | const |
DynamicElementTextModel::textFromIndex.
index |
Definition at line 360 of file dynamicelementtextmodel.cpp.
References textFromItem().
Referenced by DynamicTextItemDelegate::createEditor(), DynamicElementTextItemEditor::on_m_remove_selection_clicked(), and DynamicTextItemDelegate::setModelData().
DynamicElementTextItem * DynamicElementTextModel::textFromItem | ( | QStandardItem * | item | ) | const |
DynamicElementTextModel::textFromItem.
item |
Definition at line 378 of file dynamicelementtextmodel.cpp.
References m_groups_list, and m_texts_list.
Referenced by itemDataChanged(), and textFromIndex().
QUndoCommand * DynamicElementTextModel::undoForEditedGroup | ( | ElementTextItemGroup * | group, |
QUndoCommand * | parent_undo = nullptr |
||
) | const |
DynamicElementTextModel::undoForEditedGroup.
group | |
parent_undo |
Definition at line 572 of file dynamicelementtextmodel.cpp.
References adjust_grp_row, align_grp_row, ElementTextItemGroup::alignment, ElementTextItemGroup::frame, frame_grp_row, hold_to_bottom_grp_row, ElementTextItemGroup::holdToBottomPage, m_groups_list, ElementTextItemGroup::name, pos, ElementTextItemGroup::pos, rot_grp_row, rotation, ElementTextItemGroup::rotation, QPropertyUndoCommand::setAnimated(), QET::Icons::tr, ElementTextItemGroup::verticalAdjustment, x_grp_row, and y_grp_row.
Referenced by DynamicElementTextItemEditor::apply(), and DynamicElementTextItemEditor::associatedUndo().
QUndoCommand * DynamicElementTextModel::undoForEditedText | ( | DynamicElementTextItem * | deti, |
QUndoCommand * | parent_undo = nullptr |
||
) | const |
DynamicElementTextModel::undoForEditedText.
deti |
Definition at line 446 of file dynamicelementtextmodel.cpp.
References align_txt_row, DiagramTextItem::alignment, color, DiagramTextItem::color, color_txt_row, compo_txt_row, DynamicElementTextItem::compositeText, DynamicElementTextItem::CompositeText, QET::correctAngle(), DynamicElementTextItem::ElementInfo, font, DiagramTextItem::font, font_txt_row, DynamicElementTextItem::frame, frame, frame_txt_row, info_txt_row, DynamicElementTextItem::infoName, m_texts_list, rot_txt_row, QPropertyUndoCommand::setAnimated(), size_txt_row, src_txt_row, DynamicElementTextItem::text, DynamicElementTextItem::textFrom, DynamicElementTextItem::textWidth, QET::Icons::tr, DynamicElementTextItem::UserText, usr_txt_row, width_txt_row, x_txt_row, and y_txt_row.
Referenced by DynamicElementTextItemEditor::apply(), and DynamicElementTextItemEditor::associatedUndo().
|
private |
Definition at line 1389 of file dynamicelementtextmodel.cpp.
References adjust_grp_row, align_grp_row, ElementTextItemGroup::alignment, enableGroupRotationAndPos(), ElementTextItemGroup::frame, frame_grp_row, grpAlignment, grpFrame, grpHoldBottom, grpName, grpPos, grpRotation, grpVAdjust, hold_to_bottom_grp_row, ElementTextItemGroup::holdToBottomPage, m_block_dataChanged, m_groups_list, ElementTextItemGroup::name, ElementTextItemGroup::pos, rot_grp_row, ElementTextItemGroup::rotation, QET::Icons::tr, ElementTextItemGroup::verticalAdjustment, x_grp_row, and y_grp_row.
Referenced by setConnection().
|
private |
Definition at line 1297 of file dynamicelementtextmodel.cpp.
References color, DiagramTextItem::color, color_txt_row, compo_txt_row, DynamicElementTextItem::compositeText, compositeText, DynamicElementTextItem::CompositeText, DynamicElementTextItem::ElementInfo, QETApp::elementTranslatedInfoKey(), enableSourceText(), font, DiagramTextItem::font, font_txt_row, DynamicElementTextItem::frame, frame, frame_txt_row, info_txt_row, DynamicElementTextItem::infoName, infoText, m_block_dataChanged, m_texts_list, pos, rot_txt_row, rotation, size, size_txt_row, DynamicElementTextItem::textFrom, textFrom, DynamicElementTextItem::textWidth, textWidth, QET::Icons::tr, userText, DynamicElementTextItem::UserText, usr_txt_row, width_txt_row, x_txt_row, and y_txt_row.
Referenced by setConnection().
|
private |
Definition at line 108 of file dynamicelementtextmodel.h.
Referenced by itemDataChanged(), updateDataFromGroup(), and updateDataFromText().
|
private |
Definition at line 103 of file dynamicelementtextmodel.h.
Referenced by canDropMimeData(), dropMimeData(), and DynamicElementTextModel().
|
private |
Definition at line 105 of file dynamicelementtextmodel.h.
Referenced by addGroup(), addTextToGroup(), enableGroupRotationAndPos(), groupFromItem(), indexFromGroup(), indexIsGroup(), indexIsInGroup(), itemDataChanged(), removeGroup(), textFromItem(), undoForEditedGroup(), and updateDataFromGroup().
|
private |
Definition at line 107 of file dynamicelementtextmodel.h.
Referenced by setConnection(), and ~DynamicElementTextModel().
|
private |
Definition at line 106 of file dynamicelementtextmodel.h.
Referenced by setConnection(), and ~DynamicElementTextModel().
|
private |
Definition at line 104 of file dynamicelementtextmodel.h.
Referenced by enableSourceText(), indexFromText(), indexIsText(), itemDataChanged(), itemsForText(), mimeData(), removeText(), removeTextFromGroup(), textFromItem(), undoForEditedText(), and updateDataFromText().