forked from qt-creator/qt-creator
QmlDesigner.DragTool: Remove import handling code
We have an import manager now. Change-Id: If0123059a0fa1b51ef91c13bf24e3e6998195880 Reviewed-by: Marco Bubke <marco.bubke@digia.com>
This commit is contained in:
@@ -203,24 +203,6 @@ FormEditorItem* DragTool::calculateContainer(const QPointF &point, FormEditorIte
|
||||
return 0;
|
||||
}
|
||||
|
||||
QList<Import> DragTool::missingImportList(const ItemLibraryEntry &itemLibraryEntry)
|
||||
{
|
||||
QList<Import> importToBeAddedList;
|
||||
|
||||
if (!itemLibraryEntry.requiredImport().isEmpty()) {
|
||||
const QString newImportUrl = itemLibraryEntry.requiredImport();
|
||||
const QString newImportVersion = QString("%1.%2").arg(QString::number(itemLibraryEntry.majorVersion()), QString::number(itemLibraryEntry.minorVersion()));
|
||||
Import newImport = Import::createLibraryImport(newImportUrl, newImportVersion);
|
||||
|
||||
if (itemLibraryEntry.majorVersion() == -1 && itemLibraryEntry.minorVersion() == -1)
|
||||
newImport = Import::createFileImport(newImportUrl, QString());
|
||||
else
|
||||
newImport = Import::createLibraryImport(newImportUrl, newImportVersion);
|
||||
}
|
||||
return importToBeAddedList;
|
||||
}
|
||||
|
||||
|
||||
void DragTool::formEditorItemsChanged(const QList<FormEditorItem*> & itemList)
|
||||
{
|
||||
if (m_movingItem && itemList.contains(m_movingItem.data())) {
|
||||
@@ -317,13 +299,8 @@ void DragTool::dragEnterEvent(QGraphicsSceneDragDropEvent * event)
|
||||
view()->widgetInfo().widget->setFocus();
|
||||
m_Aborted = false;
|
||||
Q_ASSERT(!event->mimeData()->data("application/vnd.bauhaus.itemlibraryinfo").isEmpty());
|
||||
|
||||
importToBeAddedList = missingImportList(
|
||||
itemLibraryEntryFromData(event->mimeData()->data("application/vnd.bauhaus.itemlibraryinfo")));
|
||||
}
|
||||
|
||||
view()->model()->changeImports(importToBeAddedList, QList<Import>());
|
||||
|
||||
if (!m_rewriterTransaction.isValid()) {
|
||||
view()->clearSelectedModelNodes();
|
||||
m_rewriterTransaction = view()->beginRewriterTransaction(QByteArrayLiteral("DragTool::dragEnterEvent"));
|
||||
|
||||
@@ -113,7 +113,6 @@ private:
|
||||
void createQmlItemNode(const ItemLibraryEntry &itemLibraryEntry, QmlItemNode parentNode, QPointF scenePos);
|
||||
void createQmlItemNodeFromImage(const QString &imageName, QmlItemNode parentNode, QPointF scenePos);
|
||||
FormEditorItem* calculateContainer(const QPointF &point, FormEditorItem * currentItem = 0);
|
||||
QList<Import> missingImportList(const ItemLibraryEntry &itemLibraryEntry);
|
||||
|
||||
void begin(QPointF scenePos);
|
||||
void end();
|
||||
|
||||
Reference in New Issue
Block a user