diff --git a/sources/editor/editorcommands.cpp b/sources/editor/editorcommands.cpp index 6a0b23942..66db35a37 100644 --- a/sources/editor/editorcommands.cpp +++ b/sources/editor/editorcommands.cpp @@ -604,16 +604,18 @@ ChangePropertiesCommand::ChangePropertiesCommand(ElementScene *scene, QString ty ChangePropertiesCommand::~ChangePropertiesCommand() {} -void ChangePropertiesCommand::undo() { +void ChangePropertiesCommand::undo() +{ m_scene->m_elmt_type = m_type.first(); m_scene->m_elmt_kindInfo = m_kind_info.first(); - m_scene->m_elmt_information = m_elmt_info.first(); + m_scene->setElementInfo(m_elmt_info.first()); } -void ChangePropertiesCommand::redo() { +void ChangePropertiesCommand::redo() +{ m_scene->m_elmt_type = m_type.last(); m_scene->m_elmt_kindInfo = m_kind_info.last(); - m_scene->m_elmt_information = m_elmt_info.last(); + m_scene->setElementInfo(m_elmt_info.last()); } diff --git a/sources/editor/elementscene.cpp b/sources/editor/elementscene.cpp index fbfc76d25..686d5cbf6 100644 --- a/sources/editor/elementscene.cpp +++ b/sources/editor/elementscene.cpp @@ -532,6 +532,15 @@ QETElementEditor* ElementScene::editor() const { return m_element_editor; } +void ElementScene::setElementInfo(DiagramContext dc) +{ + if(m_elmt_information != dc) + { + m_elmt_information = dc; + emit elementInfoChanged(); + } +} + /** * @brief ElementScene::slot_select * Select the item in content, every others items in the scene are deselected diff --git a/sources/editor/elementscene.h b/sources/editor/elementscene.h index c8cf69cf6..6c5120df9 100644 --- a/sources/editor/elementscene.h +++ b/sources/editor/elementscene.h @@ -63,41 +63,30 @@ class ElementScene : public QGraphicsScene // attributes private: - /// List of localized names - NamesList m_names_list; - /// Extra informations - QString m_informations; - /// element type - QString m_elmt_type; - /// element kind info + NamesList m_names_list; /// List of localized names + QString m_informations; /// Extra informations + QString m_elmt_type; /// element type DiagramContext m_elmt_kindInfo, - m_elmt_information; - /// QGraphicsItem manager + m_elmt_information; /// element kind info QGIManager m_qgi_manager; - /// Undo stack QUndoStack m_undo_stack; - - /// Variables related to drawing + ESEventInterface *m_event_interface = nullptr; Behavior m_behavior; QETElementEditor *m_element_editor = nullptr; - /// Variables to manage the paste area on the scene QGraphicsRectItem *m_paste_area; QRectF m_defined_paste_area; - - /// Variables to handle copy/paste with offset + QString m_last_copied; /// Decorator item displayed when at least one item is selected ElementPrimitiveDecorator *m_decorator = nullptr; + + int m_x_grid, + m_y_grid; - ///< Size of the horizontal grid step - int m_x_grid; - ///< Size of the vertical grid step - int m_y_grid; - - // methods + // methods public: void setEventInterface (ESEventInterface *event_interface); void clearEventInterface(); @@ -109,6 +98,7 @@ class ElementScene : public QGraphicsScene void setInformations(const QString &); QString elementType () const {return m_elmt_type;} DiagramContext elementKindInfo () const {return m_elmt_kindInfo;} + DiagramContext elementInformation() const {return m_elmt_information;} virtual int xGrid() const; virtual int yGrid() const; virtual void setGrid(int, int); @@ -129,6 +119,7 @@ class ElementScene : public QGraphicsScene void cut(); void copy(); QETElementEditor* editor() const; + void setElementInfo(DiagramContext dc); protected: void mouseMoveEvent (QGraphicsSceneMouseEvent *) override; @@ -169,16 +160,17 @@ class ElementScene : public QGraphicsScene void stackAction(ElementEditionCommand *); signals: - /// Signal emitted after one or several parts were added + /// Signal emitted after one or several parts were added void partsAdded(); - /// Signal emitted after one or several parts were removed + /// Signal emitted after one or several parts were removed void partsRemoved(); - /// Signal emitted when the zValue of one or several parts change + /// Signal emitted when the zValue of one or several parts change void partsZValueChanged(); - /// Signal emitted when users have defined the copy/paste area + /// Signal emitted when users have defined the copy/paste area void pasteAreaDefined(const QRectF &); - /// Signal emitted when need zoomFit + /// Signal emitted when need zoomFit void needZoomFit(); + void elementInfoChanged(); }; Q_DECLARE_OPERATORS_FOR_FLAGS(ElementScene::ItemOptions) diff --git a/sources/editor/graphicspart/partdynamictextfield.cpp b/sources/editor/graphicspart/partdynamictextfield.cpp index 9f4c8734f..0052ffbd8 100644 --- a/sources/editor/graphicspart/partdynamictextfield.cpp +++ b/sources/editor/graphicspart/partdynamictextfield.cpp @@ -54,6 +54,11 @@ PartDynamicTextField::PartDynamicTextField(QETElementEditor *editor, QGraphicsIt setTextFrom(DynamicElementTextItem::UserText); setFlags(QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemSendsGeometryChanges | QGraphicsItem::ItemIsMovable); + //Option when text is displayed in multiple line + QTextOption option = document()->defaultTextOption(); + option.setAlignment(Qt::AlignHCenter); + option.setWrapMode(QTextOption::WordWrap); + document()->setDefaultTextOption(option); } QString PartDynamicTextField::name() const @@ -106,6 +111,7 @@ const QDomElement PartDynamicTextField::toXml(QDomDocument &dom_doc) const root_element.setAttribute("font_size", font().pointSize()); root_element.setAttribute("uuid", m_uuid.toString()); root_element.setAttribute("frame", m_frame? "true" : "false"); + root_element.setAttribute("text_width", QString::number(m_text_width)); QMetaEnum me = DynamicElementTextItem::textFromMetaEnum(); @@ -130,14 +136,6 @@ const QDomElement PartDynamicTextField::toXml(QDomDocument &dom_doc) const dom_comp_text.appendChild(dom_doc.createTextNode(m_composite_text)); root_element.appendChild(dom_comp_text); } - - //tagg - if (!m_tagg.isEmpty()) - { - QDomElement dom_tagg = dom_doc.createElement("tagg"); - dom_tagg.appendChild(dom_doc.createTextNode(m_tagg)); - root_element.appendChild(dom_tagg); - } //Color if(color() != QColor(Qt::black)) @@ -167,7 +165,8 @@ void PartDynamicTextField::fromXml(const QDomElement &dom_elmt) QGraphicsTextItem::setRotation(dom_elmt.attribute("rotation", QString::number(0)).toDouble()); setFont(QETApp::diagramTextsFont(dom_elmt.attribute("font_size", QString::number(9)).toInt())); m_uuid = QUuid(dom_elmt.attribute("uuid", QUuid::createUuid().toString())); - m_frame = dom_elmt.attribute("frame", "false") == "true"? true : false; + setFrame(dom_elmt.attribute("frame", "false") == "true"? true : false); + setTextWidth(dom_elmt.attribute("text_width", QString::number(-1)).toDouble()); QMetaEnum me = DynamicElementTextItem::textFromMetaEnum(); m_text_from = DynamicElementTextItem::TextFrom(me.keyToValue(dom_elmt.attribute("text_from").toStdString().data())); @@ -189,11 +188,6 @@ void PartDynamicTextField::fromXml(const QDomElement &dom_elmt) QDomElement dom_comp_text = dom_elmt.firstChildElement("composite_text"); if(!dom_comp_text.isNull()) m_composite_text = dom_comp_text.text(); - - //tagg - QDomElement dom_tagg = dom_elmt.firstChildElement("tagg"); - if (!dom_tagg.isNull()) - m_tagg = dom_tagg.text(); //Color QDomElement dom_color = dom_elmt.firstChildElement("color"); @@ -249,25 +243,6 @@ void PartDynamicTextField::setTextFrom(DynamicElementTextItem::TextFrom text_fro emit textFromChanged(m_text_from); } -/** - * @brief PartDynamicTextField::tagg - * @return the tagg of this text - */ -QString PartDynamicTextField::tagg() const { - return m_tagg; -} - -/** - * @brief PartDynamicTextField::setTagg - * set the taggof this text - * @param tagg - */ -void PartDynamicTextField::setTagg(const QString &tagg) -{ - m_tagg = tagg; - emit taggChanged(m_tagg); -} - /** * @brief PartDynamicTextField::text * @return the text of this text @@ -364,6 +339,36 @@ bool PartDynamicTextField::frame() const return m_frame; } +void PartDynamicTextField::setTextWidth(qreal width) +{ + this->document()->setTextWidth(width); + + //Adjust the width, to ideal width if needed + if(width > 0 && document()->size().width() > width) + document()->setTextWidth(document()->idealWidth()); + + m_text_width = document()->textWidth(); + emit textWidthChanged(m_text_width); +} + +void PartDynamicTextField::setPlainText(const QString &text) +{ + QGraphicsTextItem::setPlainText(text); + + //User define a text width + if(m_text_width > 0) + { + if(document()->size().width() > m_text_width) + { + document()->setTextWidth(m_text_width); + if(document()->size().width() > m_text_width) + { + document()->setTextWidth(document()->idealWidth()); + } + } + } +} + /** * @brief PartDynamicTextField::mouseMoveEvent * @param event @@ -417,7 +422,16 @@ void PartDynamicTextField::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) QVariant PartDynamicTextField::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) { if (change == QGraphicsItem::ItemPositionHasChanged || change == QGraphicsItem::ItemSceneHasChanged) + { updateCurrentPartEditor(); + if(change == QGraphicsItem::ItemSceneHasChanged && + m_first_add && + elementScene() != nullptr) + { + connect(elementScene(), &ElementScene::elementInfoChanged, this, &PartDynamicTextField::elementInfoChanged); + m_first_add = false; + } + } else if ((change == QGraphicsItem::ItemSelectedHasChanged) && (value.toBool() == true)) updateCurrentPartEditor(); @@ -441,25 +455,45 @@ void PartDynamicTextField::paint(QPainter *painter, const QStyleOptionGraphicsIt if(w > 2.5) w = 2.5; } - + QPen pen; pen.setColor(color()); pen.setWidthF(w); painter->setPen(pen); painter->setRenderHint(QPainter::Antialiasing); - //Get the bounding rectangle of the text - QRectF text_bounding = painter->boundingRect(boundingRect(), toPlainText()); - //Center text_bounding in the bounding rect of this - text_bounding.moveTop((boundingRect().height()-text_bounding.height())/2); - text_bounding.moveLeft((boundingRect().width() - text_bounding.width())/2); - //adjust only for better visual - text_bounding.adjust(-2,0,2,0); + //Get the bounding rectangle of the text + QSizeF size = document()->size(); + size.setWidth(document()->idealWidth()); + //Remove the margin. Size is exactly the bounding rect of the text + size.rheight() -= document()->documentMargin()*2; + size.rwidth() -= document()->documentMargin()*2; + //Add a little margin only for a better visual; + size.rheight() += 2; + size.rwidth() += 2; + + //The pos of the rect + QPointF pos = boundingRect().center(); + pos.rx() -= size.width()/2; + pos.ry() -= size.height()/2; //Adjust the rounding of the rectangle according to the size of the font qreal ro = (qreal)fontSize()/3; - painter->drawRoundedRect(text_bounding, ro, ro); + painter->drawRoundedRect(QRectF(pos, size), ro, ro); painter->restore(); } } + +/** + * @brief PartDynamicTextField::elementInfoChanged + * Used to up to date this text field, when the element information (see elementScene) changed + */ +void PartDynamicTextField::elementInfoChanged() +{ + if(m_text_from == DynamicElementTextItem::ElementInfo) + { + DiagramContext dc = elementScene()->elementInformation(); + setPlainText(dc.value(m_info_name).toString()); + } +} diff --git a/sources/editor/graphicspart/partdynamictextfield.h b/sources/editor/graphicspart/partdynamictextfield.h index 3e83159bb..8acb4da4a 100644 --- a/sources/editor/graphicspart/partdynamictextfield.h +++ b/sources/editor/graphicspart/partdynamictextfield.h @@ -33,7 +33,6 @@ class PartDynamicTextField : public QGraphicsTextItem, public CustomElementPart { Q_OBJECT - Q_PROPERTY(QString tagg READ tagg WRITE setTagg NOTIFY taggChanged) Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) Q_PROPERTY(DynamicElementTextItem::TextFrom textFrom READ textFrom WRITE setTextFrom NOTIFY textFromChanged) Q_PROPERTY(QString infoName READ infoName WRITE setInfoName NOTIFY infoNameChanged) @@ -41,6 +40,7 @@ class PartDynamicTextField : public QGraphicsTextItem, public CustomElementPart Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) Q_PROPERTY(int fontSize READ fontSize WRITE setFontSize NOTIFY fontSizeChanged) Q_PROPERTY(bool frame READ frame WRITE setFrame NOTIFY frameChanged) + Q_PROPERTY(qreal textWidth READ textWidth WRITE setTextWidth NOTIFY textWidthChanged) public: static bool canImportFromTextField(const QDomElement &dom_element); @@ -59,6 +59,7 @@ class PartDynamicTextField : public QGraphicsTextItem, public CustomElementPart void colorChanged(QColor color); void fontSizeChanged(int size); void frameChanged(bool frame); + void textWidthChanged(qreal width); public: PartDynamicTextField(QETElementEditor *editor, QGraphicsItem *parent = nullptr); @@ -68,6 +69,7 @@ class PartDynamicTextField : public QGraphicsTextItem, public CustomElementPart QString name() const override; QString xmlName() const override; + static QString xmlTaggName() {return QString("dynamic_text");} bool isUseless() const override {return false;} QRectF sceneGeometricRect() const override {return sceneBoundingRect();} void startUserTransformation(const QRectF &initial_selection_rect) override; @@ -79,8 +81,6 @@ class PartDynamicTextField : public QGraphicsTextItem, public CustomElementPart DynamicElementTextItem::TextFrom textFrom() const; void setTextFrom (DynamicElementTextItem::TextFrom text_from); - QString tagg() const; - void setTagg(const QString &tagg); QString text() const; void setText(const QString &text); void setInfoName(const QString &info_name); @@ -93,6 +93,8 @@ class PartDynamicTextField : public QGraphicsTextItem, public CustomElementPart int fontSize()const; void setFrame(bool frame); bool frame() const; + void setTextWidth(qreal width); + void setPlainText(const QString &text); protected: void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override; @@ -101,18 +103,20 @@ class PartDynamicTextField : public QGraphicsTextItem, public CustomElementPart QVariant itemChange(GraphicsItemChange change, const QVariant &value) override; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override; + private: + void elementInfoChanged(); + private: QPointF m_origine_pos, m_saved_point; - QString m_tagg, - m_text, + QString m_text, m_info_name, m_composite_text; - DynamicElementTextItem::TextFrom m_text_from = DynamicElementTextItem::UserText; QUuid m_uuid; - - bool m_frame = false; + bool m_frame = false, + m_first_add = true; + qreal m_text_width = -1; }; #endif // PARTDYNAMICTEXTFIELD_H diff --git a/sources/editor/ui/dynamictextfieldeditor.cpp b/sources/editor/ui/dynamictextfieldeditor.cpp index dfaac40b7..8564540c6 100644 --- a/sources/editor/ui/dynamictextfieldeditor.cpp +++ b/sources/editor/ui/dynamictextfieldeditor.cpp @@ -20,6 +20,8 @@ #include "customelementpart.h" #include "partdynamictextfield.h" #include "QPropertyUndoCommand/qpropertyundocommand.h" +#include "qetelementeditor.h" +#include "qetapp.h" #include #include @@ -34,6 +36,7 @@ DynamicTextFieldEditor::DynamicTextFieldEditor(QETElementEditor *editor, PartDyn ui->m_elmt_info_cb->setDisabled(true); if(text_field) setPart(text_field); + fillInfoComboBox(); } DynamicTextFieldEditor::~DynamicTextFieldEditor() @@ -75,6 +78,7 @@ bool DynamicTextFieldEditor::setPart(CustomElementPart *part) m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::infoNameChanged, [this](){this->updateForm();}); m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::rotationChanged, [this](){this->updateForm();}); m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::frameChanged, [this](){this->updateForm();}); + m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::textWidthChanged,[this]() {this->updateForm();}); m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::compositeTextChanged, [this]() {this->updateForm();}); return true; @@ -99,8 +103,27 @@ void DynamicTextFieldEditor::updateForm() ui->m_frame_cb->setChecked(m_text_field.data()->frame()); ui->m_user_text_le->setText(m_text_field.data()->text()); ui->m_size_sb->setValue(m_text_field.data()->fontSize()); - ui->m_tagg_le->setText(m_text_field.data()->tagg()); setColorPushButton(m_text_field.data()->color()); + ui->m_width_sb->setValue(m_text_field.data()->textWidth()); + + switch (m_text_field.data()->textFrom()) + { + case DynamicElementTextItem::UserText: + ui->m_text_from_cb->setCurrentIndex(0); + break; + case DynamicElementTextItem::ElementInfo: + { + ui->m_text_from_cb->setCurrentIndex(1); + ui->m_elmt_info_cb->setCurrentIndex(ui->m_elmt_info_cb->findData(m_text_field.data()->infoName())); + } + break; + case DynamicElementTextItem::CompositeText: + ui->m_text_from_cb->setCurrentIndex(2); + default: + break; + } + + on_m_text_from_cb_activated(ui->m_text_from_cb->currentIndex()); //For enable the good widget } } @@ -111,6 +134,32 @@ void DynamicTextFieldEditor::setColorPushButton(QColor color) ui->m_color_pb->setStyleSheet(QString("background-color: %1; min-height: 1.5em; border-style: outset; border-width: 2px; border-color: gray; border-radius: 4px;").arg(color.name())); } +/** + * @brief DynamicTextFieldEditor::fillInfoComboBox + * Fill the combo box "element information" + */ +void DynamicTextFieldEditor::fillInfoComboBox() +{ + ui->m_elmt_info_cb->clear(); + + QStringList strl; + QString type = elementEditor()->elementScene()->elementType(); + + if(type.contains("report")) + strl << "function" << "tension-protocol"; + else + strl = QETApp::elementInfoKeys(); + + //We use a QMap because the keys of the map are sorted, then no matter the curent local, + //the value of the combo box are always alphabetically sorted + QMap info_map; + for(QString str : strl) + info_map.insert(QETApp::elementTranslatedInfoKey(str), str); + + for (QString key : info_map.keys()) + ui->m_elmt_info_cb->addItem(key, info_map.value(key)); +} + void DynamicTextFieldEditor::on_m_x_sb_editingFinished() { QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_text_field, "x", m_text_field.data()->x(), ui->m_x_sb->value()); @@ -174,3 +223,57 @@ void DynamicTextFieldEditor::on_m_frame_cb_clicked() undoStack().push(undo); } } + +void DynamicTextFieldEditor::on_m_width_sb_editingFinished() +{ + qreal width = (qreal)ui->m_width_sb->value(); + + if(width != m_text_field.data()->textWidth()) + { + QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_text_field, "textWidth", m_text_field.data()->textWidth(), width); + undo->setText(tr("Modifier la largeur d'un texte")); + undoStack().push(undo); + } +} + +void DynamicTextFieldEditor::on_m_elmt_info_cb_activated(const QString &arg1) +{ + Q_UNUSED(arg1) + + QString info = ui->m_elmt_info_cb->currentData().toString(); + + if(info != m_text_field.data()->infoName()) + { + QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_text_field, "infoName", m_text_field.data()->infoName(), info); + undo->setText(tr("Modifier l'information d'un texte")); + undoStack().push(undo); + + m_text_field.data()->setPlainText(elementEditor()->elementScene()->elementInformation().value(m_text_field.data()->infoName()).toString()); + } +} + +void DynamicTextFieldEditor::on_m_text_from_cb_activated(int index) +{ + ui->m_user_text_le->setDisabled(true); + ui->m_elmt_info_cb->setDisabled(true); + ui->m_composite_text_pb->setDisabled(true); + + if(index == 0) + ui->m_user_text_le->setEnabled(true); + else if (index == 1) + ui->m_elmt_info_cb->setEnabled(true); + else + ui->m_composite_text_pb->setEnabled(true); + + DynamicElementTextItem::TextFrom tf; + if(index == 0) tf = DynamicElementTextItem::UserText; + else if(index == 1) tf = DynamicElementTextItem::ElementInfo; + else tf = DynamicElementTextItem::CompositeText; + + if(tf != m_text_field.data()->textFrom()) + { + QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_text_field, "textFrom", m_text_field.data()->textFrom(), tf); + undo->setText(tr("Modifier la source de texte, d'un texte")); + undoStack().push(undo); + } +} diff --git a/sources/editor/ui/dynamictextfieldeditor.h b/sources/editor/ui/dynamictextfieldeditor.h index 2766d8881..44e67a979 100644 --- a/sources/editor/ui/dynamictextfieldeditor.h +++ b/sources/editor/ui/dynamictextfieldeditor.h @@ -43,6 +43,7 @@ class DynamicTextFieldEditor : public ElementItemEditor private: void setColorPushButton(QColor color); + void fillInfoComboBox(); private slots: void on_m_x_sb_editingFinished(); @@ -52,6 +53,9 @@ class DynamicTextFieldEditor : public ElementItemEditor void on_m_size_sb_editingFinished(); void on_m_color_pb_clicked(); void on_m_frame_cb_clicked(); + void on_m_width_sb_editingFinished(); + void on_m_elmt_info_cb_activated(const QString &arg1); + void on_m_text_from_cb_activated(int index); private: Ui::DynamicTextFieldEditor *ui; diff --git a/sources/editor/ui/dynamictextfieldeditor.ui b/sources/editor/ui/dynamictextfieldeditor.ui index bc2a7b8ed..e8eb12714 100644 --- a/sources/editor/ui/dynamictextfieldeditor.ui +++ b/sources/editor/ui/dynamictextfieldeditor.ui @@ -6,7 +6,7 @@ 0 0 - 419 + 299 332 @@ -14,7 +14,7 @@ Form - + @@ -33,107 +33,21 @@ - + Couleur - - - - Tagg - - - - - - - - - - QFrame::NoFrame - - - QFrame::Raised - - - - - - X - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - -5000.000000000000000 - - - 5000.000000000000000 - - - - - - - Y - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - -5000.000000000000000 - - - 5000.000000000000000 - - - - - - - Rotation - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 359 - - - - - - - cadre - - - - - - - + - + Qt::Vertical @@ -146,16 +60,16 @@ - + - + - + - + Texte composé @@ -166,7 +80,7 @@ - + @@ -189,6 +103,102 @@ + + + + QFrame::NoFrame + + + QFrame::Raised + + + + + + -5000.000000000000000 + + + 5000.000000000000000 + + + + + + + cadre + + + + + + + 359 + + + + + + + Rotation + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + X + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + -1 + + + 500 + + + + + + + Largeur + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Y + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + -5000.000000000000000 + + + 5000.000000000000000 + + + + + + diff --git a/sources/qetgraphicsitem/customelement.cpp b/sources/qetgraphicsitem/customelement.cpp index 4a85c8c31..b42c1ba77 100644 --- a/sources/qetgraphicsitem/customelement.cpp +++ b/sources/qetgraphicsitem/customelement.cpp @@ -192,7 +192,7 @@ bool CustomElement::buildFromXml(const QDomElement &xml_def_elmt, int *state) { ++ parsed_elements_count; QString current_tag = qde.tagName(); - if (current_tag != "terminal" && current_tag != "input" && current_tag != DynamicElementTextItem::xmlTaggName()) + if (current_tag != "terminal" && current_tag != "input" && current_tag != PartDynamicTextField::xmlTaggName()) { forbid_antialiasing = true; parseElement(qde, low_zoom_qp, false);