[qet] qet/qet: [5268] Fix : Composite text dialog widget can' t be selected when he is open by the element properties dialog widget

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


Revision: 5268
Author:   blacksun
Date:     2018-03-13 17:20:59 +0100 (Tue, 13 Mar 2018)
Log Message:
-----------
Fix : Composite text dialog widget can't be selected when he is open by the element properties dialog widget
Fix : The ui freeze when use the drag and drop in the tab widget "texts" of element properties, when he is displayed by the element properties dialog widget.

Modified Paths:
--------------
    trunk/sources/qetgraphicsitem/element.cpp
    trunk/sources/ui/dynamicelementtextmodel.cpp

Modified: trunk/sources/qetgraphicsitem/element.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/element.cpp	2018-03-11 16:26:02 UTC (rev 5267)
+++ trunk/sources/qetgraphicsitem/element.cpp	2018-03-13 16:20:59 UTC (rev 5268)
@@ -91,6 +91,9 @@
 		ElementPropertiesWidget *epw = new ElementPropertiesWidget(this);
 		PropertiesEditorDialog dialog(epw, QApplication::activeWindow());
 		connect(epw, &ElementPropertiesWidget::findEditClicked, &dialog, &QDialog::reject);
+			//Must be windowModal, else when user do a drag and drop
+			//with the "text" tab of ElementPropertiesWidget, the ui freeze, until user press escape key
+		dialog.setWindowModality(Qt::WindowModal);
 		dialog.exec();
 	}
 }

Modified: trunk/sources/ui/dynamicelementtextmodel.cpp
===================================================================
--- trunk/sources/ui/dynamicelementtextmodel.cpp	2018-03-11 16:26:02 UTC (rev 5267)
+++ trunk/sources/ui/dynamicelementtextmodel.cpp	2018-03-13 16:20:59 UTC (rev 5268)
@@ -799,7 +799,7 @@
 bool DynamicElementTextModel::canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
 {
 	Q_UNUSED(action);
-	
+
 	if(data->hasFormat("application/x-qet-element-text-uuid"))
 	{
 		QModelIndex index;
@@ -945,7 +945,7 @@
 }
 
 QMimeData *DynamicElementTextModel::mimeData(const QModelIndexList &indexes) const
-{
+{	
 	QModelIndex index = indexes.first();
 	if (index.isValid())
 	{
@@ -963,7 +963,7 @@
 		}
 	}
 	
-	return new QMimeData();
+	return QStandardItemModel::mimeData(indexes);
 }
 
 /**
@@ -1355,7 +1355,7 @@
 			if(!deti)
 				break;
 			
-			CompositeTextEditDialog *cted = new CompositeTextEditDialog(deti);
+			CompositeTextEditDialog *cted = new CompositeTextEditDialog(deti, parent);
 			cted->setObjectName("composite_text");
 			return cted;
 		}


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