Merge remote-tracking branch 'origin/2.4'

This commit is contained in:
Eike Ziller
2011-10-11 16:14:33 +02:00
50 changed files with 924 additions and 246 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -773,14 +773,6 @@
press \key Tab. Press \key {Shift+Tab} to decrease the indentation. You press \key Tab. Press \key {Shift+Tab} to decrease the indentation. You
can disable automatic indentation. 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 You can specify indentation either globally for all files or separately
for: for:
@@ -794,8 +786,9 @@
\endlist \endlist
You can specify indentation either globally for all files of a particular You can also specify indentation separately for each project. You can
type or separately for each project. 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 \section1 Indenting Text Files
@@ -808,15 +801,30 @@
To specify settings for a particular project, select \gui {Projects > To specify settings for a particular project, select \gui {Projects >
Editor Settings}. 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 \section1 Indenting C++ Files
To specify global indentation settings for the C++ editor, select To specify indentation settings for the C++ editor:
\gui {Tools > Options > C++}.
\image qtcreator-options-code-style-cpp.png "C++ Code Style options" \list 1
To specify the settings for a particular project, select \gui {Projects > \o Select \gui {Tools > Options > C++}.
Code Style Settings}.
\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: You can specify how to:
@@ -836,18 +844,35 @@
You can use the live preview to see how the options change the indentation. 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 > To specify the settings for a particular project, select \gui {Projects >
Code Style Settings}. Code Style Settings}.
You can specify how to interpret the \key Tab and \key Backspace key \section1 Indenting QML Files
presses.
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 \section1 Specifying Tab Settings
@@ -869,15 +894,41 @@
\endlist \endlist
By default, the tab-length in code editor is 8 spaces. You can specify the \section2 Specifying Tabs and Indentation
tab length separately for each project and for
different types of files.
The code editor can also determine whether tabs or spaces are used You can specify tab policy and tab size in the \gui Typing group. In the
on the previous or next line and copy the style. \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 By default, the tab length in code editor is 8 spaces and the indent size is
when the cursor is located within leading white space. 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 \section1 Specifying Settings for Content
@@ -1447,7 +1498,10 @@
\row \row
\i Add Definition in 'filename' \i Add Definition in 'filename'
\i Inserts a definition stub for a member function declaration in the \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 \i Method name
\row \row
\i Add 'Function' Declaration \i Add 'Function' Declaration
@@ -1496,6 +1550,15 @@
\o data member with the name \c {m_<propertyName>} \o data member with the name \c {m_<propertyName>}
\endlist \endlist
\i Q_PROPERTY \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 \endtable
\section2 Refactoring QML Code \section2 Refactoring QML Code

View File

@@ -40,11 +40,15 @@
You can configure the code style according to your needs. You can specify You can configure the code style according to your needs. You can specify
code style either globally for all projects or separately for each code style either globally for all projects or separately for each
project. To specify global code style for C++ files, select \gui {Tools > project. You can specify several sets of code style settings and easily
Options > C++}. 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 To specify global code style settings sets for C++ files, select
> Qt Quick}. \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: 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 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 \o Give a name to the settings and click \gui OK.
settings are available for QML files.
\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 \endlist
\image qtcreator-code-style-settings.png "Code Style Settings view"
For more information about the settings, see \l{Indenting Code}. For more information about the settings, see \l{Indenting Code}.
*/ */

View File

@@ -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" }
}
}

View File

@@ -77,16 +77,25 @@
# endif # endif
#endif #endif
#if USE_QT_GUI #ifndef USE_QT_WIDGETS
# include <QtGui/QApplication> # if defined(QT_WIDGETS_LIB) || ((QT_VERSION < 0x050000) && defined(USE_QT_GUI))
# define USE_QT_WIDGETS 1
# endif
#endif
#ifdef USE_QT_GUI
# include <QtGui/QImage> # include <QtGui/QImage>
# include <QtGui/QRegion> # include <QtGui/QRegion>
# include <QtGui/QPixmap> # include <QtGui/QPixmap>
# include <QtGui/QWidget>
# include <QtGui/QFont> # include <QtGui/QFont>
# include <QtGui/QColor> # include <QtGui/QColor>
# include <QtGui/QKeySequence> # include <QtGui/QKeySequence>
#endif
#ifdef USE_QT_WIDGETS
# include <QtGui/QSizePolicy> # include <QtGui/QSizePolicy>
# include <QtGui/QWidget>
# include <QtGui/QApplication>
#endif #endif
#endif // QT_BOOTSTRAPPED #endif // QT_BOOTSTRAPPED
@@ -1670,7 +1679,7 @@ static void qDumpQImage(QDumper &d)
static void qDumpQImageData(QDumper &d) static void qDumpQImageData(QDumper &d)
{ {
const QImage &im = *reinterpret_cast<const QImage *>(d.data); const QImage &im = *reinterpret_cast<const QImage *>(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("type", NS"QImageData");
d.putItem("numchild", "0"); d.putItem("numchild", "0");
#if 1 #if 1
@@ -1703,7 +1712,10 @@ static void qDumpQList(QDumper &d)
return; return;
if (pdata.d->begin > pdata.d->end) if (pdata.d->begin > pdata.d->end)
return; 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) if (pdata.d->ref._q_value <= 0)
return; return;
#endif #endif

View File

@@ -13,6 +13,7 @@ else {
DEFINES += USE_QT_GUI=1 DEFINES += USE_QT_GUI=1
QT = core \ QT = core \
gui gui
greaterThan(QT_MAJOR_VERSION, 4):QT *= widgets
} }
exists($$QMAKE_INCDIR_QT/QtCore/private/qobject_p.h):DEFINES += HAS_QOBJECT_P_H exists($$QMAKE_INCDIR_QT/QtCore/private/qobject_p.h):DEFINES += HAS_QOBJECT_P_H
HEADERS += dumper.h HEADERS += dumper.h

View File

@@ -425,7 +425,11 @@ def check(exp):
raise RuntimeError("Check failed") raise RuntimeError("Check failed")
def checkRef(ref): 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 > 0)
check(count < 1000000) # assume there aren't a million references to any object check(count < 1000000) # assume there aren't a million references to any object

View File

@@ -7,7 +7,7 @@
TARGET = dumpertest TARGET = dumpertest
CONFIG += console CONFIG += console
CONFIG -= app_bundle CONFIG -= app_bundle
greaterThan(QT_MAJOR_VERSION, 4):QT *= widgets
TEMPLATE = app TEMPLATE = app
SOURCES += main.cpp \ SOURCES += main.cpp \

