[qet] qet/qet: [5093] Dynamic element text can have a frame

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 5093
Author:   blacksun
Date:     2017-11-07 19:35:26 +0100 (Tue, 07 Nov 2017)
Log Message:
-----------
Dynamic element text can have a frame

Modified Paths:
--------------
    trunk/sources/editor/graphicspart/partdynamictextfield.cpp
    trunk/sources/editor/graphicspart/partdynamictextfield.h
    trunk/sources/editor/ui/dynamictextfieldeditor.cpp
    trunk/sources/editor/ui/dynamictextfieldeditor.h
    trunk/sources/editor/ui/dynamictextfieldeditor.ui
    trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp
    trunk/sources/qetgraphicsitem/dynamicelementtextitem.h
    trunk/sources/ui/dynamicelementtextmodel.cpp
    trunk/sources/ui/dynamicelementtextmodel.h

Modified: trunk/sources/editor/graphicspart/partdynamictextfield.cpp
===================================================================
--- trunk/sources/editor/graphicspart/partdynamictextfield.cpp	2017-11-06 16:17:48 UTC (rev 5092)
+++ trunk/sources/editor/graphicspart/partdynamictextfield.cpp	2017-11-07 18:35:26 UTC (rev 5093)
@@ -104,6 +104,7 @@
 	root_element.setAttribute("rotation", QString::number(QET::correctAngle(rotation())));
 	root_element.setAttribute("font_size", font().pointSize());
 	root_element.setAttribute("uuid", m_uuid.toString());
+	root_element.setAttribute("frame", m_frame? "true" : "false");
 	
 
 	QMetaEnum me = DynamicElementTextItem::textFromMetaEnum();
@@ -165,6 +166,7 @@
 	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;
 	
 	QMetaEnum me = DynamicElementTextItem::textFromMetaEnum();
 	m_text_from = DynamicElementTextItem::TextFrom(me.keyToValue(dom_elmt.attribute("text_from").toStdString().data()));
@@ -349,6 +351,18 @@
 	return font().pointSize();
 }
 
