From 874328fe9bf68b18ee2dd0e1e6aa7c7d497d00e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20N=C3=A4tterlund?= Date: Fri, 19 Apr 2013 13:54:52 +0200 Subject: [PATCH 01/23] QNX: Corrected path to qml files for pure QNX devices For pure QNX (non-BlackBerry) devices, the path to the QML files are decided by the user. Only adjust the path for BlackBerry devices. Change-Id: I909ed0a06bc6985a5a353aab61bda395afcfb7aa Reviewed-by: Eike Ziller Reviewed-by: Mehdi Fekari --- .../qtquick2applicationviewer/qtquick2applicationviewer.cpp | 2 +- .../qtquickapp/qmlapplicationviewer/qmlapplicationviewer.cpp | 2 +- src/plugins/qt4projectmanager/wizards/qtquickapp.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/share/qtcreator/templates/qtquick2app/qtquick2applicationviewer/qtquick2applicationviewer.cpp b/share/qtcreator/templates/qtquick2app/qtquick2applicationviewer/qtquick2applicationviewer.cpp index 6d7232e2609..7f5e1e40d70 100644 --- a/share/qtcreator/templates/qtquick2app/qtquick2applicationviewer/qtquick2applicationviewer.cpp +++ b/share/qtcreator/templates/qtquick2app/qtquick2applicationviewer/qtquick2applicationviewer.cpp @@ -26,7 +26,7 @@ QString QtQuick2ApplicationViewerPrivate::adjustPath(const QString &path) if (!QDir::isAbsolutePath(path)) return QString::fromLatin1("%1/../Resources/%2") .arg(QCoreApplication::applicationDirPath(), path); -#elif defined(Q_OS_QNX) +#elif defined(Q_OS_BLACKBERRY) if (!QDir::isAbsolutePath(path)) return QString::fromLatin1("app/native/%1").arg(path); #elif !defined(Q_OS_ANDROID) diff --git a/share/qtcreator/templates/qtquickapp/qmlapplicationviewer/qmlapplicationviewer.cpp b/share/qtcreator/templates/qtquickapp/qmlapplicationviewer/qmlapplicationviewer.cpp index 9166a92f805..f373ad6f532 100644 --- a/share/qtcreator/templates/qtquickapp/qmlapplicationviewer/qmlapplicationviewer.cpp +++ b/share/qtcreator/templates/qtquickapp/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -60,7 +60,7 @@ QString QmlApplicationViewerPrivate::adjustPath(const QString &path) if (!QDir::isAbsolutePath(path)) return QString::fromLatin1("%1/../Resources/%2") .arg(QCoreApplication::applicationDirPath(), path); -#elif defined(Q_OS_QNX) +#elif defined(Q_OS_BLACKBERRY) if (!QDir::isAbsolutePath(path)) return QString::fromLatin1("app/native/%1").arg(path); #elif !defined(Q_OS_ANDROID) diff --git a/src/plugins/qt4projectmanager/wizards/qtquickapp.cpp b/src/plugins/qt4projectmanager/wizards/qtquickapp.cpp index 7ebf816afba..99754a14ade 100644 --- a/src/plugins/qt4projectmanager/wizards/qtquickapp.cpp +++ b/src/plugins/qt4projectmanager/wizards/qtquickapp.cpp @@ -227,7 +227,7 @@ QByteArray QtQuickApp::generateFileExtended(int fileType, int QtQuickApp::stubVersionMinor() const { - return m_componentSet == QtQuick20Components ? 4 : 23; + return m_componentSet == QtQuick20Components ? 5 : 24; } QList QtQuickApp::updateableFiles(const QString &mainProFile) const From 1f5b3ed670f1410c949e1944dedf81172498f0b4 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 22 Apr 2013 17:11:29 +0200 Subject: [PATCH 02/23] Squish: Cleanup tst_simple_analyze * workingDir should not be global * handle missing Qt Creator plugins on startup Change-Id: Ibb8267da9d3443104f6d895ff98b6047f693284e Reviewed-by: Robert Loehning --- tests/system/suite_debugger/tst_simple_analyze/test.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/system/suite_debugger/tst_simple_analyze/test.py b/tests/system/suite_debugger/tst_simple_analyze/test.py index 56ad572dd7d..0fa530df764 100644 --- a/tests/system/suite_debugger/tst_simple_analyze/test.py +++ b/tests/system/suite_debugger/tst_simple_analyze/test.py @@ -1,10 +1,9 @@ source("../../shared/qtcreator.py") -workingDir = None - def main(): - global workingDir startApplication("qtcreator" + SettingsPath) + if not startedWithoutPluginError(): + return # using a temporary directory won't mess up a potentially existing workingDir = tempDir() checkedTargets, projectName = createNewQtQuickApplication(workingDir) From c4aad3ef79d2648da27c7109e8938a26e9ce64bb Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 22 Apr 2013 17:20:40 +0200 Subject: [PATCH 03/23] Squish: Cleanup tst_simple_debug Change-Id: Ie74b0dd42d14e594e436408e39db20554904b84e Reviewed-by: Robert Loehning --- tests/system/suite_debugger/tst_simple_debug/test.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/system/suite_debugger/tst_simple_debug/test.py b/tests/system/suite_debugger/tst_simple_debug/test.py index b5fd5fdc378..1a966a51720 100644 --- a/tests/system/suite_debugger/tst_simple_debug/test.py +++ b/tests/system/suite_debugger/tst_simple_debug/test.py @@ -1,9 +1,6 @@ source("../../shared/qtcreator.py") -workingDir = None - def main(): - global workingDir startApplication("qtcreator" + SettingsPath) if not startedWithoutPluginError(): return From 59edc405939307606551fd96895dc767fb6a5d23 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 23 Apr 2013 12:39:05 +0200 Subject: [PATCH 04/23] Squish: Add Run button to objects.map Change-Id: I506a030714a46a1ca3610b18daf296deaa6bfcc2 Reviewed-by: Robert Loehning --- tests/system/objects.map | 1 + tests/system/shared/project.py | 5 ++--- tests/system/suite_debugger/tst_cli_output_console/test.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/system/objects.map b/tests/system/objects.map index fb324704bed..e35b36a5f01 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -8,6 +8,7 @@ :*Qt Creator.Interrupt_Core::Internal::FancyToolButton {text='Interrupt' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.JavaScript_QDockWidget {name='QmlProfilerV8ProfileViewDockWidget' type='QDockWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='JavaScript'} :*Qt Creator.JavaScript_QTabBar {aboveWidget=':*Qt Creator.JavaScript_QDockWidget' type='QTabBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:*Qt Creator.Run_Core::Internal::FancyToolButton {text='Run' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.Start Debugging_Core::Internal::FancyToolButton {text='Start Debugging' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.findEdit_Utils::FilterLineEdit {name='findEdit' type='Utils::FilterLineEdit' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator_Core::Internal::FancyToolButton {occurrence='3' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index c27b5614976..95ea4988656 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -304,7 +304,7 @@ def runAndCloseApp(withHookInto=False, executable=None, port=None, function=None overrideInstallLazySignalHandler() installLazySignalHandler("{type='ProjectExplorer::ApplicationLauncher'}", "processStarted()", "__handleProcessStarted__") installLazySignalHandler("{type='ProjectExplorer::ApplicationLauncher'}", "processExited(int)", "__handleProcessExited__") - runButton = waitForObject("{type='Core::Internal::FancyToolButton' text='Run' visible='1'}") + runButton = waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton") clickButton(runButton) if sType != SubprocessType.QT_QUICK_UI: waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)", 300000) @@ -388,8 +388,7 @@ def __closeSubprocessByHookingInto__(executable, port, function, sType, userDefT switchViewTo(ViewConstants.EDIT) global processStarted processStarted = False - runButton = waitForObject("{type='Core::Internal::FancyToolButton' text='Run' " - "visible='1'}") + runButton = waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton") clickButton(runButton) if not waitFor("processStarted == True", 10000): test.fatal("Something seems to be really wrong.", "Application output:" diff --git a/tests/system/suite_debugger/tst_cli_output_console/test.py b/tests/system/suite_debugger/tst_cli_output_console/test.py index cabfa2aebb3..f03bef601f6 100644 --- a/tests/system/suite_debugger/tst_cli_output_console/test.py +++ b/tests/system/suite_debugger/tst_cli_output_console/test.py @@ -46,7 +46,7 @@ def main(): test.log("Running application") setRunInTerminal(len(checkedTargets), kit, False) runControlFinished = False - clickButton(waitForObject("{type='Core::Internal::FancyToolButton' text='Run' visible='1'}")) + clickButton(waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton")) waitFor("runControlFinished==True", 20000) if not runControlFinished: test.warning("Waiting for runControlFinished timed out") From eab228dcca8b52e2a178aadcd74b8139b91cb567 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 22 Apr 2013 13:52:53 +0200 Subject: [PATCH 05/23] Squish: Cleanup workarounds.py * removed fetching status * improved output for closed bugs Change-Id: Ice0256f75571c6c44e9878447d3821247f5ded4f Reviewed-by: Robert Loehning --- tests/system/shared/workarounds.py | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/tests/system/shared/workarounds.py b/tests/system/shared/workarounds.py index f0ce4c348cc..b47c9aad55c 100644 --- a/tests/system/shared/workarounds.py +++ b/tests/system/shared/workarounds.py @@ -22,7 +22,7 @@ class JIRA: else: JIRA.__instance__._bugType = bugType JIRA.__instance__._number = number - JIRA.__instance__.__fetchStatusAndResolutionFromJira__() + JIRA.__instance__.__fetchResolutionFromJira__() # overriden to make it possible to use JIRA just like the # underlying implementation (__impl) @@ -56,7 +56,7 @@ class JIRA: if JIRA.isBugStillOpen(number, bugType): return JIRA.performWorkaroundForBug(number, bugType, *args) else: - test.warning("Bug is closed... skipping workaround!", + test.warning("Bug %s-%d is closed... skipping workaround!" % (bugType, number), "You should remove potential code inside performWorkaroundForBug()") return False @@ -82,7 +82,7 @@ class JIRA: self._localOnly = os.getenv("SYSTEST_JIRA_NO_LOOKUP")=="1" self.__initBugDict__() self._fetchResults_ = {} - self.__fetchStatusAndResolutionFromJira__() + self.__fetchResolutionFromJira__() # this function checks the resolution of the given bug # and returns True if the bug can still be assumed as 'Open' and False otherwise @@ -96,16 +96,15 @@ class JIRA: return True return self._resolution != 'Done' - # this function tries to fetch the status and resolution from JIRA for the given bug + # this function tries to fetch the resolution from JIRA for the given bug # if this isn't possible or the lookup is disabled it does only check the internal # dict whether a function for the given bug is deposited or not - def __fetchStatusAndResolutionFromJira__(self): + def __fetchResolutionFromJira__(self): global JIRA_URL bug = "%s-%d" % (self._bugType, self._number) if bug in self._fetchResults_: result = self._fetchResults_[bug] - self._resolution = result[0] - self._status = result[1] + self._resolution = result return data = None proxy = os.getenv("SYSTEST_PROXY", None) @@ -129,7 +128,6 @@ class JIRA: if bug in self.__bugs__: test.warning("Using internal dict - bug status could have changed already", "Please check manually!") - self._status = None self._resolution = None else: test.fatal("No workaround function deposited for %s" % bug) @@ -137,24 +135,16 @@ class JIRA: else: data = data.replace("\r", "").replace("\n", "") resPattern = re.compile('(?P.*?)') - statPattern = re.compile('(.*?)?(?P.*?)') - status = statPattern.search(data) resolution = resPattern.search(data) - if status: - self._status = status.group("status").strip() - else: - test.fatal("FATAL: Cannot get status of bugreport %s" % bug, - "Looks like JIRA has changed.... Please verify!") - self._status = None if resolution: self._resolution = resolution.group("resolution").strip() else: test.fatal("FATAL: Cannot get resolution of bugreport %s" % bug, "Looks like JIRA has changed.... Please verify!") self._resolution = None - if None in (self._status, self._resolution): + if self._resolution == None: self.__cropAndLog__(data) - self._fetchResults_.update({bug:[self._resolution, self._status]}) + self._fetchResults_.update({bug:self._resolution}) # simple helper function - used as fallback if python has no ssl support # tries to find curl or wget in PATH and fetches data with it instead of From a58810ce9ecf5e47d0f260cdde1b5a55cb5c38e1 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Tue, 23 Apr 2013 18:45:26 +0200 Subject: [PATCH 06/23] QmlDesigner: Do componentComplete for QObjects with QmlParserStatus Change-Id: If7ea6c55f4540a8bde113076288c0e9c6dd1210f Reviewed-by: Thomas Hartmann --- .../qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp index ececc9b722a..c84323d9460 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp @@ -42,7 +42,7 @@ #include #include #include - +#include #include #include @@ -1252,7 +1252,9 @@ bool ObjectNodeInstance::resetStateProperty(const ObjectNodeInstance::Pointer &/ void ObjectNodeInstance::doComponentComplete() { - + QQmlParserStatus *qmlParserStatus = dynamic_cast< QQmlParserStatus*>(object()); + if (qmlParserStatus) + qmlParserStatus->componentComplete(); } bool ObjectNodeInstance::isRootNodeInstance() const From ba6cc1d04f9ec81e5153b3d48310eecef643f3d5 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 24 Apr 2013 12:44:11 +0200 Subject: [PATCH 07/23] Squish: Cleanup workarounds.py Change-Id: Ibbdae1c85d49122928fda97ea5f3d83245eab7ed Reviewed-by: Robert Loehning --- tests/system/shared/workarounds.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tests/system/shared/workarounds.py b/tests/system/shared/workarounds.py index b47c9aad55c..81180a5a39f 100644 --- a/tests/system/shared/workarounds.py +++ b/tests/system/shared/workarounds.py @@ -172,18 +172,11 @@ class JIRA: return fetched = " ".join(fetched.split()) resoInd = fetched.find('resolution-val') - statInd = fetched.find('status-val') - if resoInd == statInd == -1: - test.log("Neither resolution nor status found inside fetched data.", + if resoInd == -1: + test.log("Resolution not found inside fetched data.", "%s[...]" % fetched[:200]) else: - if resoInd == -1: - test.log("Fetched and cropped data: [...]%s[...]" % fetched[statInd-20:statInd+800]) - elif statInd == -1: - test.log("Fetched and cropped data: [...]%s[...]" % fetched[resoInd-720:resoInd+100]) - else: - test.log("Fetched and cropped data (status): [...]%s[...]" % fetched[statInd-20:statInd+300], - "Fetched and cropped data (resolution): [...]%s[...]" % fetched[resoInd-20:resoInd+100]) + test.log("Fetched and cropped data: [...]%s[...]" % fetched[resoInd-20:resoInd+100]) # this function initializes the bug dict for localOnly usage and # for later lookup which function to call for which bug From ea5169a163257f4a56e98d60b8465ca16fddf748 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 24 Apr 2013 17:00:34 +0200 Subject: [PATCH 08/23] QmlDesigner: Improve naming of variables Change-Id: I8429517b81308f4a6a15b90a1ac7486de49562d9 Reviewed-by: Thomas Hartmann --- .../qml2puppet/instances/graphicalnodeinstance.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/graphicalnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/graphicalnodeinstance.cpp index 7f5dc9301d8..f17ba7895f4 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/graphicalnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/graphicalnodeinstance.cpp @@ -238,13 +238,13 @@ static inline bool isRectangleSane(const QRectF &rect) return rect.isValid() && (rect.width() < 10000) && (rect.height() < 10000); } -QRectF GraphicalNodeInstance::boundingRectWithStepChilds(QQuickItem *parentItem) const +QRectF GraphicalNodeInstance::boundingRectWithStepChilds(QQuickItem *item) const { - QRectF boundingRect = parentItem->boundingRect(); + QRectF boundingRect = item->boundingRect(); - foreach (QQuickItem *childItem, parentItem->childItems()) { + foreach (QQuickItem *childItem, item->childItems()) { if (!nodeInstanceServer()->hasInstanceForObject(childItem)) { - QRectF transformedRect = childItem->mapRectToItem(parentItem, boundingRectWithStepChilds(childItem)); + QRectF transformedRect = childItem->mapRectToItem(item, boundingRectWithStepChilds(childItem)); if (isRectangleSane(transformedRect)) boundingRect = boundingRect.united(transformedRect); } From cec82a13e18c5f48b29583adabbe840aa198a3df Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 24 Apr 2013 17:33:17 +0200 Subject: [PATCH 09/23] QmlDesigner: Fix clipping render bug Clipping is happen over the bounding rectangle, so should provide the clipped bounding rectangle. Change-Id: I602da312a7ca327def378a887a75782c61cc680d Reviewed-by: Thomas Hartmann --- .../qmlpuppet/qml2puppet/instances/graphicalnodeinstance.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/graphicalnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/graphicalnodeinstance.cpp index f17ba7895f4..78431c75137 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/graphicalnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/graphicalnodeinstance.cpp @@ -137,9 +137,9 @@ QImage GraphicalNodeInstance::renderImage() const { updateDirtyNodeRecursive(quickItem()); - QRectF boundingRect = boundingRectWithStepChilds(quickItem()); + QRectF renderBoundingRect = boundingRect(); - QImage renderImage = designerSupport()->renderImageForItem(quickItem(), boundingRect, boundingRect.size().toSize()); + QImage renderImage = designerSupport()->renderImageForItem(quickItem(), renderBoundingRect, renderBoundingRect.size().toSize()); renderImage = renderImage.convertToFormat(QImage::Format_ARGB32_Premultiplied); From 893020ae5db0bde0827fe980a5fdb4ca7838db4e Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 24 Apr 2013 17:33:46 +0200 Subject: [PATCH 10/23] QmlDesigner: We should test if untracked items are dirty too Change-Id: I94db08fff3e7e38a9cc377d06a5aabc6d886b64e Reviewed-by: Thomas Hartmann --- .../qt5informationnodeinstanceserver.cpp | 27 ++++++++++++++----- .../qt5informationnodeinstanceserver.h | 2 +- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index 8f6c458521b..85b8354fef0 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -86,6 +86,26 @@ void Qt5InformationNodeInstanceServer::token(const TokenCommand &command) startRenderTimer(); } +bool Qt5InformationNodeInstanceServer::isDirtyRecursiveForNonInstanceItems(QQuickItem *item) const +{ + static DesignerSupport::DirtyType informationsDirty = DesignerSupport::DirtyType(DesignerSupport::TransformUpdateMask + | DesignerSupport::ContentUpdateMask + | DesignerSupport::Visible + | DesignerSupport::ZValue + | DesignerSupport::OpacityValue); + + if (DesignerSupport::isDirty(item, informationsDirty)) + return true; + + foreach (QQuickItem *childItem, item->childItems()) { + if (!hasInstanceForObject(childItem) && DesignerSupport::isDirty(childItem, informationsDirty)) + return true; + } + + return false; + +} + void Qt5InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands() { static bool inFunction = false; @@ -103,12 +123,7 @@ void Qt5InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands() if (item && hasInstanceForObject(item)) { ServerNodeInstance instance = instanceForObject(item); - DesignerSupport::DirtyType informationsDirty = DesignerSupport::DirtyType(DesignerSupport::TransformUpdateMask - | DesignerSupport::ContentUpdateMask - | DesignerSupport::Visible - | DesignerSupport::ZValue - | DesignerSupport::OpacityValue); - if (DesignerSupport::isDirty(item, informationsDirty)) + if (isDirtyRecursiveForNonInstanceItems(item)) informationChangedInstanceSet.insert(instance); diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.h index ee6d32e00b9..21342ec88b7 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.h @@ -52,7 +52,7 @@ protected: void collectItemChangesAndSendChangeCommands() Q_DECL_OVERRIDE; void sendChildrenChangedCommand(const QList childList); void sendTokenBack(); - + bool isDirtyRecursiveForNonInstanceItems(QQuickItem *item) const; private: QSet m_parentChangedSet; From d799bf31befdc4d5be36b1b807d5dd74dd0d5a72 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 22 Apr 2013 14:37:05 +0200 Subject: [PATCH 11/23] Squish: Changed handling of workarounds If a bug is closed for master but still valid for the current working branch the workaround won't be executed if started with performWorkaroundIfStillOpen(). This leads to wrong results. The new approach is less automatic but more error-proof. Change-Id: If33c920be08e33c0fb2ccc4faec4ae8ff0d0f95d Reviewed-by: Robert Loehning --- tests/system/shared/editor_utils.py | 2 +- tests/system/shared/workarounds.py | 30 ++++++++++--------- .../tst_cli_output_console/test.py | 2 +- .../tst_basic_cpp_support/test.py | 2 +- .../tst_delete_externally/test.py | 2 +- .../suite_editors/tst_revert_changes/test.py | 2 +- .../suite_editors/tst_select_all/test.py | 2 +- 7 files changed, 22 insertions(+), 20 deletions(-) diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py index 294093314fb..ac698353dd4 100644 --- a/tests/system/shared/editor_utils.py +++ b/tests/system/shared/editor_utils.py @@ -64,7 +64,7 @@ def widgetContainsPoint(widget, point): def openContextMenuOnTextCursorPosition(editor): rect = editor.cursorRect(editor.textCursor()) if platform.system() == 'Darwin': - JIRA.performWorkaroundIfStillOpen(8735, JIRA.Bug.CREATOR, editor) + JIRA.performWorkaroundForBug(8735, JIRA.Bug.CREATOR, editor) openContextMenu(editor, rect.x+rect.width/2, rect.y+rect.height/2, 0) menuInList = [None] waitFor("menuVisibleAtEditor(editor, menuInList)", 5000) diff --git a/tests/system/shared/workarounds.py b/tests/system/shared/workarounds.py index 81180a5a39f..2726b381129 100644 --- a/tests/system/shared/workarounds.py +++ b/tests/system/shared/workarounds.py @@ -48,22 +48,14 @@ class JIRA: tmpJIRA = JIRA(number, bugType) return tmpJIRA.isOpen() - # function similar to performWorkaroundForBug - but it will execute the - # workaround (function) only if the bug is still open - # returns True if the workaround function has been executed, False otherwise - @staticmethod - def performWorkaroundIfStillOpen(number, bugType=Bug.CREATOR, *args): - if JIRA.isBugStillOpen(number, bugType): - return JIRA.performWorkaroundForBug(number, bugType, *args) - else: - test.warning("Bug %s-%d is closed... skipping workaround!" % (bugType, number), - "You should remove potential code inside performWorkaroundForBug()") - return False - # function that performs the workaround (function) for the given bug # if the function needs additional arguments pass them as 3rd parameter @staticmethod def performWorkaroundForBug(number, bugType=Bug.CREATOR, *args): + if not JIRA.isBugStillOpen(number, bugType): + test.warning("Bug %s-%d is closed for version %s." % + (bugType, number, JIRA(number, bugType)._fix), + "You should probably remove potential code inside workarounds.py") functionToCall = JIRA.getInstance().__bugs__.get("%s-%d" % (bugType, number), None) if functionToCall: test.warning("Using workaround for %s-%d" % (bugType, number)) @@ -104,7 +96,8 @@ class JIRA: bug = "%s-%d" % (self._bugType, self._number) if bug in self._fetchResults_: result = self._fetchResults_[bug] - self._resolution = result + self._resolution = result[0] + self._fix = result[1] return data = None proxy = os.getenv("SYSTEST_PROXY", None) @@ -136,6 +129,15 @@ class JIRA: data = data.replace("\r", "").replace("\n", "") resPattern = re.compile('(?P.*?)') resolution = resPattern.search(data) + fixVersion = 'None' + fixPattern = re.compile('(?P.*?)') + fix = fixPattern.search(data) + titlePattern = re.compile('title="(?P.*?)"') + if fix: + fix = titlePattern.search(fix.group('fix').strip()) + if fix: + fixVersion = fix.group('title').strip() + self._fix = fixVersion if resolution: self._resolution = resolution.group("resolution").strip() else: @@ -144,7 +146,7 @@ class JIRA: self._resolution = None if self._resolution == None: self.__cropAndLog__(data) - self._fetchResults_.update({bug:self._resolution}) + self._fetchResults_.update({bug:[self._resolution, self._fix]}) # simple helper function - used as fallback if python has no ssl support # tries to find curl or wget in PATH and fetches data with it instead of diff --git a/tests/system/suite_debugger/tst_cli_output_console/test.py b/tests/system/suite_debugger/tst_cli_output_console/test.py index f03bef601f6..ffb782d31d2 100644 --- a/tests/system/suite_debugger/tst_cli_output_console/test.py +++ b/tests/system/suite_debugger/tst_cli_output_console/test.py @@ -65,7 +65,7 @@ def main(): isMsvc = isMsvcConfig(len(checkedTargets), kit) runControlFinished = False invokeMenuItem("Debug", "Start Debugging", "Start Debugging") - JIRA.performWorkaroundIfStillOpen(6853, JIRA.Bug.CREATOR, config) + JIRA.performWorkaroundForBug(6853, JIRA.Bug.CREATOR, config) handleDebuggerWarnings(config, isMsvc) waitFor("runControlFinished==True", 20000) if not runControlFinished: diff --git a/tests/system/suite_editors/tst_basic_cpp_support/test.py b/tests/system/suite_editors/tst_basic_cpp_support/test.py index 8837eca8c43..c48332e0e6a 100644 --- a/tests/system/suite_editors/tst_basic_cpp_support/test.py +++ b/tests/system/suite_editors/tst_basic_cpp_support/test.py @@ -39,7 +39,7 @@ def main(): # Creator will show you the declaration of the variable. if platform.system() == "Darwin": - JIRA.performWorkaroundIfStillOpen(8735, JIRA.Bug.CREATOR, cppwindow) + JIRA.performWorkaroundForBug(8735, JIRA.Bug.CREATOR, cppwindow) type(cppwindow, "<Ctrl+F>") type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), " xi") diff --git a/tests/system/suite_editors/tst_delete_externally/test.py b/tests/system/suite_editors/tst_delete_externally/test.py index 21bfaf3318c..2af76e94656 100644 --- a/tests/system/suite_editors/tst_delete_externally/test.py +++ b/tests/system/suite_editors/tst_delete_externally/test.py @@ -39,7 +39,7 @@ def main(): continue if platform.system() == 'Darwin': - JIRA.performWorkaroundIfStillOpen(8735, JIRA.Bug.CREATOR, editor) + JIRA.performWorkaroundForBug(8735, JIRA.Bug.CREATOR, editor) contentBefore = readFile(currentFile) popupText = "The file %s was removed. Do you want to save it under a different name, or close the editor?" os.remove(currentFile) diff --git a/tests/system/suite_editors/tst_revert_changes/test.py b/tests/system/suite_editors/tst_revert_changes/test.py index 159396c75c4..8656b224162 100644 --- a/tests/system/suite_editors/tst_revert_changes/test.py +++ b/tests/system/suite_editors/tst_revert_changes/test.py @@ -63,7 +63,7 @@ def __modifyProFile__(): def __modifyHeader__(): global cppEditorStr, homeShortCut, endShortCut if platform.system() == "Darwin": - JIRA.performWorkaroundIfStillOpen(8735, JIRA.Bug.CREATOR, waitForObject(cppEditorStr, 1000)) + JIRA.performWorkaroundForBug(8735, JIRA.Bug.CREATOR, waitForObject(cppEditorStr, 1000)) if placeCursorToLine(cppEditorStr, "class.+", True): type(cppEditorStr, homeShortCut) markText(cppEditorStr, "Down", 5) diff --git a/tests/system/suite_editors/tst_select_all/test.py b/tests/system/suite_editors/tst_select_all/test.py index 9bdf546eeb7..81f051a59a5 100644 --- a/tests/system/suite_editors/tst_select_all/test.py +++ b/tests/system/suite_editors/tst_select_all/test.py @@ -30,7 +30,7 @@ def main(): "Skipping this file for now.") continue if platform.system() == 'Darwin': - JIRA.performWorkaroundIfStillOpen(8735, JIRA.Bug.CREATOR, editor) + JIRA.performWorkaroundForBug(8735, JIRA.Bug.CREATOR, editor) for key in ["<Up>", "<Down>", "<Left>", "<Right>"]: test.log("Selecting everything") invokeMenuItem("Edit", "Select All") From a6cd9abcd1b3fb55c3e3cfd2d31756abcce2180f Mon Sep 17 00:00:00 2001 From: Kai Koehne <kai.koehne@digia.com> Date: Thu, 25 Apr 2013 09:57:27 +0200 Subject: [PATCH 12/23] QmlDesigner: Fix gcc compilation warnings Fix warnings from gcc 4.8. Change-Id: If4fc311ea021d1014141cb123f1d765577efd831 Reviewed-by: Marco Bubke <marco.bubke@digia.com> --- .../qt5informationnodeinstanceserver.cpp | 16 ---------------- .../components/formeditor/abstractcustomtool.cpp | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index 85b8354fef0..0aaa6abe494 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -116,7 +116,6 @@ void Qt5InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands() QSet<ServerNodeInstance> informationChangedInstanceSet; QVector<InstancePropertyPair> propertyChangedList; - bool adjustSceneRect = false; if (quickView()) { foreach (QQuickItem *item, allItems()) { @@ -131,11 +130,6 @@ void Qt5InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands() m_parentChangedSet.insert(instance); informationChangedInstanceSet.insert(instance); } -// if (d->geometryChanged) { -// if (instance.isRootNodeInstance()) -// declarativeView()->scene()->setSceneRect(item->boundingRect()); -// } - } } @@ -144,9 +138,6 @@ void Qt5InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands() const QString propertyName = property.second; if (instance.isValid()) { - if (instance.isRootNodeInstance() && (propertyName == "width" || propertyName == "height")) - adjustSceneRect = true; - if (propertyName.contains("anchors")) informationChangedInstanceSet.insert(instance); @@ -170,13 +161,6 @@ void Qt5InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands() m_parentChangedSet.clear(); } -// if (adjustSceneRect) { -// QRectF boundingRect = rootNodeInstance().boundingRect(); -// if (boundingRect.isValid()) { -// declarativeView()->setSceneRect(boundingRect); -// } -// } - if (!m_completedComponentList.isEmpty()) { nodeInstanceClient()->componentCompleted(createComponentCompletedCommand(m_completedComponentList)); m_completedComponentList.clear(); diff --git a/src/plugins/qmldesigner/components/formeditor/abstractcustomtool.cpp b/src/plugins/qmldesigner/components/formeditor/abstractcustomtool.cpp index 772ba71f8d8..b5d6f390b3b 100644 --- a/src/plugins/qmldesigner/components/formeditor/abstractcustomtool.cpp +++ b/src/plugins/qmldesigner/components/formeditor/abstractcustomtool.cpp @@ -9,7 +9,7 @@ AbstractCustomTool::AbstractCustomTool() { } -void AbstractCustomTool::selectedItemsChanged(const QList<FormEditorItem *> &itemList) +void AbstractCustomTool::selectedItemsChanged(const QList<FormEditorItem *> & /*itemList*/) { view()->changeToSelectionTool(); } From 31223a55b7094f2c666e9a01f807ab084f80153e Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed <fawzi.mohamed@digia.com> Date: Thu, 25 Apr 2013 13:58:13 +0200 Subject: [PATCH 13/23] qt4project/qmljs: get info from all subprojects removes an incorrect break that limited the number of nodes processed in updateQmljsCodeModel. Change-Id: I82c254721ee92765cb65840c428ea08e97f587c6 Reviewed-by: Aurindam Jana <aurindam.jana@digia.com> --- src/plugins/qt4projectmanager/qt4project.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp index 293404eccae..87653acf8d1 100644 --- a/src/plugins/qt4projectmanager/qt4project.cpp +++ b/src/plugins/qt4projectmanager/qt4project.cpp @@ -609,7 +609,6 @@ void Qt4Project::updateQmlJSCodeModel() hasQmlLib = qtLibs.contains(QLatin1String("declarative")) || qtLibs.contains(QLatin1String("qml")) || qtLibs.contains(QLatin1String("quick")); - break; } } From e79377958991e14d504f17674496d90e202170a8 Mon Sep 17 00:00:00 2001 From: Robert Loehning <robert.loehning@digia.com> Date: Thu, 25 Apr 2013 16:04:36 +0200 Subject: [PATCH 14/23] Squish: Added test for renaming files Task-number: QTCREATORBUG-8335 Change-Id: Ie9ca9018194c955f099b7d99ab46ba26303e354d Reviewed-by: Christian Stenger <christian.stenger@digia.com> --- tests/system/objects.map | 2 + tests/system/shared/utils.py | 6 ++ .../tst_delete_externally/test.py | 6 -- tests/system/suite_general/suite.conf | 2 +- .../suite_general/tst_rename_file/test.py | 78 +++++++++++++++++++ 5 files changed, 87 insertions(+), 7 deletions(-) create mode 100644 tests/system/suite_general/tst_rename_file/test.py diff --git a/tests/system/objects.map b/tests/system/objects.map index e35b36a5f01..b39ba183f66 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -92,6 +92,7 @@ :Qt Creator.Go to Help Mode_QToolButton {text='Go to Help Mode' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Help_Search for:_QLineEdit {leftWidget=':Qt Creator.Search for:_QLabel' type='QLineEdit' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Issues_QListView {type='QListView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Issues'} +:Qt Creator.Project.Menu.File_QMenu {name='Project.Menu.File' type='QMenu' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Project.Menu.Project_QMenu {name='Project.Menu.Project' type='QMenu' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.QtCreator.MenuBar_QMenuBar {name='QtCreator.MenuBar' type='QMenuBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.ReRun_QToolButton {toolTip='Re-run this run-configuration' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} @@ -123,6 +124,7 @@ :Qt Creator_SearchResult_Core::Internal::OutputPaneToggleButton {occurrence='2' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_SystemSettings.Details_Utils::DetailsButton {occurrence='4' text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Utils::NavigationTreeView {type='Utils::NavigationTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator_Utils::NavigationTreeView::QExpandingLineEdit {container=':Qt Creator_Utils::NavigationTreeView' type='QExpandingLineEdit' unnamed='1' visible='1'} :Qt Gui Application.Form file:_QLabel {name='formLabel' text='Form file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'} :Qt Gui Application.Header file:_QLabel {name='headerLabel' text='Header file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'} :Qt Gui Application.Source file:_QLabel {name='sourceLabel' text='Source file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'} diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 3af2ffd5aed..4bb0e36ef8f 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -612,3 +612,9 @@ def checkIfObjectExists(name, shouldExist = True, timeout = 3000, verboseOnFail def progressBarWait(): checkIfObjectExists("{type='Core::Internal::ProgressBar' unnamed='1'}", True, 2000) checkIfObjectExists("{type='Core::Internal::ProgressBar' unnamed='1'}", False, 60000) + +def readFile(filename): + f = open(filename, "r") + content = f.read() + f.close() + return content diff --git a/tests/system/suite_editors/tst_delete_externally/test.py b/tests/system/suite_editors/tst_delete_externally/test.py index 2af76e94656..0d82dcaa87e 100644 --- a/tests/system/suite_editors/tst_delete_externally/test.py +++ b/tests/system/suite_editors/tst_delete_externally/test.py @@ -3,12 +3,6 @@ source("../../shared/suites_qtta.py") global templateDir -def readFile(filename): - f = open(filename, "r") - content = f.read() - f.close() - return content - def copyToTemplateDir(filepath): global templateDir dst = os.path.join(templateDir, os.path.basename(filepath)) diff --git a/tests/system/suite_general/suite.conf b/tests/system/suite_general/suite.conf index 19ee1d31dfc..3a75d120de8 100644 --- a/tests/system/suite_general/suite.conf +++ b/tests/system/suite_general/suite.conf @@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false IMPLICITAUTSTART=0 LANGUAGE=Python OBJECTMAP=../objects.map -TEST_CASES=tst_build_speedcrunch tst_cmake_speedcrunch tst_create_proj_wizard tst_default_settings tst_installed_languages tst_openqt_creator +TEST_CASES=tst_build_speedcrunch tst_cmake_speedcrunch tst_create_proj_wizard tst_default_settings tst_installed_languages tst_openqt_creator tst_rename_file VERSION=2 WRAPPERS=Qt diff --git a/tests/system/suite_general/tst_rename_file/test.py b/tests/system/suite_general/tst_rename_file/test.py new file mode 100644 index 00000000000..fad2c7e78b6 --- /dev/null +++ b/tests/system/suite_general/tst_rename_file/test.py @@ -0,0 +1,78 @@ +source("../../shared/qtcreator.py") + +def main(): + # prepare example project + projectName = "declarative-music-browser" + sourceExample = os.path.join(sdkPath, "Examples", "QtMobility", projectName) + proFile = projectName + ".pro" + if not neededFilePresent(os.path.join(sourceExample, proFile)): + return + # copy example project to temp directory + templateDir = prepareTemplate(sourceExample) + + startApplication("qtcreator" + SettingsPath) + if not startedWithoutPluginError(): + return + usedProFile = os.path.join(templateDir, proFile) + openQmakeProject(usedProFile) + for filetype, filename in [["Headers", "utility.h"], + ["Sources", "main.cpp"], + ["Sources", "utility.cpp"], + ["Resources", "musicbrowser.qrc"], + ["QML", "musicbrowser.qml"]]: + filenames = ["ABCD" + filename.upper(), "abcd" + filename.lower(), "test", "TEST", filename] + if platform.system() == 'Darwin': + # avoid QTCREATORBUG-9197 + filtered = [filenames[0]] + for i in range(1, len(filenames)): + if filenames[i].lower() != filtered[-1].lower(): + filtered.append(filenames[i]) + filenames = filtered + for i in range(len(filenames)): + tempFiletype = filetype + if filetype == "QML" and filenames[i - 1][-4:] != ".qml": + tempFiletype = "Other files" + # workaround QTCREATORBUG-9191 + if filenames[i - 1][-4:].lower() == ".qml" and platform.system() in ('Windows', + 'Microsoft'): + tempFiletype = "QML" + renameFile(templateDir, usedProFile, projectName + "." + tempFiletype, + filenames[i - 1], filenames[i]) + invokeMenuItem("File", "Exit") + +def renameFile(projectDir, proFile, branch, oldname, newname): + oldFilePath = os.path.join(projectDir, oldname) + newFilePath = os.path.join(projectDir, newname) + oldFileText = readFile(oldFilePath) + itemText = branch + "." + oldname.replace(".", "\\.") + treeview = waitForObject(":Qt Creator_Utils::NavigationTreeView") + if platform.system() == 'Darwin': + JIRA.performWorkaroundForBug(8735, JIRA.Bug.CREATOR, treeview) + try: + openItemContextMenu(treeview, itemText, 5, 5, 0) + except: + openItemContextMenu(treeview, addBranchWildcardToRoot(itemText), 5, 5, 0) + activateItem(waitForObjectItem(":Qt Creator.Project.Menu.File_QMenu", "Rename...")) + type(waitForObject(":Qt Creator_Utils::NavigationTreeView::QExpandingLineEdit"), newname) + type(waitForObject(":Qt Creator_Utils::NavigationTreeView::QExpandingLineEdit"), "<Return>") + test.verify(waitFor("os.path.exists(newFilePath)", 1000), + "Verify that file with new name exists: %s" % newFilePath) + if not (oldname.lower() == newname.lower() and platform.system() in ('Windows', 'Microsoft')): + test.verify(not os.path.exists(oldFilePath), + "Verify that file with old name does not exist: %s" % oldFilePath) + test.compare(readFile(newFilePath), oldFileText, + "Comparing content of file before and after renaming") + test.verify(waitFor("newname in safeReadFile(proFile)", 2000), + "Verify that new filename '%s' was added to pro-file." % newname) + if not oldname in newname: + test.verify(not oldname in readFile(proFile), + "Verify that old filename '%s' was removed from pro-file." % oldname) + +def safeReadFile(filename): + text = "" + while text == "": + try: + text = readFile(filename) + except: + pass + return text From eac15b5e7d7c8ce61c70a2843384b41a820a2531 Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed <fawzi.mohamed@digia.com> Date: Wed, 24 Apr 2013 12:21:21 +0200 Subject: [PATCH 15/23] qmljs: add explicit -relocatable flag to qmlplugindumper and use it This will allow changing the default to nonrelocatable. Change-Id: I80746a3e70f94040a407cc25cec9ad6fac8b6fec Reviewed-by: Kai Koehne <kai.koehne@digia.com> --- share/qtcreator/qml/qmldump/main.cpp | 9 +++++++-- src/libs/qmljs/qmljsmodelmanagerinterface.h | 5 +++-- src/plugins/qmljstools/qmljsmodelmanager.cpp | 2 ++ src/plugins/qmljstools/qmljsplugindumper.cpp | 2 ++ src/plugins/qtsupport/baseqtversion.cpp | 7 +++++++ src/plugins/qtsupport/baseqtversion.h | 1 + src/plugins/qtsupport/qmldumptool.cpp | 1 + 7 files changed, 23 insertions(+), 4 deletions(-) diff --git a/share/qtcreator/qml/qmldump/main.cpp b/share/qtcreator/qml/qmldump/main.cpp index 6870f4d7f05..c455620274f 100644 --- a/share/qtcreator/qml/qmldump/main.cpp +++ b/share/qtcreator/qml/qmldump/main.cpp @@ -460,7 +460,7 @@ void sigSegvHandler(int) { void printUsage(const QString &appName) { qWarning() << qPrintable(QString( - "Usage: %1 [-v] [-notrelocatable] module.uri version [module/import/path]\n" + "Usage: %1 [-v] [-[non]relocatable] module.uri version [module/import/path]\n" " %1 [-v] -path path/to/qmldir/directory [version]\n" " %1 [-v] -builtins\n" "Example: %1 Qt.labs.particles 4.7 /home/user/dev/qt-install/imports").arg( @@ -507,8 +507,13 @@ int main(int argc, char *argv[]) } if (arg == QLatin1String("--notrelocatable") - || arg == QLatin1String("-notrelocatable")) { + || arg == QLatin1String("-notrelocatable") + || arg == QLatin1String("--nonrelocatable") + || arg == QLatin1String("-nonrelocatable")) { relocatable = false; + } else if (arg == QLatin1String("--relocatable") + || arg == QLatin1String("-relocatable")) { + relocatable = true; } else if (arg == QLatin1String("--path") || arg == QLatin1String("-path")) { action = Path; diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.h b/src/libs/qmljs/qmljsmodelmanagerinterface.h index d5d41e340cf..b708c3ca413 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.h +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.h @@ -57,12 +57,12 @@ public: { public: ProjectInfo() - : tryQmlDump(false) + : tryQmlDump(false), qmlDumpHasRelocatableFlag(true) { } ProjectInfo(QPointer<ProjectExplorer::Project> project) : project(project) - , tryQmlDump(false) + , tryQmlDump(false), qmlDumpHasRelocatableFlag(true) { } operator bool() const @@ -83,6 +83,7 @@ public: // whether trying to run qmldump makes sense bool tryQmlDump; + bool qmlDumpHasRelocatableFlag; QString qmlDumpPath; ::Utils::Environment qmlDumpEnvironment; diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp index a97a9449050..aa7ef5b550c 100644 --- a/src/plugins/qmljstools/qmljsmodelmanager.cpp +++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp @@ -135,9 +135,11 @@ ModelManagerInterface::ProjectInfo QmlJSTools::defaultProjectInfoForProject( toolChain, preferDebugDump, &projectInfo.qmlDumpPath, &projectInfo.qmlDumpEnvironment); + projectInfo.qmlDumpHasRelocatableFlag = qtVersion->hasQmlDumpWithRelocatableFlag(); } else { projectInfo.qmlDumpPath.clear(); projectInfo.qmlDumpEnvironment.clear(); + projectInfo.qmlDumpHasRelocatableFlag = true; } setupProjectInfoQmlBundles(projectInfo); return projectInfo; diff --git a/src/plugins/qmljstools/qmljsplugindumper.cpp b/src/plugins/qmljstools/qmljsplugindumper.cpp index 766024d9810..771d60b2667 100644 --- a/src/plugins/qmljstools/qmljsplugindumper.cpp +++ b/src/plugins/qmljstools/qmljsplugindumper.cpp @@ -433,6 +433,8 @@ void PluginDumper::dump(const Plugin &plugin) if (ComponentVersion(plugin.importVersion).isValid()) args << plugin.importVersion; } else { + if (info.qmlDumpHasRelocatableFlag) + args << QLatin1String("-relocatable"); args << plugin.importUri; args << plugin.importVersion; args << plugin.importPath; diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 3c6e54794b8..db214cc4a17 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -1097,6 +1097,13 @@ bool BaseQtVersion::hasQmlDump() const return m_hasQmlDump; } +bool BaseQtVersion::hasQmlDumpWithRelocatableFlag() const +{ + updateVersionInfo(); + return ((qtVersion() > QtVersionNumber(4, 8, 4) && qtVersion() < QtVersionNumber(5, 0, 0)) + || qtVersion() >= QtVersionNumber(5, 1, 0)); +} + bool BaseQtVersion::needsQmlDump() const { updateVersionInfo(); diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h index 1789314727b..a73f601dbc0 100644 --- a/src/plugins/qtsupport/baseqtversion.h +++ b/src/plugins/qtsupport/baseqtversion.h @@ -200,6 +200,7 @@ public: virtual bool hasGdbDebuggingHelper() const; virtual bool hasQmlDump() const; + virtual bool hasQmlDumpWithRelocatableFlag() const; virtual bool needsQmlDump() const; virtual bool hasQmlDebuggingLibrary() const; virtual bool needsQmlDebuggingLibrary() const; diff --git a/src/plugins/qtsupport/qmldumptool.cpp b/src/plugins/qtsupport/qmldumptool.cpp index 9921878e73b..fe1535275da 100644 --- a/src/plugins/qtsupport/qmldumptool.cpp +++ b/src/plugins/qtsupport/qmldumptool.cpp @@ -137,6 +137,7 @@ private slots: if (projectInfo.qmlDumpPath.isEmpty()) projectInfo.qmlDumpPath = version->qmlDumpTool(!update.preferDebug); projectInfo.qmlDumpEnvironment = version->qmlToolsEnvironment(); + projectInfo.qmlDumpHasRelocatableFlag = version->hasQmlDumpWithRelocatableFlag(); modelManager->updateProjectInfo(projectInfo); } From f3056f04b22c3c112da2f60ffe706116aec09b75 Mon Sep 17 00:00:00 2001 From: Christian Stenger <christian.stenger@digia.com> Date: Mon, 8 Apr 2013 11:18:43 +0200 Subject: [PATCH 16/23] Squish: Fix script for multiline strings If object names are scattered across multiple lines the script failed to get the whole object name and failed therefore. This patch corrects this behavior. Change-Id: Ia97e2577162b77ae1b72fdd51dda4c74c59abe25 Reviewed-by: Robert Loehning <robert.loehning@digia.com> --- tests/system/tools/findUnusedObjects.py | 30 +++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/tests/system/tools/findUnusedObjects.py b/tests/system/tools/findUnusedObjects.py index dfa8d283331..811660d5269 100755 --- a/tests/system/tools/findUnusedObjects.py +++ b/tests/system/tools/findUnusedObjects.py @@ -8,6 +8,8 @@ from toolfunctions import checkDirectory from toolfunctions import getFileContent objMap = None +lastToken = [None, None] +stopTokens = ('OP', 'NAME', 'NUMBER', 'ENDMARKER') def parseCommandLine(): global directory, onlyRemovable, fileType @@ -44,12 +46,32 @@ def getFileSuffix(): 'Tcl':'.tcl', 'Ruby':'.rb'} return fileSuffixes.get(fileType, None) +def handleStringsWithTrailingBackSlash(origStr): + try: + while True: + index = origStr.index("\\\n") + origStr = origStr[:index] + origStr[index+2:].lstrip() + except: + return origStr + def handle_token(tokenType, token, (startRow, startCol), (endRow, endCol), line): - global useCounts + global useCounts, lastToken, stopTokens + if tokenize.tok_name[tokenType] == 'STRING': - for obj in useCounts: - useCounts[obj] += str(token).count("'%s'" % obj) - useCounts[obj] += str(token).count('"%s"' % obj) + # concatenate strings followed directly by other strings + if lastToken[0] == 'STRING': + token = "'" + lastToken[1][1:-1] + str(token)[1:-1] + "'" + # store the new string as lastToken after removing potential trailing backslashes + # (including their following indentation) + lastToken = ['STRING' , handleStringsWithTrailingBackSlash(str(token))] + # if a stop token occurs check the potential string before it + elif tokenize.tok_name[tokenType] in stopTokens: + if lastToken[0] == 'STRING': + for obj in useCounts: + useCounts[obj] += lastToken[1].count("'%s'" % obj) + useCounts[obj] += lastToken[1].count('"%s"' % obj) + # store the stop token as lastToken + lastToken = [tokenize.tok_name[tokenType], str(token)] def findUsages(): global directory, objMap From 963a1015b7de66e046d7549294eab6a23fc0bb98 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann <Thomas.Hartmann@digia.com> Date: Sun, 28 Apr 2013 18:57:22 +0200 Subject: [PATCH 17/23] QmlDesigner.MetaInfo: adding requiredImport for Controls This was missing for a couple of items and creating confusion, if another item of the same name was used. Change-Id: I88746a3e700940404047cc25cec9ad6fac8b6fcc Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com> --- .../qmldesigner/componentsplugin/components.metainfo | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/plugins/qmldesigner/componentsplugin/components.metainfo b/src/plugins/qmldesigner/componentsplugin/components.metainfo index 6337597aa70..3c32d947669 100644 --- a/src/plugins/qmldesigner/componentsplugin/components.metainfo +++ b/src/plugins/qmldesigner/componentsplugin/components.metainfo @@ -80,6 +80,7 @@ MetaInfo { category: "Qt Quick - Controls" libraryIcon: ":/componentsplugin/images/buttonrow.png" version: "1.0" + requiredImport: "QtQuick.Controls" } } @@ -92,6 +93,7 @@ MetaInfo { category: "Qt Quick - Controls" libraryIcon: ":/componentsplugin/images/buttoncolumn.png" version: "1.0" + requiredImport: "QtQuick.Controls" } } @@ -104,6 +106,7 @@ MetaInfo { category: "Qt Quick - Controls" libraryIcon: ":/componentsplugin/images/label.png" version: "1.0" + requiredImport: "QtQuick.Controls" Property { name: "text"; type: "QString"; value: "Label"; } } @@ -118,6 +121,7 @@ MetaInfo { category: "Qt Quick - Controls" libraryIcon: ":/componentsplugin/images/textfield.png" version: "1.0" + requiredImport: "QtQuick.Controls" Property { name: "placeholderText"; type: "QString"; value: "Text Field"; } } @@ -132,6 +136,7 @@ MetaInfo { category: "Qt Quick - Controls" libraryIcon: ":/componentsplugin/images/textarea.png" version: "1.0" + requiredImport: "QtQuick.Controls" } } @@ -144,6 +149,7 @@ MetaInfo { category: "Qt Quick - Controls" libraryIcon: ":/componentsplugin/images/progressbar.png" version: "1.0" + requiredImport: "QtQuick.Controls" } } @@ -156,6 +162,7 @@ MetaInfo { category: "Qt Quick - Controls" libraryIcon: ":/componentsplugin/images/sliderh.png" version: "1.0" + requiredImport: "QtQuick.Controls" } ItemLibraryEntry { @@ -163,6 +170,7 @@ MetaInfo { category: "Qt Quick - Controls" libraryIcon: ":/componentsplugin/images/sliderh.png" version: "1.0" + requiredImport: "QtQuick.Controls" Property { name: "orientation"; type: "int"; value: "0"; } } } @@ -176,6 +184,7 @@ MetaInfo { category: "Qt Quick - Controls" libraryIcon: ":/componentsplugin/images/scrollbarh.png" version: "1.0" + requiredImport: "QtQuick.Controls" } ItemLibraryEntry { @@ -183,6 +192,7 @@ MetaInfo { category: "Qt Quick - Controls" libraryIcon: ":/componentsplugin/images/scrollbarv.png" version: "1.0" + requiredImport: "QtQuick.Controls" Property { name: "orientation"; type: "int"; value: "0"; } } } From 2d9343b264f3a9bc41d1f7bdcc4d1ad93bc97613 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann <Thomas.Hartmann@digia.com> Date: Sun, 28 Apr 2013 19:02:51 +0200 Subject: [PATCH 18/23] QmlDesigner.SubComponentManager: use ModelManager for import paths The model manager provides the import paths defined in .pro and .qmlproject files. Change-Id: I80846ace70f940400407cc25cec9ad6fac8b6fec Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com> --- .../qmldesigner/designercore/metainfo/subcomponentmanager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp b/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp index 761aa1ca2fc..09af54cd0a4 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp @@ -75,6 +75,8 @@ static inline QStringList importPaths() { .split(Utils::HostOsInfo::pathListSeparator(), QString::SkipEmptyParts); } + paths.append(QmlJS::ModelManagerInterface::instance()->importPaths()); + return paths; } From 12d1a184b1b46a5a2e9cc7a1b68f54105e3d1688 Mon Sep 17 00:00:00 2001 From: hluk <hluk@email.cz> Date: Fri, 26 Apr 2013 18:07:04 +0200 Subject: [PATCH 19/23] FakeVim: Focus current editor before handling command line command Action like "Switch Header/Source" need to be performed in correct context, in this case "CppEditor.C++Editor". But while command line is focused the context is global. Change-Id: Id9aa24641508a08f5196d314edc74644780c26d9 Reviewed-by: hjk <hjk121@nokiamail.com> --- src/plugins/fakevim/fakevimhandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 23159ea6a45..9a22d5174a5 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -4376,6 +4376,7 @@ EventResult FakeVimHandler::Private::handleExMode(const Input &input) // FIXME: Complete actual commands. g.commandBuffer.historyUp(); } else if (input.isReturn()) { + editor()->focus(); showMessage(MessageCommand, g.commandBuffer.display()); handleExCommand(g.commandBuffer.contents()); g.commandBuffer.clear(); From feeff29f2272fe922b7f7c8498208e342c33b54b Mon Sep 17 00:00:00 2001 From: hjk <hjk121@nokiamail.com> Date: Mon, 29 Apr 2013 08:23:31 +0200 Subject: [PATCH 20/23] Revert "FakeVim: Focus current editor before handling command line command" This reverts commit 316f15cb3b6ce8aedaaee5a954da9d99b1090350 Wrong branch, should be master. Change-Id: I700e8802300b8e1e093f73ea11e07c4cdb03b81a Reviewed-by: hjk <hjk121@nokiamail.com> --- src/plugins/fakevim/fakevimhandler.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 9a22d5174a5..23159ea6a45 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -4376,7 +4376,6 @@ EventResult FakeVimHandler::Private::handleExMode(const Input &input) // FIXME: Complete actual commands. g.commandBuffer.historyUp(); } else if (input.isReturn()) { - editor()->focus(); showMessage(MessageCommand, g.commandBuffer.display()); handleExCommand(g.commandBuffer.contents()); g.commandBuffer.clear(); From 4d18710f464c4a2d1171ec02c1aa3d6298d39cf6 Mon Sep 17 00:00:00 2001 From: Francois Ferrand <thetypz@gmail.com> Date: Thu, 25 Apr 2013 17:13:39 +0200 Subject: [PATCH 21/23] C++: fix handling of empty va_args macro arguments. Preprocessor did not correctly handle when variadic macro arguments were not provided at all, if there were other arguments: macro was not expanded in case only the non variadic arguments were given. #define MACRO(...) used to work fine for 0 or more arguments. #define MACRO(ARG0, ...) used to work only for 2 or more arguments, now fixed. Change-Id: I64e9199ceccae05618a49931c2adad8e4f9471ba Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> --- src/libs/cplusplus/pp-engine.cpp | 2 ++ .../preprocessor/tst_preprocessor.cpp | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp index 980f59c0a26..0aa11f0fee7 100644 --- a/src/libs/cplusplus/pp-engine.cpp +++ b/src/libs/cplusplus/pp-engine.cpp @@ -945,6 +945,8 @@ bool Preprocessor::handleIdentifier(PPToken *tk) bool hasMatchingArgs = false; if (hasArgs) { const int expectedArgCount = macro->formals().size(); + if (macro->isVariadic() && allArgTks.size() == expectedArgCount - 1) + allArgTks.push_back(QVector<PPToken>()); const int actualArgCount = allArgTks.size(); if (expectedArgCount == actualArgCount || (macro->isVariadic() && actualArgCount > expectedArgCount - 1) diff --git a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp index 2a985f5a099..61137c3788d 100644 --- a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp +++ b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp @@ -317,6 +317,7 @@ private: private slots: void va_args(); void named_va_args(); + void extra_va_args(); void defined(); void defined_data(); void empty_macro_args(); @@ -413,6 +414,23 @@ void tst_Preprocessor::named_va_args() QCOMPARE(simplified(preprocessed), QString("int f();int f(int a);int f(int a,int b);")); } +void tst_Preprocessor::extra_va_args() +{ + Client *client = 0; // no client. + Environment env; + + Preprocessor preprocess(client, &env); + QByteArray preprocessed = preprocess.run(QLatin1String("<stdin>"), + "#define foo(ret, ...) ret f(__VA_ARGS__);\n" + "\nfoo(int)\n" + "\nfoo(float,int b)\n" + "\nfoo(long,int b,int c)\n", + true, false); + + preprocessed = preprocessed.simplified(); + QCOMPARE(simplified(preprocessed), QString("int f();float f(int b);long f(int b,int c);")); +} + void tst_Preprocessor::empty_macro_args() { Client *client = 0; // no client. From 86c2342ed2ca9f2ae95f81e9f594328a8d0bf499 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh <orgad.shaneh@audiocodes.com> Date: Sun, 28 Apr 2013 21:05:02 +0300 Subject: [PATCH 22/23] Git: Fix Precedes/Follows display for show opened from log Change-Id: Ib999f8f00b065e4e51b70f1c5f81bdd17baabd8c Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> --- src/plugins/git/giteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp index fe2871ad89e..23eb2ba73c7 100644 --- a/src/plugins/git/giteditor.cpp +++ b/src/plugins/git/giteditor.cpp @@ -192,7 +192,7 @@ void GitEditor::setPlainTextDataFiltered(const QByteArray &a) } case VcsBase::DiffOutput: { const QFileInfo fi(source()); - const QString workingDirectory = fi.absolutePath(); + const QString workingDirectory = fi.isDir() ? fi.absoluteFilePath() : fi.absolutePath(); QByteArray precedes, follows; if (array.startsWith("commit ")) { // show int lastHeaderLine = array.indexOf("\n\n") + 1; From 71f1919de9a1ce0abc370fb2a1044ad6e85438cf Mon Sep 17 00:00:00 2001 From: Eike Ziller <eike.ziller@digia.com> Date: Mon, 22 Apr 2013 16:39:26 +0200 Subject: [PATCH 23/23] Mac: Deploy and patch qml imports and qml2puppet The patching of imports and plugins is done automatically by macdeployqt, we need to pass it the qml2puppet executable though. Also add Qml2Imports to the qml(2)puppet's qt.conf. Task-number: QTCREATORBUG-9136 Change-Id: I9cb21d104f4c0c42531facfc6bc92fa9663e95a9 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com> --- dist/installer/mac/qmlpuppet_qt.conf | 3 ++- qtcreator.pro | 2 +- scripts/deployqtHelper_mac.sh | 28 ++++++++++++++++++++++++---- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/dist/installer/mac/qmlpuppet_qt.conf b/dist/installer/mac/qmlpuppet_qt.conf index 9298042e36b..034fabe6f8a 100644 --- a/dist/installer/mac/qmlpuppet_qt.conf +++ b/dist/installer/mac/qmlpuppet_qt.conf @@ -1,3 +1,4 @@ [Paths] -Imports = ../.. +Imports = ../../../Imports/qtquick1 +Qml2Imports = ../../../Imports/qtquick2 Plugins = ../../../PlugIns diff --git a/qtcreator.pro b/qtcreator.pro index 091b6937991..9629d1e1849 100644 --- a/qtcreator.pro +++ b/qtcreator.pro @@ -52,7 +52,7 @@ macx { APPBUNDLE = "$$OUT_PWD/bin/Qt Creator.app" BINDIST_SOURCE = "$$OUT_PWD/bin/Qt Creator.app" BINDIST_INSTALLER_SOURCE = $$BINDIST_SOURCE - deployqt.commands = $$PWD/scripts/deployqtHelper_mac.sh \"$${APPBUNDLE}\" \"$$[QT_INSTALL_TRANSLATIONS]\" \"$$[QT_INSTALL_PLUGINS]\" + deployqt.commands = $$PWD/scripts/deployqtHelper_mac.sh \"$${APPBUNDLE}\" \"$$[QT_INSTALL_TRANSLATIONS]\" \"$$[QT_INSTALL_PLUGINS]\" \"$$[QT_INSTALL_IMPORTS]\" \"$$[QT_INSTALL_QML]\" codesign.commands = codesign -s \"$(SIGNING_IDENTITY)\" $(SIGNING_FLAGS) \"$${APPBUNDLE}\" dmg.commands = $$PWD/scripts/makedmg.sh $$OUT_PWD/bin qt-creator-$${PATTERN}.dmg dmg.depends = deployqt diff --git a/scripts/deployqtHelper_mac.sh b/scripts/deployqtHelper_mac.sh index 53836b7046f..bcb4b36fea2 100755 --- a/scripts/deployqtHelper_mac.sh +++ b/scripts/deployqtHelper_mac.sh @@ -1,5 +1,5 @@ #!/bin/bash -[ $# -lt 3 ] && echo "Usage: $(basename $0) <app folder> <qt translations folder> <qt plugin folder>" && exit 2 +[ $# -lt 5 ] && echo "Usage: $(basename $0) <app folder> <qt translations folder> <qt plugin folder> <qt quick imports folder> <qt quick 2 imports folder>" && exit 2 [ $(uname -s) != "Darwin" ] && echo "Run this script on Mac OS X" && exit 2; # collect designer plugins @@ -7,14 +7,34 @@ designerDestDir="$1/Contents/PlugIns/designer" test -d "$designerDestDir" || mkdir -p "$designerDestDir" for plugin in "$3"/designer/*.dylib; do cp "$plugin" "$designerDestDir"/ || exit 1 - pluginbase=`basename "$plugin"` - designerPluginArguments+="\"-executable=$designerDestDir/$pluginbase\" " done +# copy Qt Quick 1 imports +importsDir="$1/Contents/Imports/qtquick1" +if [ -d "$4" ]; then + test -d "$importsDir" || mkdir -p "$importsDir" + cp -R "$4"/ "$importsDir"/ +fi + +# copy Qt Quick 2 imports +imports2Dir="$1/Contents/Imports/qtquick2" +if [ -d "$5" ]; then + test -d "$imports2Dir" || mkdir -p "$imports2Dir" + cp -R "$5"/ "$imports2Dir"/ +fi + +qml2puppetapp="$1/Contents/MacOS/qml2puppet.app" +if [ -d "$qml2puppetapp" ]; then + qml2puppetArgument="-executable=$qml2puppetapp/Contents/MacOS/qml2puppet" + qml2puppetResources="$1/Contents/MacOS/qml2puppet.app/Contents/Resources" + test -d "$qml2puppetResources" || mkdir -p "$qml2puppetResources" + cp "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/qmlpuppet_qt.conf" "$qml2puppetResources/qt.conf" || exit 1 +fi + macdeployqt "$1" \ "-executable=$1/Contents/MacOS/qmlpuppet.app/Contents/MacOS/qmlpuppet" \ "-executable=$1/Contents/Resources/qtpromaker" \ - "-executable=$1/Contents/Resources/sdktool" $designerPluginArguments || exit 1 + "-executable=$1/Contents/Resources/sdktool" "$qml2puppetArgument" || exit 1 qmlpuppetResources="$1/Contents/MacOS/qmlpuppet.app/Contents/Resources" test -d "$qmlpuppetResources" || mkdir -p "$qmlpuppetResources"