View File

@@ -40,7 +40,7 @@
#include <QtCore/QVariant> #include <QtCore/QVariant>
#include <QtCore/QFileInfo> #include <QtCore/QFileInfo>
#include <QtCore/QCoreApplication> #include <QtCore/QCoreApplication>
#include <QtGui/QAction> #include <QAction>
#include <string> #include <string>
#include <list> #include <list>

View File

@@ -37,40 +37,29 @@ Item {
id: root id: root
property int currentItem: 0 property int currentItem: 0
property alias model: repeater.model property alias model: view.model
property alias itemCount: repeater.count property alias itemCount: view.count
Timer { Timer {
id: nextItemTimer id: nextItemTimer
repeat: true repeat: true
interval: 30*1000 interval: 30*1000
onTriggered: repeater.incrementIndex() onTriggered: view.incrementCurrentIndex()
} }
Timer { Timer {
id: modelUpdateTimer id: modelUpdateTimer
repeat: false repeat: false
interval: 1000 interval: 1000
onTriggered: repeater.handleModelUpdate(); onTriggered: view.handleModelUpdate();
} }
Repeater { ListView {
id: repeater id: view
function incrementIndex() {
repeater.itemAt(currentItem).active = false
currentItem = (currentItem+1) % repeater.count
repeater.itemAt(currentItem).active = true
}
function handleModelUpdate() { function handleModelUpdate() {
nextItemTimer.stop(); nextItemTimer.stop();
currentItem = 0; currentIndex = 0;
for (var i = 0; i < count; ++i) {
if (i != currentItem)
repeater.itemAt(i).active = false;
else
repeater.itemAt(i).active = true;
}
nextItemTimer.start(); nextItemTimer.start();
} }
@@ -78,21 +67,16 @@ Item {
modelUpdateTimer.restart(); modelUpdateTimer.restart();
} }
function handleItemRemoved(index, item) {
modelUpdateTimer.restart();
}
function handleItemAdded(index, item) {
modelUpdateTimer.restart();
}
anchors.fill: parent anchors.fill: parent
highlightMoveDuration: 1 // don't show any scrolling
keyNavigationWraps: true // start from 0 again if at end
interactive: false
onModelChanged: handleModelChanged() onModelChanged: handleModelChanged()
onItemAdded: handleItemAdded(index, item)
onItemRemoved: handleItemRemoved(index, item)
delegate: Item { delegate: Item {
property bool active: false
id: delegateItem id: delegateItem
property bool active: ListView.isCurrentItem
opacity: 0 opacity: 0
height: root.height height: root.height
width: root.width width: root.width

View File

@@ -30,6 +30,9 @@
** **
**************************************************************************/ **************************************************************************/
#ifndef APP_VERSION_H
#define APP_VERSION_H
namespace Core { namespace Core {
namespace Constants { namespace Constants {
@@ -66,3 +69,5 @@ const char * const IDE_REVISION_STR = \"\";
} // Constants } // Constants
} // Core } // Core
#endif //APP_VERSION_H

View File

@@ -222,6 +222,12 @@ qint64 QDeclarativeDebugConnection::writeData(const char *data, qint64 maxSize)
return d->device->write(data, maxSize); return d->device->write(data, maxSize);
} }
void QDeclarativeDebugConnection::internalError(QAbstractSocket::SocketError socketError)
{
setErrorString(d->device->errorString());
emit error(socketError);
}
qint64 QDeclarativeDebugConnection::bytesAvailable() const qint64 QDeclarativeDebugConnection::bytesAvailable() const
{ {
return d->device->bytesAvailable(); return d->device->bytesAvailable();
@@ -300,7 +306,7 @@ void QDeclarativeDebugConnection::connectToHost(const QString &hostName, quint16
d->connectDeviceSignals(); d->connectDeviceSignals();
d->gotHello = false; d->gotHello = false;
connect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SIGNAL(stateChanged(QAbstractSocket::SocketState))); 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())); connect(socket, SIGNAL(connected()), this, SIGNAL(connected()));
socket->connectToHost(hostName, port); socket->connectToHost(hostName, port);
QIODevice::open(ReadWrite | Unbuffered); QIODevice::open(ReadWrite | Unbuffered);

View File

@@ -66,6 +66,9 @@ protected:
qint64 readData(char *data, qint64 maxSize); qint64 readData(char *data, qint64 maxSize);
qint64 writeData(const char *data, qint64 maxSize); qint64 writeData(const char *data, qint64 maxSize);
private slots:
void internalError(QAbstractSocket::SocketError error);
private: private:
QDeclarativeDebugConnectionPrivate *d; QDeclarativeDebugConnectionPrivate *d;
friend class QDeclarativeDebugClient; friend class QDeclarativeDebugClient;

View File

@@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>246</width> <width>246</width>
<height>147</height> <height>183</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -73,7 +73,10 @@
<item row="3" column="0"> <item row="3" column="0">
<widget class="QLabel" name="sysrootLabel"> <widget class="QLabel" name="sysrootLabel">
<property name="text"> <property name="text">
<string>Sysroot</string> <string>Sys&amp;root:</string>
</property>
<property name="buddy">
<cstring>sysrootPathChooser</cstring>
</property> </property>
</widget> </widget>
</item> </item>

View File

@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>435</width> <width>185</width>
<height>133</height> <height>115</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -17,12 +17,12 @@
<item> <item>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::FieldsStayAtSizeHint</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="hostLabel"> <widget class="QLabel" name="hostLabel">
<property name="text"> <property name="text">
<string>Host</string> <string>&amp;Host:</string>
</property> </property>
<property name="buddy"> <property name="buddy">
<cstring>hostLineEdit</cstring> <cstring>hostLineEdit</cstring>
@@ -39,7 +39,10 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="portLabel"> <widget class="QLabel" name="portLabel">
<property name="text"> <property name="text">
<string>Port</string> <string>&amp;Port:</string>
</property>
<property name="buddy">
<cstring>portSpinBox</cstring>
</property> </property>
</widget> </widget>
</item> </item>

View File

@@ -124,6 +124,8 @@ static QString typeToString(BreakpointType type)
return BreakHandler::tr("Watchpoint at Expression"); return BreakHandler::tr("Watchpoint at Expression");
case BreakpointOnQmlSignalHandler: case BreakpointOnQmlSignalHandler:
return BreakHandler::tr("Breakpoint on QML Signal Handler"); return BreakHandler::tr("Breakpoint on QML Signal Handler");
case BreakpointAtJavaScriptThrow:
return BreakHandler::tr("Breakpoint at JavaScript throw");
case UnknownType: case UnknownType:
break; break;
} }

View File

@@ -277,6 +277,7 @@ QString BreakpointParameters::toString() const
case BreakpointAtExec: case BreakpointAtExec:
//case BreakpointAtVFork: //case BreakpointAtVFork:
case BreakpointAtSysCall: case BreakpointAtSysCall:
case BreakpointAtJavaScriptThrow:
case UnknownType: case UnknownType:
break; break;
} }

