mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
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:
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user