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.


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5268 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2018-03-13 16:20:59 +00:00
parent 1077c91b6f
commit f2fd446bb5
2 changed files with 7 additions and 4 deletions

View File

@@ -91,6 +91,9 @@ void Element::editProperty()
ElementPropertiesWidget *epw = new ElementPropertiesWidget(this); ElementPropertiesWidget *epw = new ElementPropertiesWidget(this);
PropertiesEditorDialog dialog(epw, QApplication::activeWindow()); PropertiesEditorDialog dialog(epw, QApplication::activeWindow());
connect(epw, &ElementPropertiesWidget::findEditClicked, &dialog, &QDialog::reject); 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(); dialog.exec();
} }
} }

View File

@@ -799,7 +799,7 @@ bool DynamicElementTextModel::indexIsGroup(const QModelIndex &index) const
bool DynamicElementTextModel::canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const bool DynamicElementTextModel::canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
{ {
Q_UNUSED(action); Q_UNUSED(action);
if(data->hasFormat("application/x-qet-element-text-uuid")) if(data->hasFormat("application/x-qet-element-text-uuid"))
{ {
QModelIndex index; QModelIndex index;
@@ -945,7 +945,7 @@ bool DynamicElementTextModel::dropMimeData(const QMimeData *data, Qt::DropAction
} }
QMimeData *DynamicElementTextModel::mimeData(const QModelIndexList &indexes) const QMimeData *DynamicElementTextModel::mimeData(const QModelIndexList &indexes) const
{ {
QModelIndex index = indexes.first(); QModelIndex index = indexes.first();
if (index.isValid()) if (index.isValid())
{ {
@@ -963,7 +963,7 @@ QMimeData *DynamicElementTextModel::mimeData(const QModelIndexList &indexes) con
} }
} }
return new QMimeData(); return QStandardItemModel::mimeData(indexes);
} }
/** /**
@@ -1355,7 +1355,7 @@ QWidget *DynamicTextItemDelegate::createEditor(QWidget *parent, const QStyleOpti
if(!deti) if(!deti)
break; break;
CompositeTextEditDialog *cted = new CompositeTextEditDialog(deti); CompositeTextEditDialog *cted = new CompositeTextEditDialog(deti, parent);
cted->setObjectName("composite_text"); cted->setObjectName("composite_text");
return cted; return cted;
} }