From f0d5ad714e7487b16e6c068d15f108a5d983afaf Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 3 Dec 2012 15:28:34 +0100 Subject: [PATCH 1/5] QmlProject: Don't add Qt import on command line Actually this can lead to crashes if passing the QtQuick1 import path to qmlscene. The removed code was introduced in 404186a919b5655054. However, the Qt import path for the code model is also added in QmlProject::refresh(). Task-number: QTCREATORBUG-8365 Change-Id: I8581ce3d67c83c0f27d7b8aefedf9765935bedbc Reviewed-by: Fawzi Mohamed --- src/plugins/qmlprojectmanager/qmlproject.cpp | 18 ++---------------- src/plugins/qmlprojectmanager/qmlproject.h | 2 +- .../qmlprojectrunconfiguration.cpp | 2 +- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index abd4f2e5a46..a598d5d93a1 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -170,7 +170,7 @@ void QmlProject::refresh(RefreshOptions options) QmlJS::ModelManagerInterface::ProjectInfo pinfo(this); pinfo.sourceFiles = files(); - pinfo.importPaths = importPaths(); + pinfo.importPaths = customImportPaths(); QtSupport::BaseQtVersion *version = 0; if (activeTarget()) { ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(activeTarget()->kit()); @@ -220,26 +220,12 @@ bool QmlProject::validProjectFile() const return !m_projectItem.isNull(); } -QStringList QmlProject::importPaths() const +QStringList QmlProject::customImportPaths() const { QStringList importPaths; if (m_projectItem) importPaths = m_projectItem.data()->importPaths(); - // add the default import path for the target Qt version - if (activeTarget()) { - const QmlProjectRunConfiguration *runConfig = - qobject_cast(activeTarget()->activeRunConfiguration()); - if (runConfig) { - const QtSupport::BaseQtVersion *qtVersion = runConfig->qtVersion(); - if (qtVersion && qtVersion->isValid()) { - const QString qtVersionImportPath = qtVersion->qmakeProperty("QT_INSTALL_IMPORTS"); - if (!qtVersionImportPath.isEmpty()) - importPaths += qtVersionImportPath; - } - } - } - return importPaths; } diff --git a/src/plugins/qmlprojectmanager/qmlproject.h b/src/plugins/qmlprojectmanager/qmlproject.h index af49bfa284d..26b66917fe8 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.h +++ b/src/plugins/qmlprojectmanager/qmlproject.h @@ -87,7 +87,7 @@ public: QDir projectDir() const; QStringList files() const; QString mainFile() const; - QStringList importPaths() const; + QStringList customImportPaths() const; bool addFiles(const QStringList &filePaths); diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index 6d16731a375..4ffa15fef4b 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -144,7 +144,7 @@ QString QmlProjectRunConfiguration::viewerArguments() const // arguments from .qmlproject file QmlProject *project = static_cast(target()->project()); - foreach (const QString &importPath, project->importPaths()) { + foreach (const QString &importPath, project->customImportPaths()) { Utils::QtcProcess::addArg(&args, "-I"); Utils::QtcProcess::addArg(&args, importPath); } From 6f6ee546cdb16f4bcd354577f62012108c4ec66f Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 19 Nov 2012 15:49:33 +0100 Subject: [PATCH 2/5] Squish: Added some to list of test files Task-number: QTCREATORBUG-8272 Change-Id: I248ee83c5f6b5db4189ac1b5458ba5f884a996a9 Reviewed-by: Christian Stenger --- tests/system/suite_editors/shared/testdata/files.tsv | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/system/suite_editors/shared/testdata/files.tsv b/tests/system/suite_editors/shared/testdata/files.tsv index bc9ade18138..cfdf5d87933 100644 --- a/tests/system/suite_editors/shared/testdata/files.tsv +++ b/tests/system/suite_editors/shared/testdata/files.tsv @@ -3,3 +3,6 @@ "creator/qtcreator.pri" "creator/doc/snippets/qml/list-of-transitions.qml" "creator/share/qtcreator/glsl/glsl_120.frag" +"creator/tests/manual/cplusplus-frontend/conf.c++" +"creator/src/plugins/coreplugin/basefilewizard.cpp" +"creator/src/plugins/coreplugin/basefilewizard.h" From f47ca8f4d6d6c27e2e64c7e7354b406414e68c5e Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 30 Nov 2012 09:22:12 +0100 Subject: [PATCH 3/5] Squish: Fix tst_qtquick_creation4 Change-Id: Iff7ce74c947dba7522b47991fb0217916dee921a Reviewed-by: Robert Loehning --- tests/system/shared/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 56a6880d09f..a4ec2ac349b 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -231,7 +231,7 @@ def createNewQtQuickUI(workingDir): return projectName def createNewQmlExtension(workingDir): - available = __createProjectOrFileSelectType__(" Libraries", "Custom QML Extension Plugin") + available = __createProjectOrFileSelectType__(" Libraries", "Qt Quick 1 Extension Plugin") if workingDir == None: workingDir = tempDir() __createProjectSetNameAndPath__(workingDir) From 04e8abfa4c289b86a1e415174b2ea62ee9c1641d Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 30 Nov 2012 09:18:54 +0100 Subject: [PATCH 4/5] Squish: Fix tst_create_proj_wizard Change-Id: Id1609b5c4f46036e7a5fb90cd7fc720bd27c1844 Reviewed-by: Robert Loehning --- tests/system/suite_general/tst_create_proj_wizard/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/suite_general/tst_create_proj_wizard/test.py b/tests/system/suite_general/tst_create_proj_wizard/test.py index 237171db037..86010337913 100644 --- a/tests/system/suite_general/tst_create_proj_wizard/test.py +++ b/tests/system/suite_general/tst_create_proj_wizard/test.py @@ -34,7 +34,7 @@ def main(): for template in dumpItems(templatesView.model(), templatesView.rootIndex()): template = template.replace(".", "\\.") # skip non-configurable - if "Qt Quick UI" in template or "Plain C" in template: + if "Qt Quick 1 UI" in template or "Plain C" in template: continue availableProjectTypes.append({category:template}) clickButton(waitForObject("{text='Cancel' type='QPushButton' unnamed='1' visible='1'}")) From 8a6d5ccd365e14a5597c1bf043dbf4fb04f34560 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 28 Nov 2012 11:34:15 +0100 Subject: [PATCH 5/5] Squish: Fix usage of Qt Quick UI wizard Change-Id: I51aee75d695ab8faa8090dc44fd4abb79b0181b6 Reviewed-by: Robert Loehning --- tests/system/shared/hook_utils.py | 3 +-- tests/system/shared/project.py | 2 +- tests/system/suite_qtquick/tst_qtquick_creation3/test.py | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/system/shared/hook_utils.py b/tests/system/shared/hook_utils.py index 96509e23ce5..aad61157c6f 100644 --- a/tests/system/shared/hook_utils.py +++ b/tests/system/shared/hook_utils.py @@ -54,8 +54,7 @@ def modifyRunSettingsForHookInto(projectName, port): switchViewTo(ViewConstants.EDIT) return result -def modifyRunSettingsForHookIntoQtQuickUI(projectName, port): - global workingDir +def modifyRunSettingsForHookIntoQtQuickUI(workingDir, projectName, port): switchViewTo(ViewConstants.PROJECTS) switchToBuildOrRunSettingsFor(1, 0, ProjectSettings.RUN, True) diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index a4ec2ac349b..f2980d9b271 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -223,7 +223,7 @@ def createNewQtQuickApplication(workingDir, projectName = None, templateFile = N return projectName def createNewQtQuickUI(workingDir): - __createProjectOrFileSelectType__(" Applications", "Qt Quick UI") + __createProjectOrFileSelectType__(" Applications", "Qt Quick 1 UI") if workingDir == None: workingDir = tempDir() projectName = __createProjectSetNameAndPath__(workingDir) diff --git a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py index fc6345ca884..b3a7e8b7ea8 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py @@ -1,13 +1,12 @@ source("../../shared/qtcreator.py") def main(): - global workingDir startApplication("qtcreator" + SettingsPath) # using a temporary directory won't mess up a potentially existing workingDir = tempDir() projectName = createNewQtQuickUI(workingDir) test.log("Running project") - qmlViewer = modifyRunSettingsForHookIntoQtQuickUI(projectName, 11223) + qmlViewer = modifyRunSettingsForHookIntoQtQuickUI(workingDir, projectName, 11223) if qmlViewer!=None: qmlViewerPath = os.path.dirname(qmlViewer) qmlViewer = os.path.basename(qmlViewer)