Commit 234cc766 authored by Marco Bubke's avatar Marco Bubke

QmlDesigner: Item dropping from the item library to the navigator

Change-Id: I04f3b809ce743bbeef5e3955892ab51690783942
Reviewed-by: default avatarTim Jenssen <>
parent c1d521bf
......@@ -697,7 +697,23 @@ static ItemLibraryEntry itemLibraryEntryFromData(const QByteArray &data)
void NavigatorTreeModel::handleItemLibraryItemDrop(const QMimeData *mimeData, int rowNumber, const QModelIndex &dropModelIndex)
QModelIndex rowModelIndex = dropModelIndex.sibling(dropModelIndex.row(), 0);
int targetRowNumber = rowNumber;
NodeAbstractProperty targetProperty;
bool foundTarget = computeTarget(rowModelIndex, this, &targetProperty, &targetRowNumber);
if (foundTarget) {
ItemLibraryEntry itemLibraryEntry = itemLibraryEntryFromData(mimeData->data("application/"));
QmlItemNode newQmlItemNode = QmlItemNode::createQmlItemNode(m_view, itemLibraryEntry, QPointF(0., 0.), targetProperty);
if (newQmlItemNode.isValid()) {
QList<ModelNode> newModelNodeList;
moveNodesInteractive(targetProperty, newModelNodeList, targetRowNumber);
void NavigatorTreeModel::handleItemLibraryImageDrop(const QMimeData *mimeData, int rowNumber, const QModelIndex &dropModelIndex)
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