Commit e4dd8e75 authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.ItemLibrary: Fix Drag Drop on Mac OS X

Since grabMouse() is limited on Mac OS X, we cannot use
the custom drag and drop code anymore.
The icon stays visible.

Task-number: QTBUG-34201
Task-number: QTCREATORBUG-10414
Change-Id: I92009c34881d086049e50b0c9ef109a7149ac657
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 0282b97c
......@@ -366,15 +366,13 @@ void ItemLibraryWidget::setResourcePath(const QString &resourcePath)
void ItemLibraryWidget::startDragAndDrop(int itemLibId)
{
QMimeData *mimeData = m_itemLibraryModel->getMimeData(itemLibId);
CustomItemLibraryDrag *drag = new CustomItemLibraryDrag(this);
QDrag *drag = new QDrag(this);
const QImage image = qvariant_cast<QImage>(mimeData->imageData());
drag->setPixmap(m_itemLibraryModel->getIcon(itemLibId).pixmap(32, 32));
drag->setPreview(QPixmap::fromImage(image));
drag->setMimeData(mimeData);
QQuickItem *rootItem = qobject_cast<QQuickItem*>(m_itemsView->rootObject());
connect(rootItem, SIGNAL(stopDragAndDrop()), drag, SLOT(stopDrag()));
drag->exec();
}
......
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