View File

@@ -140,7 +140,8 @@ enum BreakpointType
BreakpointAtSysCall, BreakpointAtSysCall,
WatchpointAtAddress, WatchpointAtAddress,
WatchpointAtExpression, WatchpointAtExpression,
BreakpointOnQmlSignalHandler BreakpointOnQmlSignalHandler,
BreakpointAtJavaScriptThrow
}; };
//! \enum Debugger::Internal::BreakpointState //! \enum Debugger::Internal::BreakpointState

View File

@@ -120,9 +120,10 @@ BreakpointDialog::BreakpointDialog(unsigned engineCapabilities, QWidget *parent)
<< tr("Break when a system call is executed") << tr("Break when a system call is executed")
<< tr("Break on data access at fixed address") << tr("Break on data access at fixed address")
<< tr("Break on data access at address given by expression") << 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.comboBoxType->addItems(types);
m_ui.pathChooserFileName->setExpectedKind(Utils::PathChooser::File); m_ui.pathChooserFileName->setExpectedKind(Utils::PathChooser::File);
connect(m_ui.comboBoxType, SIGNAL(activated(int)), SLOT(typeChanged(int))); connect(m_ui.comboBoxType, SIGNAL(activated(int)), SLOT(typeChanged(int)));
@@ -352,6 +353,7 @@ void BreakpointDialog::typeChanged(int)
case BreakpointAtExec: case BreakpointAtExec:
//case BreakpointAtVFork: //case BreakpointAtVFork:
case BreakpointAtSysCall: case BreakpointAtSysCall:
case BreakpointAtJavaScriptThrow:
break; break;
case BreakpointByAddress: case BreakpointByAddress:
case WatchpointAtAddress: case WatchpointAtAddress:
@@ -384,6 +386,7 @@ void BreakpointDialog::typeChanged(int)
case BreakpointAtExec: case BreakpointAtExec:
//case BreakpointAtVFork: //case BreakpointAtVFork:
case BreakpointAtSysCall: case BreakpointAtSysCall:
case BreakpointAtJavaScriptThrow:
clearOtherParts(AllConditionParts|ModulePart|TracePointPart); clearOtherParts(AllConditionParts|ModulePart|TracePointPart);
setPartsEnabled(AllConditionParts|TracePointPart); setPartsEnabled(AllConditionParts|TracePointPart);
break; break;

View File

@@ -2551,6 +2551,7 @@ bool CdbEngine::acceptsBreakpoint(BreakpointModelId id) const
case WatchpointAtExpression: case WatchpointAtExpression:
case BreakpointAtSysCall: case BreakpointAtSysCall:
case BreakpointOnQmlSignalHandler: case BreakpointOnQmlSignalHandler:
case BreakpointAtJavaScriptThrow:
return false; return false;
case WatchpointAtAddress: case WatchpointAtAddress:
case BreakpointByFileAndLine: case BreakpointByFileAndLine:

View File

