forked from qt-creator/qt-creator
Items were removed from QML overview when dragging onto editor view
Change-Id: I6e8b3cbedb78df08066f87d4aa9922145cfa151c Task-number: QTCREATORBUG-14496 Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com> Reviewed-by: Marco Benelli <marco.benelli@theqtcompany.com> Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
This commit is contained in:
@@ -135,6 +135,12 @@ EditorView::EditorView(SplitterOrView *parentSplitterOrView, QWidget *parent) :
|
|||||||
m_widgetEditorMap.insert(empty, 0);
|
m_widgetEditorMap.insert(empty, 0);
|
||||||
|
|
||||||
auto dropSupport = new FileDropSupport(this, [this](QDropEvent *event) {
|
auto dropSupport = new FileDropSupport(this, [this](QDropEvent *event) {
|
||||||
|
// do not accept move events except from other editor views (i.e. their tool bars)
|
||||||
|
// otherwise e.g. item views that support moving items within themselves would
|
||||||
|
// also "move" the item into the editor view, i.e. the item would be removed from the
|
||||||
|
// item view
|
||||||
|
if (!qobject_cast<EditorToolBar*>(event->source()))
|
||||||
|
event->setDropAction(Qt::CopyAction);
|
||||||
return event->source() != m_toolBar; // do not accept drops on ourselves
|
return event->source() != m_toolBar; // do not accept drops on ourselves
|
||||||
});
|
});
|
||||||
connect(dropSupport, &FileDropSupport::filesDropped,
|
connect(dropSupport, &FileDropSupport::filesDropped,
|
||||||
|
Reference in New Issue
Block a user