diff --git a/.gitmodules b/.gitmodules index 3abc8f844dafe326d60f99b36af4df1f43e560b9..9eb4a3af9d688c49ed40a6da2b10098ada6a5414 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 78431c751378dc3c602fe3cd9611939c80cab339..44384f34d6cc78e43d8fac29ab1135206dcac12a 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/graphicalnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/graphicalnodeinstance.cpp @@ -12,6 +12,8 @@ #include <private/qquicktextinput_p.h> #include <private/qquicktextedit_p.h> +#include <designersupport.h> + 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 5152da59d68c813438ba4b2ed8eee3de987a924d..625d9224ddfb9452eb449f0593c567553e15d7b7 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 0000000000000000000000000000000000000000..67a98612785f67ee887c00bd01b3680325679d3a --- /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 0000000000000000000000000000000000000000..558f68d0351cd1f106b3b102515d3595c73e9d64 --- /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 0000000000000000000000000000000000000000..aea726ab21f99bfdeae72d2bf6be0df1a31ad39c --- /dev/null +++ b/share/qtcreator/templates/qml/qtquickcontrols/template.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<template openeditor="main.qml" priority="2" + featuresRequired="QtSupport.Wizards.FeatureQtQuickProject, QtSupport.Wizards.FeatureQtQuick, QtSupport.Wizards.FeatureQtQuick.2, QtSupport.Wizards.FeatureQtQuick.Controls" + id="QB.QML Application for Qt Quick 2.0"> + <displayname>Qt Quick 2 UI with Controls</displayname> + <description>Creates a Qt Quick 2 UI project with a single QML file that contains the main view and uses Qt Quick Controls.<br/>You can review Qt Quick 2 UI projects in the QML Scene and you need not build them. This project requires that you have installed Qt Quick Controls for your Qt version.<br/><br/>Requires <b>Qt 5.1</b> or newer.</description> +</template> diff --git a/share/qtcreator/templates/wizards/qtquick2-extension/project.pro b/share/qtcreator/templates/wizards/qtquick2-extension/project.pro index 7c7794671bbe0285df7acc1f7278dffca1436387..babf99d64fb712fc666e03909675be760db8b0ba 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 8931f44005173a9c212eacc271972078d4976bd9..816b82353d8e5310f1df2d09a37569f1e78833e9 100644 --- a/share/qtcreator/welcomescreen/qtcreator_tutorials.xml +++ b/share/qtcreator/welcomescreen/qtcreator_tutorials.xml @@ -45,10 +45,6 @@ <description><![CDATA[This talk discusses various QML best practices and design patterns for building powerful and scalable Qt Quick applications with QML and C++ code.]]></description> <tags>qt quick, qml</tags> </tutorial> - <tutorial imageUrl="images/icons/ddays11.png" difficulty="" projectPath="" name="Meet Qt and Qt Quick" isVideo="true" videoUrl="http://qt-project.org/videos/watch/qt-quick-best-practices-and-design-patterns" videoLength="1:07:43"> - <description><![CDATA[Are you fully aware of all you can really accomplish with Qt and Qt Quick? We’ll take you beyond the benefits of Qt and Qt Quick from a marketing standpoint and dive into the technical aspects of what they are and how they work together.]]></description> - <tags>qt quick, qml</tags> - </tutorial> <tutorial imageUrl="images/icons/ddays12.png" difficulty="" projectPath="" name="What is New in QtWebKit in 5.0" isVideo="true" videoUrl="http://www.youtube.com/watch?v=xEuapSGxaeU" videoLength="1:01:55"> <description><![CDATA[The web platform continues to evolve at breakneck speed. With our WebKit port to Qt 5 we are bringing these latest web technologies to the Qt world.]]></description> <tags>qt, webkit</tags> diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index 1f59b89fbb3dfbaadb7b4d5b513eb4b0941917bc..dcb7ddc5c67bca54b5c2fede81d5e6bc086a1695 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 e92bc0240f07a3d4a417c20670df916077ec16d8..b4e82b6cd2a1052e83ca9508fe1eedb4221bab1d 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 c6d7f3c24c64c7105672e8230e759ac52b68a1a3..c68dafeed30275863966696a1ee0d47cd87b3924 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 d837c38151f744165f8462420f0b14490875a7a0..b51475093e57d49a24dc06351d820be21c6975ce 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 0e7f6f4109ca9cf2613e86d4f0caf4506a5f2dab..0c55994e74be8ef57dd74e577e2ceb0f5184c466 100644 --- a/src/plugins/cpptools/abstracteditorsupport.h +++ b/src/plugins/cpptools/abstracteditorsupport.h @@ -33,12 +33,14 @@ #include "cpptools_global.h" #include <QString> +#include <QObject> 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 b9e2f7bdde55badc5e37ef0e9a8ee7e52670c2be..54403f9a93f08b3a54a1b885d9a5bcb3a52ed4c6 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_sourceName<<uiHeaderFile; + connect(&m_process, SIGNAL(finished(int)), + this, SLOT(finishProcess())); } UiCodeModelSupport::~UiCodeModelSupport() @@ -59,7 +60,8 @@ UiCodeModelSupport::~UiCodeModelSupport() void UiCodeModelSupport::init() const { - m_initialized = true; + if (m_state != BARE) + return; QDateTime sourceTime = QFileInfo(m_sourceName).lastModified(); QFileInfo uiHeaderFileInfo(m_fileName); QDateTime uiHeaderTime = uiHeaderFileInfo.exists() ? uiHeaderFileInfo.lastModified() : QDateTime(); @@ -71,6 +73,7 @@ void UiCodeModelSupport::init() const QTextStream stream(&file); m_contents = stream.readAll().toUtf8(); m_cacheTime = uiHeaderTime; + m_state = FINISHED; return; } } @@ -91,20 +94,25 @@ void UiCodeModelSupport::init() const qDebug()<<"uic run wasn't succesfull"; m_cacheTime = QDateTime (); m_contents = QByteArray(); + m_state = FINISHED; return; } } else { if (debug) qDebug()<<"Could open "<<m_sourceName<<"needed for the cpp model"; m_contents = QByteArray(); + m_state = FINISHED; } } QByteArray UiCodeModelSupport::contents() const { - if (!m_initialized) + // Check the common case first + if (m_state == FINISHED) + return m_contents; + if (m_state == BARE) init(); - if (m_running) + if (m_state == RUNNING) finishProcess(); return m_contents; @@ -120,13 +128,16 @@ void UiCodeModelSupport::setFileName(const QString &name) if (m_fileName == name && m_cacheTime.isValid()) return; + if (m_state == RUNNING) + finishProcess(); + if (debug) qDebug() << "UiCodeModelSupport::setFileName"<<name; m_fileName = name; m_contents.clear(); m_cacheTime = QDateTime(); - init(); + m_state = BARE; } bool UiCodeModelSupport::runUic(const QString &ui) const @@ -145,19 +156,23 @@ bool UiCodeModelSupport::runUic(const QString &ui) const if (!m_process.waitForBytesWritten(3000)) goto error; m_process.closeWriteChannel(); - m_running = true; + m_state = RUNNING; return true; error: if (debug) qDebug() << "failed" << m_process.readAllStandardError(); m_process.kill(); - m_running = false; + m_state = FINISHED; return false; } void UiCodeModelSupport::updateFromEditor(const QString &formEditorContents) { + if (m_state == BARE) + init(); + if (m_state == RUNNING) + finishProcess(); if (runUic(formEditorContents)) if (finishProcess()) updateDocument(); @@ -165,23 +180,29 @@ void UiCodeModelSupport::updateFromEditor(const QString &formEditorContents) bool UiCodeModelSupport::finishProcess() const { - if (!m_running) + if (m_state != RUNNING) return false; if (!m_process.waitForFinished(3000) && m_process.exitStatus() != QProcess::NormalExit && m_process.exitCode() != 0) { + if (m_state != RUNNING) // waitForFinished can recurse into finishProcess + return false; + if (debug) qDebug() << "failed" << m_process.readAllStandardError(); m_process.kill(); - m_running = false; + m_state = FINISHED; return false; } + if (m_state != RUNNING) // waitForFinished can recurse into finishProcess + return true; + m_contents = m_process.readAllStandardOutput(); m_cacheTime = QDateTime::currentDateTime(); if (debug) qDebug() << "ok" << m_contents.size() << "bytes."; - m_running = false; + m_state = FINISHED; return true; } @@ -189,6 +210,10 @@ void UiCodeModelSupport::updateFromBuild() { if (debug) qDebug()<<"UiCodeModelSupport::updateFromBuild() for file"<<m_sourceName; + if (m_state == BARE) + init(); + if (m_state == RUNNING) + finishProcess(); // This is mostly a fall back for the cases when uic couldn't be run // it pays special attention to the case where a ui_*h was newly created QDateTime sourceTime = QFileInfo(m_sourceName).lastModified(); diff --git a/src/plugins/cpptools/uicodecompletionsupport.h b/src/plugins/cpptools/uicodecompletionsupport.h index 6bfd86430f6aa85849af61ab53b71a69bc9a2431..df56b544dea7f3c13cb63fddbdf6948126a303e2 100644 --- a/src/plugins/cpptools/uicodecompletionsupport.h +++ b/src/plugins/cpptools/uicodecompletionsupport.h @@ -42,6 +42,7 @@ namespace CppTools { class CPPTOOLS_EXPORT UiCodeModelSupport : public AbstractEditorSupport { + Q_OBJECT public: UiCodeModelSupport(CppTools::CppModelManagerInterface *modelmanager, const QString &sourceFile, @@ -57,16 +58,18 @@ protected: virtual QString uicCommand() const = 0; virtual QStringList environment() const = 0; private: + enum State { BARE, RUNNING, FINISHED }; + void init() const; bool runUic(const QString &ui) const; - bool finishProcess() const; + Q_SLOT bool finishProcess() const; mutable QProcess m_process; QString m_sourceName; QString m_fileName; - mutable bool m_initialized; + mutable State m_state; mutable QByteArray m_contents; mutable QDateTime m_cacheTime; - mutable bool m_running; + static QList<UiCodeModelSupport *> m_waitingForStart; }; } // CppTools diff --git a/src/plugins/debugger/qml/qmlinspectoragent.cpp b/src/plugins/debugger/qml/qmlinspectoragent.cpp index 0c2de93fcc3be62643e6e42f6760662437b9f552..8a65a59ab07fcb8881f4ad5edda1d5d9b05bfd3d 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<WatchData> 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 5ea7561e316cf977068bd6070d22c5ed4993754a..d48d3e3cb95a803abe3dadeea6c5d661abda72c9 100644 --- a/src/plugins/debugger/qml/qmlinspectoragent.h +++ b/src/plugins/debugger/qml/qmlinspectoragent.h @@ -143,7 +143,6 @@ private: QList<int> m_objectWatches; QList<int> m_fetchDataIds; QTimer m_delayQueryTimer; - bool m_newObjectsCreated; }; } // Internal diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 885a4b45f9c381ce552c22c95492068a11fb0cf3..1661e90d55c591d3107e96aeea85e29748529fa2 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 bd6a5b4a5cca371698f05ea0af4d7c42147810bb..695dc98c6f7d370506527131249214f5eaa110df 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 3583ffd0c6ef7f7f228dc6dba9ee9a4dea418f3d..b9f36113c528f550efd0e4ab482b87dc572e7417 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 3c32d94766919e31c4fe4fbb1c8106e16bc102b0..2e775a4acb1633ce23768a5ada72cbbffa0886c6 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 a026da45ca7179094b84ae634aafcc00852df5f5..2640a29a6a4dbffb77fbf16f162bca0065fe1499 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<PropertyName, TypeName> PropertyInfo; -QList<PropertyInfo> getObjectTypes(const ObjectValue *ov, const ContextPtr &context, bool local = false); +QList<PropertyInfo> getObjectTypes(const ObjectValue *ov, const ContextPtr &context, bool local = false, int rec = 0); static TypeName resolveTypeName(const ASTPropertyReference *ref, const ContextPtr &context, QList<PropertyInfo> &dotProperties) { @@ -219,7 +219,7 @@ QStringList prototypes(const ObjectValue *ov, const ContextPtr &context, bool ve return list; } -QList<PropertyInfo> getQmlTypes(const CppComponentValue *objectValue, const ContextPtr &context, bool local = false) +QList<PropertyInfo> getQmlTypes(const CppComponentValue *objectValue, const ContextPtr &context, bool local = false, int rec = 0) { QList<PropertyInfo> propertyList; @@ -228,6 +228,9 @@ QList<PropertyInfo> 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<PropertyInfo> getQmlTypes(const CppComponentValue *objectValue, const Cont //dot property const CppComponentValue * qmlValue = value_cast<CppComponentValue>(objectValue->lookupMember(name, context)); if (qmlValue) { - QList<PropertyInfo> dotProperties = getQmlTypes(qmlValue, context); + QList<PropertyInfo> 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<PropertyInfo> getQmlTypes(const CppComponentValue *objectValue, const Cont if (isValueType(objectValue->propertyType(name))) { const ObjectValue *dotObjectValue = value_cast<ObjectValue>(objectValue->lookupMember(name, context)); if (dotObjectValue) { - QList<PropertyInfo> dotProperties = getObjectTypes(dotObjectValue, context); + QList<PropertyInfo> 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<PropertyInfo> getQmlTypes(const CppComponentValue *objectValue, const Cont const CppComponentValue * qmlObjectValue = value_cast<CppComponentValue>(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<PropertyInfo> getTypes(const ObjectValue *objectValue, const ContextPtr &c return propertyList; } -QList<PropertyInfo> getObjectTypes(const ObjectValue *objectValue, const ContextPtr &context, bool local) +QList<PropertyInfo> getObjectTypes(const ObjectValue *objectValue, const ContextPtr &context, bool local, int rec) { QList<PropertyInfo> propertyList; @@ -329,6 +332,9 @@ QList<PropertyInfo> 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<PropertyInfo> getObjectTypes(const ObjectValue *objectValue, const Context const CppComponentValue * qmlObjectValue = value_cast<CppComponentValue>(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 b3d57ad05ace89ddfb488e9542ebedc0792d7125..52d0112ee613e2774db272af42407283b3eee036 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<QmlJS::DiagnosticMessage> 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<const QmlJS::ObjectValue *> prototypes = QmlJS::PrototypeIterator(objectValue, context).all(); diff --git a/src/plugins/qmlprofiler/qmlprofiler.qbs b/src/plugins/qmlprofiler/qmlprofiler.qbs index ff518734fe190a847c914a2c8ccbe6f26f02d72e..f19582516d8638faa279d518be316e6abd3c2267 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 3dd108d6a393de34741a92cacac7d224a4feba6b..58d645ea22bb76f09a0527ed4302d7789e6a3e7c 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 e4b8009baf2b84d8586124e59e6313ff30d99641..7ede5e1b0760da51794ccde5e86b54002e0c1249 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 c99a62b0ec6630e914fdab0a4403e9b6dccc7624..55ef8e81959de93f206c08d3c3ca058d9b2c09f6 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 832a468792ae3883e211ccd7cbec79bc0e1406ef..b7fcb5f5882c55c02103eef91cd070d65e78918c 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 4bb0e36ef8fae34906c6ae13fede8ffa8198d36a..b1f55dc5a64abe43cfaa9df7078ba3d55f3a9e44 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 405c59551811ea1d3c2c608bae38d1b2a8b7a312..05c7d5e4a692020a8ed155c18c3604edbdd895be 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 97dec22d1e3fa8a6262263b1f4fd99f02324cb6e..174759e7da5ade0b593942c5c7d85093dbe55951 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 a68f7554866eb3a5b44c5229728763a386d50c52..d8b359b07043aa466a8629e536ce5a0781b71489 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 c48332e0e6a2284603fb6f2997aa04c34de26aa9..a19b28561e898391ac80db0b7c39deadb0ca72d5 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 9925be73db4d7a1baf947125ba2379667e284c3a..65b915023baa361442e4a117e4b7aafbdbda0b0b 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 feac26c9e3bee2171ab1f0ec2200bb64dc546a81..1521611fff5b08da5c8ca2206bdfb179b10ae737 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 7993d4b30ebc8bc6f025c24f562ee085a984abb6..b6475fd6d9f78c726ad246ae48811dd89c707b71 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 3908ec9c423f3559d36ca32406d6faacb6544d9b..d8ccecd7cbb7d3b92bd9e4a89fe134b64f57bcde 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)")