+void PartDynamicTextField::setFrame(bool frame)
+{
+	m_frame = frame;
+	update();
+	emit frameChanged(m_frame);
+}
+
+bool PartDynamicTextField::frame() const
+{
+	return m_frame;
+}
+
 /**
  * @brief PartDynamicTextField::mouseMoveEvent
  * @param event
@@ -408,3 +422,43 @@
 	
 	return(QGraphicsTextItem::itemChange(change, value));
 }
+
+void PartDynamicTextField::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+{
+	QGraphicsTextItem::paint(painter, option, widget);
+	
+	if (m_frame)
+	{
+		painter->save();
+		painter->setFont(QETApp::diagramTextsFont(fontSize()));
+		
+			//Adjust the thickness according to the font size, 
+		qreal w=0.3;
+		if(fontSize() >= 5)
+		{
+			w = (qreal)fontSize()*0.1;
+			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); 
+		
+			//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->restore();
+	}
+}

Modified: trunk/sources/editor/graphicspart/partdynamictextfield.h
===================================================================
--- trunk/sources/editor/graphicspart/partdynamictextfield.h	2017-11-06 16:17:48 UTC (rev 5092)
+++ trunk/sources/editor/graphicspart/partdynamictextfield.h	2017-11-07 18:35:26 UTC (rev 5093)
@@ -40,6 +40,7 @@
 	Q_PROPERTY(QString compositeText READ compositeText WRITE setCompositeText NOTIFY compositeTextChanged)
 	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)
 	
 	public:
 		static bool canImportFromTextField(const QDomElement &dom_element);
@@ -57,6 +58,7 @@
 		void compositeTextChanged(QString text);
 		void colorChanged(QColor color);
 		void fontSizeChanged(int size);
+		void frameChanged(bool frame);
 	
 	public:
 		PartDynamicTextField(QETElementEditor *editor, QGraphicsItem *parent = nullptr);
@@ -89,6 +91,8 @@
         QColor color() const;
 		void setFontSize(int s);
         int fontSize()const;
+		void setFrame(bool frame);
+		bool frame() const;
 		
 	protected:
 		void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
@@ -95,6 +99,7 @@
 		void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
         void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
         QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
+		void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
 		
 	private:
 		QPointF m_origine_pos,
@@ -107,6 +112,7 @@
 		DynamicElementTextItem::TextFrom m_text_from = DynamicElementTextItem::UserText;
 		QUuid m_uuid;
 		
+		bool m_frame = false;
 };
 
 #endif // PARTDYNAMICTEXTFIELD_H

Modified: trunk/sources/editor/ui/dynamictextfieldeditor.cpp
===================================================================
--- trunk/sources/editor/ui/dynamictextfieldeditor.cpp	2017-11-06 16:17:48 UTC (rev 5092)
+++ trunk/sources/editor/ui/dynamictextfieldeditor.cpp	2017-11-07 18:35:26 UTC (rev 5093)
@@ -74,6 +74,7 @@
 	m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::textChanged,     [this](){this->updateForm();});
 	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::compositeTextChanged, [this]() {this->updateForm();});
 	
 	return true;
@@ -95,6 +96,7 @@
 		ui->m_x_sb->setValue(m_text_field.data()->x());
 		ui->m_y_sb->setValue(m_text_field.data()->y());
 		ui->m_rotation_sb->setValue(QET::correctAngle(m_text_field.data()->rotation()));
+		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());
@@ -112,7 +114,7 @@
 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());
-	undo->setText(tr("Déplacer un champ texte dynamique"));
+	undo->setText(tr("Déplacer un champ texte"));
 	undo->enableAnimation(true);
 	undoStack().push(undo);
 }
@@ -120,7 +122,7 @@
 void DynamicTextFieldEditor::on_m_y_sb_editingFinished()
 {
 	QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_text_field, "y", m_text_field.data()->y(), ui->m_y_sb->value());
-	undo->setText(tr("Déplacer un champ texte dynamique"));
+	undo->setText(tr("Déplacer un champ texte"));
 	undo->enableAnimation(true);
 	undoStack().push(undo);
 }
@@ -128,7 +130,7 @@
 void DynamicTextFieldEditor::on_m_rotation_sb_editingFinished()
 {
 	QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_text_field, "rotation", m_text_field.data()->rotation(), ui->m_rotation_sb->value());
-	undo->setText(tr("Pivoter un champ texte dynamique"));
+	undo->setText(tr("Pivoter un champ texte"));
 	undo->enableAnimation(true);
 	undoStack().push(undo);
 }
@@ -136,7 +138,7 @@
 void DynamicTextFieldEditor::on_m_user_text_le_editingFinished()
 {
 	QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_text_field, "text", m_text_field.data()->text(), ui->m_user_text_le->text());
-	undo->setText(tr("Modifier le texte d'un champ texte dynamique"));
+	undo->setText(tr("Modifier le texte d'un champ texte"));
 	undoStack().push(undo);
 }
 
@@ -143,7 +145,7 @@
 void DynamicTextFieldEditor::on_m_size_sb_editingFinished()
 {
 	QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_text_field, "fontSize", m_text_field.data()->fontSize(), ui->m_size_sb->value());
-	undo->setText(tr("Modifier la taille d'un champ texte dynamique"));
+	undo->setText(tr("Modifier la taille d'un champ texte"));
 	undo->enableAnimation(true);
 	undoStack().push(undo);
 }
@@ -155,8 +157,20 @@
 	if(color.isValid() && color != m_text_field.data()->color())
 	{
 		QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_text_field, "color", m_text_field.data()->color(), color);
-		undo->setText(tr("Modifier la couleur d'un champ texte dynamique"));
+		undo->setText(tr("Modifier la couleur d'un champ texte"));
 		undoStack().push(undo);
 		setColorPushButton(m_text_field.data()->color());
 	}
 }
+
+void DynamicTextFieldEditor::on_m_frame_cb_clicked()
+{
+    bool frame = ui->m_frame_cb->isChecked();
+	
+	if(frame != m_text_field.data()->frame())
+	{
+		QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_text_field, "frame", m_text_field.data()->frame(), frame);
+		undo->setText(tr("Modifier le cadre d'un champ texte"));
+		undoStack().push(undo);
+	}
+}

Modified: trunk/sources/editor/ui/dynamictextfieldeditor.h
===================================================================
--- trunk/sources/editor/ui/dynamictextfieldeditor.h	2017-11-06 16:17:48 UTC (rev 5092)
+++ trunk/sources/editor/ui/dynamictextfieldeditor.h	2017-11-07 18:35:26 UTC (rev 5093)
@@ -50,7 +50,8 @@
 		void on_m_rotation_sb_editingFinished();
 		void on_m_user_text_le_editingFinished();
 		void on_m_size_sb_editingFinished();
-		void on_m_color_pb_clicked();
+		void on_m_color_pb_clicked();	
+		void on_m_frame_cb_clicked();
 		
 		private:
 		Ui::DynamicTextFieldEditor *ui;

Modified: trunk/sources/editor/ui/dynamictextfieldeditor.ui
===================================================================
--- trunk/sources/editor/ui/dynamictextfieldeditor.ui	2017-11-06 16:17:48 UTC (rev 5092)
+++ trunk/sources/editor/ui/dynamictextfieldeditor.ui	2017-11-07 18:35:26 UTC (rev 5093)
@@ -143,6 +143,13 @@
         </property>
        </widget>
       </item>
+      <item>
+       <widget class="QCheckBox" name="m_frame_cb">
+        <property name="text">
+         <string>cadre</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>

Modified: trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp	2017-11-06 16:17:48 UTC (rev 5092)
+++ trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp	2017-11-07 18:35:26 UTC (rev 5093)
@@ -114,6 +114,7 @@
 	root_element.setAttribute("rotation", QString::number(QET::correctAngle(rotation())));
 	root_element.setAttribute("font_size", font().pointSize());
 	root_element.setAttribute("uuid", m_uuid.toString());
+	root_element.setAttribute("frame", m_frame? "true" : "false");
 	
 	QMetaEnum me = textFromMetaEnum();
 	root_element.setAttribute("text_from", me.valueToKey(m_text_from));
@@ -174,6 +175,7 @@
 	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;
 	
 	QMetaEnum me = textFromMetaEnum();
 	m_text_from = DynamicElementTextItem::TextFrom(me.keyToValue(dom_elmt.attribute("text_from").toStdString().data()));
@@ -479,6 +481,18 @@
 	return m_composite_text;
 }
 
+void DynamicElementTextItem::setFrame(const bool frame)
+{
+	m_frame = frame;
+	update();
+	emit frameChanged(m_frame);
+}
+
+bool DynamicElementTextItem::frame() const
+{
+	return m_frame;
+}
+
 /**
  * @brief DynamicElementTextItem::mousePressEvent
  * @param event
@@ -653,6 +667,46 @@
 	
 }
 
+void DynamicElementTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+{
+	DiagramTextItem::paint(painter, option, widget);
+	
+	if (m_frame)
+	{
+		painter->save();
+		painter->setFont(QETApp::diagramTextsFont(fontSize()));
+		
+			//Adjust the thickness according to the font size, 
+		qreal w=0.3;
+		if(fontSize() >= 5)
+		{
+			w = (qreal)fontSize()*0.1;
+			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); 
+		
+			//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->restore();
+	}
+}
+
 void DynamicElementTextItem::elementInfoChanged()
 {
 	DiagramContext dc;

Modified: trunk/sources/qetgraphicsitem/dynamicelementtextitem.h
===================================================================
--- trunk/sources/qetgraphicsitem/dynamicelementtextitem.h	2017-11-06 16:17:48 UTC (rev 5092)
+++ trunk/sources/qetgraphicsitem/dynamicelementtextitem.h	2017-11-07 18:35:26 UTC (rev 5093)
@@ -44,6 +44,7 @@
 	Q_PROPERTY(TextFrom textFrom READ textFrom WRITE setTextFrom NOTIFY textFromChanged)
 	Q_PROPERTY(QString infoName READ infoName WRITE setInfoName NOTIFY infoNameChanged)
 	Q_PROPERTY(QString compositeText READ compositeText WRITE setCompositeText NOTIFY compositeTextChanged)
+	Q_PROPERTY(bool frame READ frame WRITE setFrame NOTIFY frameChanged)
 	
 	public:
 		Q_ENUMS(TextFrom)
@@ -61,6 +62,7 @@
 		void textFromChanged(DynamicElementTextItem::TextFrom text_from);
 		void infoNameChanged(QString info);
 		void compositeTextChanged(QString text);
+		void frameChanged(bool frame);
 	
 	public:
 		DynamicElementTextItem(Element *parent_element);
@@ -89,6 +91,8 @@
 		QString infoName() const;
 		void setCompositeText(const QString &text);
 		QString compositeText() const;
+		void setFrame(const bool frame);
+		bool frame() const;
 		
 	protected:
 		void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
@@ -97,6 +101,7 @@
 		void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
 		void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
 		void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
+		void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
 		
 	private:
 		void elementInfoChanged();
@@ -132,6 +137,7 @@
 		QMetaObject::Connection m_report_formula_con;
 		QList<QMetaObject::Connection> m_formula_connection;
 		QColor m_user_color;
+		bool m_frame = false;
 };
 
 #endif // DYNAMICELEMENTTEXTITEM_H

Modified: trunk/sources/ui/dynamicelementtextmodel.cpp
===================================================================
--- trunk/sources/ui/dynamicelementtextmodel.cpp	2017-11-06 16:17:48 UTC (rev 5092)
+++ trunk/sources/ui/dynamicelementtextmodel.cpp	2017-11-07 18:35:26 UTC (rev 5093)
@@ -121,6 +121,17 @@
 	qsi_list << composite << compositea;
 	src->appendRow(qsi_list);
 
+		//Tagg
+	QStandardItem *tagg = new QStandardItem(tr("Tagg"));
+	tagg->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
+	
+	QStandardItem *tagga = new QStandardItem(deti->tagg());
+	tagga->setData(DynamicElementTextModel::tagg, Qt::UserRole+1);
+	tagga->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
+	
+	qsi_list.clear();
+	qsi_list << tagg << tagga;
+	qsi->appendRow(qsi_list);
     
         //Size
 	QStandardItem *size = new QStandardItem(tr("Taille"));
@@ -134,19 +145,7 @@
     qsi_list.clear();
     qsi_list << size << siza;
 	qsi->appendRow(qsi_list);
-    
-        //Tagg
-    QStandardItem *tagg = new QStandardItem(tr("Tagg"));
-    tagg->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
-    
-    QStandardItem *tagga = new QStandardItem(deti->tagg());
-    tagga->setData(DynamicElementTextModel::tagg, Qt::UserRole+1);
-    tagga->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
-    
-    qsi_list.clear();
-    qsi_list << tagg << tagga;
-	qsi->appendRow(qsi_list);
-    
+
         //Color
     QStandardItem *color = new QStandardItem(tr("Couleur"));
     color->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
@@ -161,6 +160,20 @@
     qsi_list << color << colora;
 	qsi->appendRow(qsi_list);
 	
+		//Frame
+	QStandardItem *frame = new QStandardItem(tr("Cadre"));
+	frame->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
+	
+	QStandardItem *frame_a = new QStandardItem;
+	frame_a->setCheckable(true);
+	frame_a->setCheckState(deti->frame()? Qt::Checked : Qt::Unchecked);
+	frame_a->setData(DynamicElementTextModel::frame, Qt::UserRole+1);
+	frame_a->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable);
+	
+	qsi_list.clear();
+	qsi_list << frame << frame_a;
+	qsi->appendRow(qsi_list);
+	
 		//X pos
 	QStandardItem *x_pos = new QStandardItem(tr("Position X"));
 	x_pos->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
@@ -186,7 +199,6 @@
 	qsi_list.clear();
 	qsi_list << y_pos << y_pos_a;
 	qsi->appendRow(qsi_list);
-    
 	
 	
 	qsi_list.clear();
@@ -313,7 +325,14 @@
 			new QPropertyUndoCommand(deti, "compositeText", QVariant(deti->compositeText()), QVariant(composite_text), undo);
 	}
 	
-	int fs = text_qsi->child(1,1)->data(Qt::EditRole).toInt();
+	QString tagg = text_qsi->child(1,1)->data(Qt::DisplayRole).toString();
+	if(tagg != deti->tagg())
+	{
+		QUndoCommand *quc = new QPropertyUndoCommand(deti, "tagg", QVariant(deti->tagg()), QVariant(tagg), undo);
+		quc->setText(tr("Modifier le tagg d'un texte d'élément"));
+	}
+	
+	int fs = text_qsi->child(2,1)->data(Qt::EditRole).toInt();
 	if (fs != deti->fontSize())
 	{
 		QUndoCommand *quc = new QPropertyUndoCommand(deti, "fontSize", QVariant(deti->fontSize()), QVariant(fs), undo);
@@ -320,13 +339,6 @@
 		quc->setText(tr("Modifier la taille d'un texte d'élément"));
 	}
 	
-	QString tagg = text_qsi->child(2,1)->data(Qt::DisplayRole).toString();
-	if(tagg != deti->tagg())
-	{
-		QUndoCommand *quc = new QPropertyUndoCommand(deti, "tagg", QVariant(deti->tagg()), QVariant(tagg), undo);
-		quc->setText(tr("Modifier le tagg d'un texte d'élément"));
-	}
-	
 	QColor color = text_qsi->child(3,1)->data(Qt::EditRole).value<QColor>();
 	if(color != deti->color())
 	{
@@ -334,8 +346,15 @@
 		quc->setText(tr("Modifier la couleur d'un texte d'élément"));
 	}
 	
-	QPointF p(text_qsi->child(4,1)->data(Qt::EditRole).toDouble(),
-			  text_qsi->child(5,1)->data(Qt::EditRole).toDouble());
+	bool frame = text_qsi->child(4,1)->checkState() == Qt::Checked? frame=true : frame=false;
+	if(frame != deti->frame())
+	{
+		QUndoCommand *quc = new QPropertyUndoCommand(deti, "frame", QVariant(deti->frame()), QVariant(frame), undo);
+		quc->setText(tr("Modifier le cadre d'un texte d'élément"));
+	}
+	
+	QPointF p(text_qsi->child(5,1)->data(Qt::EditRole).toDouble(),
+			  text_qsi->child(6,1)->data(Qt::EditRole).toDouble());
 	if(p != deti->pos())
 	{
 		QPropertyUndoCommand *quc = new QPropertyUndoCommand(deti, "pos", QVariant(deti->pos()), QVariant(p), undo);
@@ -342,7 +361,6 @@
 		quc->setText(tr("Déplacer un texte d'élément"));
 	}
 	
-	
 	return undo;
 }
 
@@ -459,6 +477,7 @@
 		connection_list << connect(deti, &DynamicElementTextItem::infoNameChanged, [deti,this](){this->updateDataFromText(deti, infoText);});
 		connection_list << connect(deti, &DynamicElementTextItem::xChanged,        [deti,this](){this->updateDataFromText(deti, pos);});
 		connection_list << connect(deti, &DynamicElementTextItem::yChanged,        [deti,this](){this->updateDataFromText(deti, pos);});
+		connection_list << connect(deti, &DynamicElementTextItem::frameChanged,    [deti,this](){this->updateDataFromText(deti, frame);});
 		connection_list << connect(deti, &DynamicElementTextItem::compositeTextChanged, [deti, this]() {this->updateDataFromText(deti, compositeText);});
 		
 		m_hash_text_connect.insert(deti, connection_list);
@@ -524,10 +543,10 @@
 			break;
 		}
 		case size:
-			qsi->child(1,1)->setData(deti->fontSize(), Qt::EditRole);
+			qsi->child(2,1)->setData(deti->fontSize(), Qt::EditRole);
 			break;
 		case tagg:
-			qsi->child(2,1)->setData(deti->tagg(), Qt::DisplayRole);
+			qsi->child(1,1)->setData(deti->tagg(), Qt::DisplayRole);
 			break;
 		case color:
 		{
@@ -537,10 +556,15 @@
 		}
 		case pos:
 		{
-			qsi->child(4,1)->setData(deti->pos().x(), Qt::EditRole);
-			qsi->child(5,1)->setData(deti->pos().y(), Qt::EditRole);
+			qsi->child(5,1)->setData(deti->pos().x(), Qt::EditRole);
+			qsi->child(6,1)->setData(deti->pos().y(), Qt::EditRole);
 			break;
 		}
+		case frame:
+		{
+			qsi->child(4,1)->setCheckState(deti->frame()? Qt::Checked : Qt::Unchecked);
+			break;
+		}
 	}
 	
 	m_block_dataForTextChanged = false;

Modified: trunk/sources/ui/dynamicelementtextmodel.h
===================================================================
--- trunk/sources/ui/dynamicelementtextmodel.h	2017-11-06 16:17:48 UTC (rev 5092)
+++ trunk/sources/ui/dynamicelementtextmodel.h	2017-11-07 18:35:26 UTC (rev 5093)
@@ -43,7 +43,8 @@
             size,
             tagg,
             color,
-			pos
+			pos,
+			frame
         };
         
 		DynamicElementTextModel(QObject *parent = nullptr);


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/