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 <tim.jenssen@digia.com>
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/vnd.bauhaus.libraryresource"));
QmlItemNode newQmlItemNode = QmlItemNode::createQmlItemNodeFromImage(m_view, imageFileName, QPointF(0., 0.), targetProperty);
if (newQmlItemNode.isValid()) {
QList<ModelNode> newModelNodeList;
newModelNodeList.append(newQmlItemNode);
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