diff options
author | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-01-09 09:38:38 +0100 |
---|---|---|
committer | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-01-09 09:38:47 +0100 |
commit | aed7aa451f582a772368b80506c7e26c3e8c18a2 (patch) | |
tree | 06632103e243f5d2ec5044f3d4d5afd0a119634f | |
parent | d140f99fa3052c8957b9247d9c6f9bf47c6c2a92 (diff) | |
parent | 722725cf24e45e86a2844810b90787a29df8a4a9 (diff) |
Merge branch 'stable' into release
Change-Id: I1f4521205b6bb3811294fd2c32df4b4bce97d147
28 files changed, 195 insertions, 93 deletions
@@ -268,3 +268,6 @@ tests/auto/*/*.moc tests/auto/*/*/*.o tests/auto/*/*/*.moc src/declarative/generated/ + +# Generated static plugin import sources +*_plugin_import.cpp diff --git a/dist/changes-5.0.1 b/dist/changes-5.0.1 new file mode 100644 index 00000000..cc5a6704 --- /dev/null +++ b/dist/changes-5.0.1 @@ -0,0 +1,51 @@ +Qt 5.0.1 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.0.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + + http://qt-project.org/doc/qt-5.0/ + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + http://bugreports.qt-project.org/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + + +**************************************************************************** +* General * +**************************************************************************** + +General Improvements +-------------------- + +Third party components +---------------------- + +**************************************************************************** +* Library * +**************************************************************************** + + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + + +**************************************************************************** +* Compiler Specific Changes * +**************************************************************************** + + +**************************************************************************** +* Tools * +**************************************************************************** + + +**************************************************************************** +* Plugins * +**************************************************************************** + diff --git a/examples/declarative/cppextensions/imageprovider/imageprovider.pro b/examples/declarative/cppextensions/imageprovider/imageprovider.pro index 9c305212..66beb308 100644 --- a/examples/declarative/cppextensions/imageprovider/imageprovider.pro +++ b/examples/declarative/cppextensions/imageprovider/imageprovider.pro @@ -1,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt plugin +CONFIG += plugin QT += declarative DESTDIR = ImageProviderCore diff --git a/examples/declarative/cppextensions/networkaccessmanagerfactory/qml/networkaccessmanagerfactory/view.qml b/examples/declarative/cppextensions/networkaccessmanagerfactory/qml/networkaccessmanagerfactory/view.qml index 4257965c..a13fadd3 100644 --- a/examples/declarative/cppextensions/networkaccessmanagerfactory/qml/networkaccessmanagerfactory/view.qml +++ b/examples/declarative/cppextensions/networkaccessmanagerfactory/qml/networkaccessmanagerfactory/view.qml @@ -43,5 +43,5 @@ import QtQuick 1.0 Image { width: 100 height: 100 - source: "http://qt.nokia.com/logo.png" + source: "http://planet.qt-project.org/images/logo.png" } diff --git a/examples/declarative/cppextensions/plugins/plugins.pro b/examples/declarative/cppextensions/plugins/plugins.pro index 93318e40..476a58e6 100644 --- a/examples/declarative/cppextensions/plugins/plugins.pro +++ b/examples/declarative/cppextensions/plugins/plugins.pro @@ -1,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt plugin +CONFIG += plugin QT += widgets declarative DESTDIR = com/nokia/TimeExample diff --git a/examples/declarative/cppextensions/qwidgets/qwidgets.pro b/examples/declarative/cppextensions/qwidgets/qwidgets.pro index ea61235e..d7fe5a2b 100644 --- a/examples/declarative/cppextensions/qwidgets/qwidgets.pro +++ b/examples/declarative/cppextensions/qwidgets/qwidgets.pro @@ -1,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt plugin +CONFIG += plugin QT += widgets declarative DESTDIR = QWidgets diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro b/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro index 095312ea..17986a6b 100644 --- a/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro +++ b/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro @@ -1,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt plugin +CONFIG += plugin QT += declarative widgets DESTDIR = lib diff --git a/examples/declarative/tutorials/gettingStarted/filedialog/filedialog.pro b/examples/declarative/tutorials/gettingStarted/filedialog/filedialog.pro index 0d8dc981..f7f6edd7 100644 --- a/examples/declarative/tutorials/gettingStarted/filedialog/filedialog.pro +++ b/examples/declarative/tutorials/gettingStarted/filedialog/filedialog.pro @@ -1,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt plugin +CONFIG += plugin QT += declarative DESTDIR += ../plugins diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/filedialog.pro b/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/filedialog.pro index d85787d0..f25c490b 100644 --- a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/filedialog.pro +++ b/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/filedialog.pro @@ -1,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt plugin +CONFIG += plugin QT += declarative DESTDIR += ../plugins diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.pro b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.pro index 62477470..f9229a3b 100644 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.pro +++ b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.pro @@ -1,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt plugin +CONFIG += plugin QT += declarative DESTDIR += ../plugins diff --git a/examples/declarative/tutorials/gettingStarted/parts/part5/filedialog/filedialog.pro b/examples/declarative/tutorials/gettingStarted/parts/part5/filedialog/filedialog.pro index 62477470..f9229a3b 100644 --- a/examples/declarative/tutorials/gettingStarted/parts/part5/filedialog/filedialog.pro +++ b/examples/declarative/tutorials/gettingStarted/parts/part5/filedialog/filedialog.pro @@ -1,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt plugin +CONFIG += plugin QT += declarative DESTDIR += ../plugins diff --git a/src/declarative/declarative.pro b/src/declarative/declarative.pro index be3978aa..365cb04e 100644 --- a/src/declarative/declarative.pro +++ b/src/declarative/declarative.pro @@ -29,7 +29,6 @@ HEADERS += \ linux-g++-maemo:DEFINES += QDECLARATIVEVIEW_NOBACKGROUND DEFINES += QT_NO_OPENTYPE -INCLUDEPATH += ../3rdparty/harfbuzz/src blackberry: { DEFINES += CUSTOM_DECLARATIVE_DEBUG_TRACE_INSTANCE diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h index cc1d5520..4f22b94d 100644 --- a/src/declarative/qml/qdeclarativeengine_p.h +++ b/src/declarative/qml/qdeclarativeengine_p.h @@ -157,7 +157,7 @@ public: int notifyIndex; }; bool captureProperties; - QPODVector<CapturedProperty> capturedProperties; + QPODVector<CapturedProperty, 16> capturedProperties; QDeclarativeContext *rootContext; bool isDebugging; diff --git a/src/declarative/qml/qdeclarativeexpression.cpp b/src/declarative/qml/qdeclarativeexpression.cpp index b52a0748..58897c9e 100644 --- a/src/declarative/qml/qdeclarativeexpression.cpp +++ b/src/declarative/qml/qdeclarativeexpression.cpp @@ -460,7 +460,7 @@ QScriptValue QDeclarativeQtScriptExpression::scriptValue(QObject *secondaryScope QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context()->engine); bool lastCaptureProperties = ep->captureProperties; - QPODVector<QDeclarativeEnginePrivate::CapturedProperty> lastCapturedProperties; + QPODVector<QDeclarativeEnginePrivate::CapturedProperty, 16> lastCapturedProperties; ep->captureProperties = trackChange; ep->capturedProperties.copyAndClear(lastCapturedProperties); @@ -539,7 +539,7 @@ QScriptValue QDeclarativeQtScriptExpression::eval(QObject *secondaryScope, bool } } -void QDeclarativeQtScriptExpression::updateGuards(const QPODVector<QDeclarativeEnginePrivate::CapturedProperty> &properties) +void QDeclarativeQtScriptExpression::updateGuards(const QPODVector<QDeclarativeEnginePrivate::CapturedProperty, 16> &properties) { Q_ASSERT(guardObject); Q_ASSERT(guardObjectNotifyIndex != -1); diff --git a/src/declarative/qml/qdeclarativeexpression_p.h b/src/declarative/qml/qdeclarativeexpression_p.h index 6e8df8ae..402ae846 100644 --- a/src/declarative/qml/qdeclarativeexpression_p.h +++ b/src/declarative/qml/qdeclarativeexpression_p.h @@ -153,7 +153,7 @@ public: private: void clearGuards(); QScriptValue eval(QObject *secondaryScope, bool *isUndefined); - void updateGuards(const QPODVector<QDeclarativeEnginePrivate::CapturedProperty> &properties); + void updateGuards(const QPODVector<QDeclarativeEnginePrivate::CapturedProperty, 16> &properties); bool trackChange; diff --git a/src/declarative/qml/qdeclarativefastproperties_p.h b/src/declarative/qml/qdeclarativefastproperties_p.h index 8747eeba..f0e94779 100644 --- a/src/declarative/qml/qdeclarativefastproperties_p.h +++ b/src/declarative/qml/qdeclarativefastproperties_p.h @@ -50,7 +50,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE class QObject; -class QMetaObject; +struct QMetaObject; class QDeclarativeNotifierEndpoint; class QDeclarativeFastProperties { diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp index d7eacaf4..f9ce988c 100644 --- a/src/declarative/qml/qdeclarativemetatype.cpp +++ b/src/declarative/qml/qdeclarativemetatype.cpp @@ -438,7 +438,7 @@ QObject *QDeclarativeType::create() const d->m_newFunc(rv); if (rv && !d->m_metaObjects.isEmpty()) - (void *)new QDeclarativeProxyMetaObject(rv, &d->m_metaObjects); + (void)new QDeclarativeProxyMetaObject(rv, &d->m_metaObjects); return rv; } @@ -451,7 +451,7 @@ void QDeclarativeType::create(QObject **out, void **memory, size_t additionalMem d->m_newFunc(rv); if (rv && !d->m_metaObjects.isEmpty()) - (void *)new QDeclarativeProxyMetaObject(rv, &d->m_metaObjects); + (void)new QDeclarativeProxyMetaObject(rv, &d->m_metaObjects); *out = rv; *memory = ((char *)rv) + d->m_allocationSize; diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp index 5c875510..49ce35da 100644 --- a/src/declarative/qml/qdeclarativevme.cpp +++ b/src/declarative/qml/qdeclarativevme.cpp @@ -283,7 +283,7 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEObjectStack &stack, { QObject *o = (QObject *)operator new(instr.createSimple.typeSize + sizeof(QDeclarativeData)); - ::memset(o, 0, instr.createSimple.typeSize + sizeof(QDeclarativeData)); + ::memset(static_cast<void *>(o), 0, instr.createSimple.typeSize + sizeof(QDeclarativeData)); instr.createSimple.create(o); QDeclarativeData *ddata = (QDeclarativeData *)(((const char *)o) + instr.createSimple.typeSize); diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp index bb16a9c1..dd091ca7 100644 --- a/src/declarative/qml/qdeclarativexmlhttprequest.cpp +++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp @@ -1321,7 +1321,7 @@ void QDeclarativeXMLHttpRequest::readEncoding() if (header.first == "content-type") { int separatorIdx = header.second.indexOf(';'); if (separatorIdx == -1) { - m_mime == header.second; + m_mime = header.second; } else { m_mime = header.second.mid(0, separatorIdx); int charsetIdx = header.second.indexOf("charset="); diff --git a/src/declarative/util/qdeclarativeanimation_p.h b/src/declarative/util/qdeclarativeanimation_p.h index bf3019de..2c09235b 100644 --- a/src/declarative/util/qdeclarativeanimation_p.h +++ b/src/declarative/util/qdeclarativeanimation_p.h @@ -61,6 +61,12 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) +#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && \ + (defined(Q_CC_CLANG) || (__GNUC__ * 100 + __GNUC_MINOR__) > 406) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Woverloaded-virtual" +#endif + class QDeclarativeAbstractAnimationPrivate; class QDeclarativeAnimationGroup; class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeAbstractAnimation : public QObject, public QDeclarativePropertyValueSource, public QDeclarativeParserStatus @@ -507,6 +513,11 @@ protected: virtual QAbstractAnimation *qtAnimation(); }; +#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && \ + (defined(Q_CC_CLANG) || (__GNUC__ * 100 + __GNUC_MINOR__) > 406) +# pragma GCC diagnostic pop +#endif + QT_END_NAMESPACE QML_DECLARE_TYPE(QDeclarativeAbstractAnimation) diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp index 6304ee40..60b3f9be 100644 --- a/src/declarative/util/qdeclarativefontloader.cpp +++ b/src/declarative/util/qdeclarativefontloader.cpp @@ -64,7 +64,7 @@ class QDeclarativeFontObject : public QObject Q_OBJECT public: - QDeclarativeFontObject(int _id); + QDeclarativeFontObject(int _id = -1); void download(const QUrl &url, QNetworkAccessManager *manager); @@ -84,7 +84,7 @@ private: Q_DISABLE_COPY(QDeclarativeFontObject) }; -QDeclarativeFontObject::QDeclarativeFontObject(int _id = -1) +QDeclarativeFontObject::QDeclarativeFontObject(int _id) : QObject(0), id(_id), reply(0), redirectCount(0) {} diff --git a/src/doc/qtdeclarative.qdocconf b/src/doc/qtdeclarative.qdocconf index f64625ec..6a87d453 100644 --- a/src/doc/qtdeclarative.qdocconf +++ b/src/doc/qtdeclarative.qdocconf @@ -3,7 +3,7 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtDeclarative description = "Qt Declarative Examples Documentation" url = http://qt-project.org/doc/qt-5.0/qtdeclarative -version = 5.0.0 +version = 5.0.1 exampleinstallpath = declarative @@ -15,9 +15,9 @@ qhp.QtDeclarative.virtualFolder = declarative qhp.QtDeclarative.indexTitle = Qt Quick qhp.QtDeclarative.indexRoot = -qhp.QtDeclarative.filterAttributes = declarative 5.0.0 qtrefdoc -qhp.QtDeclarative.customFilters.Qt.name = declarative 5.0.0 -qhp.QtDeclarative.customFilters.Qt.filterAttributes = declarative 5.0.0 +qhp.QtDeclarative.filterAttributes = declarative 5.0.1 qtrefdoc +qhp.QtDeclarative.customFilters.Qt.name = declarative 5.0.1 +qhp.QtDeclarative.customFilters.Qt.filterAttributes = declarative 5.0.1 depends += qtcore qtgui qtscript qtdoc diff --git a/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro b/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro index 566ca6c6..d4a5e771 100644 --- a/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro +++ b/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro @@ -5,8 +5,9 @@ QT += testlib contains(QT_CONFIG,declarative): QT += declarative declarative-private gui gui-private widgets widgets-private network core-private macx:CONFIG -= app_bundle +include(../shared/qdeclarativedatatest.pri) + SOURCES += tst_qdeclarativetextedit.cpp ../shared/testhttpserver.cpp HEADERS += ../shared/testhttpserver.h -DEFINES += SRCDIR=\\\"$$PWD\\\" DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 9c899445..2d71ca4b 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -41,6 +41,7 @@ #include <qtest.h> #include <QtTest/QSignalSpy> #include "../shared/testhttpserver.h" +#include <qdeclarativedatatest.h> #include <math.h> #include <QFile> #include <QTextDocument> @@ -63,20 +64,20 @@ Q_DECLARE_METATYPE(QDeclarativeTextEdit::SelectionMode) -QString createExpectedFileIfNotFound(const QString& filebasename, const QImage& actual) +// Make a widget frameless to prevent size constraints of title bars +// from interfering (Windows). +static inline void setFrameless(QWidget *w) { - // XXX This will be replaced by some clever persistent platform image store. - QString persistent_dir = SRCDIR "/data"; - QString arch = "unknown-architecture"; // QTest needs to help with this. - - QString expectfile = persistent_dir + QDir::separator() + filebasename + "-" + arch + ".png"; - - if (!QFile::exists(expectfile)) { - actual.save(expectfile); - qWarning() << "created" << expectfile; - } + Qt::WindowFlags flags = w->windowFlags(); + flags |= Qt::FramelessWindowHint; + flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); + w->setWindowFlags(flags); +} - return expectfile; +// Helper message for comparisons +static inline QByteArray msgComparison(int v1, int v2) +{ + return QByteArray::number(v1) + ' ' + QByteArray::number(v2); } void sendPreeditText(const QString &text, int cursor) @@ -90,7 +91,7 @@ void sendPreeditText(const QString &text, int cursor) } -class tst_qdeclarativetextedit : public QObject +class tst_qdeclarativetextedit : public QDeclarativeDataTest { Q_OBJECT @@ -168,6 +169,7 @@ private slots: private: void simulateKey(QDeclarativeView *, int key, Qt::KeyboardModifiers modifiers = 0); QDeclarativeView *createView(const QString &filename); + QString alignmentReferenceImage(const QString& filebasename) const; QStringList standard; QStringList richText; @@ -395,6 +397,12 @@ void tst_qdeclarativetextedit::alignments_data() QTest::newRow("CC") << int(Qt::AlignHCenter) << int(Qt::AlignVCenter) << "alignments_cc"; } +QString tst_qdeclarativetextedit::alignmentReferenceImage(const QString& filebasename) const +{ + // XXX This will be replaced by some clever persistent platform image store. + static const QString arch = QGuiApplication::platformName() + QLatin1Char('-') + qApp->style()->objectName(); + return testFile(filebasename + QLatin1Char('-') + arch + QStringLiteral(".png")); +} void tst_qdeclarativetextedit::alignments() { @@ -402,7 +410,14 @@ void tst_qdeclarativetextedit::alignments() QFETCH(int, vAlign); QFETCH(QString, expectfile); - QDeclarativeView *canvas = createView(SRCDIR "/data/alignments.qml"); + const QString referenceImage = alignmentReferenceImage(expectfile); + if (!QFile(referenceImage).exists()) + QSKIP(qPrintable(QStringLiteral("Reference image '") + + QDir::toNativeSeparators(referenceImage) + + QStringLiteral("' does not exist."))); + + QDeclarativeView *canvas = createView(testFile("alignments.qml")); + setFrameless(canvas); canvas->show(); QApplication::setActiveWindow(canvas); @@ -419,9 +434,8 @@ void tst_qdeclarativetextedit::alignments() QPainter p(&actual); canvas->render(&p); - expectfile = createExpectedFileIfNotFound(expectfile, actual); - - QImage expect(expectfile); + QImage expect(referenceImage); + QVERIFY(!expect.isNull()); QCOMPARE(actual,expect); @@ -466,7 +480,7 @@ void tst_qdeclarativetextedit::hAlign() void tst_qdeclarativetextedit::hAlign_RightToLeft() { - QDeclarativeView *canvas = createView(SRCDIR "/data/horizontalAlignment_RightToLeft.qml"); + QDeclarativeView *canvas = createView(testFile("horizontalAlignment_RightToLeft.qml")); QDeclarativeTextEdit *textEdit = canvas->rootObject()->findChild<QDeclarativeTextEdit*>("text"); QVERIFY(textEdit != 0); canvas->show(); @@ -957,7 +971,7 @@ void tst_qdeclarativetextedit::isRightToLeft() void tst_qdeclarativetextedit::keySelection() { - QDeclarativeView *canvas = createView(SRCDIR "/data/navigation.qml"); + QDeclarativeView *canvas = createView(testFile("navigation.qml")); canvas->show(); QApplication::setActiveWindow(canvas); QVERIFY(QTest::qWaitForWindowActive(canvas)); @@ -1349,19 +1363,19 @@ void tst_qdeclarativetextedit::mouseSelection_data() QTest::addColumn<QString>("selectedText"); // import installed - QTest::newRow("on") << SRCDIR "/data/mouseselection_true.qml" << 4 << 9 << "45678"; - QTest::newRow("off") << SRCDIR "/data/mouseselection_false.qml" << 4 << 9 << QString(); - QTest::newRow("default") << SRCDIR "/data/mouseselection_default.qml" << 4 << 9 << QString(); - QTest::newRow("off word selection") << SRCDIR "/data/mouseselection_false_words.qml" << 4 << 9 << QString(); - QTest::newRow("on word selection (4,9)") << SRCDIR "/data/mouseselection_true_words.qml" << 4 << 9 << "0123456789"; - QTest::newRow("on word selection (2,13)") << SRCDIR "/data/mouseselection_true_words.qml" << 2 << 13 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - QTest::newRow("on word selection (2,30)") << SRCDIR "/data/mouseselection_true_words.qml" << 2 << 30 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - QTest::newRow("on word selection (9,13)") << SRCDIR "/data/mouseselection_true_words.qml" << 9 << 13 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - QTest::newRow("on word selection (9,30)") << SRCDIR "/data/mouseselection_true_words.qml" << 9 << 30 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - QTest::newRow("on word selection (13,2)") << SRCDIR "/data/mouseselection_true_words.qml" << 13 << 2 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - QTest::newRow("on word selection (20,2)") << SRCDIR "/data/mouseselection_true_words.qml" << 20 << 2 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - QTest::newRow("on word selection (12,9)") << SRCDIR "/data/mouseselection_true_words.qml" << 12 << 9 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - QTest::newRow("on word selection (30,9)") << SRCDIR "/data/mouseselection_true_words.qml" << 30 << 9 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + QTest::newRow("on") << testFile("mouseselection_true.qml") << 4 << 9 << "45678"; + QTest::newRow("off") << testFile("mouseselection_false.qml") << 4 << 9 << QString(); + QTest::newRow("default") << testFile("mouseselection_default.qml") << 4 << 9 << QString(); + QTest::newRow("off word selection") << testFile("mouseselection_false_words.qml") << 4 << 9 << QString(); + QTest::newRow("on word selection (4,9)") << testFile("mouseselection_true_words.qml") << 4 << 9 << "0123456789"; + QTest::newRow("on word selection (2,13)") << testFile("mouseselection_true_words.qml") << 2 << 13 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + QTest::newRow("on word selection (2,30)") << testFile("mouseselection_true_words.qml") << 2 << 30 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + QTest::newRow("on word selection (9,13)") << testFile("mouseselection_true_words.qml") << 9 << 13 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + QTest::newRow("on word selection (9,30)") << testFile("mouseselection_true_words.qml") << 9 << 30 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + QTest::newRow("on word selection (13,2)") << testFile("mouseselection_true_words.qml") << 13 << 2 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + QTest::newRow("on word selection (20,2)") << testFile("mouseselection_true_words.qml") << 20 << 2 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + QTest::newRow("on word selection (12,9)") << testFile("mouseselection_true_words.qml") << 12 << 9 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + QTest::newRow("on word selection (30,9)") << testFile("mouseselection_true_words.qml") << 30 << 9 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; } void tst_qdeclarativetextedit::mouseSelection() @@ -1403,8 +1417,7 @@ void tst_qdeclarativetextedit::mouseSelection() void tst_qdeclarativetextedit::multilineMouseSelection() { - QDeclarativeView *canvas = createView(SRCDIR "/data/mouseselection_multiline.qml"); - + QDeclarativeView *canvas = createView(testFile("mouseselection_multiline.qml")); canvas->show(); QApplication::setActiveWindow(canvas); QVERIFY(QTest::qWaitForWindowActive(canvas)); @@ -1440,8 +1453,8 @@ void tst_qdeclarativetextedit::deferEnableSelectByMouse_data() { QTest::addColumn<QString>("qmlfile"); - QTest::newRow("writable") << SRCDIR "/data/mouseselection_false.qml"; - QTest::newRow("read only") << SRCDIR "/data/mouseselection_false_readonly.qml"; + QTest::newRow("writable") << testFile("mouseselection_false.qml"); + QTest::newRow("read only") << testFile("mouseselection_false_readonly.qml"); } void tst_qdeclarativetextedit::deferEnableSelectByMouse() @@ -1480,8 +1493,8 @@ void tst_qdeclarativetextedit::deferDisableSelectByMouse_data() { QTest::addColumn<QString>("qmlfile"); - QTest::newRow("writable") << SRCDIR "/data/mouseselection_true.qml"; - QTest::newRow("read only") << SRCDIR "/data/mouseselection_true_readonly.qml"; + QTest::newRow("writable") << testFile("mouseselection_true.qml"); + QTest::newRow("read only") << testFile("mouseselection_true_readonly.qml"); } void tst_qdeclarativetextedit::deferDisableSelectByMouse() @@ -1518,7 +1531,7 @@ void tst_qdeclarativetextedit::deferDisableSelectByMouse() void tst_qdeclarativetextedit::dragMouseSelection() { - QString qmlfile = SRCDIR "/data/mouseselection_true.qml"; + QString qmlfile = testFile("mouseselection_true.qml"); QDeclarativeView *canvas = createView(qmlfile); @@ -1569,9 +1582,9 @@ void tst_qdeclarativetextedit::mouseSelectionMode_data() QTest::addColumn<bool>("selectWords"); // import installed - QTest::newRow("SelectWords") << SRCDIR "/data/mouseselectionmode_words.qml" << true; - QTest::newRow("SelectCharacters") << SRCDIR "/data/mouseselectionmode_characters.qml" << false; - QTest::newRow("default") << SRCDIR "/data/mouseselectionmode_default.qml" << false; + QTest::newRow("SelectWords") << testFile("mouseselectionmode_words.qml") << true; + QTest::newRow("SelectCharacters") << testFile("mouseselectionmode_characters.qml") << false; + QTest::newRow("default") << testFile("mouseselectionmode_default.qml") << false; } void tst_qdeclarativetextedit::mouseSelectionMode() @@ -1620,7 +1633,8 @@ void tst_qdeclarativetextedit::mouseSelectionMode() void tst_qdeclarativetextedit::inputMethodHints() { - QDeclarativeView *canvas = createView(SRCDIR "/data/inputmethodhints.qml"); + QDeclarativeView *canvas = createView(testFile("inputmethodhints.qml")); + setFrameless(canvas); canvas->show(); canvas->setFocus(); @@ -1636,8 +1650,9 @@ void tst_qdeclarativetextedit::inputMethodHints() void tst_qdeclarativetextedit::positionAt() { - QDeclarativeView *canvas = createView(SRCDIR "/data/positionAt.qml"); + QDeclarativeView *canvas = createView(testFile("positionAt.qml")); QVERIFY(canvas->rootObject() != 0); + setFrameless(canvas); canvas->show(); canvas->setFocus(); QApplication::setActiveWindow(canvas); @@ -1676,8 +1691,9 @@ void tst_qdeclarativetextedit::positionAt() int widthBegin = floor(line.cursorToX(pos - 1)); int widthEnd = ceil(line.cursorToX(pos + 1)); - QVERIFY(widthBegin <= texteditObject->width() / 2); - QVERIFY(widthEnd >= texteditObject->width() / 2); + const int halfObjectWidth = texteditObject->width() / 2; + QVERIFY2(widthBegin <= halfObjectWidth, msgComparison(widthBegin, halfObjectWidth).constData()); + QVERIFY2(widthEnd >= halfObjectWidth, msgComparison(widthEnd, halfObjectWidth).constData()); const qreal x0 = texteditObject->positionToRectangle(pos).x(); const qreal x1 = texteditObject->positionToRectangle(pos + 1).x(); @@ -1705,7 +1721,7 @@ void tst_qdeclarativetextedit::positionAt() void tst_qdeclarativetextedit::cursorDelegate() { - QDeclarativeView* view = createView(SRCDIR "/data/cursorTest.qml"); + QDeclarativeView* view = createView(testFile("cursorTest.qml")); view->show(); view->setFocus(); QDeclarativeTextEdit *textEditObject = view->rootObject()->findChild<QDeclarativeTextEdit*>("textEditObject"); @@ -1877,9 +1893,9 @@ void tst_qdeclarativetextedit::delegateLoading() QFETCH(QString, error); TestHTTPServer server(42332); - server.serveDirectory(SRCDIR "/data/httpfail", TestHTTPServer::Disconnect); - server.serveDirectory(SRCDIR "/data/httpslow", TestHTTPServer::Delay); - server.serveDirectory(SRCDIR "/data/http"); + server.serveDirectory(testFile("httpfail"), TestHTTPServer::Disconnect); + server.serveDirectory(testFile("httpslow"), TestHTTPServer::Delay); + server.serveDirectory(testFile("http")); QDeclarativeView* view = new QDeclarativeView(0); @@ -1922,7 +1938,7 @@ the extent of the text, then they should ignore the keys. */ void tst_qdeclarativetextedit::navigation() { - QDeclarativeView *canvas = createView(SRCDIR "/data/navigation.qml"); + QDeclarativeView *canvas = createView(testFile("navigation.qml")); canvas->show(); canvas->setFocus(); @@ -2054,7 +2070,7 @@ void tst_qdeclarativetextedit::canPasteEmpty() { void tst_qdeclarativetextedit::readOnly() { - QDeclarativeView *canvas = createView(SRCDIR "/data/readOnly.qml"); + QDeclarativeView *canvas = createView(testFile("readOnly.qml")); canvas->show(); canvas->setFocus(); @@ -2297,7 +2313,7 @@ void tst_qdeclarativetextedit::openInputPanelOnFocus() void tst_qdeclarativetextedit::geometrySignals() { - QDeclarativeComponent component(&engine, SRCDIR "/data/geometrySignals.qml"); + QDeclarativeComponent component(&engine, testFile("geometrySignals.qml")); QObject *o = component.create(); QVERIFY(o); QCOMPARE(o->property("bindingWidth").toInt(), 400); @@ -2385,8 +2401,10 @@ void tst_qdeclarativetextedit::implicitSizePreedit() QInputMethodEvent event(text, QList<QInputMethodEvent::Attribute>()); QCoreApplication::sendEvent(&view, &event); - QVERIFY(textObject->width() < textObject->implicitWidth()); - QVERIFY(textObject->height() == textObject->implicitHeight()); + QVERIFY2(textObject->width() < textObject->implicitWidth(), + msgComparison(textObject->width(), textObject->implicitWidth()).constData()); + QVERIFY2(textObject->height() == textObject->implicitHeight(), + msgComparison(textObject->height(), textObject->implicitHeight()).constData()); qreal wrappedHeight = textObject->height(); textObject->resetWidth(); @@ -2484,7 +2502,8 @@ void tst_qdeclarativetextedit::preeditMicroFocus() ic.clear(); sendPreeditText(preeditText, i); currentRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect(); - QVERIFY(previousRect.left() < currentRect.left()); + QVERIFY2(previousRect.left() < currentRect.left(), + msgComparison(previousRect.left(), currentRect.left()).constData()); #if defined(Q_WS_X11) QVERIFY(ic.updateCallCount > 0); #endif @@ -2592,7 +2611,8 @@ void tst_qdeclarativetextedit::inputMethodComposing() void tst_qdeclarativetextedit::cursorRectangleSize() { - QDeclarativeView *canvas = createView(SRCDIR "/data/CursorRect.qml"); + QDeclarativeView *canvas = createView(testFile("CursorRect.qml")); + setFrameless(canvas); QVERIFY(canvas->rootObject() != 0); canvas->show(); canvas->setFocus(); @@ -2601,7 +2621,7 @@ void tst_qdeclarativetextedit::cursorRectangleSize() QDeclarativeTextEdit *textEdit = qobject_cast<QDeclarativeTextEdit *>(canvas->rootObject()); QVERIFY(textEdit != 0); - textEdit->setFocus(Qt::OtherFocusReason); + textEdit->setFocus(true); QRectF cursorRect = textEdit->positionToRectangle(textEdit->cursorPosition()); QRectF microFocusFromScene = canvas->scene()->inputMethodQuery(Qt::ImMicroFocus).toRectF(); QRectF microFocusFromApp= QApplication::focusWidget()->inputMethodQuery(Qt::ImMicroFocus).toRectF(); @@ -2612,7 +2632,8 @@ void tst_qdeclarativetextedit::cursorRectangleSize() void tst_qdeclarativetextedit::deselect() { - QDeclarativeView *canvas = createView(SRCDIR "/data/CursorRect.qml"); + QDeclarativeView *canvas = createView(testFile("CursorRect.qml")); + setFrameless(canvas); QVERIFY(canvas->rootObject() != 0); canvas->show(); canvas->setFocus(); diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 7e593f67..23ad31a2 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -71,7 +71,9 @@ void exitApp(int i) // Debugging output is not visible by default on Windows - // therefore show modal dialog with errors instead. if (!warnings.isEmpty()) { - QMessageBox::warning(0, QApplication::translate("QDeclarativeViewer", "Qt QML Viewer"), warnings); + const QString message = QStringLiteral("<pre>") + warnings + QStringLiteral("</pre>"); + QMessageBox::warning(0, QApplication::translate("QDeclarativeViewer", "Qt QML Viewer"), + message); } #endif exit(i); diff --git a/tools/qml/qdeclarativetester.cpp b/tools/qml/qdeclarativetester.cpp index 1d46f560..70d50f3a 100644 --- a/tools/qml/qdeclarativetester.cpp +++ b/tools/qml/qdeclarativetester.cpp @@ -53,6 +53,15 @@ QT_BEGIN_NAMESPACE +enum { + TestSuccessExitCode = 0, +#ifdef Q_OS_WIN + TestFailureExitCode = 1 // QProcess on Windows reports crash for exit codes < 0, QTBUG-28735 +#else + TestFailureExitCode = -1 +#endif +}; + extern Q_GUI_EXPORT bool qt_applefontsmoothing_enabled; QDeclarativeTester::QDeclarativeTester(const QString &script, QDeclarativeViewer::ScriptOptions opts, @@ -137,7 +146,7 @@ void QDeclarativeTester::executefailure() hasFailed = true; if (options & QDeclarativeViewer::ExitOnFailure) - exit(-1); + QCoreApplication::exit(TestFailureExitCode); } void QDeclarativeTester::imagefailure() @@ -146,7 +155,7 @@ void QDeclarativeTester::imagefailure() if (options & QDeclarativeViewer::ExitOnFailure){ testSkip(); - exit(hasFailed?-1:0); + QCoreApplication::exit(hasFailed ? TestFailureExitCode : TestSuccessExitCode); } } @@ -178,7 +187,7 @@ void QDeclarativeTester::complete() testSkip(); if (options & QDeclarativeViewer::ExitOnComplete) - QApplication::exit(hasFailed?-1:0); + QCoreApplication::exit(hasFailed? TestFailureExitCode : TestSuccessExitCode); if (hasCompleted) return; @@ -193,8 +202,13 @@ void QDeclarativeTester::run() QDeclarativeComponent c(m_view->engine(), m_script + QLatin1String(".qml")); testscript = qobject_cast<QDeclarativeVisualTest *>(c.create()); - if (testscript) testscript->setParent(this); - else { executefailure(); exit(-1); } + if (testscript) { + testscript->setParent(this); + } else { + executefailure(); + if (!(options & QDeclarativeViewer::ExitOnFailure)) + QCoreApplication::exit(TestFailureExitCode); + } testscriptidx = 0; } diff --git a/tools/qml/qml.pro b/tools/qml/qml.pro index 877fbee2..669b4cea 100644 --- a/tools/qml/qml.pro +++ b/tools/qml/qml.pro @@ -1,5 +1,5 @@ TEMPLATE = app -CONFIG += qt uic declarative_debug declarative +CONFIG += uic declarative_debug declarative DESTDIR = $$QT.declarative.bins include(qml.pri) diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index 35ee37ae..e9e59142 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -177,7 +177,7 @@ QByteArray convertToId(const QMetaObject *mo) return className; } -QSet<const QMetaObject *> collectReachableMetaObjects(QDeclarativeEngine *engine, const QList<QDeclarativeType *> &skip = QList<QDeclarativeType *>()) +QSet<const QMetaObject *> collectReachableMetaObjects(QDeclarativeEngine *, const QList<QDeclarativeType *> &skip = QList<QDeclarativeType *>()) { QSet<const QMetaObject *> metas; metas.insert(FriendlyQObject::qtMeta()); |