forked from qt-creator/qt-creator
QmlDesigner: Use NodeHints in navigator
Change-Id: I90cffc6d814c06d2474b003a4b6c5714b1a9ad1c Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include <bindingproperty.h>
|
#include <bindingproperty.h>
|
||||||
#include <nodeabstractproperty.h>
|
#include <nodeabstractproperty.h>
|
||||||
|
#include <nodehints.h>
|
||||||
#include <nodelistproperty.h>
|
#include <nodelistproperty.h>
|
||||||
#include <nodeproperty.h>
|
#include <nodeproperty.h>
|
||||||
#include <variantproperty.h>
|
#include <variantproperty.h>
|
||||||
@@ -763,6 +764,10 @@ void NavigatorTreeModel::handleItemLibraryItemDrop(const QMimeData *mimeData, in
|
|||||||
|
|
||||||
if (foundTarget) {
|
if (foundTarget) {
|
||||||
ItemLibraryEntry itemLibraryEntry = itemLibraryEntryFromData(mimeData->data(QLatin1String("application/vnd.bauhaus.itemlibraryinfo")));
|
ItemLibraryEntry itemLibraryEntry = itemLibraryEntryFromData(mimeData->data(QLatin1String("application/vnd.bauhaus.itemlibraryinfo")));
|
||||||
|
|
||||||
|
if (!NodeHints::fromItemLibraryEntry(itemLibraryEntry).canBeDroppedInNavigator())
|
||||||
|
return;
|
||||||
|
|
||||||
QmlItemNode newQmlItemNode = QmlItemNode::createQmlItemNode(m_view, itemLibraryEntry, QPointF(), targetProperty);
|
QmlItemNode newQmlItemNode = QmlItemNode::createQmlItemNode(m_view, itemLibraryEntry, QPointF(), targetProperty);
|
||||||
|
|
||||||
if (newQmlItemNode.isValid() && targetProperty.isNodeListProperty()) {
|
if (newQmlItemNode.isValid() && targetProperty.isNodeListProperty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user