@@ -108,6 +108,7 @@ static BreakpointParameters fixWinMSVCBreakpoint(const BreakpointParameters &p)
case BreakpointAtSysCall: case BreakpointAtSysCall:
case WatchpointAtAddress: case WatchpointAtAddress:
case BreakpointOnQmlSignalHandler: case BreakpointOnQmlSignalHandler:
case BreakpointAtJavaScriptThrow:
break; break;
case BreakpointAtExec: { // Emulate by breaking on CreateProcessW(). case BreakpointAtExec: { // Emulate by breaking on CreateProcessW().
BreakpointParameters rc(BreakpointByFunction); BreakpointParameters rc(BreakpointByFunction);
@@ -165,6 +166,7 @@ QByteArray cdbAddBreakpointCommand(const BreakpointParameters &bpIn,
case BreakpointAtThrow: case BreakpointAtThrow:
case BreakpointAtMain: case BreakpointAtMain:
case BreakpointOnQmlSignalHandler: case BreakpointOnQmlSignalHandler:
case BreakpointAtJavaScriptThrow:
QTC_ASSERT(false, return QByteArray(); ) QTC_ASSERT(false, return QByteArray(); )
break; break;
case BreakpointByAddress: case BreakpointByAddress:

View File

@@ -46,6 +46,10 @@ const char C_DEBUGMODE[] = "Debugger.DebugMode";
const char C_CPPDEBUGGER[] = "Gdb Debugger"; const char C_CPPDEBUGGER[] = "Gdb Debugger";
const char C_QMLDEBUGGER[] = "Qml/JavaScript 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) // Project Explorer run mode (RUN/DEBUG)
const char DEBUGMODE[] = "Debugger.DebugMode"; const char DEBUGMODE[] = "Debugger.DebugMode";
const char DEBUGMODE2[] = "Debugger.DebugMode2"; // Breaks on main. const char DEBUGMODE2[] = "Debugger.DebugMode2"; // Breaks on main.

View File

@@ -1583,6 +1583,11 @@ void DebuggerEngine::showStoppedByExceptionMessageBox(const QString &description
bool DebuggerEngine::isCppBreakpoint(const BreakpointParameters &p) bool DebuggerEngine::isCppBreakpoint(const BreakpointParameters &p)
{ {
//Qml specific breakpoint types
if (p.type == BreakpointAtJavaScriptThrow
|| p.type == BreakpointOnQmlSignalHandler)
return false;
// Qml is currently only file // Qml is currently only file
if (p.type != BreakpointByFileAndLine) if (p.type != BreakpointByFileAndLine)
return true; return true;

View File

@@ -1400,16 +1400,6 @@ void DebuggerPluginPrivate::onCurrentProjectChanged(Project *project)
void DebuggerPluginPrivate::languagesChanged() 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() void DebuggerPluginPrivate::debugProject()
@@ -2962,6 +2952,12 @@ void DebuggerPluginPrivate::extensionsInitialized()
act->setText(tr("Detach Debugger")); act->setText(tr("Detach Debugger"));
connect(act, SIGNAL(triggered()), SLOT(handleExecDetach())); connect(act, SIGNAL(triggered()), SLOT(handleExecDetach()));
// "Start Debugging" sub-menu
// groups:
// G_DEFAULT_ONE
// G_START_CPP
// G_START_QML
Command *cmd = 0; Command *cmd = 0;
ActionContainer *mstart = am->actionContainer(PE::M_DEBUG_STARTDEBUGGING); ActionContainer *mstart = am->actionContainer(PE::M_DEBUG_STARTDEBUGGING);
@@ -2969,7 +2965,7 @@ void DebuggerPluginPrivate::extensionsInitialized()
cmd->setDefaultText(tr("Start Debugging")); cmd->setDefaultText(tr("Start Debugging"));
cmd->setDefaultKeySequence(QKeySequence(Constants::DEBUG_KEY)); cmd->setDefaultKeySequence(QKeySequence(Constants::DEBUG_KEY));
cmd->setAttribute(Command::CA_UpdateText); 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 = new Utils::ProxyAction(this);
m_visibleStartAction->initialize(m_startAction); m_visibleStartAction->initialize(m_startAction);
@@ -2983,52 +2979,54 @@ void DebuggerPluginPrivate::extensionsInitialized()
cmd = am->registerAction(m_startExternalAction, cmd = am->registerAction(m_startExternalAction,
"Debugger.StartExternal", globalcontext); "Debugger.StartExternal", globalcontext);
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
mstart->addAction(cmd, CC::G_DEFAULT_ONE); mstart->addAction(cmd, Constants::G_START_CPP);
cmd = am->registerAction(m_attachExternalAction, cmd = am->registerAction(m_attachExternalAction,
"Debugger.AttachExternal", globalcontext); "Debugger.AttachExternal", globalcontext);
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
mstart->addAction(cmd, CC::G_DEFAULT_ONE); mstart->addAction(cmd, Constants::G_START_CPP);
cmd = am->registerAction(m_attachCoreAction, cmd = am->registerAction(m_attachCoreAction,
"Debugger.AttachCore", globalcontext); "Debugger.AttachCore", globalcontext);
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
mstart->addAction(cmd, CC::G_DEFAULT_ONE); mstart->addAction(cmd, Constants::G_START_CPP);
cmd = am->registerAction(m_startRemoteAction, cmd = am->registerAction(m_startRemoteAction,
"Debugger.StartRemote", globalcontext); "Debugger.StartRemote", globalcontext);
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
mstart->addAction(cmd, CC::G_DEFAULT_ONE); mstart->addAction(cmd, Constants::G_START_CPP);
cmd = am->registerAction(m_attachRemoteAction, cmd = am->registerAction(m_attachRemoteAction,
"Debugger.AttachRemote", globalcontext); "Debugger.AttachRemote", globalcontext);
cmd->setAttribute(Command::CA_Hide); 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 #ifdef WITH_LLDB
cmd = am->registerAction(m_startRemoteLldbAction, cmd = am->registerAction(m_startRemoteLldbAction,
"Debugger.RemoteLldb", globalcontext); "Debugger.RemoteLldb", globalcontext);
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
mstart->addAction(cmd, CC::G_DEFAULT_ONE); mstart->addAction(cmd, Constants::G_START_CPP);
#endif #endif
if (m_startRemoteCdbAction) { if (m_startRemoteCdbAction) {
cmd = am->registerAction(m_startRemoteCdbAction, cmd = am->registerAction(m_startRemoteCdbAction,
"Debugger.AttachRemoteCdb", globalcontext); "Debugger.AttachRemoteCdb", globalcontext);
cmd->setAttribute(Command::CA_Hide); 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); sep->setSeparator(true);
cmd = am->registerAction(sep, "Debugger.Sep.Start", globalcontext); cmd = am->registerAction(sep,
mstart->addAction(cmd); "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, cmd = am->registerAction(m_detachAction,
"Debugger.Detach", globalcontext); "Debugger.Detach", globalcontext);
@@ -3378,6 +3376,25 @@ DebuggerPlugin::~DebuggerPlugin()
bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMessage) 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); return theDebuggerCore->initialize(arguments, errorMessage);
} }

View File

@@ -279,10 +279,6 @@ void QmlV8DebuggerClient::interruptInferior()
void QmlV8DebuggerClient::startSession() void QmlV8DebuggerClient::startSession()
{ {
//Set up Exception Handling first
//TODO: For now we enable breaks for all exceptions
breakOnException(AllExceptions, true);
QByteArray request; QByteArray request;
JsonInputStream(request) << '{' << INITIALPARAMS ; JsonInputStream(request) << '{' << INITIALPARAMS ;
@@ -315,28 +311,39 @@ void QmlV8DebuggerClient::activateFrame(int index)
bool QmlV8DebuggerClient::acceptsBreakpoint(const BreakpointModelId &id) bool QmlV8DebuggerClient::acceptsBreakpoint(const BreakpointModelId &id)
{ {
BreakpointType type = d->engine->breakHandler()->breakpointData(id).type; 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) void QmlV8DebuggerClient::insertBreakpoint(const BreakpointModelId &id)
{ {
BreakHandler *handler = d->engine->breakHandler(); BreakHandler *handler = d->engine->breakHandler();
const BreakpointParameters &params = handler->breakpointData(id);
if (params.type == BreakpointAtJavaScriptThrow) {
handler->notifyBreakpointInsertOk(id);
return breakOnException(AllExceptions, params.enabled);
}
QByteArray request; QByteArray request;
JsonInputStream(request) << '{' << INITIALPARAMS ; JsonInputStream(request) << '{' << INITIALPARAMS ;
JsonInputStream(request) << ',' << "command" << ':' << "setbreakpoint"; JsonInputStream(request) << ',' << "command" << ':' << "setbreakpoint";
JsonInputStream(request) << ',' << "arguments" << ':' << '{'; JsonInputStream(request) << ',' << "arguments" << ':' << '{';
if (handler->breakpointData(id).type == BreakpointByFileAndLine) { if (params.type == BreakpointByFileAndLine) {
JsonInputStream(request) << "type" << ':' << "script"; JsonInputStream(request) << "type" << ':' << "script";
JsonInputStream(request) << ',' << "target" << ':' << QFileInfo(handler->fileName(id)).fileName().toUtf8(); JsonInputStream(request) << ',' << "target" << ':' << QFileInfo(params.fileName).fileName().toUtf8();
JsonInputStream(request) << ',' << "line" << ':' << handler->lineNumber(id) - 1; JsonInputStream(request) << ',' << "line" << ':' << params.lineNumber - 1;
} else if (handler->breakpointData(id).type == BreakpointByFunction) { } else if (params.type == BreakpointByFunction) {
JsonInputStream(request) << "type" << ':' << "function"; JsonInputStream(request) << "type" << ':' << "function";
JsonInputStream(request) << ',' << "target" << ':' << handler->functionName(id).toUtf8(); JsonInputStream(request) << ',' << "target" << ':' << params.functionName.toUtf8();
} else if (handler->breakpointData(id).type == BreakpointOnQmlSignalHandler) { } else if (params.type == BreakpointOnQmlSignalHandler) {
JsonInputStream(request) << "type" << ':' << "event"; 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) << '}';
JsonInputStream(request) << '}'; JsonInputStream(request) << '}';
@@ -346,6 +353,12 @@ void QmlV8DebuggerClient::insertBreakpoint(const BreakpointModelId &id)
void QmlV8DebuggerClient::removeBreakpoint(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); int breakpoint = d->breakpoints.value(id);
d->breakpoints.remove(id); d->breakpoints.remove(id);
@@ -363,8 +376,14 @@ void QmlV8DebuggerClient::removeBreakpoint(const BreakpointModelId &id)
sendMessage(packMessage(request)); sendMessage(packMessage(request));
} }
void QmlV8DebuggerClient::changeBreakpoint(const BreakpointModelId &/*id*/) void QmlV8DebuggerClient::changeBreakpoint(const BreakpointModelId &id)
{ {
BreakHandler *handler = d->engine->breakHandler();
const BreakpointParameters &params = handler->breakpointData(id);
if (params.type == BreakpointAtJavaScriptThrow) {
return breakOnException(AllExceptions, params.enabled);
}
} }
void QmlV8DebuggerClient::updateBreakpoints() void QmlV8DebuggerClient::updateBreakpoints()
@@ -482,8 +501,8 @@ void QmlV8DebuggerClient::messageReceived(const QByteArray &data)
if (type == "response") { if (type == "response") {
if (!value.findChild("success").toVariant().toBool()) { if (!value.findChild("success").toVariant().toBool()) {
//TODO:: Error //TODO:: have to handle this case for each command
qDebug() << Q_FUNC_INFO << value.toString(true,2); d->engine->logMessage(QmlEngine::LogReceive, QString("V8 Response Error: %1").arg(QString(value.toString(true,2))));
return; return;
} }
@@ -514,8 +533,7 @@ void QmlV8DebuggerClient::messageReceived(const QByteArray &data)
backtrace(); backtrace();
} else { } else {
//TODO:: d->engine->logMessage(QmlEngine::LogReceive, value.toString(true,2));
//qDebug() << Q_FUNC_INFO << value.toString(true,2);
} }
} else if (type == "event") { } else if (type == "event") {

View File

@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>184</width> <width>185</width>
<height>124</height> <height>115</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -19,21 +19,27 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="addressLabel"> <widget class="QLabel" name="addressLabel">
<property name="text"> <property name="text">
<string>Address:</string> <string>&amp;Host:</string>
</property>
<property name="buddy">
<cstring>addressLineEdit</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLineEdit" name="addressLineEdit"> <widget class="QLineEdit" name="addressLineEdit">
<property name="text"> <property name="text">
<string>127.0.0.1</string> <string>localhost</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="portLabel"> <widget class="QLabel" name="portLabel">
<property name="text"> <property name="text">
<string>Port:</string> <string>&amp;Port:</string>
</property>
<property name="buddy">
<cstring>portSpinBox</cstring>
</property> </property>
</widget> </widget>
</item> </item>
@@ -52,13 +58,6 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation"> <property name="orientation">

View File

@@ -60,7 +60,7 @@ struct QT4PROJECTMANAGER_EXPORT BuildConfigurationInfo {
bool temporaryQtVersion; bool temporaryQtVersion;
static QList<BuildConfigurationInfo> importBuildConfigurations(const QString &proFilePath); static QList<BuildConfigurationInfo> importBuildConfigurations(const QString &proFilePath);
static BuildConfigurationInfo checkForBuild(const QString &directory, const QString &proFilePath); static QList<BuildConfigurationInfo> checkForBuild(const QString &directory, const QString &proFilePath);
static QList<BuildConfigurationInfo> filterBuildConfigurationInfos(const QList<BuildConfigurationInfo> &infos, const QString &id); static QList<BuildConfigurationInfo> filterBuildConfigurationInfos(const QList<BuildConfigurationInfo> &infos, const QString &id);
}; };

View File

@@ -738,32 +738,46 @@ void Qt4DefaultTargetSetupWidget::addImportClicked()
m_importLineButton->setAttribute(Qt::WA_MacNormalSize); m_importLineButton->setAttribute(Qt::WA_MacNormalSize);
return; return;
} }
BuildConfigurationInfo info = BuildConfigurationInfo::checkForBuild(m_importLinePath->path(), m_proFilePath); QList<BuildConfigurationInfo> infos = BuildConfigurationInfo::checkForBuild(m_importLinePath->path(), m_proFilePath);
if (!info.isValid()) { if (infos.isEmpty()) {
QMessageBox::critical(this, QMessageBox::critical(this,
tr("No build found"), tr("No build found"),
tr("No build found in %1 matching project %2.").arg(m_importLinePath->path()).arg(m_proFilePath)); tr("No build found in %1 matching project %2.").arg(m_importLinePath->path()).arg(m_proFilePath));
return; return;
} }
if (!info.version->supportsTargetId(m_id)) { QList<BuildConfigurationInfo> filterdInfos;
QMessageBox::critical(this, bool filtered = false;
tr("Incompatible build found"), foreach (const BuildConfigurationInfo &info, infos) {
tr("The build found in %1 is incompatible with this target").arg(m_importLinePath->path())); if (info.version->supportsTargetId(m_id))
return; 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 // We switch from to "NONE" on importing if the user has not changed it
if (m_buildConfigurationTemplateUnchanged) if (m_buildConfigurationTemplateUnchanged)
setBuildConfigurationTemplate(NONE); setBuildConfigurationTemplate(NONE);
++m_selected; foreach (const BuildConfigurationInfo &info, filterdInfos) {
m_importEnabled << true; ++m_selected;
m_importEnabled << true;
m_importInfos << info; m_importInfos << info;
createImportWidget(info, m_importEnabled.size() - 1); createImportWidget(info, m_importEnabled.size() - 1);
emit newImportBuildConfiguration(info); emit newImportBuildConfiguration(info);
}
emit selectedToggled(); emit selectedToggled();
} }
@@ -1103,9 +1117,9 @@ QList<BuildConfigurationInfo> BuildConfigurationInfo::importBuildConfigurations(
// Check for in source build first // Check for in source build first
QString sourceDir = QFileInfo(proFilePath).absolutePath(); QString sourceDir = QFileInfo(proFilePath).absolutePath();
BuildConfigurationInfo info = checkForBuild(sourceDir, proFilePath); QList<BuildConfigurationInfo> infos = checkForBuild(sourceDir, proFilePath);
if (info.isValid()) if (!infos.isEmpty())
result.append(info); result.append(infos);
// If we found a in source build, we do not search for out of source builds // If we found a in source build, we do not search for out of source builds
if (!result.isEmpty()) if (!result.isEmpty())
@@ -1120,9 +1134,9 @@ QList<BuildConfigurationInfo> BuildConfigurationInfo::importBuildConfigurations(
QString baseDir = QFileInfo(expectedBuildprefix).absolutePath(); QString baseDir = QFileInfo(expectedBuildprefix).absolutePath();
foreach (const QString &dir, QDir(baseDir).entryList()) { foreach (const QString &dir, QDir(baseDir).entryList()) {
if (dir.startsWith(expectedBuildprefix)) { if (dir.startsWith(expectedBuildprefix)) {
BuildConfigurationInfo info = checkForBuild(dir, proFilePath); QList<BuildConfigurationInfo> infos = checkForBuild(dir, proFilePath);
if (info.isValid()) if (infos.isEmpty())
result.append(info); result.append(infos);
} }
} }
} }
@@ -1130,45 +1144,50 @@ QList<BuildConfigurationInfo> BuildConfigurationInfo::importBuildConfigurations(
return result; return result;
} }
BuildConfigurationInfo BuildConfigurationInfo::checkForBuild(const QString &directory, const QString &proFilePath) QList<BuildConfigurationInfo> BuildConfigurationInfo::checkForBuild(const QString &directory, const QString &proFilePath)
{ {
QString makefile = directory + "/Makefile"; QStringList makefiles = QDir(directory).entryList(QStringList() << "Makefile*");
QString qmakeBinary = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(makefile); QList<BuildConfigurationInfo> infos;
if (qmakeBinary.isEmpty()) foreach (const QString &file, makefiles) {
return BuildConfigurationInfo(); QString makefile = directory + '/' + file;
if (QtSupport::QtVersionManager::makefileIsFor(makefile, proFilePath) != QtSupport::QtVersionManager::SameProject) QString qmakeBinary = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(makefile);
return BuildConfigurationInfo(); if (qmakeBinary.isEmpty())
continue;
if (QtSupport::QtVersionManager::makefileIsFor(makefile, proFilePath) != QtSupport::QtVersionManager::SameProject)
continue;
bool temporaryQtVersion = false; bool temporaryQtVersion = false;
QtSupport::BaseQtVersion *version = QtSupport::QtVersionManager::instance()->qtVersionForQMakeBinary(qmakeBinary); QtSupport::BaseQtVersion *version = QtSupport::QtVersionManager::instance()->qtVersionForQMakeBinary(qmakeBinary);
if (!version) { if (!version) {
version = QtSupport::QtVersionFactory::createQtVersionFromQMakePath(qmakeBinary); version = QtSupport::QtVersionFactory::createQtVersionFromQMakePath(qmakeBinary);
temporaryQtVersion = true; temporaryQtVersion = true;
if (!version) if (!version)
return BuildConfigurationInfo(); continue;
}
QPair<QtSupport::BaseQtVersion::QmakeBuildConfigs, QString> 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);
} }
return infos;
QPair<QtSupport::BaseQtVersion::QmakeBuildConfigs, QString> 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;
} }

View File

@@ -43,8 +43,10 @@
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>
#include <QtCore/QMutex> #include <QtCore/QMutex>
#include <QtCore/QThread>
#include <QtCore/QMutexLocker> #include <QtCore/QMutexLocker>
#include <QtCore/QWeakPointer> #include <QtCore/QWeakPointer>
#include <QtCore/QWaitCondition>
#include <QtGui/QGraphicsProxyWidget> #include <QtGui/QGraphicsProxyWidget>
#include <QtGui/QScrollBar> #include <QtGui/QScrollBar>
#include <QtGui/QSortFilterProxyModel> #include <QtGui/QSortFilterProxyModel>
@@ -66,14 +68,80 @@ QWeakPointer<ExamplesListModel> &examplesModelStatic()
class Fetcher : public QObject class Fetcher : public QObject
{ {
Q_OBJECT 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: public slots:
void fetchData(const QUrl &url) 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: 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 class HelpImageProvider : public QDeclarativeImageProvider
@@ -88,20 +156,22 @@ public:
QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize)
{ {
QMutexLocker lock(&m_mutex); QMutexLocker lock(&m_mutex);
QUrl url = QUrl::fromEncoded(id.toAscii()); QUrl url = QUrl::fromEncoded(id.toAscii());
if (!QMetaObject::invokeMethod(&m_fetcher,
"fetchData", if (!m_fetcher.asynchronousFetchData(url))
Qt::BlockingQueuedConnection, return QImage();
Q_ARG(QUrl, url))) {
if (m_fetcher.data().isEmpty())
return QImage(); return QImage();
} QBuffer imgBuffer(&m_fetcher.data());
QBuffer imgBuffer(&m_fetcher.fetchedData);
imgBuffer.open(QIODevice::ReadOnly); imgBuffer.open(QIODevice::ReadOnly);
QImageReader reader(&imgBuffer); QImageReader reader(&imgBuffer);
QImage img = reader.read(); QImage img = reader.read();
if (size && requestedSize != *size) if (size && requestedSize != *size)
img = img.scaled(requestedSize); img = img.scaled(requestedSize);
m_fetcher.fetchedData.clear();
m_fetcher.clearData();
return img; return img;
} }
private: private:

View File

@@ -48,6 +48,8 @@
#include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actioncontainer.h>
#include <debugger/debuggerconstants.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <QtCore/QtPlugin> #include <QtCore/QtPlugin>
@@ -92,7 +94,7 @@ void RemoteLinuxPlugin::extensionsInitialized()
QAction *startGdbServerAction = new QAction(tr("Start Remote Debug Server"), 0); QAction *startGdbServerAction = new QAction(tr("Start Remote Debug Server"), 0);
Command *cmd = am->registerAction(startGdbServerAction, "StartGdbServer", globalcontext); Command *cmd = am->registerAction(startGdbServerAction, "StartGdbServer", globalcontext);
cmd->setDefaultText(tr("Start Gdbserver")); 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())); connect(startGdbServerAction, SIGNAL(triggered()), SLOT(startGdbServer()));
} }

View File

@@ -205,9 +205,9 @@ StateListener::StateListener(QObject *parent) :
QObject(parent) QObject(parent)
{ {
Core::ICore *core = Core::ICore::instance(); Core::ICore *core = Core::ICore::instance();
connect(core->fileManager(), SIGNAL(currentFileChanged(QString)), connect(core->editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)),
this, SLOT(slotStateChanged())); this, SLOT(slotStateChanged()));
connect(core->editorManager()->instance(), SIGNAL(currentEditorStateChanged(Core::IEditor*)), connect(core->editorManager(), SIGNAL(currentEditorStateChanged(Core::IEditor*)),
this, SLOT(slotStateChanged())); this, SLOT(slotStateChanged()));
connect(core->vcsManager(), SIGNAL(repositoryChanged(QString)), connect(core->vcsManager(), SIGNAL(repositoryChanged(QString)),
this, SLOT(slotStateChanged())); this, SLOT(slotStateChanged()));
@@ -235,7 +235,11 @@ void StateListener::slotStateChanged()
// temporary path prefix or does the file contains a hash, indicating a project // temporary path prefix or does the file contains a hash, indicating a project
// folder? // folder?
State state; 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<QFileInfo> currentFileInfo; // Instantiate QFileInfo only once if required. QScopedPointer<QFileInfo> currentFileInfo; // Instantiate QFileInfo only once if required.
if (!state.currentFile.isEmpty()) { if (!state.currentFile.isEmpty()) {
const bool isTempFile = state.currentFile.startsWith(QDir::tempPath()); const bool isTempFile = state.currentFile.startsWith(QDir::tempPath());

View File

@@ -15,3 +15,5 @@ SOURCES += welcomeplugin.cpp \
RESOURCES += welcome.qrc RESOURCES += welcome.qrc
DEFINES += WELCOME_LIBRARY DEFINES += WELCOME_LIBRARY
QML_IMPORT_PATH = $$IDE_SOURCE_TREE/lib/qtcreator/

View File

@@ -1,5 +1,7 @@
TARGET = gui TARGET = gui
CONFIG+=console CONFIG+=console
greaterThan(QT_MAJOR_VERSION, 4):QT *= widgets
TEMPLATE = app TEMPLATE = app
SOURCES += \ SOURCES += \
mainwindow.cpp \ mainwindow.cpp \

View File

@@ -33,7 +33,7 @@
#ifndef MAINWINDOW_H #ifndef MAINWINDOW_H
#define MAINWINDOW_H #define MAINWINDOW_H
#include <QtGui/QMainWindow> #include <QMainWindow>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QThread; class QThread;

View File

@@ -30,7 +30,7 @@
** **
**************************************************************************/ **************************************************************************/
#include <QtGui/QApplication> #include <QApplication>
#include <QtDebug> #include <QtDebug>
#include "mainwindow.h" #include "mainwindow.h"

View File

@@ -1,5 +1,6 @@
include(../../../../qtcreator.pri) include(../../../../qtcreator.pri)
TEMPLATE = app TEMPLATE = app
greaterThan(QT_MAJOR_VERSION, 4):QT *= widgets
win32:DEFINES += _CRT_SECURE_NO_WARNINGS win32:DEFINES += _CRT_SECURE_NO_WARNINGS
SOURCES += $$IDE_SOURCE_TREE/share/qtcreator/dumper/dumper.cpp SOURCES += $$IDE_SOURCE_TREE/share/qtcreator/dumper/dumper.cpp

View File

@@ -102,18 +102,14 @@ void dummyStatement(...) {}
#include <QtCore/QSharedPointer> #include <QtCore/QSharedPointer>
#endif #endif
#include <QtGui/QApplication>
#include <QtGui/QAction>
#include <QtGui/QColor> #include <QtGui/QColor>
#include <QtGui/QFont> #include <QtGui/QFont>
#include <QtGui/QLabel>
//#include <QtGui/private/qfixed_p.h> //#include <QtGui/private/qfixed_p.h>
#include <QtGui/QPainter> #include <QtGui/QPainter>
#include <QtGui/QPainterPath> #include <QtGui/QPainterPath>
#include <QtGui/QRegion> #include <QtGui/QRegion>
#include <QtGui/QStandardItemModel>
#include <QtGui/QTextCursor> #include <QtGui/QTextCursor>
#include <QtGui/QTextDocument> #include <QtGui/QTextDocument>
@@ -127,6 +123,11 @@ void dummyStatement(...) {}
#include <QtNetwork/QHostAddress> #include <QtNetwork/QHostAddress>
#include <QtNetwork/QNetworkRequest> #include <QtNetwork/QNetworkRequest>
#include <QApplication> // QWidgets: Separate module as of Qt 5
#include <QAction>
#include <QStandardItemModel>
#include <QLabel>
#include <deque> #include <deque>
#include <iostream> #include <iostream>
#include <iterator> #include <iterator>

View File

@@ -9,7 +9,10 @@ SOURCES += simple_test_app.cpp
QT += network QT += network
QT += script QT += script
QT += xml QT += xml
QT += core-private greaterThan(QT_MAJOR_VERSION, 4) {
QT += core-private
QT *= widgets
}
#unix: QMAKE_CXXFLAGS += -msse2 #unix: QMAKE_CXXFLAGS += -msse2
#DEFINES += USE_BOOST=1 #DEFINES += USE_BOOST=1

View File

@@ -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(ui_path), "Checking if '" + ui_path + "' was created")
test.verify(os.path.exists(pro_path), "Checking if '" + pro_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...") invokeMenuItem("File", "New File or Project...")
clickItem(waitForObject("{type='QTreeView' name='templateCategoryView'}", 20000), "Projects.Qt Quick Project", 5, 5, 0, Qt.LeftButton) 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) 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) baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}", 20000)
type(baseLineEd, templateFile) type(baseLineEd, templateFile)
clickButton(nextButton) clickButton(nextButton)
chooseDestination(destination) chooseTargets(targets)
snooze(1) snooze(1)
clickButton(nextButton) clickButton(nextButton)
selectFromCombo(":addToVersionControlComboBox_QComboBox", "<None>") selectFromCombo(":addToVersionControlComboBox_QComboBox", "<None>")

