Commit ce962028 authored by Tim Jenssen's avatar Tim Jenssen
Browse files

QmlDesigner: hotfix for Qt 5.3.2 to ungrab the mouse



At the moment the QML world does not get the release event if
a drag started in QML and ends up on QWidget world.

Hotfix: 3.2
Task-number: QTCREATORBUG-12510
Change-Id: I4f4c023e177221af61ba9e754f27a5087013fb08
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent 329952f5
......@@ -55,6 +55,10 @@
#include <QShortcut>
#include <QQuickItem>
#include <private/qquickwidget_p.h> // mouse ungrabbing workaround on quickitems
#include <private/qquickwindow_p.h> // mouse ungrabbing workaround on quickitems
namespace QmlDesigner {
ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) :
......@@ -369,6 +373,13 @@ void ItemLibraryWidget::setResourcePath(const QString &resourcePath)
updateSearch();
}
static void ungrabMouseOnQMLWorldWorkAround(QQuickWidget *quickWidget)
{
const QQuickWidgetPrivate *widgetPrivate = QQuickWidgetPrivate::get(quickWidget);
if (widgetPrivate && widgetPrivate->offscreenWindow && widgetPrivate->offscreenWindow->mouseGrabberItem())
widgetPrivate->offscreenWindow->mouseGrabberItem()->ungrabMouse();
}
void ItemLibraryWidget::startDragAndDrop(QVariant itemLibraryId)
{
m_currentitemLibraryEntry = itemLibraryId.value<ItemLibraryEntry>();
......@@ -380,6 +391,8 @@ void ItemLibraryWidget::startDragAndDrop(QVariant itemLibraryId)
drag->setMimeData(mimeData);
drag->exec();
ungrabMouseOnQMLWorldWorkAround(m_itemViewQuickWidget.data());
}
void ItemLibraryWidget::removeImport(const QString &name)
......
QT += quickwidgets
QT += widgets-private quick-private quickwidgets-private core-private gui-private #mouse ungrabbing workaround on quickitems
CONFIG += exceptions
INCLUDEPATH += $$PWD
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment