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>
Inherits QStandardItemModel.
|
enum | ValueType {
textFrom =1
, userText
, infoText
, compositeText
,
txtAlignment
, size
, font
, color
,
pos
, frame
, rotation
, keepVisualRotation
,
textWidth
, grpAlignment
, grpPos
, grpRotation
,
grpVAdjust
, grpName
, grpHoldBottom
, grpFrame
} |
|
|
| DynamicElementTextModel (Element *element, QObject *parent=nullptr) |
|
| ~DynamicElementTextModel () override |
|
bool | indexIsInGroup (const QModelIndex &index) const |
| DynamicElementTextModel::indexIsInGroup.
|
|
DynamicElementTextItem * | textFromIndex (const QModelIndex &index) const |
| DynamicElementTextModel::textFromIndex.
|
|
DynamicElementTextItem * | textFromItem (QStandardItem *item) const |
| DynamicElementTextModel::textFromItem.
|
|
QModelIndex | indexFromText (DynamicElementTextItem *text) const |
| DynamicElementTextModel::indexFromText.
|
|
QUndoCommand * | undoForEditedText (DynamicElementTextItem *deti, QUndoCommand *parent_undo=nullptr) const |
| DynamicElementTextModel::undoForEditedText.
|
|
QUndoCommand * | undoForEditedGroup (ElementTextItemGroup *group, QUndoCommand *parent_undo=nullptr) const |
| DynamicElementTextModel::undoForEditedGroup.
|
|
ElementTextItemGroup * | groupFromIndex (const QModelIndex &index) const |
| DynamicElementTextModel::groupFromIndex.
|
|
ElementTextItemGroup * | groupFromItem (QStandardItem *item) const |
| DynamicElementTextModel::groupFromItem.
|
|
QModelIndex | indexFromGroup (ElementTextItemGroup *group) const |
| DynamicElementTextModel::indexFromGroup.
|
|
bool | indexIsText (const QModelIndex &index) const |
| DynamicElementTextModel::indexIsText.
|
|
bool | indexIsGroup (const QModelIndex &index) const |
| DynamicElementTextModel::indexIsGroup.
|
|
bool | canDropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override |
|
bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override |
| DynamicElementTextModel::dropMimeData.
|
|
QMimeData * | mimeData (const QModelIndexList &indexes) const override |
|
QStringList | mimeTypes () const override |
| DynamicElementTextModel::mimeTypes.
|
|
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.
◆ ValueType
Enumerator |
---|
textFrom | |
userText | |
infoText | |
compositeText | |
txtAlignment | |
size | |
font | |
color | |
pos | |
frame | |
rotation | |
keepVisualRotation | |
textWidth | |
grpAlignment | |
grpPos | |
grpRotation | |
grpVAdjust | |
grpName | |
grpHoldBottom | |
grpFrame | |
◆ DynamicElementTextModel()
DynamicElementTextModel::DynamicElementTextModel |
( |
Element * |
element, |
|
|
QObject * |
parent = nullptr |
|
) |
| |
◆ ~DynamicElementTextModel()
DynamicElementTextModel::~DynamicElementTextModel |
( |
| ) |
|
|
override |
◆ addGroup()
DynamicElementTextModel::AddGroup Add a text item group to this model.
- Parameters
-
◆ addText()
◆ addTextToGroup()
DynamicElementTextModel::textAddedToGroup Add the text text to the group group.
- Parameters
-
◆ canDropMimeData()
bool DynamicElementTextModel::canDropMimeData |
( |
const QMimeData * |
data, |
|
|
Qt::DropAction |
action, |
|
|
int |
row, |
|
|
int |
column, |
|
|
const QModelIndex & |
parent |
|
) |
| const |
|
override |
◆ dataChanged
void DynamicElementTextModel::dataChanged |
( |
| ) |
|
|
signal |
◆ dropMimeData()
bool DynamicElementTextModel::dropMimeData |
( |
const QMimeData * |
data, |
|
|
Qt::DropAction |
action, |
|
|
int |
row, |
|
|
int |
column, |
|
|
const QModelIndex & |
parent |
|
) |
| |
|
override |
◆ enableGroupRotationAndPos()
DynamicElementTextModel::enableGroupRotation Enable/disable the item "group rotation" according the option hold to bottom.
- Parameters
-
◆ enableSourceText()
◆ groupFromIndex()
DynamicElementTextModel::groupFromIndex.
- Parameters
-
- Returns
- the group associated with index. Return value can be nullptr Index can be a child of an index associated with a group and can be the column 0 or 1.
◆ groupFromItem()
DynamicElementTextModel::groupFromItem.
- Parameters
-
- Returns
- the group associated with item. Return value can be nullptr item can be a child of an item associated with a group and can be the column 0 or 1.
◆ indexFromGroup()
◆ indexFromText()
◆ indexIsGroup()
bool DynamicElementTextModel::indexIsGroup |
( |
const QModelIndex & |
index | ) |
const |
DynamicElementTextModel::indexIsGroup.
- Parameters
-
- Returns
- True if index represente a group, both for the column 0 and 1. Return false if index is a child of an index associated to a group.
◆ indexIsInGroup()
bool DynamicElementTextModel::indexIsInGroup |
( |
const QModelIndex & |
index | ) |
const |
◆ indexIsText()
bool DynamicElementTextModel::indexIsText |
( |
const QModelIndex & |
index | ) |
const |
DynamicElementTextModel::indexIsText.
- Parameters
-
- Returns
- True if index represente a text, both for the column 0 and 1. Return false if index is a child of an index associated to a text.
◆ itemDataChanged()
void DynamicElementTextModel::itemDataChanged |
( |
QStandardItem * |
qsi | ) |
|
|
private |
◆ itemsForText()
DynamicElementTextModel::itemsForText.
- Parameters
-
- Returns
- The items for the text deti, if the text deti is already managed by this model the returned list is empty The returned items haven't got the same number of childs if the text is in a group or not.
◆ mimeData()
QMimeData * DynamicElementTextModel::mimeData |
( |
const QModelIndexList & |
indexes | ) |
const |
|
override |
◆ mimeTypes()
QStringList DynamicElementTextModel::mimeTypes |
( |
| ) |
const |
|
override |
◆ removeGroup()
◆ removeText()
◆ removeTextFromGroup()
◆ setConnection() [1/2]
DynamicElementTextModel::setConnection Set up the connection for deti to keep up to date the data of this model and the text. Is notably use with the use of QUndoCommand.
- Parameters
-
deti | - text to setup connection |
set | - true = set connection - false unset connection |
◆ setConnection() [2/2]
DynamicElementTextModel::setConnection Set up the connection for group to keep up to date the data of this model and the group. Is notably use with the use of QUndoCommand.
- Parameters
-
group | group to setup the connection |
set | true = set connection - false unset connection |
◆ textFromIndex()
DynamicElementTextModel::textFromIndex.
- Parameters
-
- Returns
- the text associated with index. Returned value can be nullptr Index can be a child of an index associated with a text and can be the column 0 or 1.
◆ textFromItem()
DynamicElementTextModel::textFromItem.
- Parameters
-
- Returns
- the text associated with item. Return value can be nullptr item can be a child of an item associated with a text and can be the column 0 or 1. Note can return nullptr
◆ undoForEditedGroup()
QUndoCommand * DynamicElementTextModel::undoForEditedGroup |
( |
ElementTextItemGroup * |
group, |
|
|
QUndoCommand * |
parent_undo = nullptr |
|
) |
| const |
DynamicElementTextModel::undoForEditedGroup.
- Parameters
-
- Returns
- A QUndoCommand that describe all changes made for group. Each change made for group is append as a child of the returned QUndoCommand. In other word, if the returned QUndoCommand have no child, that mean there is no change.
◆ undoForEditedText()
QUndoCommand * DynamicElementTextModel::undoForEditedText |
( |
DynamicElementTextItem * |
deti, |
|
|
QUndoCommand * |
parent_undo = nullptr |
|
) |
| const |
DynamicElementTextModel::undoForEditedText.
- Parameters
-
- Returns
- A QUndoCommand that describe all changes made for deti. Each change made for deti is append as a child of the returned QUndoCommand. In other word, if the returned QUndoCommand have no child, that mean there is no change.
◆ updateDataFromGroup()
◆ updateDataFromText()
◆ m_block_dataChanged
bool DynamicElementTextModel::m_block_dataChanged = false |
|
private |
◆ m_element
QPointer<Element> DynamicElementTextModel::m_element |
|
private |
◆ m_groups_list
◆ m_hash_group_connect
QHash<ElementTextItemGroup *, QList<QMetaObject::Connection> > DynamicElementTextModel::m_hash_group_connect |
|
private |
◆ m_hash_text_connect
◆ m_texts_list
The documentation for this class was generated from the following files: