diff --git a/.gitmodules b/.gitmodules index 3abc8f844da..9eb4a3af9d6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "qbs"] path = src/shared/qbs url = ../../qt-labs/qbs.git + ignore = dirty diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/graphicalnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/graphicalnodeinstance.cpp index 78431c75137..44384f34d6c 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/graphicalnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/graphicalnodeinstance.cpp @@ -12,6 +12,8 @@ #include #include +#include + namespace QmlDesigner { namespace Internal { @@ -499,6 +501,10 @@ void GraphicalNodeInstance::doComponentComplete() disableTextCursor(quickItem()); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)) + DesignerSupport::emitComponentCompleteSignalForAttachedProperty(quickItem()); +#endif + quickItem()->update(); } diff --git a/share/qtcreator/qmldesigner/propertyeditor/PropertyTemplates/StringEditorTemplate.template b/share/qtcreator/qmldesigner/propertyeditor/PropertyTemplates/StringEditorTemplate.template index 5152da59d68..625d9224ddf 100644 --- a/share/qtcreator/qmldesigner/propertyeditor/PropertyTemplates/StringEditorTemplate.template +++ b/share/qtcreator/qmldesigner/propertyeditor/PropertyTemplates/StringEditorTemplate.template @@ -7,6 +7,7 @@ QWidget { LineEdit { backendValue: backendValues.%2 baseStateFlag: isBaseState + translation: true } } } \ No newline at end of file diff --git a/share/qtcreator/templates/qml/qtquickcontrols/main.qml b/share/qtcreator/templates/qml/qtquickcontrols/main.qml new file mode 100644 index 00000000000..67a98612785 --- /dev/null +++ b/share/qtcreator/templates/qml/qtquickcontrols/main.qml @@ -0,0 +1,24 @@ +import QtQuick 2.0 +import QtQuick.Controls 1.0 +import QtQuick.Window 2.0 + +ApplicationWindow { + width: 640 + height: 480 + + menuBar: MenuBar { + Menu { + title: qsTr("File") + MenuItem { + text: qsTr("Exit") + onTriggered: Qt.quit(); + } + } + } + + Button { + text: qsTr("Hello World") + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + } +} diff --git a/share/qtcreator/templates/qml/qtquickcontrols/main.qmlproject b/share/qtcreator/templates/qml/qtquickcontrols/main.qmlproject new file mode 100644 index 00000000000..558f68d0351 --- /dev/null +++ b/share/qtcreator/templates/qml/qtquickcontrols/main.qmlproject @@ -0,0 +1,21 @@ +/* File generated by Qt Creator, version 2.7.0 */ + +import QmlProject 1.1 + +Project { +// QTC_REPLACE main.qml WITH main + mainFile: "main.qml" + + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ "../exampleplugin" ] +} diff --git a/share/qtcreator/templates/qml/qtquickcontrols/template.xml b/share/qtcreator/templates/qml/qtquickcontrols/template.xml new file mode 100644 index 00000000000..aea726ab21f --- /dev/null +++ b/share/qtcreator/templates/qml/qtquickcontrols/template.xml @@ -0,0 +1,7 @@ + + diff --git a/share/qtcreator/templates/wizards/qtquick2-extension/project.pro b/share/qtcreator/templates/wizards/qtquick2-extension/project.pro index 7c7794671bb..babf99d64fb 100644 --- a/share/qtcreator/templates/wizards/qtquick2-extension/project.pro +++ b/share/qtcreator/templates/wizards/qtquick2-extension/project.pro @@ -27,7 +27,7 @@ OTHER_FILES = qmldir qmldir.files = qmldir unix { - installPath = $$[QT_INSTALL_IMPORTS]/$$replace(uri, \\., /) + installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /) qmldir.path = $$installPath target.path = $$installPath INSTALLS += target qmldir diff --git a/share/qtcreator/welcomescreen/qtcreator_tutorials.xml b/share/qtcreator/welcomescreen/qtcreator_tutorials.xml index 8931f440051..816b82353d8 100644 --- a/share/qtcreator/welcomescreen/qtcreator_tutorials.xml +++ b/share/qtcreator/welcomescreen/qtcreator_tutorials.xml @@ -45,10 +45,6 @@ qt quick, qml - - - qt quick, qml - qt, webkit diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index 1f59b89fbb3..dcb7ddc5c67 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -280,6 +280,10 @@ bool AndroidManager::ensureIconAttribute(ProjectExplorer::Target *target) QString AndroidManager::targetSDK(ProjectExplorer::Target *target) { + QVariant v = target->namedSettings(QLatin1String("AndroidManager.TargetSdk")); + if (v.isValid()) + return v.toString(); + QString fallback = QLatin1String("android-8"); if (QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(target->kit())) if (qt->qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0)) @@ -287,6 +291,7 @@ QString AndroidManager::targetSDK(ProjectExplorer::Target *target) if (!createAndroidTemplatesIfNecessary(target)) return AndroidConfigurations::instance().bestMatch(fallback); + QFile file(defaultPropertiesPath(target).toString()); if (!file.open(QIODevice::ReadOnly)) return AndroidConfigurations::instance().bestMatch(fallback); @@ -301,6 +306,7 @@ QString AndroidManager::targetSDK(ProjectExplorer::Target *target) bool AndroidManager::setTargetSDK(ProjectExplorer::Target *target, const QString &sdk) { updateTarget(target, sdk, applicationName(target)); + target->setNamedSettings(QLatin1String("AndroidManager.TargetSdk"), sdk); return true; } diff --git a/src/plugins/android/androidqtversion.cpp b/src/plugins/android/androidqtversion.cpp index e92bc0240f0..b4e82b6cd2a 100644 --- a/src/plugins/android/androidqtversion.cpp +++ b/src/plugins/android/androidqtversion.cpp @@ -118,8 +118,6 @@ void AndroidQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::En if (AndroidConfigurations::instance().config().ndkLocation.isEmpty() || AndroidConfigurations::instance().config().sdkLocation.isEmpty()) return; - if (AndroidConfigurations::instance().sdkTargets().isEmpty()) - return; env.set(QLatin1String("ANDROID_NDK_PLATFORM"), AndroidConfigurations::instance().bestMatch(AndroidManager::targetSDK(target))); diff --git a/src/plugins/cmakeprojectmanager/cmakeuicodemodelsupport.h b/src/plugins/cmakeprojectmanager/cmakeuicodemodelsupport.h index c6d7f3c24c6..c68dafeed30 100644 --- a/src/plugins/cmakeprojectmanager/cmakeuicodemodelsupport.h +++ b/src/plugins/cmakeprojectmanager/cmakeuicodemodelsupport.h @@ -43,6 +43,7 @@ class CMakeProject; class CMakeUiCodeModelSupport : public CppTools::UiCodeModelSupport { + Q_OBJECT public: CMakeUiCodeModelSupport(CppTools::CppModelManagerInterface *modelmanager, CMakeProject *project, diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index d837c38151f..b51475093e5 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -2215,7 +2215,8 @@ void EditorManager::removeAllSplits() d->m_splitter->unsplitAll(); if (!editor) editor = pickUnusedEditor(); - activateEditor(editor); + if (editor) + activateEditor(editor); } void EditorManager::gotoOtherSplit() diff --git a/src/plugins/cpptools/abstracteditorsupport.h b/src/plugins/cpptools/abstracteditorsupport.h index 0e7f6f4109c..0c55994e74b 100644 --- a/src/plugins/cpptools/abstracteditorsupport.h +++ b/src/plugins/cpptools/abstracteditorsupport.h @@ -33,12 +33,14 @@ #include "cpptools_global.h" #include +#include namespace CppTools { class CppModelManagerInterface; -class CPPTOOLS_EXPORT AbstractEditorSupport +class CPPTOOLS_EXPORT AbstractEditorSupport : public QObject { + Q_OBJECT public: explicit AbstractEditorSupport(CppModelManagerInterface *modelmanager); virtual ~AbstractEditorSupport(); diff --git a/src/plugins/cpptools/uicodecompletionsupport.cpp b/src/plugins/cpptools/uicodecompletionsupport.cpp index b9e2f7bdde5..54403f9a93f 100644 --- a/src/plugins/cpptools/uicodecompletionsupport.cpp +++ b/src/plugins/cpptools/uicodecompletionsupport.cpp @@ -44,11 +44,12 @@ UiCodeModelSupport::UiCodeModelSupport(CppModelManagerInterface *modelmanager, : AbstractEditorSupport(modelmanager), m_sourceName(source), m_fileName(uiHeaderFile), - m_initialized(false), - m_running(false) + m_state(BARE) { if (debug) qDebug()<<"ctor UiCodeModelSupport for"< m_waitingForStart; }; } // CppTools diff --git a/src/plugins/debugger/qml/qmlinspectoragent.cpp b/src/plugins/debugger/qml/qmlinspectoragent.cpp index 0c2de93fcc3..8a65a59ab07 100644 --- a/src/plugins/debugger/qml/qmlinspectoragent.cpp +++ b/src/plugins/debugger/qml/qmlinspectoragent.cpp @@ -61,7 +61,6 @@ QmlInspectorAgent::QmlInspectorAgent(DebuggerEngine *engine, QObject *parent) , m_engineQueryId(0) , m_rootContextQueryId(0) , m_objectToSelect(-1) - , m_newObjectsCreated(false) { m_debugIdToIname.insert(-1, QByteArray("inspect")); connect(debuggerCore()->action(ShowQmlObjectTree), @@ -811,11 +810,6 @@ QList QmlInspectorAgent::buildWatchData(const ObjectReference &obj, // element makes sure we're queried on expansion. if (obj.needsMoreData()) return list; - - // To improve performance, we do not insert data for items - // that have not been previously queried when the object tree is refreshed. - if (m_newObjectsCreated) - append = false; } // properties @@ -886,10 +880,6 @@ void QmlInspectorAgent::clearObjectTree() m_debugIdToIname.clear(); m_debugIdToIname.insert(-1, QByteArray("inspect")); m_objectStack.clear(); - // reset only for qt > 4.8.3. - if (m_engineClient->objectName() != QLatin1String(QDECLARATIVE_ENGINE)) - m_newObjectsCreated = false; - removeAllObjectWatches(); } } // Internal diff --git a/src/plugins/debugger/qml/qmlinspectoragent.h b/src/plugins/debugger/qml/qmlinspectoragent.h index 5ea7561e316..d48d3e3cb95 100644 --- a/src/plugins/debugger/qml/qmlinspectoragent.h +++ b/src/plugins/debugger/qml/qmlinspectoragent.h @@ -143,7 +143,6 @@ private: QList m_objectWatches; QList m_fetchDataIds; QTimer m_delayQueryTimer; - bool m_newObjectsCreated; }; } // Internal diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 885a4b45f9c..1661e90d55c 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -2413,12 +2413,13 @@ void GitClient::handleMergeConflicts(const QString &workingDir, const QString &c { QString message = commit.isEmpty() ? tr("Conflicts detected") : tr("Conflicts detected with commit %1").arg(commit); - QMessageBox mergeOrAbort(QMessageBox::Question, tr("Conflicts Detected"), - message, QMessageBox::Ignore | QMessageBox::Abort); + QMessageBox mergeOrAbort(QMessageBox::Question, tr("Conflicts Detected"), message); QPushButton *mergeToolButton = mergeOrAbort.addButton(tr("Run &Merge Tool"), - QMessageBox::ActionRole); + QMessageBox::AcceptRole); + mergeOrAbort.addButton(QMessageBox::Ignore); if (abortCommand == QLatin1String("rebase")) - mergeOrAbort.addButton(tr("&Skip"), QMessageBox::ActionRole); + mergeOrAbort.addButton(tr("&Skip"), QMessageBox::RejectRole); + mergeOrAbort.addButton(QMessageBox::Abort); switch (mergeOrAbort.exec()) { case QMessageBox::Abort: synchronousAbortCommand(workingDir, abortCommand); diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp index bd6a5b4a5cc..695dc98c6f7 100644 --- a/src/plugins/projectexplorer/target.cpp +++ b/src/plugins/projectexplorer/target.cpp @@ -63,6 +63,7 @@ const char DC_COUNT_KEY[] = "ProjectExplorer.Target.DeployConfigurationCount"; const char ACTIVE_RC_KEY[] = "ProjectExplorer.Target.ActiveRunConfiguration"; const char RC_KEY_PREFIX[] = "ProjectExplorer.Target.RunConfiguration."; const char RC_COUNT_KEY[] = "ProjectExplorer.Target.RunConfigurationCount"; +const char PLUGIN_SETTINGS_KEY[] = "ProjectExplorer.Target.PluginSettings"; } // namespace @@ -92,6 +93,7 @@ public: RunConfiguration* m_activeRunConfiguration; DeploymentData m_deploymentData; BuildTargetInfoList m_appTargets; + QVariantMap m_pluginSettings; QPixmap m_connectedPixmap; QPixmap m_readyToUsePixmap; @@ -517,6 +519,8 @@ QVariantMap Target::toMap() const for (int i = 0; i < rcs.size(); ++i) map.insert(QString::fromLatin1(RC_KEY_PREFIX) + QString::number(i), rcs.at(i)->toMap()); + map.insert(QLatin1String(PLUGIN_SETTINGS_KEY), d->m_pluginSettings); + return map; } @@ -663,6 +667,19 @@ void Target::updateDefaultRunConfigurations() addRunConfiguration(rc); } +QVariant Target::namedSettings(const QString &name) const +{ + return d->m_pluginSettings.value(name); +} + +void Target::setNamedSettings(const QString &name, const QVariant &value) +{ + if (value.isNull()) + d->m_pluginSettings.remove(name); + else + d->m_pluginSettings.insert(name, value); +} + static QString formatToolTip(const IDevice::DeviceInfo &input) { QStringList lines; @@ -824,6 +841,9 @@ bool Target::fromMap(const QVariantMap &map) setActiveRunConfiguration(rc); } + if (map.contains(QLatin1String(PLUGIN_SETTINGS_KEY))) + d->m_pluginSettings = map.value(QLatin1String(PLUGIN_SETTINGS_KEY)).toMap(); + return true; } diff --git a/src/plugins/projectexplorer/target.h b/src/plugins/projectexplorer/target.h index 3583ffd0c6e..b9f36113c52 100644 --- a/src/plugins/projectexplorer/target.h +++ b/src/plugins/projectexplorer/target.h @@ -116,6 +116,8 @@ public: void updateDefaultDeployConfigurations(); void updateDefaultRunConfigurations(); + QVariant namedSettings(const QString &name) const; + void setNamedSettings(const QString &name, const QVariant &value); signals: void targetEnabled(bool); void iconChanged(); diff --git a/src/plugins/qmldesigner/componentsplugin/components.metainfo b/src/plugins/qmldesigner/componentsplugin/components.metainfo index 3c32d947669..2e775a4acb1 100644 --- a/src/plugins/qmldesigner/componentsplugin/components.metainfo +++ b/src/plugins/qmldesigner/componentsplugin/components.metainfo @@ -256,8 +256,7 @@ MetaInfo { version: "1.0" requiredImport: "QtQuick.Controls" - Property { name: "width"; type: "int"; value: 360; } - Property { name: "height"; type: "int"; value: 50; } + } } @@ -288,9 +287,6 @@ MetaInfo { libraryIcon: ":/desktopplugin/images/toolbar.png" version: "1.0" requiredImport: "QtQuick.Controls" - - Property { name: "width"; type: "int"; value: 360; } - Property { name: "height"; type: "int"; value: 50; } } } diff --git a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp index a026da45ca7..2640a29a6a4 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp @@ -77,7 +77,7 @@ using namespace QmlJS; typedef QPair PropertyInfo; -QList getObjectTypes(const ObjectValue *ov, const ContextPtr &context, bool local = false); +QList getObjectTypes(const ObjectValue *ov, const ContextPtr &context, bool local = false, int rec = 0); static TypeName resolveTypeName(const ASTPropertyReference *ref, const ContextPtr &context, QList &dotProperties) { @@ -219,7 +219,7 @@ QStringList prototypes(const ObjectValue *ov, const ContextPtr &context, bool ve return list; } -QList getQmlTypes(const CppComponentValue *objectValue, const ContextPtr &context, bool local = false) +QList getQmlTypes(const CppComponentValue *objectValue, const ContextPtr &context, bool local = false, int rec = 0) { QList propertyList; @@ -228,6 +228,9 @@ QList getQmlTypes(const CppComponentValue *objectValue, const Cont if (objectValue->className().isEmpty()) return propertyList; + if (rec > 2) + return propertyList; + PropertyMemberProcessor processor(context); objectValue->processMembers(&processor); @@ -239,7 +242,7 @@ QList getQmlTypes(const CppComponentValue *objectValue, const Cont //dot property const CppComponentValue * qmlValue = value_cast(objectValue->lookupMember(name, context)); if (qmlValue) { - QList dotProperties = getQmlTypes(qmlValue, context); + QList dotProperties = getQmlTypes(qmlValue, context, false, rec + 1); foreach (const PropertyInfo &propertyInfo, dotProperties) { PropertyName dotName = propertyInfo.first; TypeName type = propertyInfo.second; @@ -251,7 +254,7 @@ QList getQmlTypes(const CppComponentValue *objectValue, const Cont if (isValueType(objectValue->propertyType(name))) { const ObjectValue *dotObjectValue = value_cast(objectValue->lookupMember(name, context)); if (dotObjectValue) { - QList dotProperties = getObjectTypes(dotObjectValue, context); + QList dotProperties = getObjectTypes(dotObjectValue, context, false, rec + 1); foreach (const PropertyInfo &propertyInfo, dotProperties) { PropertyName dotName = propertyInfo.first; TypeName type = propertyInfo.second; @@ -272,9 +275,9 @@ QList getQmlTypes(const CppComponentValue *objectValue, const Cont const CppComponentValue * qmlObjectValue = value_cast(prototype); if (qmlObjectValue) - propertyList.append(getQmlTypes(qmlObjectValue, context)); + propertyList.append(getQmlTypes(qmlObjectValue, context, false, rec + 1)); else - propertyList.append(getObjectTypes(prototype, context)); + propertyList.append(getObjectTypes(prototype, context, false, rec + 1)); } return propertyList; @@ -320,7 +323,7 @@ QList getTypes(const ObjectValue *objectValue, const ContextPtr &c return propertyList; } -QList getObjectTypes(const ObjectValue *objectValue, const ContextPtr &context, bool local) +QList getObjectTypes(const ObjectValue *objectValue, const ContextPtr &context, bool local, int rec) { QList propertyList; @@ -329,6 +332,9 @@ QList getObjectTypes(const ObjectValue *objectValue, const Context if (objectValue->className().isEmpty()) return propertyList; + if (rec > 2) + return propertyList; + PropertyMemberProcessor processor(context); objectValue->processMembers(&processor); @@ -343,9 +349,9 @@ QList getObjectTypes(const ObjectValue *objectValue, const Context const CppComponentValue * qmlObjectValue = value_cast(prototype); if (qmlObjectValue) - propertyList.append(getQmlTypes(qmlObjectValue, context)); + propertyList.append(getQmlTypes(qmlObjectValue, context, local, rec + 1)); else - propertyList.append(getObjectTypes(prototype, context)); + propertyList.append(getObjectTypes(prototype, context, local, rec + 1)); } return propertyList; diff --git a/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp b/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp index b3d57ad05ac..52d0112ee61 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp @@ -101,7 +101,7 @@ static inline bool checkIfDerivedFromItem(const QString &fileName) snapshot.insert(document); - QmlJS::Link link(snapshot, QStringList(), QmlJS::ModelManagerInterface::instance()->builtins(document)); + QmlJS::Link link(snapshot, modelManager->importPaths(), QmlJS::ModelManagerInterface::instance()->builtins(document)); QList diagnosticLinkMessages; QmlJS::ContextPtr context = link(document, &diagnosticLinkMessages); @@ -116,15 +116,7 @@ static inline bool checkIfDerivedFromItem(const QString &fileName) if (!definition) return false; - QString fullTypeName; - for (QmlJS::AST::UiQualifiedId *iter = definition->qualifiedTypeNameId; iter; iter = iter->next) - if (!iter->name.isEmpty()) - fullTypeName += iter->name.toString() + QLatin1Char('.'); - - if (fullTypeName.endsWith(QLatin1Char('.'))) - fullTypeName.chop(1); - - const QmlJS::ObjectValue *objectValue = context->lookupType(document.data(), fullTypeName.split('.')); + const QmlJS::ObjectValue *objectValue = context->lookupType(document.data(), definition->qualifiedTypeNameId); QList prototypes = QmlJS::PrototypeIterator(objectValue, context).all(); diff --git a/src/plugins/qmlprofiler/qmlprofiler.qbs b/src/plugins/qmlprofiler/qmlprofiler.qbs index ff518734fe1..f19582516d8 100644 --- a/src/plugins/qmlprofiler/qmlprofiler.qbs +++ b/src/plugins/qmlprofiler/qmlprofiler.qbs @@ -76,7 +76,6 @@ QtcPlugin { "qml/RangeMover.qml", "qml/SelectionRange.qml", "qml/SelectionRangeDetails.qml", - "qml/StatusDisplay.qml", "qml/TimeDisplay.qml", "qml/TimeMarks.qml", "qml/qmlprofiler.qrc", diff --git a/src/plugins/qt4projectmanager/qtuicodemodelsupport.h b/src/plugins/qt4projectmanager/qtuicodemodelsupport.h index 3dd108d6a39..58d645ea22b 100644 --- a/src/plugins/qt4projectmanager/qtuicodemodelsupport.h +++ b/src/plugins/qt4projectmanager/qtuicodemodelsupport.h @@ -42,6 +42,7 @@ namespace Internal { class Qt4UiCodeModelSupport : public CppTools::UiCodeModelSupport { + Q_OBJECT public: Qt4UiCodeModelSupport(CppTools::CppModelManagerInterface *modelmanager, Qt4Project *project, diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index e4b8009baf2..7ede5e1b076 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -716,7 +716,7 @@ bool ExamplesListModelFilter::filterAcceptsRow(int sourceRow, const QModelIndex if (!m_showTutorialsOnly) { int type = sourceModel()->index(sourceRow, 0, sourceParent).data(Type).toInt(); - if (type != Example) + if (type != Example && type != Demo) return false; } diff --git a/tests/system/shared/build_utils.py b/tests/system/shared/build_utils.py index c99a62b0ec6..55ef8e81959 100644 --- a/tests/system/shared/build_utils.py +++ b/tests/system/shared/build_utils.py @@ -160,8 +160,7 @@ def selectBuildConfig(targetCount, currentTarget, configName): switchViewTo(ViewConstants.PROJECTS) switchToBuildOrRunSettingsFor(targetCount, currentTarget, ProjectSettings.BUILD) if selectFromCombo(":scrollArea.Edit build configuration:_QComboBox", configName): - waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", - "sourceFilesRefreshed(QStringList)") + progressBarWait(30000) return getQtInformationForBuildSettings(targetCount, True, ViewConstants.EDIT) # This will not trigger a rebuild. If needed, caller has to do this. diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 832a468792a..b7fcb5f5882 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -175,7 +175,7 @@ def createProject_Qt_GUI(path, projectName, checks = True): expectedFiles.extend(__sortFilenamesOSDependent__(["main.cpp", cpp_file, h_file, ui_file, pro_file])) __createProjectHandleLastPage__(expectedFiles) - waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 20000) + progressBarWait(20000) __verifyFileCreation__(path, expectedFiles) return checkedTargets @@ -199,7 +199,7 @@ def createProject_Qt_Console(path, projectName, checks = True): expectedFiles.extend(__sortFilenamesOSDependent__([cpp_file, pro_file])) __createProjectHandleLastPage__(expectedFiles) - waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 10000) + progressBarWait(10000) __verifyFileCreation__(path, expectedFiles) return checkedTargets @@ -224,7 +224,7 @@ def createNewQtQuickApplication(workingDir, projectName = None, templateFile = N clickButton(nextButton) __createProjectHandleLastPage__() - waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 10000) + progressBarWait(10000) return checkedTargets, projectName def createNewQtQuickUI(workingDir): diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 4bb0e36ef8f..b1f55dc5a64 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -609,9 +609,9 @@ def checkIfObjectExists(name, shouldExist = True, timeout = 3000, verboseOnFail return result # wait for progress bar(s) to appear and disappear -def progressBarWait(): +def progressBarWait(timeout=60000): checkIfObjectExists("{type='Core::Internal::ProgressBar' unnamed='1'}", True, 2000) - checkIfObjectExists("{type='Core::Internal::ProgressBar' unnamed='1'}", False, 60000) + checkIfObjectExists("{type='Core::Internal::ProgressBar' unnamed='1'}", False, timeout) def readFile(filename): f = open(filename, "r") diff --git a/tests/system/suite_CSUP/tst_CSUP04/test.py b/tests/system/suite_CSUP/tst_CSUP04/test.py index 405c5955181..05c7d5e4a69 100644 --- a/tests/system/suite_CSUP/tst_CSUP04/test.py +++ b/tests/system/suite_CSUP/tst_CSUP04/test.py @@ -19,7 +19,7 @@ def main(): openQmakeProject(examplePath) installLazySignalHandler("{type='Core::FutureProgress' unnamed='1'}", "finished()", "__handleFutureProgress__") # wait for parsing to complete - waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)") + progressBarWait(30000) # open .cpp file in editor if not openDocument("propertyanimation.Sources.main\\.cpp"): test.fatal("Could not open main.cpp") diff --git a/tests/system/suite_CSUP/tst_CSUP05/test.py b/tests/system/suite_CSUP/tst_CSUP05/test.py index 97dec22d1e3..174759e7da5 100644 --- a/tests/system/suite_CSUP/tst_CSUP05/test.py +++ b/tests/system/suite_CSUP/tst_CSUP05/test.py @@ -17,7 +17,7 @@ def main(): # open example project openQmakeProject(examplePath) # wait for parsing to complete - waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)") + progressBarWait(30000) # open .cpp file in editor if not openDocument("propertyanimation.Sources.main\\.cpp"): test.fatal("Could not open main.cpp") diff --git a/tests/system/suite_WELP/tst_WELP02/test.py b/tests/system/suite_WELP/tst_WELP02/test.py index a68f7554866..d8b359b0704 100644 --- a/tests/system/suite_WELP/tst_WELP02/test.py +++ b/tests/system/suite_WELP/tst_WELP02/test.py @@ -28,8 +28,7 @@ def main(): # select "Create Project" and try to create a new project. # create Qt Quick application from "Welcome" page -> "Develop" tab createNewQtQuickApplication(tempDir(), "SampleApp", fromWelcome = True) - waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", - "sourceFilesRefreshed(QStringList)") + progressBarWait(30000) test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'" " text~='SampleApp( \(.*\))?' type='QModelIndex'}"), "Verifying: The project is opened in 'Edit' mode after configuring.") @@ -42,8 +41,7 @@ def main(): examplePath = os.path.join(prepareTemplate(sourceExample), "propertyanimation.pro") # open example project from "Welcome" page -> "Develop" tab openQmakeProject(examplePath, fromWelcome = True) - waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", - "sourceFilesRefreshed(QStringList)") + progressBarWait(30000) test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'" " text~='propertyanimation( \(.*\))?' type='QModelIndex'}"), "Verifying: The project is opened in 'Edit' mode after configuring.") 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 c48332e0e6a..a19b28561e8 100644 --- a/tests/system/suite_editors/tst_basic_cpp_support/test.py +++ b/tests/system/suite_editors/tst_basic_cpp_support/test.py @@ -19,9 +19,8 @@ def main(): overrideInstallLazySignalHandler() installLazySignalHandler(":Qt Creator_CppEditor::Internal::CPPEditorWidget", "textChanged()", "__handleTextChanged__") - prepareForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)") openQmakeProject(proFile) - waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 20000) + progressBarWait(20000) selectFromLocator("dummy.cpp") ## Waiting for a solution from Froglogic to make the below work. diff --git a/tests/system/suite_general/tst_build_speedcrunch/test.py b/tests/system/suite_general/tst_build_speedcrunch/test.py index 9925be73db4..65b915023ba 100644 --- a/tests/system/suite_general/tst_build_speedcrunch/test.py +++ b/tests/system/suite_general/tst_build_speedcrunch/test.py @@ -21,7 +21,7 @@ def main(): if platform.system() in ('Windows', 'Microsoft'): suitableKits |= Targets.DESKTOP_474_MSVC2008 checkedTargets = openQmakeProject(SpeedCrunchPath, suitableKits) - waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)") + progressBarWait(30000) fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton") diff --git a/tests/system/suite_general/tst_cmake_speedcrunch/test.py b/tests/system/suite_general/tst_cmake_speedcrunch/test.py index feac26c9e3b..1521611fff5 100644 --- a/tests/system/suite_general/tst_cmake_speedcrunch/test.py +++ b/tests/system/suite_general/tst_cmake_speedcrunch/test.py @@ -21,7 +21,7 @@ def main(): test.fatal("Could not open/create cmake project - leaving test") invokeMenuItem("File", "Exit") return - waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)") + progressBarWait(30000) # Invoke a rebuild of the application invokeMenuItem("Build", "Rebuild All") diff --git a/tests/system/suite_general/tst_openqt_creator/test.py b/tests/system/suite_general/tst_openqt_creator/test.py index 7993d4b30eb..b6475fd6d9f 100644 --- a/tests/system/suite_general/tst_openqt_creator/test.py +++ b/tests/system/suite_general/tst_openqt_creator/test.py @@ -12,10 +12,10 @@ def main(): openQmakeProject(pathSpeedcrunch) # Wait for parsing to complete - waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)") + progressBarWait(30000) openQmakeProject(pathCreator) # Wait for parsing to complete - waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 300000) + progressBarWait(300000) naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s' type='QModelIndex'}" compareProjectTree(naviTreeView % "speedcrunch( \(\S+\))?", "projecttree_speedcrunch.tsv") diff --git a/tests/system/suite_qtquick/tst_qtquick_creation4/test.py b/tests/system/suite_qtquick/tst_qtquick_creation4/test.py index 3908ec9c423..d8ccecd7cbb 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation4/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation4/test.py @@ -7,7 +7,7 @@ def main(): # using a temporary directory won't mess up a potentially existing createNewQmlExtension(tempDir()) # wait for parsing to complete - waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)") + progressBarWait(30000) test.log("Building project") invokeMenuItem("Build","Build All") waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)")