Commit d3465906 authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner: Handle drops of images from the item library in the navigator

Change-Id: I42c0224d5f6aadc7253113b39d7c4ababeab45fb
Reviewed-by: default avatarTim Jenssen <>
parent 49347f3c
......@@ -718,7 +718,23 @@ void NavigatorTreeModel::handleItemLibraryItemDrop(const QMimeData *mimeData, in
void NavigatorTreeModel::handleItemLibraryImageDrop(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) {
QString imageFileName = QString::fromUtf8(mimeData->data("application/"));
QmlItemNode newQmlItemNode = QmlItemNode::createQmlItemNodeFromImage(m_view, imageFileName, QPointF(0., 0.), targetProperty);
if (newQmlItemNode.isValid()) {
QList<ModelNode> newModelNodeList;
moveNodesInteractive(targetProperty, newModelNodeList, targetRowNumber);
// along the lines of QObject::blockSignals
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