View File

@@ -9,7 +9,7 @@ class QtQuickConstants:
MEEGO_HARMATTAN = 4 MEEGO_HARMATTAN = 4
EXISTING_QML = 8 EXISTING_QML = 8
class Destinations: class Targets:
DESKTOP = 1 DESKTOP = 1
SIMULATOR = 2 SIMULATOR = 2
SYMBIAN = 4 SYMBIAN = 4
@@ -30,16 +30,16 @@ class QtQuickConstants:
return None return None
@staticmethod @staticmethod
def getStringForDestination(destination): def getStringForTarget(target):
if destination==QtQuickConstants.Destinations.DESKTOP: if target==QtQuickConstants.Targets.DESKTOP:
return "Desktop" return "Desktop"
elif destination==QtQuickConstants.Destinations.SYMBIAN: elif target==QtQuickConstants.Targets.SYMBIAN:
return "Symbian Device" return "Symbian Device"
elif destination==QtQuickConstants.Destinations.MAEMO5: elif target==QtQuickConstants.Targets.MAEMO5:
return "Maemo5" return "Maemo5"
elif destination==QtQuickConstants.Destinations.SIMULATOR: elif target==QtQuickConstants.Targets.SIMULATOR:
return "Qt Simulator" return "Qt Simulator"
elif destination==QtQuickConstants.Destinations.HARMATTAN: elif target==QtQuickConstants.Targets.HARMATTAN:
return "Harmattan" return "Harmattan"
else: else:
return None return None
@@ -63,26 +63,26 @@ def chooseComponents(components=QtQuickConstants.Components.BUILTIN):
test.verify(rbComponentToChoose.checked, "Selected QRadioButton is '%s'" test.verify(rbComponentToChoose.checked, "Selected QRadioButton is '%s'"
% QtQuickConstants.getStringForComponents(components)) % QtQuickConstants.getStringForComponents(components))
# parameter destination can be an OR'd value of QtQuickConstants.Destinations # parameter target can be an OR'd value of QtQuickConstants.Targets
def chooseDestination(destination=QtQuickConstants.Destinations.DESKTOP): def chooseTargets(targets=QtQuickConstants.Targets.DESKTOP):
# DESKTOP should be always accessible # DESKTOP should be always accessible
destDesktop = waitForObject("{type='QCheckBox' text='%s' visible='1'}" destDesktop = waitForObject("{type='QCheckBox' text='%s' visible='1'}"
% QtQuickConstants.getStringForDestination(QtQuickConstants.Destinations.DESKTOP), 20000) % QtQuickConstants.getStringForTarget(QtQuickConstants.Targets.DESKTOP), 20000)
mustCheck = destination & QtQuickConstants.Destinations.DESKTOP==QtQuickConstants.Destinations.DESKTOP mustCheck = targets & QtQuickConstants.Targets.DESKTOP==QtQuickConstants.Targets.DESKTOP
if (mustCheck and not destDesktop.checked) or (not mustCheck and destDesktop.checked): if (mustCheck ^ destDesktop.checked):
clickButton(destDesktop) clickButton(destDesktop)
# following destinations depend on the build environment - added for further/later tests # following targets depend on the build environment - added for further/later tests
available = [QtQuickConstants.Destinations.SYMBIAN, QtQuickConstants.Destinations.MAEMO5, available = [QtQuickConstants.Targets.SYMBIAN, QtQuickConstants.Targets.MAEMO5,
QtQuickConstants.Destinations.SIMULATOR, QtQuickConstants.Destinations.HARMATTAN] QtQuickConstants.Targets.SIMULATOR, QtQuickConstants.Targets.HARMATTAN]
for current in available: for current in available:
mustCheck = destination & current == current mustCheck = targets & current == current
try: try:
target = findObject("{type='QCheckBox' text='%s' visible='1'}" % QtQuickConstants.getStringForDestination(current)) targetCheckbox = findObject("{type='QCheckBox' text='%s' visible='1'}" % QtQuickConstants.getStringForTarget(current))
if (mustCheck and not target.checked) or (not mustCheck and target.checked): if mustCheck ^ targetCheckbox.checked:
clickButton(target) clickButton(targetCheckbox)
except LookupError: except LookupError:
if mustCheck: if mustCheck:
test.fail("Failed to check destination '%s'" % QtQuickConstants.getStringForDestination(current)) test.fail("Failed to check target '%s'" % QtQuickConstants.getStringForTarget(current))
def runAndCloseApp(): def runAndCloseApp():
global processStarted, processExited global processStarted, processExited

View File

@@ -35,9 +35,8 @@ def createNewQmlExtension():
# now there's the 'untitled' project inside a temporary directory - step forward...! # now there's the 'untitled' project inside a temporary directory - step forward...!
nextButton = waitForObject("{text~='(Next.*|Continue)' type='QPushButton' visible='1'}", 20000) nextButton = waitForObject("{text~='(Next.*|Continue)' type='QPushButton' visible='1'}", 20000)
clickButton(nextButton) clickButton(nextButton)
chooseDestination() chooseTargets()
clickButton(nextButton) 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'} " nameLineEd = waitForObject("{buddy={type='QLabel' text='Object Class-name:' unnamed='1' visible='1'} "
"type='QLineEdit' unnamed='1' visible='1'}", 20000) "type='QLineEdit' unnamed='1' visible='1'}", 20000)
replaceEditorContent(nameLineEd, "TestItem") replaceEditorContent(nameLineEd, "TestItem")