diff --git a/doc/images/qtcreator-code-style-alignment.png b/doc/images/qtcreator-code-style-alignment.png index d47bfcfc8ff..1a07f30a113 100644 Binary files a/doc/images/qtcreator-code-style-alignment.png and b/doc/images/qtcreator-code-style-alignment.png differ diff --git a/doc/images/qtcreator-code-style-braces.png b/doc/images/qtcreator-code-style-braces.png index c4590c234ca..1d7a1fc19d3 100644 Binary files a/doc/images/qtcreator-code-style-braces.png and b/doc/images/qtcreator-code-style-braces.png differ diff --git a/doc/images/qtcreator-code-style-content.png b/doc/images/qtcreator-code-style-content.png index f8c439cc5ad..406bb56b4c7 100644 Binary files a/doc/images/qtcreator-code-style-content.png and b/doc/images/qtcreator-code-style-content.png differ diff --git a/doc/images/qtcreator-code-style-settings-edit-cpp.png b/doc/images/qtcreator-code-style-settings-edit-cpp.png new file mode 100644 index 00000000000..651458e738a Binary files /dev/null and b/doc/images/qtcreator-code-style-settings-edit-cpp.png differ diff --git a/doc/images/qtcreator-code-style-settings-edit-qtquick.png b/doc/images/qtcreator-code-style-settings-edit-qtquick.png new file mode 100644 index 00000000000..c48cc36cda9 Binary files /dev/null and b/doc/images/qtcreator-code-style-settings-edit-qtquick.png differ diff --git a/doc/images/qtcreator-code-style-settings.png b/doc/images/qtcreator-code-style-settings.png index b62a65bcd76..a6d094ad616 100644 Binary files a/doc/images/qtcreator-code-style-settings.png and b/doc/images/qtcreator-code-style-settings.png differ diff --git a/doc/images/qtcreator-code-style-switch.png b/doc/images/qtcreator-code-style-switch.png index 89ad025345c..f1bee850d35 100644 Binary files a/doc/images/qtcreator-code-style-switch.png and b/doc/images/qtcreator-code-style-switch.png differ diff --git a/doc/images/qtcreator-indentation.png b/doc/images/qtcreator-indentation.png index 414f506676c..65721093c63 100644 Binary files a/doc/images/qtcreator-indentation.png and b/doc/images/qtcreator-indentation.png differ diff --git a/doc/images/qtcreator-options-code-style-cpp.png b/doc/images/qtcreator-options-code-style-cpp.png index 23df366ce42..48591b9141a 100644 Binary files a/doc/images/qtcreator-options-code-style-cpp.png and b/doc/images/qtcreator-options-code-style-cpp.png differ diff --git a/doc/images/qtcreator-options-code-style-qml.png b/doc/images/qtcreator-options-code-style-qml.png index 4ca8e013227..f633b1b6f95 100644 Binary files a/doc/images/qtcreator-options-code-style-qml.png and b/doc/images/qtcreator-options-code-style-qml.png differ diff --git a/doc/src/editors/creator-editors.qdoc b/doc/src/editors/creator-editors.qdoc index 551a5130fa6..cfd8946bcf8 100644 --- a/doc/src/editors/creator-editors.qdoc +++ b/doc/src/editors/creator-editors.qdoc @@ -773,14 +773,6 @@ press \key Tab. Press \key {Shift+Tab} to decrease the indentation. You can disable automatic indentation. - When you press \gui Backspace, the indentation is decreased by one level - in leading white space, by default. You can disable this setting. - - Continuation lines are aligned with the previous line by using spaces. You - can disable automatic alignment to have them indented to the logical depth. - You can always use spaces for alignment or use spaces or tabs depending on - the other options you selected. - You can specify indentation either globally for all files or separately for: @@ -794,8 +786,9 @@ \endlist - You can specify indentation either globally for all files of a particular - type or separately for each project. + You can also specify indentation separately for each project. You can + specify several sets of code style settings and easily switch between them. + In addition, you can import and export code style settings. \section1 Indenting Text Files @@ -808,15 +801,30 @@ To specify settings for a particular project, select \gui {Projects > Editor Settings}. + You can specify how to interpret the \key Tab and \key Backspace key + presses and how to align continuation lines. + \section1 Indenting C++ Files - To specify global indentation settings for the C++ editor, select - \gui {Tools > Options > C++}. + To specify indentation settings for the C++ editor: - \image qtcreator-options-code-style-cpp.png "C++ Code Style options" + \list 1 - To specify the settings for a particular project, select \gui {Projects > - Code Style Settings}. + \o Select \gui {Tools > Options > C++}. + + \o In the \gui {Current settings} field, select the settings to modify + and click \gui Copy. + + \image qtcreator-options-code-style-cpp.png "C++ Code Style options" + + \o Give a name to the settings and click \gui OK. + + \o Click \gui Edit to specify code style settings for the project. + + \image qtcreator-code-style-settings-edit-cpp.png "Edit Code Style Settings dialog" + + + \endlist You can specify how to: @@ -836,18 +844,35 @@ You can use the live preview to see how the options change the indentation. - \section1 Indenting QML Files - - To specify global settings for the Qt Quick editor, select \gui {Tools > - Options > Qt Quick}. - - \image qtcreator-options-code-style-qml.png "QML Code Style options" - To specify the settings for a particular project, select \gui {Projects > Code Style Settings}. - You can specify how to interpret the \key Tab and \key Backspace key - presses. + \section1 Indenting QML Files + + To specify global settings for the Qt Quick editor: + + \list 1 + + \o Select \gui {Tools > Options >Qt Quick}. + + \o In the \gui {Current settings} field, select the settings to modify + and click \gui Copy. + + \image qtcreator-options-code-style-qml.png "QML Code Style options" + + \o Give a name to the settings and click \gui OK. + + \o Click \gui Edit to specify code style settings for the project. + + \image qtcreator-code-style-settings-edit-qtquick.png "Edit Code Style Settings dialog" + + \endlist + + You can specify how to interpret the \key Tab key presses and how to align + continuation lines. + + To specify the settings for a particular project, select \gui {Projects > + Code Style Settings}. \section1 Specifying Tab Settings @@ -869,15 +894,41 @@ \endlist - By default, the tab-length in code editor is 8 spaces. You can specify the - tab length separately for each project and for - different types of files. + \section2 Specifying Tabs and Indentation - The code editor can also determine whether tabs or spaces are used - on the previous or next line and copy the style. + You can specify tab policy and tab size in the \gui Typing group. In the + \gui {Tab policy} field, select whether to use only spaces or only tabs for + indentation, or to use a mixture of them. - The \key Tab key can automatically indent text when you press it, or only - when the cursor is located within leading white space. + By default, the tab length in code editor is 8 spaces and the indent size is + 4 spaces. You can specify the tab length and indent size separately for each + project and for different types of files. + + You can have continuation lines aligned with the previous line. In the + \gui {Align continuation lines} field, select \gui {Not at all} to disable + automatic alignment and indent continuation lines to the logical depth. + To always use spaces for alignment, select \gui {With Spaces}. To follow the + \gui {Tab policy}, select \gui {With Regular Indent}. + + \section2 Speficying Typing Options + + When you type code, it is indented automatically according to the selected + text editor and code style options. Specify typing options in the + \gui Typing group. To disable automatic indentation, deselect the + \gui {Enable automatic indentation} check box. + + You can specify how the indentation is decreased when you press + \gui Backspace in the \gui {Backspace indentation} field. To go back one + space at a time, select \gui None. To decrease indentation in leading white + space by one level, select \gui {Follows Previous Indents}. To move back one + tab length if the character to the left of the cursor is a space, select + \gui Unindents. + + You can specify whether the \key Tab key automatically indents text when you + press it. To automatically indent text, select \gui Always in the + \gui {Tab key performs auto-indent} field. To only indent text when the + cursor is located within leading white space, select \gui {In Leading White + Space}. \section1 Specifying Settings for Content @@ -1447,7 +1498,10 @@ \row \i Add Definition in 'filename' \i Inserts a definition stub for a member function declaration in the - implementation file + implementation file. The definition is placed after that of the + preceding declaration. Qualified names are minimized when possible, + instead of always being fully expanded. + \i Method name \row \i Add 'Function' Declaration @@ -1496,6 +1550,15 @@ \o data member with the name \c {m_} \endlist \i Q_PROPERTY + \row + \i Apply Changes + \i Keeps function declarations and definitions synchronized by + checking for the matching declaration or definition when you + edit a function signature and by applying the changes to the + matching code. + \i Function signature. When this action is available, a light bulb + icon appears: + \inlineimage qml-toolbar-indicator.png \endtable \section2 Refactoring QML Code diff --git a/doc/src/projects/creator-projects-settings-code-style.qdoc b/doc/src/projects/creator-projects-settings-code-style.qdoc index 33c7db19266..acb83b6ff2e 100644 --- a/doc/src/projects/creator-projects-settings-code-style.qdoc +++ b/doc/src/projects/creator-projects-settings-code-style.qdoc @@ -40,11 +40,15 @@ You can configure the code style according to your needs. You can specify code style either globally for all projects or separately for each - project. To specify global code style for C++ files, select \gui {Tools > - Options > C++}. + project. You can specify several sets of code style settings and easily + switch between them. In addition, you can import and export code style + settings. - To specify global code style for QML files, select \gui {Tools > Options - > Qt Quick}. + To specify global code style settings sets for C++ files, select + \gui {Tools > Options > C++}. + + To specify global code style settings sets for QML files, select \gui {Tools + > Options > Qt Quick}. To configure the editor behavior for the current project: @@ -54,17 +58,23 @@ \o In the \gui Language field, select \gui C++ or \gui Qt Quick. - \o Deselect the \gui {Use global settings} check box. + \o In the \gui {Current settings} field, select the settings to modify + and click \gui Copy. - \o In the \gui Settings field, select \gui Custom. + \image qtcreator-code-style-settings.png "Code Style Settings view" - \o Specify code style settings for the project. Only \gui General - settings are available for QML files. + \o Give a name to the settings and click \gui OK. + + \o Click \gui Edit to specify code style settings for the project. + + \image qtcreator-code-style-settings-edit-cpp.png "Edit Code Style Settings dialog" + + \note Only \gui General settings are available for QML files. + + \image qtcreator-code-style-settings-edit-qtquick.png "Edit Code Style Settings view" \endlist - \image qtcreator-code-style-settings.png "Code Style Settings view" - For more information about the settings, see \l{Indenting Code}. */ diff --git a/lib/qtcreator/qtcomponents/plugins.qmltypes b/lib/qtcreator/qtcomponents/plugins.qmltypes new file mode 100644 index 00000000000..f2a3db3a7d4 --- /dev/null +++ b/lib/qtcreator/qtcomponents/plugins.qmltypes @@ -0,0 +1,428 @@ +import QtQuick.tooling 1.1 + +// This file describes the plugin-supplied types contained in the library. +// It is used for QML tooling purposes only. + +Module { + Component { + name: "QAbstractItemModel" + prototype: "QObject" + Signal { + name: "dataChanged" + Parameter { name: "topLeft"; type: "QModelIndex" } + Parameter { name: "bottomRight"; type: "QModelIndex" } + } + Signal { + name: "headerDataChanged" + Parameter { name: "orientation"; type: "Qt::Orientation" } + Parameter { name: "first"; type: "int" } + Parameter { name: "last"; type: "int" } + } + Signal { name: "layoutChanged" } + Signal { name: "layoutAboutToBeChanged" } + Signal { + name: "rowsAboutToBeInserted" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "first"; type: "int" } + Parameter { name: "last"; type: "int" } + } + Signal { + name: "rowsInserted" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "first"; type: "int" } + Parameter { name: "last"; type: "int" } + } + Signal { + name: "rowsAboutToBeRemoved" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "first"; type: "int" } + Parameter { name: "last"; type: "int" } + } + Signal { + name: "rowsRemoved" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "first"; type: "int" } + Parameter { name: "last"; type: "int" } + } + Signal { + name: "columnsAboutToBeInserted" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "first"; type: "int" } + Parameter { name: "last"; type: "int" } + } + Signal { + name: "columnsInserted" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "first"; type: "int" } + Parameter { name: "last"; type: "int" } + } + Signal { + name: "columnsAboutToBeRemoved" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "first"; type: "int" } + Parameter { name: "last"; type: "int" } + } + Signal { + name: "columnsRemoved" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "first"; type: "int" } + Parameter { name: "last"; type: "int" } + } + Signal { name: "modelAboutToBeReset" } + Signal { name: "modelReset" } + Signal { + name: "rowsAboutToBeMoved" + Parameter { name: "sourceParent"; type: "QModelIndex" } + Parameter { name: "sourceStart"; type: "int" } + Parameter { name: "sourceEnd"; type: "int" } + Parameter { name: "destinationParent"; type: "QModelIndex" } + Parameter { name: "destinationRow"; type: "int" } + } + Signal { + name: "rowsMoved" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "start"; type: "int" } + Parameter { name: "end"; type: "int" } + Parameter { name: "destination"; type: "QModelIndex" } + Parameter { name: "row"; type: "int" } + } + Signal { + name: "columnsAboutToBeMoved" + Parameter { name: "sourceParent"; type: "QModelIndex" } + Parameter { name: "sourceStart"; type: "int" } + Parameter { name: "sourceEnd"; type: "int" } + Parameter { name: "destinationParent"; type: "QModelIndex" } + Parameter { name: "destinationColumn"; type: "int" } + } + Signal { + name: "columnsMoved" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "start"; type: "int" } + Parameter { name: "end"; type: "int" } + Parameter { name: "destination"; type: "QModelIndex" } + Parameter { name: "column"; type: "int" } + } + Method { name: "submit"; type: "bool" } + Method { name: "revert" } + } + Component { name: "QAbstractListModel"; prototype: "QAbstractItemModel" } + Component { + name: "QDeclarativeFolderListModel" + prototype: "QAbstractListModel" + exports: [ + "FileSystemModel 1.0" + ] + Enum { + name: "SortField" + values: { + "Unsorted": 0, + "Name": 1, + "Time": 2, + "Size": 3, + "Type": 4 + } + } + Property { name: "folder"; type: "QUrl" } + Property { name: "parentFolder"; type: "QUrl"; isReadonly: true } + Property { name: "nameFilters"; type: "QStringList" } + Property { name: "sortField"; type: "SortField" } + Property { name: "sortReversed"; type: "bool" } + Property { name: "showDirs"; type: "bool" } + Property { name: "showDotAndDotDot"; type: "bool" } + Property { name: "showOnlyReadable"; type: "bool" } + Property { name: "count"; type: "int"; isReadonly: true } + Signal { name: "folderChanged" } + Signal { name: "countChanged" } + Method { + name: "isFolder" + type: "bool" + Parameter { name: "index"; type: "int" } + } + } + Component { + name: "QGraphicsDropShadowEffect" + prototype: "QGraphicsEffect" + exports: [ + "DropShadow 1.0" + ] + Property { name: "offset"; type: "QPointF" } + Property { name: "xOffset"; type: "qreal" } + Property { name: "yOffset"; type: "qreal" } + Property { name: "blurRadius"; type: "qreal" } + Property { name: "color"; type: "QColor" } + Signal { + name: "offsetChanged" + Parameter { name: "offset"; type: "QPointF" } + } + Signal { + name: "blurRadiusChanged" + Parameter { name: "blurRadius"; type: "qreal" } + } + Signal { + name: "colorChanged" + Parameter { name: "color"; type: "QColor" } + } + Method { + name: "setOffset" + Parameter { name: "ofs"; type: "QPointF" } + } + Method { + name: "setOffset" + Parameter { name: "dx"; type: "qreal" } + Parameter { name: "dy"; type: "qreal" } + } + Method { + name: "setOffset" + Parameter { name: "d"; type: "qreal" } + } + Method { + name: "setXOffset" + Parameter { name: "dx"; type: "qreal" } + } + Method { + name: "setYOffset" + Parameter { name: "dy"; type: "qreal" } + } + Method { + name: "setBlurRadius" + Parameter { name: "blurRadius"; type: "qreal" } + } + Method { + name: "setColor" + Parameter { name: "color"; type: "QColor" } + } + } + Component { + name: "QGraphicsEffect" + prototype: "QObject" + Enum { + name: "ChangeFlags" + values: { + "SourceAttached": 1, + "SourceDetached": 2, + "SourceBoundingRectChanged": 4, + "SourceInvalidated": 8 + } + } + Property { name: "enabled"; type: "bool" } + Signal { + name: "enabledChanged" + Parameter { name: "enabled"; type: "bool" } + } + Method { + name: "setEnabled" + Parameter { name: "enable"; type: "bool" } + } + Method { name: "update" } + } + Component { + name: "QRangeModel" + prototype: "QObject" + exports: [ + "RangeModel 1.0" + ] + Property { name: "value"; type: "qreal" } + Property { name: "minimumValue"; type: "qreal" } + Property { name: "maximumValue"; type: "qreal" } + Property { name: "stepSize"; type: "qreal" } + Property { name: "position"; type: "qreal" } + Property { name: "positionAtMinimum"; type: "qreal" } + Property { name: "positionAtMaximum"; type: "qreal" } + Property { name: "inverted"; type: "bool" } + Signal { + name: "valueChanged" + Parameter { name: "value"; type: "qreal" } + } + Signal { + name: "positionChanged" + Parameter { name: "position"; type: "qreal" } + } + Signal { + name: "stepSizeChanged" + Parameter { name: "stepSize"; type: "qreal" } + } + Signal { + name: "invertedChanged" + Parameter { name: "inverted"; type: "bool" } + } + Signal { + name: "minimumChanged" + Parameter { name: "min"; type: "qreal" } + } + Signal { + name: "maximumChanged" + Parameter { name: "max"; type: "qreal" } + } + Signal { + name: "positionAtMinimumChanged" + Parameter { name: "min"; type: "qreal" } + } + Signal { + name: "positionAtMaximumChanged" + Parameter { name: "max"; type: "qreal" } + } + Method { name: "toMinimum" } + Method { name: "toMaximum" } + Method { + name: "setValue" + Parameter { name: "value"; type: "qreal" } + } + Method { + name: "setPosition" + Parameter { name: "position"; type: "qreal" } + } + Method { + name: "valueForPosition" + type: "qreal" + Parameter { name: "position"; type: "qreal" } + } + Method { + name: "positionForValue" + type: "qreal" + Parameter { name: "value"; type: "qreal" } + } + } + Component { + name: "QStyleItem" + defaultProperty: "data" + prototype: "QDeclarativeItem" + exports: [ + "QStyleItem 1.0" + ] + Property { name: "sunken"; type: "bool" } + Property { name: "raised"; type: "bool" } + Property { name: "active"; type: "bool" } + Property { name: "selected"; type: "bool" } + Property { name: "focus"; type: "bool" } + Property { name: "on"; type: "bool" } + Property { name: "hover"; type: "bool" } + Property { name: "horizontal"; type: "bool" } + Property { name: "elementType"; type: "string" } + Property { name: "text"; type: "string" } + Property { name: "activeControl"; type: "string" } + Property { name: "info"; type: "string" } + Property { name: "style"; type: "string"; isReadonly: true } + Property { name: "hint"; type: "string" } + Property { name: "cursor"; type: "string" } + Property { name: "minimum"; type: "int" } + Property { name: "maximum"; type: "int" } + Property { name: "value"; type: "int" } + Property { name: "step"; type: "int" } + Property { name: "paintMargins"; type: "int" } + Property { name: "fontFamily"; type: "string"; isReadonly: true } + Property { name: "fontPointSize"; type: "double"; isReadonly: true } + Property { name: "fontHeight"; type: "int"; isReadonly: true } + Signal { name: "elementTypeChanged" } + Signal { name: "textChanged" } + Signal { name: "sunkenChanged" } + Signal { name: "raisedChanged" } + Signal { name: "activeChanged" } + Signal { name: "selectedChanged" } + Signal { name: "focusChanged" } + Signal { name: "onChanged" } + Signal { name: "hoverChanged" } + Signal { name: "horizontalChanged" } + Signal { name: "minimumChanged" } + Signal { name: "maximumChanged" } + Signal { name: "stepChanged" } + Signal { name: "valueChanged" } + Signal { name: "activeControlChanged" } + Signal { name: "infoChanged" } + Signal { name: "styleChanged" } + Signal { name: "paintMarginsChanged" } + Signal { name: "hintChanged" } + Signal { name: "cursorChanged" } + Signal { name: "fontHeightChanged" } + Method { + name: "pixelMetric" + type: "int" + Parameter { type: "string" } + } + Method { + name: "styleHint" + type: "QVariant" + Parameter { type: "string" } + } + Method { + name: "sizeFromContents" + type: "QSize" + Parameter { name: "width"; type: "int" } + Parameter { name: "height"; type: "int" } + } + Method { name: "updateItem" } + Method { + name: "hitTest" + type: "string" + Parameter { name: "x"; type: "int" } + Parameter { name: "y"; type: "int" } + } + Method { + name: "subControlRect" + type: "QRect" + Parameter { name: "subcontrolString"; type: "string" } + } + Method { + name: "showToolTip" + Parameter { name: "str"; type: "string" } + } + Method { + name: "textWidth" + type: "int" + Parameter { type: "string" } + } + } + Component { + name: "QWheelArea" + defaultProperty: "data" + prototype: "QDeclarativeItem" + exports: [ + "WheelArea 1.0" + ] + Property { name: "verticalDelta"; type: "qreal" } + Property { name: "horizontalDelta"; type: "qreal" } + Property { name: "horizontalMinimumValue"; type: "qreal" } + Property { name: "horizontalMaximumValue"; type: "qreal" } + Property { name: "verticalMinimumValue"; type: "qreal" } + Property { name: "verticalMaximumValue"; type: "qreal" } + Property { name: "horizontalValue"; type: "qreal" } + Property { name: "verticalValue"; type: "qreal" } + Signal { name: "verticalValueChanged" } + Signal { name: "horizontalValueChanged" } + Signal { name: "verticalWheelMoved" } + Signal { name: "horizontalWheelMoved" } + } + Component { + name: "QtMenu" + defaultProperty: "menuItems" + prototype: "QObject" + exports: [ + "MenuBase 1.0" + ] + Property { name: "title"; type: "string" } + Property { name: "menuItems"; type: "QtMenuItem"; isList: true; isReadonly: true } + Signal { name: "selected" } + Method { + name: "showPopup" + Parameter { name: "x"; type: "qreal" } + Parameter { name: "y"; type: "qreal" } + } + } + Component { + name: "QtMenuBar" + defaultProperty: "data" + prototype: "QDeclarativeItem" + exports: [ + "MenuBarBase 1.0" + ] + Property { name: "menus"; type: "QtMenu"; isList: true; isReadonly: true } + } + Component { + name: "QtMenuItem" + prototype: "QObject" + exports: [ + "MenuItemBase 1.0" + ] + Property { name: "text"; type: "string" } + Signal { name: "selected" } + } +} diff --git a/share/qtcreator/dumper/dumper.cpp b/share/qtcreator/dumper/dumper.cpp index 8f64da17c60..551d91d547b 100644 --- a/share/qtcreator/dumper/dumper.cpp +++ b/share/qtcreator/dumper/dumper.cpp @@ -77,16 +77,25 @@ # endif #endif -#if USE_QT_GUI -# include +#ifndef USE_QT_WIDGETS +# if defined(QT_WIDGETS_LIB) || ((QT_VERSION < 0x050000) && defined(USE_QT_GUI)) +# define USE_QT_WIDGETS 1 +# endif +#endif + +#ifdef USE_QT_GUI # include # include # include -# include # include # include # include +#endif + +#ifdef USE_QT_WIDGETS # include +# include +# include #endif #endif // QT_BOOTSTRAPPED @@ -1670,7 +1679,7 @@ static void qDumpQImage(QDumper &d) static void qDumpQImageData(QDumper &d) { const QImage &im = *reinterpret_cast(d.data); - const QByteArray ba(QByteArray::fromRawData((const char*)im.bits(), im.numBytes())); + const QByteArray ba(QByteArray::fromRawData((const char*)im.bits(), im.byteCount())); d.putItem("type", NS"QImageData"); d.putItem("numchild", "0"); #if 1 @@ -1703,7 +1712,10 @@ static void qDumpQList(QDumper &d) return; if (pdata.d->begin > pdata.d->end) return; -#if QT_VERSION >= 0x040400 +#if QT_VERSION >= 0x050000 + if (pdata.d->ref.atomic._q_value <= 0) + return; +#elif QT_VERSION >= 0x040400 if (pdata.d->ref._q_value <= 0) return; #endif diff --git a/share/qtcreator/dumper/dumper.pro b/share/qtcreator/dumper/dumper.pro index 323ff220e58..818b03a5d60 100644 --- a/share/qtcreator/dumper/dumper.pro +++ b/share/qtcreator/dumper/dumper.pro @@ -13,6 +13,7 @@ else { DEFINES += USE_QT_GUI=1 QT = core \ gui + greaterThan(QT_MAJOR_VERSION, 4):QT *= widgets } exists($$QMAKE_INCDIR_QT/QtCore/private/qobject_p.h):DEFINES += HAS_QOBJECT_P_H HEADERS += dumper.h diff --git a/share/qtcreator/dumper/dumper.py b/share/qtcreator/dumper/dumper.py index 01b3bfdee6e..0f4056ae39e 100644 --- a/share/qtcreator/dumper/dumper.py +++ b/share/qtcreator/dumper/dumper.py @@ -425,7 +425,11 @@ def check(exp): raise RuntimeError("Check failed") def checkRef(ref): - count = ref["_q_value"] + count = 0 + if qtMajorVersion() >= 5: + count = ref["atomic"]["_q_value"] + else: + count = ref["_q_value"] check(count > 0) check(count < 1000000) # assume there aren't a million references to any object diff --git a/share/qtcreator/dumper/test/dumpertest.pro b/share/qtcreator/dumper/test/dumpertest.pro index be4c9a58948..95546a6f264 100644 --- a/share/qtcreator/dumper/test/dumpertest.pro +++ b/share/qtcreator/dumper/test/dumpertest.pro @@ -7,7 +7,7 @@ TARGET = dumpertest CONFIG += console CONFIG -= app_bundle - +greaterThan(QT_MAJOR_VERSION, 4):QT *= widgets TEMPLATE = app SOURCES += main.cpp \ diff --git a/share/qtcreator/dumper/test/main.cpp b/share/qtcreator/dumper/test/main.cpp index fc1b3e8a20c..c9920f33475 100644 --- a/share/qtcreator/dumper/test/main.cpp +++ b/share/qtcreator/dumper/test/main.cpp @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include diff --git a/share/qtcreator/welcomescreen/widgets/NewsListing.qml b/share/qtcreator/welcomescreen/widgets/NewsListing.qml index 864d54457e7..ae41df31afa 100644 --- a/share/qtcreator/welcomescreen/widgets/NewsListing.qml +++ b/share/qtcreator/welcomescreen/widgets/NewsListing.qml @@ -37,40 +37,29 @@ Item { id: root property int currentItem: 0 - property alias model: repeater.model - property alias itemCount: repeater.count + property alias model: view.model + property alias itemCount: view.count Timer { id: nextItemTimer repeat: true interval: 30*1000 - onTriggered: repeater.incrementIndex() + onTriggered: view.incrementCurrentIndex() } Timer { id: modelUpdateTimer repeat: false interval: 1000 - onTriggered: repeater.handleModelUpdate(); + onTriggered: view.handleModelUpdate(); } - Repeater { - id: repeater - function incrementIndex() { - repeater.itemAt(currentItem).active = false - currentItem = (currentItem+1) % repeater.count - repeater.itemAt(currentItem).active = true - } + ListView { + id: view function handleModelUpdate() { nextItemTimer.stop(); - currentItem = 0; - for (var i = 0; i < count; ++i) { - if (i != currentItem) - repeater.itemAt(i).active = false; - else - repeater.itemAt(i).active = true; - } + currentIndex = 0; nextItemTimer.start(); } @@ -78,21 +67,16 @@ Item { modelUpdateTimer.restart(); } - function handleItemRemoved(index, item) { - modelUpdateTimer.restart(); - } - - function handleItemAdded(index, item) { - modelUpdateTimer.restart(); - } - anchors.fill: parent + highlightMoveDuration: 1 // don't show any scrolling + keyNavigationWraps: true // start from 0 again if at end + interactive: false + onModelChanged: handleModelChanged() - onItemAdded: handleItemAdded(index, item) - onItemRemoved: handleItemRemoved(index, item) + delegate: Item { - property bool active: false id: delegateItem + property bool active: ListView.isCurrentItem opacity: 0 height: root.height width: root.width diff --git a/src/app/app_version.h.in b/src/app/app_version.h.in index bb3c48be28d..f96228bba98 100644 --- a/src/app/app_version.h.in +++ b/src/app/app_version.h.in @@ -30,6 +30,9 @@ ** **************************************************************************/ +#ifndef APP_VERSION_H +#define APP_VERSION_H + namespace Core { namespace Constants { @@ -66,3 +69,5 @@ const char * const IDE_REVISION_STR = \"\"; } // Constants } // Core + +#endif //APP_VERSION_H diff --git a/src/libs/qmljsdebugclient/qdeclarativedebugclient.cpp b/src/libs/qmljsdebugclient/qdeclarativedebugclient.cpp index f12eaf6937e..c7a80b070b4 100644 --- a/src/libs/qmljsdebugclient/qdeclarativedebugclient.cpp +++ b/src/libs/qmljsdebugclient/qdeclarativedebugclient.cpp @@ -222,6 +222,12 @@ qint64 QDeclarativeDebugConnection::writeData(const char *data, qint64 maxSize) return d->device->write(data, maxSize); } +void QDeclarativeDebugConnection::internalError(QAbstractSocket::SocketError socketError) +{ + setErrorString(d->device->errorString()); + emit error(socketError); +} + qint64 QDeclarativeDebugConnection::bytesAvailable() const { return d->device->bytesAvailable(); @@ -300,7 +306,7 @@ void QDeclarativeDebugConnection::connectToHost(const QString &hostName, quint16 d->connectDeviceSignals(); d->gotHello = false; connect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SIGNAL(stateChanged(QAbstractSocket::SocketState))); - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SIGNAL(error(QAbstractSocket::SocketError))); + connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(internalError(QAbstractSocket::SocketError))); connect(socket, SIGNAL(connected()), this, SIGNAL(connected())); socket->connectToHost(hostName, port); QIODevice::open(ReadWrite | Unbuffered); diff --git a/src/libs/qmljsdebugclient/qdeclarativedebugclient.h b/src/libs/qmljsdebugclient/qdeclarativedebugclient.h index fe118de535e..57a331c5ab4 100644 --- a/src/libs/qmljsdebugclient/qdeclarativedebugclient.h +++ b/src/libs/qmljsdebugclient/qdeclarativedebugclient.h @@ -66,6 +66,9 @@ protected: qint64 readData(char *data, qint64 maxSize); qint64 writeData(const char *data, qint64 maxSize); +private slots: + void internalError(QAbstractSocket::SocketError error); + private: QDeclarativeDebugConnectionPrivate *d; friend class QDeclarativeDebugClient; diff --git a/src/plugins/debugger/attachcoredialog.ui b/src/plugins/debugger/attachcoredialog.ui index 206b7d41dc6..61a34105703 100644 --- a/src/plugins/debugger/attachcoredialog.ui +++ b/src/plugins/debugger/attachcoredialog.ui @@ -7,7 +7,7 @@ 0 0 246 - 147 + 183 @@ -73,7 +73,10 @@ - Sysroot + Sys&root: + + + sysrootPathChooser diff --git a/src/plugins/debugger/attachtoqmlportdialog.ui b/src/plugins/debugger/attachtoqmlportdialog.ui index 2a88bff1e49..45feeb73ef0 100644 --- a/src/plugins/debugger/attachtoqmlportdialog.ui +++ b/src/plugins/debugger/attachtoqmlportdialog.ui @@ -6,8 +6,8 @@ 0 0 - 435 - 133 + 185 + 115 @@ -17,12 +17,12 @@ - QFormLayout::FieldsStayAtSizeHint + QFormLayout::AllNonFixedFieldsGrow - Host + &Host: hostLineEdit @@ -39,7 +39,10 @@ - Port + &Port: + + + portSpinBox diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index cb1df995c23..0bc771de6b6 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -124,6 +124,8 @@ static QString typeToString(BreakpointType type) return BreakHandler::tr("Watchpoint at Expression"); case BreakpointOnQmlSignalHandler: return BreakHandler::tr("Breakpoint on QML Signal Handler"); + case BreakpointAtJavaScriptThrow: + return BreakHandler::tr("Breakpoint at JavaScript throw"); case UnknownType: break; } diff --git a/src/plugins/debugger/breakpoint.cpp b/src/plugins/debugger/breakpoint.cpp index 6f15a5317fb..c61892c09bd 100644 --- a/src/plugins/debugger/breakpoint.cpp +++ b/src/plugins/debugger/breakpoint.cpp @@ -277,6 +277,7 @@ QString BreakpointParameters::toString() const case BreakpointAtExec: //case BreakpointAtVFork: case BreakpointAtSysCall: + case BreakpointAtJavaScriptThrow: case UnknownType: break; } diff --git a/src/plugins/debugger/breakpoint.h b/src/plugins/debugger/breakpoint.h index ace4bce5bdb..b1636be10c4 100644 --- a/src/plugins/debugger/breakpoint.h +++ b/src/plugins/debugger/breakpoint.h @@ -140,7 +140,8 @@ enum BreakpointType BreakpointAtSysCall, WatchpointAtAddress, WatchpointAtExpression, - BreakpointOnQmlSignalHandler + BreakpointOnQmlSignalHandler, + BreakpointAtJavaScriptThrow }; //! \enum Debugger::Internal::BreakpointState diff --git a/src/plugins/debugger/breakwindow.cpp b/src/plugins/debugger/breakwindow.cpp index 7739491d30a..ed8177d3b38 100644 --- a/src/plugins/debugger/breakwindow.cpp +++ b/src/plugins/debugger/breakwindow.cpp @@ -120,9 +120,10 @@ BreakpointDialog::BreakpointDialog(unsigned engineCapabilities, QWidget *parent) << tr("Break when a system call is executed") << tr("Break on data access at fixed address") << tr("Break on data access at address given by expression") - << tr("Break on QML signal handler"); + << tr("Break on QML signal handler") + << tr("Break when JavaScript exception is thrown"); - QTC_ASSERT(types.size() == BreakpointOnQmlSignalHandler, return; ) + QTC_ASSERT(types.size() == BreakpointAtJavaScriptThrow, return; ) m_ui.comboBoxType->addItems(types); m_ui.pathChooserFileName->setExpectedKind(Utils::PathChooser::File); connect(m_ui.comboBoxType, SIGNAL(activated(int)), SLOT(typeChanged(int))); @@ -352,6 +353,7 @@ void BreakpointDialog::typeChanged(int) case BreakpointAtExec: //case BreakpointAtVFork: case BreakpointAtSysCall: + case BreakpointAtJavaScriptThrow: break; case BreakpointByAddress: case WatchpointAtAddress: @@ -384,6 +386,7 @@ void BreakpointDialog::typeChanged(int) case BreakpointAtExec: //case BreakpointAtVFork: case BreakpointAtSysCall: + case BreakpointAtJavaScriptThrow: clearOtherParts(AllConditionParts|ModulePart|TracePointPart); setPartsEnabled(AllConditionParts|TracePointPart); break; diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 32bb468ad69..3d62f6eec72 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -2551,6 +2551,7 @@ bool CdbEngine::acceptsBreakpoint(BreakpointModelId id) const case WatchpointAtExpression: case BreakpointAtSysCall: case BreakpointOnQmlSignalHandler: + case BreakpointAtJavaScriptThrow: return false; case WatchpointAtAddress: case BreakpointByFileAndLine: diff --git a/src/plugins/debugger/cdb/cdbparsehelpers.cpp b/src/plugins/debugger/cdb/cdbparsehelpers.cpp index 591323950e5..32db699b7b5 100644 --- a/src/plugins/debugger/cdb/cdbparsehelpers.cpp +++ b/src/plugins/debugger/cdb/cdbparsehelpers.cpp @@ -108,6 +108,7 @@ static BreakpointParameters fixWinMSVCBreakpoint(const BreakpointParameters &p) case BreakpointAtSysCall: case WatchpointAtAddress: case BreakpointOnQmlSignalHandler: + case BreakpointAtJavaScriptThrow: break; case BreakpointAtExec: { // Emulate by breaking on CreateProcessW(). BreakpointParameters rc(BreakpointByFunction); @@ -165,6 +166,7 @@ QByteArray cdbAddBreakpointCommand(const BreakpointParameters &bpIn, case BreakpointAtThrow: case BreakpointAtMain: case BreakpointOnQmlSignalHandler: + case BreakpointAtJavaScriptThrow: QTC_ASSERT(false, return QByteArray(); ) break; case BreakpointByAddress: diff --git a/src/plugins/debugger/debuggerconstants.h b/src/plugins/debugger/debuggerconstants.h index fa179279ead..a3cdc775004 100644 --- a/src/plugins/debugger/debuggerconstants.h +++ b/src/plugins/debugger/debuggerconstants.h @@ -46,6 +46,10 @@ const char C_DEBUGMODE[] = "Debugger.DebugMode"; const char C_CPPDEBUGGER[] = "Gdb Debugger"; const char C_QMLDEBUGGER[] = "Qml/JavaScript Debugger"; +// Menu Groups +const char G_START_CPP[] = "Debugger.Group.Start.Cpp"; +const char G_START_QML[] = "Debugger.Group.Start.Cpp"; + // Project Explorer run mode (RUN/DEBUG) const char DEBUGMODE[] = "Debugger.DebugMode"; const char DEBUGMODE2[] = "Debugger.DebugMode2"; // Breaks on main. diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 352189a1510..a8208eacff4 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -1583,6 +1583,11 @@ void DebuggerEngine::showStoppedByExceptionMessageBox(const QString &description bool DebuggerEngine::isCppBreakpoint(const BreakpointParameters &p) { + //Qml specific breakpoint types + if (p.type == BreakpointAtJavaScriptThrow + || p.type == BreakpointOnQmlSignalHandler) + return false; + // Qml is currently only file if (p.type != BreakpointByFileAndLine) return true; diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index d810ee3104c..bb06bb951b3 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1400,16 +1400,6 @@ void DebuggerPluginPrivate::onCurrentProjectChanged(Project *project) void DebuggerPluginPrivate::languagesChanged() { - const bool debuggerIsCPP = - m_mainWindow->activeDebugLanguages() & CppLanguage; - //qDebug() << "DEBUGGER IS CPP: " << debuggerIsCPP; - m_startExternalAction->setVisible(debuggerIsCPP); - m_attachExternalAction->setVisible(debuggerIsCPP); - m_attachCoreAction->setVisible(debuggerIsCPP); - m_startRemoteAction->setVisible(debuggerIsCPP); - m_attachRemoteAction->setVisible(debuggerIsCPP); - m_detachAction->setVisible(debuggerIsCPP); - m_attachToQmlPortAction->setVisible(m_mainWindow->activeDebugLanguages() & QmlLanguage); } void DebuggerPluginPrivate::debugProject() @@ -2962,6 +2952,12 @@ void DebuggerPluginPrivate::extensionsInitialized() act->setText(tr("Detach Debugger")); connect(act, SIGNAL(triggered()), SLOT(handleExecDetach())); + // "Start Debugging" sub-menu + // groups: + // G_DEFAULT_ONE + // G_START_CPP + // G_START_QML + Command *cmd = 0; ActionContainer *mstart = am->actionContainer(PE::M_DEBUG_STARTDEBUGGING); @@ -2969,7 +2965,7 @@ void DebuggerPluginPrivate::extensionsInitialized() cmd->setDefaultText(tr("Start Debugging")); cmd->setDefaultKeySequence(QKeySequence(Constants::DEBUG_KEY)); cmd->setAttribute(Command::CA_UpdateText); - mstart->addAction(cmd, Core::Constants::G_DEFAULT_ONE); + mstart->addAction(cmd, CC::G_DEFAULT_ONE); m_visibleStartAction = new Utils::ProxyAction(this); m_visibleStartAction->initialize(m_startAction); @@ -2983,52 +2979,54 @@ void DebuggerPluginPrivate::extensionsInitialized() cmd = am->registerAction(m_startExternalAction, "Debugger.StartExternal", globalcontext); cmd->setAttribute(Command::CA_Hide); - mstart->addAction(cmd, CC::G_DEFAULT_ONE); + mstart->addAction(cmd, Constants::G_START_CPP); cmd = am->registerAction(m_attachExternalAction, "Debugger.AttachExternal", globalcontext); cmd->setAttribute(Command::CA_Hide); - mstart->addAction(cmd, CC::G_DEFAULT_ONE); + mstart->addAction(cmd, Constants::G_START_CPP); cmd = am->registerAction(m_attachCoreAction, "Debugger.AttachCore", globalcontext); cmd->setAttribute(Command::CA_Hide); - mstart->addAction(cmd, CC::G_DEFAULT_ONE); + mstart->addAction(cmd, Constants::G_START_CPP); cmd = am->registerAction(m_startRemoteAction, "Debugger.StartRemote", globalcontext); cmd->setAttribute(Command::CA_Hide); - mstart->addAction(cmd, CC::G_DEFAULT_ONE); + mstart->addAction(cmd, Constants::G_START_CPP); cmd = am->registerAction(m_attachRemoteAction, "Debugger.AttachRemote", globalcontext); cmd->setAttribute(Command::CA_Hide); - mstart->addAction(cmd, CC::G_DEFAULT_ONE); + mstart->addAction(cmd, Constants::G_START_CPP); - cmd = am->registerAction(m_attachToQmlPortAction, - "Debugger.AttachToQmlPort", globalcontext); - cmd->setAttribute(Command::CA_Hide); - mstart->addAction(cmd, CC::G_DEFAULT_ONE); #ifdef WITH_LLDB cmd = am->registerAction(m_startRemoteLldbAction, "Debugger.RemoteLldb", globalcontext); cmd->setAttribute(Command::CA_Hide); - mstart->addAction(cmd, CC::G_DEFAULT_ONE); + mstart->addAction(cmd, Constants::G_START_CPP); #endif if (m_startRemoteCdbAction) { cmd = am->registerAction(m_startRemoteCdbAction, "Debugger.AttachRemoteCdb", globalcontext); cmd->setAttribute(Command::CA_Hide); - mstart->addAction(cmd, CC::G_DEFAULT_ONE); + mstart->addAction(cmd, Constants::G_START_CPP); } - QAction *sep = new QAction(this); + QAction *sep = new QAction(mstart); sep->setSeparator(true); - cmd = am->registerAction(sep, "Debugger.Sep.Start", globalcontext); - mstart->addAction(cmd); + cmd = am->registerAction(sep, + "Debugger.Start.Qml", globalcontext); + mstart->addAction(cmd, Constants::G_START_QML); + + cmd = am->registerAction(m_attachToQmlPortAction, + "Debugger.AttachToQmlPort", globalcontext); + cmd->setAttribute(Command::CA_Hide); + mstart->addAction(cmd, Constants::G_START_QML); cmd = am->registerAction(m_detachAction, "Debugger.Detach", globalcontext); @@ -3378,6 +3376,25 @@ DebuggerPlugin::~DebuggerPlugin() bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMessage) { + ICore *core = ICore::instance(); + QTC_ASSERT(core, return true); + + // Menu groups + const Context globalcontext(CC::C_GLOBAL); + + Core::ActionManager *am = core->actionManager(); + ActionContainer *mstart = am->actionContainer(PE::M_DEBUG_STARTDEBUGGING); + + mstart->appendGroup(Constants::G_START_CPP); + mstart->appendGroup(Constants::G_START_QML); + + // add cpp separator + QAction *sep = new QAction(mstart); + sep->setSeparator(true); + Command *cmd = am->registerAction(sep, + "Debugger.Start.Cpp", globalcontext); + mstart->addAction(cmd, Constants::G_START_CPP); + return theDebuggerCore->initialize(arguments, errorMessage); } diff --git a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp index b0b7c59e12a..33d4353d414 100644 --- a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp +++ b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp @@ -279,10 +279,6 @@ void QmlV8DebuggerClient::interruptInferior() void QmlV8DebuggerClient::startSession() { - //Set up Exception Handling first - //TODO: For now we enable breaks for all exceptions - breakOnException(AllExceptions, true); - QByteArray request; JsonInputStream(request) << '{' << INITIALPARAMS ; @@ -315,28 +311,39 @@ void QmlV8DebuggerClient::activateFrame(int index) bool QmlV8DebuggerClient::acceptsBreakpoint(const BreakpointModelId &id) { BreakpointType type = d->engine->breakHandler()->breakpointData(id).type; - return (type == BreakpointOnQmlSignalHandler || type == BreakpointByFunction); + return (type == BreakpointOnQmlSignalHandler + || type == BreakpointByFunction + || type == BreakpointAtJavaScriptThrow); } void QmlV8DebuggerClient::insertBreakpoint(const BreakpointModelId &id) { BreakHandler *handler = d->engine->breakHandler(); + const BreakpointParameters ¶ms = handler->breakpointData(id); + + if (params.type == BreakpointAtJavaScriptThrow) { + handler->notifyBreakpointInsertOk(id); + return breakOnException(AllExceptions, params.enabled); + } + QByteArray request; JsonInputStream(request) << '{' << INITIALPARAMS ; JsonInputStream(request) << ',' << "command" << ':' << "setbreakpoint"; JsonInputStream(request) << ',' << "arguments" << ':' << '{'; - if (handler->breakpointData(id).type == BreakpointByFileAndLine) { + if (params.type == BreakpointByFileAndLine) { JsonInputStream(request) << "type" << ':' << "script"; - JsonInputStream(request) << ',' << "target" << ':' << QFileInfo(handler->fileName(id)).fileName().toUtf8(); - JsonInputStream(request) << ',' << "line" << ':' << handler->lineNumber(id) - 1; - } else if (handler->breakpointData(id).type == BreakpointByFunction) { + JsonInputStream(request) << ',' << "target" << ':' << QFileInfo(params.fileName).fileName().toUtf8(); + JsonInputStream(request) << ',' << "line" << ':' << params.lineNumber - 1; + } else if (params.type == BreakpointByFunction) { JsonInputStream(request) << "type" << ':' << "function"; - JsonInputStream(request) << ',' << "target" << ':' << handler->functionName(id).toUtf8(); - } else if (handler->breakpointData(id).type == BreakpointOnQmlSignalHandler) { + JsonInputStream(request) << ',' << "target" << ':' << params.functionName.toUtf8(); + } else if (params.type == BreakpointOnQmlSignalHandler) { JsonInputStream(request) << "type" << ':' << "event"; - JsonInputStream(request) << ',' << "target" << ':' << handler->functionName(id).toUtf8(); + JsonInputStream(request) << ',' << "target" << ':' << params.functionName.toUtf8(); } + JsonInputStream(request) << ',' << "enabled" << ':' << params.enabled; + JsonInputStream(request) << '}'; JsonInputStream(request) << '}'; @@ -346,6 +353,12 @@ void QmlV8DebuggerClient::insertBreakpoint(const BreakpointModelId &id) void QmlV8DebuggerClient::removeBreakpoint(const BreakpointModelId &id) { + BreakHandler *handler = d->engine->breakHandler(); + + if (handler->breakpointData(id).type == BreakpointAtJavaScriptThrow) { + return breakOnException(AllExceptions, false); + } + int breakpoint = d->breakpoints.value(id); d->breakpoints.remove(id); @@ -363,8 +376,14 @@ void QmlV8DebuggerClient::removeBreakpoint(const BreakpointModelId &id) sendMessage(packMessage(request)); } -void QmlV8DebuggerClient::changeBreakpoint(const BreakpointModelId &/*id*/) +void QmlV8DebuggerClient::changeBreakpoint(const BreakpointModelId &id) { + BreakHandler *handler = d->engine->breakHandler(); + const BreakpointParameters ¶ms = handler->breakpointData(id); + + if (params.type == BreakpointAtJavaScriptThrow) { + return breakOnException(AllExceptions, params.enabled); + } } void QmlV8DebuggerClient::updateBreakpoints() @@ -482,8 +501,8 @@ void QmlV8DebuggerClient::messageReceived(const QByteArray &data) if (type == "response") { if (!value.findChild("success").toVariant().toBool()) { - //TODO:: Error - qDebug() << Q_FUNC_INFO << value.toString(true,2); + //TODO:: have to handle this case for each command + d->engine->logMessage(QmlEngine::LogReceive, QString("V8 Response Error: %1").arg(QString(value.toString(true,2)))); return; } @@ -514,8 +533,7 @@ void QmlV8DebuggerClient::messageReceived(const QByteArray &data) backtrace(); } else { - //TODO:: - //qDebug() << Q_FUNC_INFO << value.toString(true,2); + d->engine->logMessage(QmlEngine::LogReceive, value.toString(true,2)); } } else if (type == "event") { diff --git a/src/plugins/qmlprofiler/qmlprofilerattachdialog.ui b/src/plugins/qmlprofiler/qmlprofilerattachdialog.ui index 7619903627f..7d74b39e3fe 100644 --- a/src/plugins/qmlprofiler/qmlprofilerattachdialog.ui +++ b/src/plugins/qmlprofiler/qmlprofilerattachdialog.ui @@ -6,8 +6,8 @@ 0 0 - 184 - 124 + 185 + 115 @@ -19,21 +19,27 @@ - Address: + &Host: + + + addressLineEdit - 127.0.0.1 + localhost - Port: + &Port: + + + portSpinBox @@ -52,13 +58,6 @@ - - - - Qt::Horizontal - - - diff --git a/src/plugins/qt4projectmanager/buildconfigurationinfo.h b/src/plugins/qt4projectmanager/buildconfigurationinfo.h index b9795497c93..18883a7096e 100644 --- a/src/plugins/qt4projectmanager/buildconfigurationinfo.h +++ b/src/plugins/qt4projectmanager/buildconfigurationinfo.h @@ -60,7 +60,7 @@ struct QT4PROJECTMANAGER_EXPORT BuildConfigurationInfo { bool temporaryQtVersion; static QList importBuildConfigurations(const QString &proFilePath); - static BuildConfigurationInfo checkForBuild(const QString &directory, const QString &proFilePath); + static QList checkForBuild(const QString &directory, const QString &proFilePath); static QList filterBuildConfigurationInfos(const QList &infos, const QString &id); }; diff --git a/src/plugins/qt4projectmanager/qt4target.cpp b/src/plugins/qt4projectmanager/qt4target.cpp index b5e7922c128..014887462de 100644 --- a/src/plugins/qt4projectmanager/qt4target.cpp +++ b/src/plugins/qt4projectmanager/qt4target.cpp @@ -738,32 +738,46 @@ void Qt4DefaultTargetSetupWidget::addImportClicked() m_importLineButton->setAttribute(Qt::WA_MacNormalSize); return; } - BuildConfigurationInfo info = BuildConfigurationInfo::checkForBuild(m_importLinePath->path(), m_proFilePath); - if (!info.isValid()) { + QList infos = BuildConfigurationInfo::checkForBuild(m_importLinePath->path(), m_proFilePath); + if (infos.isEmpty()) { QMessageBox::critical(this, tr("No build found"), tr("No build found in %1 matching project %2.").arg(m_importLinePath->path()).arg(m_proFilePath)); return; } - if (!info.version->supportsTargetId(m_id)) { - QMessageBox::critical(this, - tr("Incompatible build found"), - tr("The build found in %1 is incompatible with this target").arg(m_importLinePath->path())); - return; + QList filterdInfos; + bool filtered = false; + foreach (const BuildConfigurationInfo &info, infos) { + if (info.version->supportsTargetId(m_id)) + filterdInfos << info; + else + filtered = true; + } + + if (filtered) { + if (filterdInfos.isEmpty()) { + QMessageBox::critical(this, + tr("Incompatible build found"), + tr("The build found in %1 is incompatible with this target").arg(m_importLinePath->path())); + return; + } + // show something if we found incompatible builds? } // We switch from to "NONE" on importing if the user has not changed it if (m_buildConfigurationTemplateUnchanged) setBuildConfigurationTemplate(NONE); - ++m_selected; - m_importEnabled << true; + foreach (const BuildConfigurationInfo &info, filterdInfos) { + ++m_selected; + m_importEnabled << true; - m_importInfos << info; + m_importInfos << info; - createImportWidget(info, m_importEnabled.size() - 1); - emit newImportBuildConfiguration(info); + createImportWidget(info, m_importEnabled.size() - 1); + emit newImportBuildConfiguration(info); + } emit selectedToggled(); } @@ -1103,9 +1117,9 @@ QList BuildConfigurationInfo::importBuildConfigurations( // Check for in source build first QString sourceDir = QFileInfo(proFilePath).absolutePath(); - BuildConfigurationInfo info = checkForBuild(sourceDir, proFilePath); - if (info.isValid()) - result.append(info); + QList infos = checkForBuild(sourceDir, proFilePath); + if (!infos.isEmpty()) + result.append(infos); // If we found a in source build, we do not search for out of source builds if (!result.isEmpty()) @@ -1120,9 +1134,9 @@ QList BuildConfigurationInfo::importBuildConfigurations( QString baseDir = QFileInfo(expectedBuildprefix).absolutePath(); foreach (const QString &dir, QDir(baseDir).entryList()) { if (dir.startsWith(expectedBuildprefix)) { - BuildConfigurationInfo info = checkForBuild(dir, proFilePath); - if (info.isValid()) - result.append(info); + QList infos = checkForBuild(dir, proFilePath); + if (infos.isEmpty()) + result.append(infos); } } } @@ -1130,45 +1144,50 @@ QList BuildConfigurationInfo::importBuildConfigurations( return result; } -BuildConfigurationInfo BuildConfigurationInfo::checkForBuild(const QString &directory, const QString &proFilePath) +QList BuildConfigurationInfo::checkForBuild(const QString &directory, const QString &proFilePath) { - QString makefile = directory + "/Makefile"; - QString qmakeBinary = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(makefile); - if (qmakeBinary.isEmpty()) - return BuildConfigurationInfo(); - if (QtSupport::QtVersionManager::makefileIsFor(makefile, proFilePath) != QtSupport::QtVersionManager::SameProject) - return BuildConfigurationInfo(); + QStringList makefiles = QDir(directory).entryList(QStringList() << "Makefile*"); + QList infos; + foreach (const QString &file, makefiles) { + QString makefile = directory + '/' + file; + QString qmakeBinary = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(makefile); + if (qmakeBinary.isEmpty()) + continue; + if (QtSupport::QtVersionManager::makefileIsFor(makefile, proFilePath) != QtSupport::QtVersionManager::SameProject) + continue; - bool temporaryQtVersion = false; - QtSupport::BaseQtVersion *version = QtSupport::QtVersionManager::instance()->qtVersionForQMakeBinary(qmakeBinary); - if (!version) { - version = QtSupport::QtVersionFactory::createQtVersionFromQMakePath(qmakeBinary); - temporaryQtVersion = true; - if (!version) - return BuildConfigurationInfo(); + bool temporaryQtVersion = false; + QtSupport::BaseQtVersion *version = QtSupport::QtVersionManager::instance()->qtVersionForQMakeBinary(qmakeBinary); + if (!version) { + version = QtSupport::QtVersionFactory::createQtVersionFromQMakePath(qmakeBinary); + temporaryQtVersion = true; + if (!version) + continue; + } + + QPair makefileBuildConfig = + QtSupport::QtVersionManager::scanMakeFile(makefile, version->defaultBuildConfig()); + + QString additionalArguments = makefileBuildConfig.second; + QString parsedSpec = Qt4BuildConfiguration::extractSpecFromArguments(&additionalArguments, directory, version); + QString versionSpec = version->mkspec(); + + QString specArgument; + // Compare mkspecs and add to additional arguments + if (parsedSpec.isEmpty() || parsedSpec == versionSpec || parsedSpec == "default") { + // using the default spec, don't modify additional arguments + } else { + specArgument = "-spec " + Utils::QtcProcess::quoteArg(parsedSpec); + } + Utils::QtcProcess::addArgs(&specArgument, additionalArguments); + + BuildConfigurationInfo info = BuildConfigurationInfo(version, + makefileBuildConfig.first, + specArgument, + directory, + true, + temporaryQtVersion); + infos.append(info); } - - QPair makefileBuildConfig = - QtSupport::QtVersionManager::scanMakeFile(makefile, version->defaultBuildConfig()); - - QString additionalArguments = makefileBuildConfig.second; - QString parsedSpec = Qt4BuildConfiguration::extractSpecFromArguments(&additionalArguments, directory, version); - QString versionSpec = version->mkspec(); - - QString specArgument; - // Compare mkspecs and add to additional arguments - if (parsedSpec.isEmpty() || parsedSpec == versionSpec || parsedSpec == "default") { - // using the default spec, don't modify additional arguments - } else { - specArgument = "-spec " + Utils::QtcProcess::quoteArg(parsedSpec); - } - Utils::QtcProcess::addArgs(&specArgument, additionalArguments); - - BuildConfigurationInfo info = BuildConfigurationInfo(version, - makefileBuildConfig.first, - specArgument, - directory, - true, - temporaryQtVersion); - return info; + return infos; } diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp index e249fb93642..fb78d3c3d07 100644 --- a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp +++ b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp @@ -43,8 +43,10 @@ #include #include +#include #include #include +#include #include #include #include @@ -66,14 +68,80 @@ QWeakPointer &examplesModelStatic() class Fetcher : public QObject { Q_OBJECT +public: + Fetcher() : QObject(), m_shutdown(false) + { + connect(Core::ICore::instance(), SIGNAL(coreAboutToClose()), this, SLOT(shutdown())); + } + + void wait() + { + if (QThread::currentThread() == QApplication::instance()->thread()) + return; + if (m_shutdown) + return; + + m_waitcondition.wait(&m_mutex, 4000); + } + + QByteArray data() + { + QMutexLocker lock(&m_dataMutex); + return m_fetchedData; + } + + void clearData() + { + QMutexLocker lock(&m_dataMutex); + m_fetchedData.clear(); + } + + bool asynchronousFetchData(const QUrl &url) + { + QMutexLocker lock(&m_mutex); + + if (!QMetaObject::invokeMethod(this, + "fetchData", + Qt::AutoConnection, + Q_ARG(QUrl, url))) { + return false; + } + + wait(); + return true; + } + + public slots: void fetchData(const QUrl &url) { - fetchedData = Core::HelpManager::instance()->fileData(url); + if (m_shutdown) + return; + + QMutexLocker lock(&m_mutex); + + if (Core::HelpManager::instance()) { + QMutexLocker dataLock(&m_dataMutex); + m_fetchedData = Core::HelpManager::instance()->fileData(url); + } + m_waitcondition.wakeAll(); + } + +private slots: + void shutdown() + { + m_shutdown = true; } public: - QByteArray fetchedData; + QByteArray m_fetchedData; + QWaitCondition m_waitcondition; + QMutex m_mutex; //This mutex synchronises the wait() and wakeAll() on the wait condition. + //We have to ensure that wakeAll() is called always after wait(). + + QMutex m_dataMutex; //This mutex synchronises the access of m_fectedData. + //If the wait condition timeouts we otherwise get a race condition. + bool m_shutdown; }; class HelpImageProvider : public QDeclarativeImageProvider @@ -88,20 +156,22 @@ public: QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) { QMutexLocker lock(&m_mutex); + QUrl url = QUrl::fromEncoded(id.toAscii()); - if (!QMetaObject::invokeMethod(&m_fetcher, - "fetchData", - Qt::BlockingQueuedConnection, - Q_ARG(QUrl, url))) { + + if (!m_fetcher.asynchronousFetchData(url)) + return QImage(); + + if (m_fetcher.data().isEmpty()) return QImage(); - } - QBuffer imgBuffer(&m_fetcher.fetchedData); + QBuffer imgBuffer(&m_fetcher.data()); imgBuffer.open(QIODevice::ReadOnly); QImageReader reader(&imgBuffer); QImage img = reader.read(); if (size && requestedSize != *size) img = img.scaled(requestedSize); - m_fetcher.fetchedData.clear(); + + m_fetcher.clearData(); return img; } private: diff --git a/src/plugins/remotelinux/remotelinuxplugin.cpp b/src/plugins/remotelinux/remotelinuxplugin.cpp index aa47157a60a..a540372627e 100644 --- a/src/plugins/remotelinux/remotelinuxplugin.cpp +++ b/src/plugins/remotelinux/remotelinuxplugin.cpp @@ -48,6 +48,8 @@ #include #include +#include + #include #include @@ -92,7 +94,7 @@ void RemoteLinuxPlugin::extensionsInitialized() QAction *startGdbServerAction = new QAction(tr("Start Remote Debug Server"), 0); Command *cmd = am->registerAction(startGdbServerAction, "StartGdbServer", globalcontext); cmd->setDefaultText(tr("Start Gdbserver")); - mstart->addAction(cmd, Constants::G_DEFAULT_TWO); + mstart->addAction(cmd, Debugger::Constants::G_START_CPP); connect(startGdbServerAction, SIGNAL(triggered()), SLOT(startGdbServer())); } diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index d011686bf9f..337c1418970 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -205,9 +205,9 @@ StateListener::StateListener(QObject *parent) : QObject(parent) { Core::ICore *core = Core::ICore::instance(); - connect(core->fileManager(), SIGNAL(currentFileChanged(QString)), + connect(core->editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)), this, SLOT(slotStateChanged())); - connect(core->editorManager()->instance(), SIGNAL(currentEditorStateChanged(Core::IEditor*)), + connect(core->editorManager(), SIGNAL(currentEditorStateChanged(Core::IEditor*)), this, SLOT(slotStateChanged())); connect(core->vcsManager(), SIGNAL(repositoryChanged(QString)), this, SLOT(slotStateChanged())); @@ -235,7 +235,11 @@ void StateListener::slotStateChanged() // temporary path prefix or does the file contains a hash, indicating a project // folder? State state; - state.currentFile = core->fileManager()->currentFile(); + Core::EditorManager *em = core->editorManager(); + if (!em || !em->currentEditor() || !em->currentEditor()->file()) + state.currentFile.clear(); + else + state.currentFile = em->currentEditor()->file()->fileName(); QScopedPointer currentFileInfo; // Instantiate QFileInfo only once if required. if (!state.currentFile.isEmpty()) { const bool isTempFile = state.currentFile.startsWith(QDir::tempPath()); diff --git a/src/plugins/welcome/welcome.pro b/src/plugins/welcome/welcome.pro index adec4b66bd1..008ed28acfd 100644 --- a/src/plugins/welcome/welcome.pro +++ b/src/plugins/welcome/welcome.pro @@ -15,3 +15,5 @@ SOURCES += welcomeplugin.cpp \ RESOURCES += welcome.qrc DEFINES += WELCOME_LIBRARY + +QML_IMPORT_PATH = $$IDE_SOURCE_TREE/lib/qtcreator/ diff --git a/tests/manual/debugger/gui/gui.pro b/tests/manual/debugger/gui/gui.pro index c62000beabd..3bab60a05a1 100644 --- a/tests/manual/debugger/gui/gui.pro +++ b/tests/manual/debugger/gui/gui.pro @@ -1,5 +1,7 @@ TARGET = gui CONFIG+=console +greaterThan(QT_MAJOR_VERSION, 4):QT *= widgets + TEMPLATE = app SOURCES += \ mainwindow.cpp \ diff --git a/tests/manual/debugger/gui/mainwindow.h b/tests/manual/debugger/gui/mainwindow.h index 2a7479e4235..dc1fe89796e 100644 --- a/tests/manual/debugger/gui/mainwindow.h +++ b/tests/manual/debugger/gui/mainwindow.h @@ -33,7 +33,7 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include +#include QT_BEGIN_NAMESPACE class QThread; diff --git a/tests/manual/debugger/gui/tst_gui.cpp b/tests/manual/debugger/gui/tst_gui.cpp index e537b0db970..73dd36c442f 100644 --- a/tests/manual/debugger/gui/tst_gui.cpp +++ b/tests/manual/debugger/gui/tst_gui.cpp @@ -30,7 +30,7 @@ ** **************************************************************************/ -#include +#include #include #include "mainwindow.h" diff --git a/tests/manual/debugger/helper/helper.pro b/tests/manual/debugger/helper/helper.pro index 5ccf8f946d1..867eb3fa2c5 100644 --- a/tests/manual/debugger/helper/helper.pro +++ b/tests/manual/debugger/helper/helper.pro @@ -1,5 +1,6 @@ include(../../../../qtcreator.pri) TEMPLATE = app +greaterThan(QT_MAJOR_VERSION, 4):QT *= widgets win32:DEFINES += _CRT_SECURE_NO_WARNINGS SOURCES += $$IDE_SOURCE_TREE/share/qtcreator/dumper/dumper.cpp diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp index d253b476265..813435937eb 100644 --- a/tests/manual/debugger/simple/simple_test_app.cpp +++ b/tests/manual/debugger/simple/simple_test_app.cpp @@ -102,18 +102,14 @@ void dummyStatement(...) {} #include #endif -#include -#include #include #include -#include - //#include #include #include #include -#include + #include #include @@ -127,6 +123,11 @@ void dummyStatement(...) {} #include #include +#include // QWidgets: Separate module as of Qt 5 +#include +#include +#include + #include #include #include diff --git a/tests/manual/debugger/simple/simple_test_app.pro b/tests/manual/debugger/simple/simple_test_app.pro index d00ffa8c2f2..84a29ff16b2 100644 --- a/tests/manual/debugger/simple/simple_test_app.pro +++ b/tests/manual/debugger/simple/simple_test_app.pro @@ -9,7 +9,10 @@ SOURCES += simple_test_app.cpp QT += network QT += script QT += xml -QT += core-private +greaterThan(QT_MAJOR_VERSION, 4) { + QT += core-private + QT *= widgets +} #unix: QMAKE_CXXFLAGS += -msse2 #DEFINES += USE_BOOST=1 diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index ee7301b3e61..4f1b41ed588 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -129,7 +129,7 @@ def createProject_Qt_GUI(path, projectName, qtVersion, checks): test.verify(os.path.exists(ui_path), "Checking if '" + ui_path + "' was created") test.verify(os.path.exists(pro_path), "Checking if '" + pro_path + "' was created") -def createNewQtQuickApplication(workingDir, projectName = None, templateFile = None, destination = QtQuickConstants.Destinations.DESKTOP): +def createNewQtQuickApplication(workingDir, projectName = None, templateFile = None, targets = QtQuickConstants.Targets.DESKTOP): invokeMenuItem("File", "New File or Project...") clickItem(waitForObject("{type='QTreeView' name='templateCategoryView'}", 20000), "Projects.Qt Quick Project", 5, 5, 0, Qt.LeftButton) clickItem(waitForObject("{name='templatesView' type='QListView'}", 20000), "Qt Quick Application", 5, 5, 0, Qt.LeftButton) @@ -157,7 +157,7 @@ def createNewQtQuickApplication(workingDir, projectName = None, templateFile = N baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}", 20000) type(baseLineEd, templateFile) clickButton(nextButton) - chooseDestination(destination) + chooseTargets(targets) snooze(1) clickButton(nextButton) selectFromCombo(":addToVersionControlComboBox_QComboBox", "") diff --git a/tests/system/shared/qtquick.py b/tests/system/shared/qtquick.py index 3eea3c6d62d..98b664bf0b1 100644 --- a/tests/system/shared/qtquick.py +++ b/tests/system/shared/qtquick.py @@ -9,7 +9,7 @@ class QtQuickConstants: MEEGO_HARMATTAN = 4 EXISTING_QML = 8 - class Destinations: + class Targets: DESKTOP = 1 SIMULATOR = 2 SYMBIAN = 4 @@ -30,16 +30,16 @@ class QtQuickConstants: return None @staticmethod - def getStringForDestination(destination): - if destination==QtQuickConstants.Destinations.DESKTOP: + def getStringForTarget(target): + if target==QtQuickConstants.Targets.DESKTOP: return "Desktop" - elif destination==QtQuickConstants.Destinations.SYMBIAN: + elif target==QtQuickConstants.Targets.SYMBIAN: return "Symbian Device" - elif destination==QtQuickConstants.Destinations.MAEMO5: + elif target==QtQuickConstants.Targets.MAEMO5: return "Maemo5" - elif destination==QtQuickConstants.Destinations.SIMULATOR: + elif target==QtQuickConstants.Targets.SIMULATOR: return "Qt Simulator" - elif destination==QtQuickConstants.Destinations.HARMATTAN: + elif target==QtQuickConstants.Targets.HARMATTAN: return "Harmattan" else: return None @@ -63,26 +63,26 @@ def chooseComponents(components=QtQuickConstants.Components.BUILTIN): test.verify(rbComponentToChoose.checked, "Selected QRadioButton is '%s'" % QtQuickConstants.getStringForComponents(components)) -# parameter destination can be an OR'd value of QtQuickConstants.Destinations -def chooseDestination(destination=QtQuickConstants.Destinations.DESKTOP): +# parameter target can be an OR'd value of QtQuickConstants.Targets +def chooseTargets(targets=QtQuickConstants.Targets.DESKTOP): # DESKTOP should be always accessible destDesktop = waitForObject("{type='QCheckBox' text='%s' visible='1'}" - % QtQuickConstants.getStringForDestination(QtQuickConstants.Destinations.DESKTOP), 20000) - mustCheck = destination & QtQuickConstants.Destinations.DESKTOP==QtQuickConstants.Destinations.DESKTOP - if (mustCheck and not destDesktop.checked) or (not mustCheck and destDesktop.checked): + % QtQuickConstants.getStringForTarget(QtQuickConstants.Targets.DESKTOP), 20000) + mustCheck = targets & QtQuickConstants.Targets.DESKTOP==QtQuickConstants.Targets.DESKTOP + if (mustCheck ^ destDesktop.checked): clickButton(destDesktop) - # following destinations depend on the build environment - added for further/later tests - available = [QtQuickConstants.Destinations.SYMBIAN, QtQuickConstants.Destinations.MAEMO5, - QtQuickConstants.Destinations.SIMULATOR, QtQuickConstants.Destinations.HARMATTAN] + # following targets depend on the build environment - added for further/later tests + available = [QtQuickConstants.Targets.SYMBIAN, QtQuickConstants.Targets.MAEMO5, + QtQuickConstants.Targets.SIMULATOR, QtQuickConstants.Targets.HARMATTAN] for current in available: - mustCheck = destination & current == current + mustCheck = targets & current == current try: - target = findObject("{type='QCheckBox' text='%s' visible='1'}" % QtQuickConstants.getStringForDestination(current)) - if (mustCheck and not target.checked) or (not mustCheck and target.checked): - clickButton(target) + targetCheckbox = findObject("{type='QCheckBox' text='%s' visible='1'}" % QtQuickConstants.getStringForTarget(current)) + if mustCheck ^ targetCheckbox.checked: + clickButton(targetCheckbox) except LookupError: if mustCheck: - test.fail("Failed to check destination '%s'" % QtQuickConstants.getStringForDestination(current)) + test.fail("Failed to check target '%s'" % QtQuickConstants.getStringForTarget(current)) def runAndCloseApp(): global processStarted, processExited diff --git a/tests/system/suite_qtquick/tst_qtquick_creation4/test.py b/tests/system/suite_qtquick/tst_qtquick_creation4/test.py index 1861aa25583..f2cd06a675c 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation4/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation4/test.py @@ -35,9 +35,8 @@ def createNewQmlExtension(): # now there's the 'untitled' project inside a temporary directory - step forward...! nextButton = waitForObject("{text~='(Next.*|Continue)' type='QPushButton' visible='1'}", 20000) clickButton(nextButton) - chooseDestination() + chooseTargets() clickButton(nextButton) -# buddy = waitForObject("{type='QLabel' text='Object Class-name:' unnamed='1' visible='1'}", 20000) nameLineEd = waitForObject("{buddy={type='QLabel' text='Object Class-name:' unnamed='1' visible='1'} " "type='QLineEdit' unnamed='1' visible='1'}", 20000) replaceEditorContent(nameLineEd, "TestItem")