diff --git a/doc/api/qtcreator-documentation.qdoc b/doc/api/qtcreator-documentation.qdoc index 935f6d10690..28e1b32fdc4 100644 --- a/doc/api/qtcreator-documentation.qdoc +++ b/doc/api/qtcreator-documentation.qdoc @@ -339,24 +339,17 @@ Besides \c docs, you have the following options: \list - \li html_docs - build \QC Manual in help format, but do not generate a - help file + \li html_docs_qtcreator - build \QC Manual in help format, but do not + generate a help file - \li dev_html_docs - build Extending \QC Manual in help format, but do - not generate a help file + \li html_docs_qtcreator-dev - build Extending \QC Manual in help + format, but do not generate a help file - \li qch_docs - build \QC Manual in help format and generate a help file - (.qch) + \li qch_docs_qtcreator - build \QC Manual in help format and generate + a help file (.qch) - \li dev_qch_docs - build Extending \QC Manual in help format and - generate a help file (.qch) - - \li docs_online - build \QC Manual and Extending \QC Manual in online - format - - \li html_docs_online - build \QC Manual in online format - - \li dev_html_docs_online - build Extending \QC Manual in online format + \li qch_docs_qtcreator-dev - build Extending \QC Manual in help format + and generate a help file (.qch) \endlist */ diff --git a/doc/src/qtquick/qtquick-iso-icon-browser.qdoc b/doc/src/qtquick/creator-only/qtquick-iso-icon-browser.qdoc similarity index 94% rename from doc/src/qtquick/qtquick-iso-icon-browser.qdoc rename to doc/src/qtquick/creator-only/qtquick-iso-icon-browser.qdoc index efc216a7f6c..c84529b2982 100644 --- a/doc/src/qtquick/qtquick-iso-icon-browser.qdoc +++ b/doc/src/qtquick/creator-only/qtquick-iso-icon-browser.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -26,13 +26,8 @@ /*! \contentspage index.html \page qtquick-iso-icon-browser.html - \if defined(qtdesignstudio) \previouspage qmldesigner-pathview-editor.html \nextpage creator-quick-ui-forms.html - \else - \previouspage quick-states.html - \nextpage quick-export-to-qml.html - \endif \title Browsing ISO 7000 Icons diff --git a/doc/src/qtquick/qtquick-components.qdoc b/doc/src/qtquick/qtquick-components.qdoc index 36190f81060..4cee65201f9 100644 --- a/doc/src/qtquick/qtquick-components.qdoc +++ b/doc/src/qtquick/qtquick-components.qdoc @@ -92,24 +92,24 @@ You can use the following QML types to create components: \list - \li \l [QML]{AnimatedImage}{Animated Image} provides a way to play + \li \l [QtQuick]{AnimatedImage}{Animated Image} provides a way to play animations stored as images containing a series of frames, such as those stored in GIF files. - \li \l [QML]{BorderImage}{Border Image} uses an image as a border or + \li \l [QtQuick]{BorderImage}{Border Image} uses an image as a border or background. - \li \l [QML]{Image} adds a bitmap to the scene. You can stretch and + \li \l [QtQuick]{Image} adds a bitmap to the scene. You can stretch and tile images. - \li \l [QML]{Item} is the most basic of all visual types in QML. Even + \li \l [QtQuick]{Item} is the most basic of all visual types in QML. Even though it has no visual appearance, it defines all the properties that are common across visual types, such as the x and y position, width and height, anchoring, and key handling. - \li \l [QML]{Rectangle} adds a rectangle that is painted with a solid + \li \l [QtQuick] {Rectangle} adds a rectangle that is painted with a solid fill color and an optional border. You can use the radius property to create rounded rectangles. - \li \l [QML]{Text} adds formatted read-only text. - \li \l [QML]{TextEdit}{Text Edit} adds a single line of editable + \li \l [QtQuick]{Text} adds formatted read-only text. + \li \l [QtQuick]{TextEdit}{Text Edit} adds a single line of editable formatted text that can be validated. - \li \l [QML]{TextInput}{Text Input} adds a single line of editable + \li \l [QtQuick]{TextInput}{Text Input} adds a single line of editable plain text that can be validated. \endlist @@ -267,12 +267,12 @@ You can use the following positioners to arrange items in UIs: \list - \li \l[QML] {Column} arranges its child items vertically. - \li \l[QML] {Row} arranges its child items horizontally. - \li \l[QML] {Grid} + \li \l[QtQuick] {Column} arranges its child items vertically. + \li \l[QtQuick] {Row} arranges its child items horizontally. + \li \l[QtQuick] {Grid} arranges its child items so that they are aligned in a grid and are not overlapping. - \li \l[QML] {Flow} + \li \l[QtQuick] {Flow} arranges its child items side by side, wrapping as necessary. \endlist @@ -365,7 +365,7 @@ \li \l{FocusScope}{Focus Scope} assists in keyboard focus handling when building reusable QML components. - \li \l [QML]{MouseArea}{Mouse Area} enables simple mouse handling. + \li \l [QtQuick]{MouseArea}{Mouse Area} enables simple mouse handling. \endlist Since Qt 5.7, you can also use the following \l{Qt Quick Controls} types diff --git a/doc/src/qtquick/qtquick-connection-editor-bindings.qdoc b/doc/src/qtquick/qtquick-connection-editor-bindings.qdoc index 2f5c1ec54b3..daee35732c6 100644 --- a/doc/src/qtquick/qtquick-connection-editor-bindings.qdoc +++ b/doc/src/qtquick/qtquick-connection-editor-bindings.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -56,14 +56,14 @@ \li In the \uicontrol {Connections} view, select the \uicontrol {Bindings} tab. \li Select the \inlineimage plus.png - (\uicontrol Add) button to add a binding. - \li Select \uicontrol Item to select the target object whose property - you want to change dynamically. - \li Select \uicontrol Property to select the property to bind to a - source property. - \li Select \uicontrol {Source Item} to select the object whose property - you want to use to determine the behavior of the target object. - \li Select \uicontrol {Source Property} to select the property to bind - the target property to. + (\uicontrol Add) button to add a binding for the currently selected + item. The ID is displayed in the \uicontrol Item column. + \li Double-click the value in the \uicontrol Property column to select + the property to bind to a source property. + \li Double-click the value in the \uicontrol {Source Item} column to + select the object whose property you want to use to determine the + behavior of the target object. + \li Double-click the value in the \uicontrol {Source Property} column + to select the property to bind the target property to. \endlist */ diff --git a/doc/src/qtquick/qtquick-connection-editor-properties.qdoc b/doc/src/qtquick/qtquick-connection-editor-properties.qdoc index 22881283277..7b6168dc788 100644 --- a/doc/src/qtquick/qtquick-connection-editor-properties.qdoc +++ b/doc/src/qtquick/qtquick-connection-editor-properties.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -46,13 +46,16 @@ \list 1 \li In the \uicontrol {Connections} view, select the \uicontrol {Properties} tab. - \li Select \uicontrol Item to select the object to specify the property - for. - \li Select \uicontrol Property to give a name to the property. - \li Select \uicontrol {Property Type} to specify the type of the - property. - \li Select \uicontrol {Property Value} to specify the value of the - property. + \li Select the \inlineimage plus.png + (\uicontrol Add) button to add a dynamic property for the currently + selected item. The item ID is displayed in the \uicontrol Item + column. + \li Double-click the value in the \uicontrol Property column to give a + name to the property. + \li Double-click the value in the \uicontrol {Property Type} column to + specify the type of the property. + \li Double-click the value in the \uicontrol {Property Value} column + to specify the value of the property. \endlist */ diff --git a/doc/src/qtquick/qtquick-connection-editor-signals.qdoc b/doc/src/qtquick/qtquick-connection-editor-signals.qdoc index 010ab17847b..a9e221ce73e 100644 --- a/doc/src/qtquick/qtquick-connection-editor-signals.qdoc +++ b/doc/src/qtquick/qtquick-connection-editor-signals.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -61,11 +61,18 @@ \uicontrol {Connections} tab. \li Select the \inlineimage plus.png (\uicontrol Add) button to add a connection. - \li Select \uicontrol Target to add the object to connect to a signal. - \li Select \uicontrol {Signal Handler} to select the signal that the - connection will listen to from a list of all signals available for - the object. - \li Select \uicontrol Actions to specify the action to perform when - the signal is emitted. You use JavaScript to specify the actions. + \li Double-click the value in the \uicontrol Target column to add the + object to connect to a signal. + \li Double-click the value in the \uicontrol {Signal Handler} column to + select the signal that the connection will listen to from a list of + all signals available for the object. + \li Double-click the value in the \uicontrol Actions column to specify + the action to perform when the signal is emitted. You use JavaScript + to specify the actions. \endlist + + \if defined(qtdesignstudio) + For an example of connecting the \c clicked signal of a button to a + \l{Adding States}{state}, see \l {Log In UI - Part 3}. + \endif */ diff --git a/doc/src/qtquick/qtquick-connection-editor.qdoc b/doc/src/qtquick/qtquick-connection-editor.qdoc index 57953505654..ad781ab5d4b 100644 --- a/doc/src/qtquick/qtquick-connection-editor.qdoc +++ b/doc/src/qtquick/qtquick-connection-editor.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -70,4 +70,7 @@ \li \l{Managing C++ Backend Objects} \endif \endlist + + For an example of using properties, bindings, and connections to create a + scalable push button, see \l{Creating Scalable Buttons and Borders}. */ diff --git a/doc/src/qtquick/qtquick-pathview-editor.qdoc b/doc/src/qtquick/qtquick-pathview-editor.qdoc index bd4f4bd8519..16cfad2e790 100644 --- a/doc/src/qtquick/qtquick-pathview-editor.qdoc +++ b/doc/src/qtquick/qtquick-pathview-editor.qdoc @@ -28,10 +28,12 @@ \page qmldesigner-pathview-editor.html \if defined(qtdesignstudio) \previouspage studio-fonts.html + \nextpage creator-quick-ui-forms.html \else \previouspage quick-states.html - \endif \nextpage qtquick-iso-icon-browser.html + \endif + \title Editing PathView Properties @@ -64,4 +66,8 @@ initiates mouse dragging and what is the rate at which a flick will decelerate. + \if defined(qtdesignstudio) + \note You can also use the \l SvgPath Qt Quick Studio Component to + specify an SVG path data string that draws a path. + \endif */ diff --git a/doc/src/qtquick/qtquick-states.qdoc b/doc/src/qtquick/qtquick-states.qdoc index 2cf02445210..975e1f09598 100644 --- a/doc/src/qtquick/qtquick-states.qdoc +++ b/doc/src/qtquick/qtquick-states.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -161,4 +161,8 @@ You can use the \uicontrol {Text Editor} to specify transitions. For more information, see \l{Transition}. + + Alternatively, you can use the \uicontrol Timeline view to animate the + properties of UI components and to bind the animations to states. For more + information, see \l {Binding Animations to States}. */ diff --git a/doc/src/qtquick/qtquick-timeline.qdoc b/doc/src/qtquick/qtquick-timeline.qdoc index 0904fd908da..3462330208d 100644 --- a/doc/src/qtquick/qtquick-timeline.qdoc +++ b/doc/src/qtquick/qtquick-timeline.qdoc @@ -312,11 +312,11 @@ You can use the Studio components to animate the following shapes: \list - \li Arc - \li Border - \li Pie - \li Rectangle - \li Triangle + \li \l Arc + \li \l Border + \li \l Pie + \li \l Rectangle + \li \l Triangle \endlist \endif */ diff --git a/doc/src/qtquick/qtquick-ui-forms.qdoc b/doc/src/qtquick/qtquick-ui-forms.qdoc index 16ce57a7e72..6ec6313ccf3 100644 --- a/doc/src/qtquick/qtquick-ui-forms.qdoc +++ b/doc/src/qtquick/qtquick-ui-forms.qdoc @@ -33,10 +33,11 @@ \contentspage index.html \page creator-quick-ui-forms.html - \previouspage qtquick-iso-icon-browser.html \if defined(qtdesignstudio) + \previouspage qmldesigner-pathview-editor.html \nextpage studio-live-preview.html \else + \previouspage qtquick-iso-icon-browser.html \nextpage quick-export-to-qml.html \endif diff --git a/share/qtcreator/qml-type-descriptions/qt5QtQuick2-bundle.json b/share/qtcreator/qml-type-descriptions/qt5QtQuick2-bundle.json index 9f797b4a265..031afcb50b9 100644 --- a/share/qtcreator/qml-type-descriptions/qt5QtQuick2-bundle.json +++ b/share/qtcreator/qml-type-descriptions/qt5QtQuick2-bundle.json @@ -108,14 +108,17 @@ "QtQuick.Controls 2.3", "QtQuick.Controls 2.4", "QtQuick.Controls 2.5", + "QtQuick.Controls 2.12", "QtQuick.Controls.Material 2.0", "QtQuick.Controls.Material 2.1", "QtQuick.Controls.Material 2.2", "QtQuick.Controls.Material 2.3", + "QtQuick.Controls.Material 2.12", "QtQuick.Controls.Universal 2.0", "QtQuick.Controls.Universal 2.1", "QtQuick.Controls.Universal 2.2", "QtQuick.Controls.Universal 2.3", + "QtQuick.Controls.Universal 2.12", "QtQuick.Controls.Styles 1.0", "QtQuick.Controls.Styles 1.1", "QtQuick.Controls.Styles 1.2", @@ -140,6 +143,7 @@ "QtQuick.Templates 2.1", "QtQuick.Templates 2.2", "QtQuick.Templates 2.5", + "QtQuick.Templates 2.12", "QtQuick.Window 2.0", "QtQuick.Window 2.1", "QtQuick.Window 2.2", diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml index 7a573d94c53..ac8fce9285c 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml @@ -295,12 +295,12 @@ Column { anchors.leftMargin: 12 anchors.rightMargin: 6 - anchors.topMargin: 24 + anchors.topMargin: 28 anchors.bottomMargin: 6 Label { text: "X1" - width: 16 + width: 18 tooltip: qsTr("Defines the start point for color interpolation.") } @@ -310,7 +310,7 @@ Column { Label { text: "X2" - width: 16 + width: 18 tooltip: qsTr("Defines the end point for color interpolation.") } @@ -320,7 +320,7 @@ Column { Label { text: "y1" - width: 16 + width: 18 tooltip: qsTr("Defines the start point for color interpolation.") } @@ -330,7 +330,7 @@ Column { Label { text: "Y2" - width: 16 + width: 18 tooltip: qsTr("Defines the end point for color interpolation.") } @@ -361,7 +361,6 @@ Column { GradientDialogPopup { id: gradientDialogPopupRadial dialogHeight: 140 - dialogWidth: 340 content: GridLayout { rowSpacing: 4 anchors.fill: parent @@ -373,12 +372,12 @@ Column { anchors.leftMargin: 12 anchors.rightMargin: 6 - anchors.topMargin: 24 + anchors.topMargin: 28 anchors.bottomMargin: 6 Label { text: "CenterX" - width: 54 + width: 64 tooltip: qsTr("Defines the center point.") } @@ -388,7 +387,7 @@ Column { Label { text: "CenterY" - width: 54 + width: 64 tooltip: qsTr("Defines the center point.") } @@ -398,7 +397,7 @@ Column { Label { text: "FocalX" - width: 54 + width: 64 tooltip: qsTr("Defines the focal point.") } @@ -408,7 +407,7 @@ Column { Label { text: "FocalY" - width: 54 + width: 64 tooltip: qsTr("Defines the focal point.") } @@ -418,7 +417,7 @@ Column { Label { text: "Center Radius" - width: 54 + width: 64 tooltip: qsTr("Defines the center point.") } @@ -428,7 +427,7 @@ Column { Label { text: "Focal Radius" - width: 54 + width: 64 tooltip: qsTr("Defines the focal radius. Set to 0 for simple radial gradients.") } @@ -471,12 +470,12 @@ Column { anchors.leftMargin: 12 anchors.rightMargin: 6 - anchors.topMargin: 24 + anchors.topMargin: 28 anchors.bottomMargin: 6 Label { text: "CenterX" - width: 32 + width: 64 tooltip: qsTr("Defines the center point.") } @@ -486,7 +485,7 @@ Column { Label { text: "CenterY" - width: 32 + width: 64 tooltip: qsTr("Defines the center point.") } @@ -496,7 +495,7 @@ Column { Label { text: "Angle" - width: 32 + width: 64 tooltip: qsTr("Defines the start angle for the conical gradient. The value is in degrees (0-360).") } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientDialogPopup.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientDialogPopup.qml index e0a12de911e..bbfc5525c7f 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientDialogPopup.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientDialogPopup.qml @@ -44,7 +44,7 @@ Loader { property Component content property int dialogHeight: 240 - property int dialogWidth: 280 + property int dialogWidth: 440 sourceComponent: Component { FocusScope { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPropertySpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPropertySpinBox.qml index fc4f2db38f1..4ca86b097d3 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPropertySpinBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPropertySpinBox.qml @@ -31,6 +31,8 @@ import QtQuick.Controls.Styles 1.1 DoubleSpinBox { id: spinBox + width: 82 + Layout.minimumWidth: 82 property string propertyName diff --git a/share/qtcreator/templates/wizards/projects/qmake/empty/wizard.json b/share/qtcreator/templates/wizards/projects/qmake/empty/wizard.json index 19e10a84171..84f019c222f 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/empty/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qmake/empty/wizard.json @@ -45,7 +45,8 @@ { "source": "file.pro", "target": "%{ProFileName}", - "openAsProject": true + "openAsProject": true, + "openInEditor": true }, { "source": "../../git.ignore", diff --git a/src/app/main.cpp b/src/app/main.cpp index 27412c3d062..17e2d3bf298 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -234,8 +234,12 @@ static inline QStringList getPluginPaths() Core::Constants::IDE_DISPLAY_NAME : Core::Constants::IDE_ID); pluginPath += QLatin1String("/plugins/"); - pluginPath += QLatin1String(Core::Constants::IDE_VERSION_LONG); - rc.push_back(pluginPath); + // Qt Creator X.Y.Z can load plugins from X.Y.(Z-1) etc, so add current and previous + // patch versions + const QString minorVersion = QString::number(IDE_VERSION_MAJOR) + '.' + + QString::number(IDE_VERSION_MINOR) + '.'; + for (int patchVersion = IDE_VERSION_RELEASE; patchVersion >= 0; --patchVersion) + rc.push_back(pluginPath + minorVersion + QString::number(patchVersion)); return rc; } diff --git a/src/libs/languageserverprotocol/lsptypes.cpp b/src/libs/languageserverprotocol/lsptypes.cpp index 2b3e2628b37..991f7cc1f83 100644 --- a/src/libs/languageserverprotocol/lsptypes.cpp +++ b/src/libs/languageserverprotocol/lsptypes.cpp @@ -53,8 +53,8 @@ Utils::optional Diagnostic::code() const if (codeValue.isUndefined()) return Utils::nullopt; QJsonValue::Type type = it.value().type(); - QTC_ASSERT(type == QJsonValue::String || type == QJsonValue::Double, - return Utils::make_optional(Code(QString()))); + if (type != QJsonValue::String && type != QJsonValue::Double) + return Utils::make_optional(Code(QString())); return Utils::make_optional(codeValue.isDouble() ? Code(codeValue.toInt()) : Code(codeValue.toString())); } @@ -81,8 +81,7 @@ Utils::optional WorkspaceEdit::changes() const auto it = find(changesKey); if (it == end()) return Utils::nullopt; - QTC_ASSERT(it.value().type() == QJsonValue::Object, return Changes()); - QJsonObject changesObject(it.value().toObject()); + const QJsonObject &changesObject = it.value().toObject(); Changes changesResult; for (const QString &key : changesObject.keys()) changesResult[DocumentUri::fromProtocol(key)] = LanguageClientArray(changesObject.value(key)).toList(); @@ -122,11 +121,13 @@ MarkupOrString::MarkupOrString(const MarkupContent &val) MarkupOrString::MarkupOrString(const QJsonValue &val) { - QTC_ASSERT(val.isString() | val.isObject(), return); - if (val.isString()) + if (val.isString()) { emplace(val.toString()); - else - emplace(MarkupContent(val.toObject())); + } else { + MarkupContent markupContent(val.toObject()); + if (markupContent.isValid(nullptr)) + emplace(MarkupContent(val.toObject())); + } } bool MarkupOrString::isValid(QStringList *error) const @@ -401,9 +402,7 @@ Utils::Link Location::toLink() const DocumentUri::DocumentUri(const QString &other) : QUrl(QUrl::fromPercentEncoding(other.toLocal8Bit())) -{ - QTC_ASSERT(isValid(), qWarning() << other); -} +{ } DocumentUri::DocumentUri(const Utils::FileName &other) : QUrl(QUrl::fromLocalFile(other.toString())) diff --git a/src/libs/languageserverprotocol/lsputils.cpp b/src/libs/languageserverprotocol/lsputils.cpp index 40d782c9f6c..aceeed73920 100644 --- a/src/libs/languageserverprotocol/lsputils.cpp +++ b/src/libs/languageserverprotocol/lsputils.cpp @@ -28,42 +28,50 @@ #include #include +#include #include namespace LanguageServerProtocol { +Q_LOGGING_CATEGORY(conversionLog, "qtc.languageserverprotocol.conversion", QtWarningMsg) + template<> QString fromJsonValue(const QJsonValue &value) { - QTC_ASSERT(value.isString(), return QString()); + if (conversionLog().isDebugEnabled() && !value.isString()) + qCDebug(conversionLog) << "Expected String in json value but got: " << value; return value.toString(); } template<> int fromJsonValue(const QJsonValue &value) { - QTC_ASSERT(value.isDouble(), return 0); - return int(value.toDouble()); + if (conversionLog().isDebugEnabled() && !value.isDouble()) + qCDebug(conversionLog) << "Expected double in json value but got: " << value; + return value.toInt(); } template<> double fromJsonValue(const QJsonValue &value) { - QTC_ASSERT(value.isDouble(), return 0); + if (conversionLog().isDebugEnabled() && !value.isDouble()) + qCDebug(conversionLog) << "Expected double in json value but got: " << value; return value.toDouble(); } template<> bool fromJsonValue(const QJsonValue &value) { - QTC_ASSERT(value.isBool(), return false); + if (conversionLog().isDebugEnabled() && !value.isBool()) + qCDebug(conversionLog) << "Expected bool in json value but got: " << value; return value.toBool(); } template<> QJsonArray fromJsonValue(const QJsonValue &value) { - QTC_ASSERT(value.isArray(), return QJsonArray()); + if (conversionLog().isDebugEnabled() && !value.isArray()) + qCDebug(conversionLog) << "Expected Array in json value but got: " << value; return value.toArray(); } diff --git a/src/libs/languageserverprotocol/lsputils.h b/src/libs/languageserverprotocol/lsputils.h index a0ce7533250..4646f181e9b 100644 --- a/src/libs/languageserverprotocol/lsputils.h +++ b/src/libs/languageserverprotocol/lsputils.h @@ -35,13 +35,17 @@ #include #include +#include namespace LanguageServerProtocol { +LANGUAGESERVERPROTOCOL_EXPORT Q_DECLARE_LOGGING_CATEGORY(conversionLog) + template T fromJsonValue(const QJsonValue &value) { - QTC_ASSERT(value.isObject(), return T()); + if (conversionLog().isDebugEnabled() && !value.isObject()) + qCDebug(conversionLog) << "Expected Object in json value but got: " << value; return T(value.toObject()); } diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 4be3ce3a1ed..62fbe7a3f12 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -2306,7 +2306,9 @@ void EditorManagerPrivate::findInDirectory() { if (!d->m_contextMenuEntry || d->m_contextMenuEntry->fileName().isEmpty()) return; - emit m_instance->findOnFileSystemRequest(d->m_contextMenuEntry->fileName().parentDir().toString()); + const FileName path = d->m_contextMenuEntry->fileName(); + emit m_instance->findOnFileSystemRequest( + (path.toFileInfo().isDir() ? path : path.parentDir()).toString()); } void EditorManagerPrivate::togglePinned() diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index e711c00a4a0..727e464b434 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -869,6 +869,16 @@ static void getExpandedCompilerFlags(QStringList &cFlags, QStringList &cxxFlags, cFlags << "-std=c99"; else if (!cLanguageVersion.isEmpty()) cFlags << ("-std=" + cLanguageVersion.first()); + + if (targetOS.contains("darwin")) { + const auto darwinVersion = getCppProp("minimumDarwinVersion").toString(); + if (!darwinVersion.isEmpty()) { + const auto darwinVersionFlag = getCppProp("minimumDarwinVersionCompilerFlag") + .toString(); + if (!darwinVersionFlag.isEmpty()) + cxxFlags << (darwinVersionFlag + '=' + darwinVersion); + } + } } else if (toolchain.contains("msvc")) { if (enableExceptions.toBool()) { const QString exceptionModel = getCppProp("exceptionHandlingModel").toString(); diff --git a/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp index 2a7412c4c65..a162ef33c56 100644 --- a/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp +++ b/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp @@ -26,9 +26,11 @@ #include "qbsrunconfiguration.h" #include "qbsnodes.h" +#include "qbspmlogging.h" #include "qbsprojectmanagerconstants.h" #include "qbsproject.h" +#include #include #include #include @@ -64,8 +66,13 @@ QbsRunConfiguration::QbsRunConfiguration(Target *target, Core::Id id) return; } BuildTargetInfo bti = buildTargetInfo(); - if (bti.runEnvModifier) + if (bti.runEnvModifier) { + if (project()->isParsing() || BuildManager::isBuilding(this->target())) { + qCDebug(qbsPmLog) << "qbs project in flux, cannot modify environment"; + return; // Intentionally skips the cache update below. + } bti.runEnvModifier(env, usingLibraryPaths); + } m_envCache.insert(key, env); }); diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp index 0070c14bf78..50a3d35af4c 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp @@ -234,6 +234,16 @@ QSet QmakePriFile::files(const FileType &type) const return m_files.value(type); } +const QSet QmakePriFile::collectFiles(const FileType &type) const +{ + QSet allFiles = files(type); + for (const QmakePriFile * const priFile : qAsConst(m_children)) { + if (!dynamic_cast(priFile)) + allFiles.unite(priFile->collectFiles(type)); + } + return allFiles; +} + QmakePriFile::~QmakePriFile() { watchFolders( {} ); @@ -1957,11 +1967,10 @@ QList QmakeProFile::extraCompilers() const void QmakeProFile::setupExtraCompiler(const FileName &buildDir, const FileType &fileType, ExtraCompilerFactory *factory) { - foreach (const FileName &fn, files(fileType)) { + for (const FileName &fn : collectFiles(fileType)) { const FileNameList generated = generatedFiles(buildDir, fn, fileType); - if (!generated.isEmpty()) { + if (!generated.isEmpty()) m_extraCompilers.append(factory->create(m_project, fn, generated)); - } } } diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.h b/src/plugins/qmakeprojectmanager/qmakeparsernodes.h index fb343cd07f1..8147b19d5f2 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.h +++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.h @@ -133,8 +133,12 @@ public: void makeEmpty(); + // Files of the specified type declared in this file. QSet files(const ProjectExplorer::FileType &type) const; + // Files of the specified type declared in this file and in included .pri files. + const QSet collectFiles(const ProjectExplorer::FileType &type) const; + void update(const Internal::QmakePriFileEvalResult &result); bool canAddSubProject(const QString &proFilePath) const; diff --git a/src/plugins/qmldesigner/designercore/exceptions/exception.cpp b/src/plugins/qmldesigner/designercore/exceptions/exception.cpp index 44022d74cbe..486e5bec2bd 100644 --- a/src/plugins/qmldesigner/designercore/exceptions/exception.cpp +++ b/src/plugins/qmldesigner/designercore/exceptions/exception.cpp @@ -85,7 +85,6 @@ void Exception::setShouldAssert(bool assert) bool Exception::shouldAssert() { - return true; return s_shouldAssert; } diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 00271bd77e3..8a0d69b222f 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -463,30 +463,29 @@ def __createProjectHandleClassInformation__(className, baseClass=None): def waitForProcessRunning(running=True): outputButton = waitForObject(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton") - if not waitFor("outputButton.checked", 10000): + if not waitFor("outputButton.checked", 5000): ensureChecked(outputButton) waitFor("object.exists(':Qt Creator.ReRun_QToolButton')", 20000) reRunButton = findObject(":Qt Creator.ReRun_QToolButton") waitFor("object.exists(':Qt Creator.Stop_QToolButton')", 20000) stopButton = findObject(":Qt Creator.Stop_QToolButton") - return waitFor("(reRunButton.enabled != running) and (stopButton.enabled == running)", 10000) + return waitFor("(reRunButton.enabled != running) and (stopButton.enabled == running)", 5000) # run and close an application # returns None if the build failed, False if the subprocess did not start, and True otherwise -def runAndCloseApp(isQtQuickUI=False): +def runAndCloseApp(): runButton = waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton") clickButton(runButton) - if not isQtQuickUI: - waitForCompile(300000) - buildSucceeded = checkLastBuild() - ensureChecked(waitForObject(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton")) - if not buildSucceeded: - test.fatal("Build inside run wasn't successful - leaving test") - return None + waitForCompile(300000) + buildSucceeded = checkLastBuild() + ensureChecked(waitForObject(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton")) + if not buildSucceeded: + test.fatal("Build inside run wasn't successful - leaving test") + return None if not waitForProcessRunning(): test.fatal("Couldn't start application - leaving test") return False - __closeSubprocessByPushingStop__(isQtQuickUI) + __closeSubprocessByPushingStop__(False) return True def __closeSubprocessByPushingStop__(isQtQuickUI): diff --git a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py index e3171153c75..adf7c4f62f8 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py @@ -25,21 +25,39 @@ source("../../shared/qtcreator.py") +def _exactlyOne_(iterable): + trueElements = 0 + for element in iterable: + if element: + trueElements += 1 + return trueElements == 1 + def main(): startQC() if not startedWithoutPluginError(): return - available = ["5.6"] + available = ["5.6", "5.10"] for qtVersion in available: # using a temporary directory won't mess up a potentially existing workingDir = tempDir() - createNewQtQuickUI(workingDir, qtVersion) - if runAndCloseApp(True) == None: - checkCompile() - else: - appOutput = logApplicationOutput() - test.verify(not ("untitled.qml" in appOutput or "MainForm.ui.qml" in appOutput), - "Does the Application Output indicate QML errors?") + checkedKits, projectName = createNewQtQuickUI(workingDir, qtVersion) + checkedKitNames = Targets.getTargetsAsStrings(checkedKits) + test.verify(_exactlyOne_(map(lambda name: qtVersion in name, checkedKitNames)), + "The requested kit should have been checked") + if qtVersion == "5.10": + test.verify(not any(map(lambda name: "5.6" in name, checkedKitNames)), + "The 5.6 kit should not have been checked when 5.10 is required") + clickButton(waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton")) + if not waitForProcessRunning(): + test.fatal("Couldn't start application - leaving test") + continue + if test.verify(not waitForProcessRunning(False), "The application should keep running"): + __closeSubprocessByPushingStop__(True) + appOutput = logApplicationOutput() + test.verify(_exactlyOne_(map(lambda ver: ver in appOutput, available)), + "Does Creator use qmlscene from a checked kit?") + test.verify(projectName + ".qml:" not in appOutput, + "Does the Application Output indicate QML errors?") invokeMenuItem("File", "Close All Projects and Editors") invokeMenuItem("File", "Exit")