From 5b2b0a7b35c9df42a92aa953fe0c58d208130d51 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 12 Apr 2011 16:58:46 +0200 Subject: QNAM HTTP: Fix upload progress signal --- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 34 +++++++++++++++----------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index f509ceaad6..36bb2efdc3 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -4162,6 +4162,7 @@ public: if (serverSocket->setSocketDescriptor(socketDescriptor)) { connect(serverSocket, SIGNAL(encrypted()), this, SLOT(encryptedSlot())); + connect(serverSocket, SIGNAL(readyRead()), this, SLOT(readyReadSlot())); serverSocket->setProtocol(QSsl::AnyProtocol); connect(serverSocket, SIGNAL(sslErrors(const QList&)), serverSocket, SLOT(ignoreSslErrors())); serverSocket->setLocalCertificate(SRCDIR "/certs/server.pem"); @@ -4178,6 +4179,11 @@ public slots: socket = (QSslSocket*) sender(); emit newEncryptedConnection(); } + void readyReadSlot() { + // for the incoming sockets, not the server socket + //qDebug() << static_cast(sender())->bytesAvailable() << static_cast(sender())->encryptedBytesAvailable(); + } + public: QSslSocket *socket; }; @@ -4185,8 +4191,15 @@ public: // very similar to ioPostToHttpUploadProgress but for SSL void tst_QNetworkReply::ioPostToHttpsUploadProgress() { - QFile sourceFile(SRCDIR "/bigfile"); - QVERIFY(sourceFile.open(QIODevice::ReadOnly)); + //QFile sourceFile(SRCDIR "/bigfile"); + //QVERIFY(sourceFile.open(QIODevice::ReadOnly)); + qint64 wantedSize = 2*1024*1024; // 2 MB + QByteArray sourceFile; + // And in the case of SSL, the compression can fool us and let the + // server send the data much faster than expected. + // So better provide random data that cannot be compressed. + for (int i = 0; i < wantedSize; ++i) + sourceFile += (char)qrand(); // emulate a minimal https server SslServer server; @@ -4195,8 +4208,10 @@ void tst_QNetworkReply::ioPostToHttpsUploadProgress() // create the request QUrl url = QUrl(QString("https://127.0.0.1:%1/").arg(server.serverPort())); QNetworkRequest request(url); + request.setRawHeader("Content-Type", "application/octet-stream"); - QNetworkReplyPtr reply = manager.post(request, &sourceFile); + QNetworkReplyPtr reply = manager.post(request, sourceFile); + QSignalSpy spy(reply, SIGNAL(uploadProgress(qint64,qint64))); connect(&server, SIGNAL(newEncryptedConnection()), &QTestEventLoop::instance(), SLOT(exitLoop())); connect(reply, SIGNAL(sslErrors(const QList&)), reply, SLOT(ignoreSslErrors())); @@ -4215,26 +4230,17 @@ void tst_QNetworkReply::ioPostToHttpsUploadProgress() QVERIFY(!spy.isEmpty()); QList args = spy.last(); QVERIFY(args.at(0).toLongLong() > 0); - + // but not everything! QVERIFY(args.at(0).toLongLong() != sourceFile.size()); - incomingSocket->setReadBufferSize(32*1024); - incomingSocket->read(16*1024); - QTestEventLoop::instance().enterLoop(2); - // some more progress than before - QVERIFY(!spy.isEmpty()); - QList args2 = spy.last(); - QVERIFY(args2.at(0).toLongLong() > args.at(0).toLongLong()); - // set the read buffer to unlimited incomingSocket->setReadBufferSize(0); QTestEventLoop::instance().enterLoop(10); // progress should be finished QVERIFY(!spy.isEmpty()); QList args3 = spy.last(); - QVERIFY(args3.at(0).toLongLong() > args2.at(0).toLongLong()); QCOMPARE(args3.at(0).toLongLong(), args3.at(1).toLongLong()); - QCOMPARE(args3.at(0).toLongLong(), sourceFile.size()); + QCOMPARE(args3.at(0).toLongLong(), qint64(sourceFile.size())); // after sending this, the QNAM should emit finished() connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); -- cgit v1.2.3 From aef6239e7d7cff1ed162408998a897cf112be47e Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 13 Apr 2011 12:29:01 +0200 Subject: Revert "HTTP caching internals: fix logic for PreferNetwork and PreferCache" This reverts commit e5d27e7aeac984e46f3aa8de20160cc00fc63155. do not change the cache logic fundamentally. --- tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp index 76e671103e..3e6ad24e0b 100644 --- a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp +++ b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp @@ -137,6 +137,7 @@ static bool AlwaysFalse = false; Q_DECLARE_METATYPE(QNetworkRequest::CacheLoadControl) + void tst_QAbstractNetworkCache::initTestCase() { #ifndef QT_NO_BEARERMANAGEMENT @@ -150,6 +151,7 @@ void tst_QAbstractNetworkCache::initTestCase() #endif } + void tst_QAbstractNetworkCache::expires_data() { QTest::addColumn("cacheLoadControl"); -- cgit v1.2.3 From 863de43dcad501a6c9675823217d0abf0269f802 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 27 Apr 2011 11:48:53 +0200 Subject: QNetworkCookie: allow spaces in unquoted values We should follow http://tools.ietf.org/html/draft-ietf-httpstate-cookie-23 , which says parse the value until reaching the next ';' or the end of the line. Other cookie implementations allow spaces in unquoted values as well. Reviewed-by: Martin Petersson Task-number: QTBUG-18876 --- tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp b/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp index e0c477b2df..9a58482de0 100644 --- a/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp +++ b/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp @@ -182,6 +182,14 @@ void tst_QNetworkCookie::parseSingleCookie_data() cookie.setValue("\"\\\"a, b; c\\\"\""); QTest::newRow("with-value-with-special5") << "a = \"\\\"a, b; c\\\"\"" << cookie; + cookie.setValue("b c"); + QTest::newRow("with-value-with-whitespace") << "a = b c" << cookie; + + cookie.setValue("\"b\""); + QTest::newRow("quoted-value") << "a = \"b\"" << cookie; + cookie.setValue("\"b c\""); + QTest::newRow("quoted-value-with-whitespace") << "a = \"b c\"" << cookie; + cookie.setValue("b"); cookie.setSecure(true); QTest::newRow("secure") << "a=b;secure" << cookie; -- cgit v1.2.3 From a4e3b2bd5ed8c80b7735c21aa406236340553dbe Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 4 May 2011 13:50:40 +0200 Subject: HTTP auto tests: do not load resources from cache that must be revalidtd The header field "Cache-Control: must-revalidate" is a strict requirement for loading the resource from the server, and not reading it from the cache without revalidating first. With this patch, PreferCache will load such from the network instead of loading them from the cache, and AlwaysCache will throw a ContentNotFound error. Reviewed-by: Markus Goetz Task-number: QTBUG-18983 --- tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp | 4 ++-- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp index 3e6ad24e0b..4777f4e468 100644 --- a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp +++ b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp @@ -263,14 +263,14 @@ void tst_QAbstractNetworkCache::cacheControl_data() QTest::newRow("200-2") << QNetworkRequest::AlwaysNetwork << "httpcachetest_cachecontrol.cgi?no-cache" << AlwaysFalse; QTest::newRow("200-3") << QNetworkRequest::PreferNetwork << "httpcachetest_cachecontrol.cgi?no-cache" << false; - QTest::newRow("200-4") << QNetworkRequest::AlwaysCache << "httpcachetest_cachecontrol.cgi?no-cache" << false;//AlwaysTrue; + QTest::newRow("200-4") << QNetworkRequest::AlwaysCache << "httpcachetest_cachecontrol.cgi?no-cache" << false; QTest::newRow("200-5") << QNetworkRequest::PreferCache << "httpcachetest_cachecontrol.cgi?no-cache" << false; QTest::newRow("304-0") << QNetworkRequest::PreferNetwork << "httpcachetest_cachecontrol.cgi?max-age=1000" << true; QTest::newRow("304-1") << QNetworkRequest::AlwaysNetwork << "httpcachetest_cachecontrol.cgi?max-age=1000, must-revalidate" << AlwaysFalse; QTest::newRow("304-2") << QNetworkRequest::PreferNetwork << "httpcachetest_cachecontrol.cgi?max-age=1000, must-revalidate" << true; - QTest::newRow("304-3") << QNetworkRequest::AlwaysCache << "httpcachetest_cachecontrol.cgi?max-age=1000, must-revalidate" << AlwaysTrue; + QTest::newRow("304-3") << QNetworkRequest::AlwaysCache << "httpcachetest_cachecontrol.cgi?max-age=1000, must-revalidate" << false; QTest::newRow("304-4") << QNetworkRequest::PreferCache << "httpcachetest_cachecontrol.cgi?max-age=1000, must-revalidate" << true; // see QTBUG-7060 diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 36bb2efdc3..f7365dfbfd 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -3237,16 +3237,16 @@ void tst_QNetworkReply::ioGetFromHttpWithCache_data() QTest::newRow("must-revalidate,200,prefer-network") << reply200 << "Reloaded" << content << int(QNetworkRequest::PreferNetwork) << QStringList() << false << true; QTest::newRow("must-revalidate,200,prefer-cache") - << reply200 << "Not-reloaded" << content << int(QNetworkRequest::PreferCache) << QStringList() << true << false; + << reply200 << "Reloaded" << content << int(QNetworkRequest::PreferCache) << QStringList() << false << true; QTest::newRow("must-revalidate,200,always-cache") - << reply200 << "Not-reloaded" << content << int(QNetworkRequest::AlwaysCache) << QStringList() << true << false; + << reply200 << "" << content << int(QNetworkRequest::AlwaysCache) << QStringList() << false << false; QTest::newRow("must-revalidate,304,prefer-network") << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferNetwork) << QStringList() << true << true; QTest::newRow("must-revalidate,304,prefer-cache") - << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferCache) << QStringList() << true << false; + << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferCache) << QStringList() << true << true; QTest::newRow("must-revalidate,304,always-cache") - << reply304 << "Not-reloaded" << content << int(QNetworkRequest::AlwaysCache) << QStringList() << true << false; + << reply304 << "" << content << int(QNetworkRequest::AlwaysCache) << QStringList() << false << false; // // Partial content -- cgit v1.2.3 From 45b80f054fb729ec94714ee1a5f6145352be0296 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 5 May 2011 13:43:13 +0200 Subject: Remove misspelled comment in tst_qtextdocument.cpp The comment was copy-pasted, spelling error and all, from the example in the bug report, and really doesn't make any sense at all in this context. Reviewed-by: TrustMe (cherry picked from commit 7ac511d8d906575dff1a02361e31251b244d3b3a) --- tests/auto/qtextdocument/tst_qtextdocument.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto') diff --git a/tests/auto/qtextdocument/tst_qtextdocument.cpp b/tests/auto/qtextdocument/tst_qtextdocument.cpp index 26fa43d137..7aa6578e86 100644 --- a/tests/auto/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/qtextdocument/tst_qtextdocument.cpp @@ -2742,7 +2742,7 @@ void tst_QTextDocument::copiedFontSize() QTextDocument documentOutput; QFont fontInput; - fontInput.setPixelSize(24); // With pixels font size is not transfered in html + fontInput.setPixelSize(24); QTextCursor cursorInput(&documentInput); QTextCharFormat formatInput = cursorInput.charFormat(); -- cgit v1.2.3 From ec88a761278953fa7816ecd874311ae270d28a2a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 6 May 2011 09:31:21 +0200 Subject: uic: Remove Q3Support. Remove code and tests. --- tests/auto/uic/baseline/config_fromuic3.ui | 1647 -------------------- tests/auto/uic/baseline/config_fromuic3.ui.h | 716 --------- tests/auto/uic/baseline/mainwindowbase.ui | 1214 --------------- tests/auto/uic/baseline/mainwindowbase.ui.h | 968 ------------ tests/auto/uic/baseline/mydialog.ui.h | 1 - .../auto/uic/baseline/paletteeditoradvancedbase.ui | 617 -------- .../uic/baseline/paletteeditoradvancedbase.ui.h | 485 ------ tests/auto/uic/baseline/previewwidgetbase.ui | 340 ---- tests/auto/uic/baseline/previewwidgetbase.ui.h | 316 ---- 9 files changed, 6304 deletions(-) delete mode 100644 tests/auto/uic/baseline/config_fromuic3.ui delete mode 100644 tests/auto/uic/baseline/config_fromuic3.ui.h delete mode 100644 tests/auto/uic/baseline/mainwindowbase.ui delete mode 100644 tests/auto/uic/baseline/mainwindowbase.ui.h delete mode 100644 tests/auto/uic/baseline/paletteeditoradvancedbase.ui delete mode 100644 tests/auto/uic/baseline/paletteeditoradvancedbase.ui.h delete mode 100644 tests/auto/uic/baseline/previewwidgetbase.ui delete mode 100644 tests/auto/uic/baseline/previewwidgetbase.ui.h (limited to 'tests/auto') diff --git a/tests/auto/uic/baseline/config_fromuic3.ui b/tests/auto/uic/baseline/config_fromuic3.ui deleted file mode 100644 index f8debfebe3..0000000000 --- a/tests/auto/uic/baseline/config_fromuic3.ui +++ /dev/null @@ -1,1647 +0,0 @@ - - - - ********************************************************************* -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* - - Config - - - - 0 - 0 - 481 - 645 - - - - Configure - - - logo.png - - - true - - - - 11 - - - 6 - - - - - Depth - - - - - 11 - 19 - 229 - 19 - - - - 1 bit monochrome - - - - - - 11 - 44 - 229 - 19 - - - - 4 bit grayscale - - - - - - 11 - 69 - 229 - 19 - - - - 8 bit - - - - - - 11 - 94 - 229 - 19 - - - - 12 (16) bit - - - - - - 11 - 119 - 229 - 19 - - - - 16 bit - - - - - - 11 - 144 - 229 - 19 - - - - 32 bit - - - - - - - - 0 - - - 6 - - - - - - 20 - 20 - - - - QSizePolicy::Expanding - - - Qt::Horizontal - - - - - - - &OK - - - true - - - true - - - - - - - &Cancel - - - true - - - - - - - - - Emulate touch screen (no mouse move). - - - - - - - Gamma - - - - 11 - - - 6 - - - - - Blue - - - false - - - - - - - - - - 0 - 0 - 0 - - - 0 - 0 - 255 - - - 127 - 127 - 255 - - - 63 - 63 - 255 - - - 0 - 0 - 127 - - - 0 - 0 - 170 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - 0 - 0 - 0 - - - 0 - 0 - 255 - - - 127 - 127 - 255 - - - 38 - 38 - 255 - - - 0 - 0 - 127 - - - 0 - 0 - 170 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - 128 - 128 - 128 - - - 0 - 0 - 255 - - - 127 - 127 - 255 - - - 38 - 38 - 255 - - - 0 - 0 - 127 - - - 0 - 0 - 170 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 128 - 128 - 128 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - - 400 - - - 100 - - - Qt::Horizontal - - - - - - - 1.0 - - - false - - - - - - - - 20 - 20 - - - - QSizePolicy::Expanding - - - Qt::Vertical - - - - - - - Green - - - false - - - - - - - - - - 0 - 0 - 0 - - - 0 - 255 - 0 - - - 127 - 255 - 127 - - - 63 - 255 - 63 - - - 0 - 127 - 0 - - - 0 - 170 - 0 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - 0 - 0 - 0 - - - 0 - 255 - 0 - - - 127 - 255 - 127 - - - 38 - 255 - 38 - - - 0 - 127 - 0 - - - 0 - 170 - 0 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - 128 - 128 - 128 - - - 0 - 255 - 0 - - - 127 - 255 - 127 - - - 38 - 255 - 38 - - - 0 - 127 - 0 - - - 0 - 170 - 0 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 128 - 128 - 128 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - - 400 - - - 100 - - - Qt::Horizontal - - - - - - - 1.0 - - - false - - - - - - - All - - - false - - - - - - - 1.0 - - - false - - - - - - - - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 255 - 255 - 255 - - - 255 - 255 - 255 - - - 127 - 127 - 127 - - - 170 - 170 - 170 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 255 - 255 - 255 - - - 255 - 255 - 255 - - - 127 - 127 - 127 - - - 170 - 170 - 170 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - 128 - 128 - 128 - - - 255 - 255 - 255 - - - 255 - 255 - 255 - - - 255 - 255 - 255 - - - 127 - 127 - 127 - - - 170 - 170 - 170 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 128 - 128 - 128 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - - 400 - - - 100 - - - Qt::Horizontal - - - - - - - Red - - - false - - - - - - - 1.0 - - - false - - - - - - - - - - 0 - 0 - 0 - - - 255 - 0 - 0 - - - 255 - 127 - 127 - - - 255 - 63 - 63 - - - 127 - 0 - 0 - - - 170 - 0 - 0 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - 0 - 0 - 0 - - - 255 - 0 - 0 - - - 255 - 127 - 127 - - - 255 - 38 - 38 - - - 127 - 0 - 0 - - - 170 - 0 - 0 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - 128 - 128 - 128 - - - 255 - 0 - 0 - - - 255 - 127 - 127 - - - 255 - 38 - 38 - - - 127 - 0 - 0 - - - 170 - 0 - 0 - - - 0 - 0 - 0 - - - 255 - 255 - 255 - - - 128 - 128 - 128 - - - 255 - 255 - 255 - - - 220 - 220 - 220 - - - 0 - 0 - 0 - - - 10 - 95 - 137 - - - 255 - 255 - 255 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - - 400 - - - 100 - - - Qt::Horizontal - - - - - - - - 20 - 20 - - - - QSizePolicy::Expanding - - - Qt::Vertical - - - - - - - - 20 - 20 - - - - QSizePolicy::Expanding - - - Qt::Vertical - - - - - - - Set all to 1.0 - - - - - - - - - - - 20 - 20 - - - - QSizePolicy::Expanding - - - Qt::Vertical - - - - - - - - - - - 5 - 5 - 0 - 0 - - - - Size - - - - 11 - - - 6 - - - - - 240x320 "PDA" - - - - - - - 320x240 "TV" - - - - - - - 640x480 "VGA" - - - - - - - 0 - - - 6 - - - - - Custom - - - - - - - 1280 - - - 1 - - - 16 - - - 400 - - - - - - - 1024 - - - 1 - - - 16 - - - 300 - - - - - - - - - 0 - - - 6 - - - - - - 0 - 0 - 0 - 0 - - - - Skin - - - - - - - - 5 - 0 - 0 - 0 - - - - - pda.skin - - - - - ipaq.skin - - - - - qpe.skin - - - - - cassiopeia.skin - - - - - other.skin - - - - - - - - - - - - - <p>Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth <i>above</i>. You may freely modify the Gamma <i>below</i>. - - - false - - - - - - - Test - - - 1 - - - - - - - - - GammaView - QWidget -
gammaview.h
- - 64 - 64 - - 0 - - 3 - 3 - - image0 -
-
- - - 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 - - - - - buttonOk - clicked() - Config - accept() - - - buttonCancel - clicked() - Config - reject() - - -
diff --git a/tests/auto/uic/baseline/config_fromuic3.ui.h b/tests/auto/uic/baseline/config_fromuic3.ui.h deleted file mode 100644 index 1078b891d2..0000000000 --- a/tests/auto/uic/baseline/config_fromuic3.ui.h +++ /dev/null @@ -1,716 +0,0 @@ -/* -********************************************************************* -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* -*/ - -/******************************************************************************** -** Form generated from reading UI file 'config_fromuic3.ui' -** -** Created: Thu Dec 17 12:48:42 2009 -** by: Qt User Interface Compiler version 4.6.4 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef CONFIG_FROMUIC3_H -#define CONFIG_FROMUIC3_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "gammaview.h" - -QT_BEGIN_NAMESPACE - -class Ui_Config -{ -public: - QGridLayout *gridLayout; - Q3ButtonGroup *ButtonGroup2; - QRadioButton *depth_1; - QRadioButton *depth_4gray; - QRadioButton *depth_8; - QRadioButton *depth_12; - QRadioButton *depth_16; - QRadioButton *depth_32; - QHBoxLayout *hboxLayout; - QSpacerItem *Horizontal_Spacing2; - QPushButton *buttonOk; - QPushButton *buttonCancel; - QCheckBox *touchScreen; - Q3GroupBox *GroupBox1; - QGridLayout *gridLayout1; - QLabel *TextLabel3; - QSlider *bslider; - QLabel *blabel; - QSpacerItem *Spacer3; - QLabel *TextLabel2; - QSlider *gslider; - QLabel *glabel; - QLabel *TextLabel7; - QLabel *TextLabel8; - QSlider *gammaslider; - QLabel *TextLabel1_2; - QLabel *rlabel; - QSlider *rslider; - QSpacerItem *Spacer2; - QSpacerItem *Spacer4; - QPushButton *PushButton3; - GammaView *MyCustomWidget1; - QSpacerItem *Spacer5; - Q3ButtonGroup *ButtonGroup1; - QVBoxLayout *vboxLayout; - QRadioButton *size_240_320; - QRadioButton *size_320_240; - QRadioButton *size_640_480; - QHBoxLayout *hboxLayout1; - QRadioButton *size_custom; - QSpinBox *size_width; - QSpinBox *size_height; - QHBoxLayout *hboxLayout2; - QRadioButton *size_skin; - QComboBox *skin; - QLabel *TextLabel1; - QRadioButton *test_for_useless_buttongroupId; - - void setupUi(QDialog *Config) - { - if (Config->objectName().isEmpty()) - Config->setObjectName(QString::fromUtf8("Config")); - Config->resize(481, 645); - Config->setWindowIcon(QPixmap(QString::fromUtf8("logo.png"))); - Config->setSizeGripEnabled(true); - gridLayout = new QGridLayout(Config); - gridLayout->setSpacing(6); - gridLayout->setContentsMargins(11, 11, 11, 11); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); - ButtonGroup2 = new Q3ButtonGroup(Config); - ButtonGroup2->setObjectName(QString::fromUtf8("ButtonGroup2")); - depth_1 = new QRadioButton(ButtonGroup2); - depth_1->setObjectName(QString::fromUtf8("depth_1")); - depth_1->setGeometry(QRect(11, 19, 229, 19)); - depth_4gray = new QRadioButton(ButtonGroup2); - depth_4gray->setObjectName(QString::fromUtf8("depth_4gray")); - depth_4gray->setGeometry(QRect(11, 44, 229, 19)); - depth_8 = new QRadioButton(ButtonGroup2); - depth_8->setObjectName(QString::fromUtf8("depth_8")); - depth_8->setGeometry(QRect(11, 69, 229, 19)); - depth_12 = new QRadioButton(ButtonGroup2); - depth_12->setObjectName(QString::fromUtf8("depth_12")); - depth_12->setGeometry(QRect(11, 94, 229, 19)); - depth_16 = new QRadioButton(ButtonGroup2); - depth_16->setObjectName(QString::fromUtf8("depth_16")); - depth_16->setGeometry(QRect(11, 119, 229, 19)); - depth_32 = new QRadioButton(ButtonGroup2); - depth_32->setObjectName(QString::fromUtf8("depth_32")); - depth_32->setGeometry(QRect(11, 144, 229, 19)); - - gridLayout->addWidget(ButtonGroup2, 0, 1, 1, 1); - - hboxLayout = new QHBoxLayout(); - hboxLayout->setSpacing(6); - hboxLayout->setContentsMargins(0, 0, 0, 0); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - Horizontal_Spacing2 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout->addItem(Horizontal_Spacing2); - - buttonOk = new QPushButton(Config); - buttonOk->setObjectName(QString::fromUtf8("buttonOk")); - buttonOk->setAutoDefault(true); - buttonOk->setDefault(true); - - hboxLayout->addWidget(buttonOk); - - buttonCancel = new QPushButton(Config); - buttonCancel->setObjectName(QString::fromUtf8("buttonCancel")); - buttonCancel->setAutoDefault(true); - - hboxLayout->addWidget(buttonCancel); - - - gridLayout->addLayout(hboxLayout, 4, 0, 1, 2); - - touchScreen = new QCheckBox(Config); - touchScreen->setObjectName(QString::fromUtf8("touchScreen")); - - gridLayout->addWidget(touchScreen, 2, 0, 1, 2); - - GroupBox1 = new Q3GroupBox(Config); - GroupBox1->setObjectName(QString::fromUtf8("GroupBox1")); - GroupBox1->setColumnLayout(0, Qt::Vertical); - GroupBox1->layout()->setSpacing(6); - GroupBox1->layout()->setContentsMargins(11, 11, 11, 11); - gridLayout1 = new QGridLayout(); - QBoxLayout *boxlayout = qobject_cast(GroupBox1->layout()); - if (boxlayout) - boxlayout->addLayout(gridLayout1); - gridLayout1->setAlignment(Qt::AlignTop); - gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); - TextLabel3 = new QLabel(GroupBox1); - TextLabel3->setObjectName(QString::fromUtf8("TextLabel3")); - TextLabel3->setWordWrap(false); - - gridLayout1->addWidget(TextLabel3, 6, 0, 1, 1); - - bslider = new QSlider(GroupBox1); - bslider->setObjectName(QString::fromUtf8("bslider")); - QPalette palette; - palette.setColor(QPalette::Active, static_cast(0), QColor(0, 0, 0)); - palette.setColor(QPalette::Active, static_cast(1), QColor(0, 0, 255)); - palette.setColor(QPalette::Active, static_cast(2), QColor(127, 127, 255)); - palette.setColor(QPalette::Active, static_cast(3), QColor(63, 63, 255)); - palette.setColor(QPalette::Active, static_cast(4), QColor(0, 0, 127)); - palette.setColor(QPalette::Active, static_cast(5), QColor(0, 0, 170)); - palette.setColor(QPalette::Active, static_cast(6), QColor(0, 0, 0)); - palette.setColor(QPalette::Active, static_cast(7), QColor(255, 255, 255)); - palette.setColor(QPalette::Active, static_cast(8), QColor(0, 0, 0)); - palette.setColor(QPalette::Active, static_cast(9), QColor(255, 255, 255)); - palette.setColor(QPalette::Active, static_cast(10), QColor(220, 220, 220)); - palette.setColor(QPalette::Active, static_cast(11), QColor(0, 0, 0)); - palette.setColor(QPalette::Active, static_cast(12), QColor(10, 95, 137)); - palette.setColor(QPalette::Active, static_cast(13), QColor(255, 255, 255)); - palette.setColor(QPalette::Active, static_cast(14), QColor(0, 0, 0)); - palette.setColor(QPalette::Active, static_cast(15), QColor(0, 0, 0)); - palette.setColor(QPalette::Inactive, static_cast(0), QColor(0, 0, 0)); - palette.setColor(QPalette::Inactive, static_cast(1), QColor(0, 0, 255)); - palette.setColor(QPalette::Inactive, static_cast(2), QColor(127, 127, 255)); - palette.setColor(QPalette::Inactive, static_cast(3), QColor(38, 38, 255)); - palette.setColor(QPalette::Inactive, static_cast(4), QColor(0, 0, 127)); - palette.setColor(QPalette::Inactive, static_cast(5), QColor(0, 0, 170)); - palette.setColor(QPalette::Inactive, static_cast(6), QColor(0, 0, 0)); - palette.setColor(QPalette::Inactive, static_cast(7), QColor(255, 255, 255)); - palette.setColor(QPalette::Inactive, static_cast(8), QColor(0, 0, 0)); - palette.setColor(QPalette::Inactive, static_cast(9), QColor(255, 255, 255)); - palette.setColor(QPalette::Inactive, static_cast(10), QColor(220, 220, 220)); - palette.setColor(QPalette::Inactive, static_cast(11), QColor(0, 0, 0)); - palette.setColor(QPalette::Inactive, static_cast(12), QColor(10, 95, 137)); - palette.setColor(QPalette::Inactive, static_cast(13), QColor(255, 255, 255)); - palette.setColor(QPalette::Inactive, static_cast(14), QColor(0, 0, 0)); - palette.setColor(QPalette::Inactive, static_cast(15), QColor(0, 0, 0)); - palette.setColor(QPalette::Disabled, static_cast(0), QColor(128, 128, 128)); - palette.setColor(QPalette::Disabled, static_cast(1), QColor(0, 0, 255)); - palette.setColor(QPalette::Disabled, static_cast(2), QColor(127, 127, 255)); - palette.setColor(QPalette::Disabled, static_cast(3), QColor(38, 38, 255)); - palette.setColor(QPalette::Disabled, static_cast(4), QColor(0, 0, 127)); - palette.setColor(QPalette::Disabled, static_cast(5), QColor(0, 0, 170)); - palette.setColor(QPalette::Disabled, static_cast(6), QColor(0, 0, 0)); - palette.setColor(QPalette::Disabled, static_cast(7), QColor(255, 255, 255)); - palette.setColor(QPalette::Disabled, static_cast(8), QColor(128, 128, 128)); - palette.setColor(QPalette::Disabled, static_cast(9), QColor(255, 255, 255)); - palette.setColor(QPalette::Disabled, static_cast(10), QColor(220, 220, 220)); - palette.setColor(QPalette::Disabled, static_cast(11), QColor(0, 0, 0)); - palette.setColor(QPalette::Disabled, static_cast(12), QColor(10, 95, 137)); - palette.setColor(QPalette::Disabled, static_cast(13), QColor(255, 255, 255)); - palette.setColor(QPalette::Disabled, static_cast(14), QColor(0, 0, 0)); - palette.setColor(QPalette::Disabled, static_cast(15), QColor(0, 0, 0)); - bslider->setPalette(palette); - bslider->setMaximum(400); - bslider->setValue(100); - bslider->setOrientation(Qt::Horizontal); - - gridLayout1->addWidget(bslider, 6, 1, 1, 1); - - blabel = new QLabel(GroupBox1); - blabel->setObjectName(QString::fromUtf8("blabel")); - blabel->setWordWrap(false); - - gridLayout1->addWidget(blabel, 6, 2, 1, 1); - - Spacer3 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout1->addItem(Spacer3, 5, 1, 1, 1); - - TextLabel2 = new QLabel(GroupBox1); - TextLabel2->setObjectName(QString::fromUtf8("TextLabel2")); - TextLabel2->setWordWrap(false); - - gridLayout1->addWidget(TextLabel2, 4, 0, 1, 1); - - gslider = new QSlider(GroupBox1); - gslider->setObjectName(QString::fromUtf8("gslider")); - QPalette palette1; - palette1.setColor(QPalette::Active, static_cast(0), QColor(0, 0, 0)); - palette1.setColor(QPalette::Active, static_cast(1), QColor(0, 255, 0)); - palette1.setColor(QPalette::Active, static_cast(2), QColor(127, 255, 127)); - palette1.setColor(QPalette::Active, static_cast(3), QColor(63, 255, 63)); - palette1.setColor(QPalette::Active, static_cast(4), QColor(0, 127, 0)); - palette1.setColor(QPalette::Active, static_cast(5), QColor(0, 170, 0)); - palette1.setColor(QPalette::Active, static_cast(6), QColor(0, 0, 0)); - palette1.setColor(QPalette::Active, static_cast(7), QColor(255, 255, 255)); - palette1.setColor(QPalette::Active, static_cast(8), QColor(0, 0, 0)); - palette1.setColor(QPalette::Active, static_cast(9), QColor(255, 255, 255)); - palette1.setColor(QPalette::Active, static_cast(10), QColor(220, 220, 220)); - palette1.setColor(QPalette::Active, static_cast(11), QColor(0, 0, 0)); - palette1.setColor(QPalette::Active, static_cast(12), QColor(10, 95, 137)); - palette1.setColor(QPalette::Active, static_cast(13), QColor(255, 255, 255)); - palette1.setColor(QPalette::Active, static_cast(14), QColor(0, 0, 0)); - palette1.setColor(QPalette::Active, static_cast(15), QColor(0, 0, 0)); - palette1.setColor(QPalette::Inactive, static_cast(0), QColor(0, 0, 0)); - palette1.setColor(QPalette::Inactive, static_cast(1), QColor(0, 255, 0)); - palette1.setColor(QPalette::Inactive, static_cast(2), QColor(127, 255, 127)); - palette1.setColor(QPalette::Inactive, static_cast(3), QColor(38, 255, 38)); - palette1.setColor(QPalette::Inactive, static_cast(4), QColor(0, 127, 0)); - palette1.setColor(QPalette::Inactive, static_cast(5), QColor(0, 170, 0)); - palette1.setColor(QPalette::Inactive, static_cast(6), QColor(0, 0, 0)); - palette1.setColor(QPalette::Inactive, static_cast(7), QColor(255, 255, 255)); - palette1.setColor(QPalette::Inactive, static_cast(8), QColor(0, 0, 0)); - palette1.setColor(QPalette::Inactive, static_cast(9), QColor(255, 255, 255)); - palette1.setColor(QPalette::Inactive, static_cast(10), QColor(220, 220, 220)); - palette1.setColor(QPalette::Inactive, static_cast(11), QColor(0, 0, 0)); - palette1.setColor(QPalette::Inactive, static_cast(12), QColor(10, 95, 137)); - palette1.setColor(QPalette::Inactive, static_cast(13), QColor(255, 255, 255)); - palette1.setColor(QPalette::Inactive, static_cast(14), QColor(0, 0, 0)); - palette1.setColor(QPalette::Inactive, static_cast(15), QColor(0, 0, 0)); - palette1.setColor(QPalette::Disabled, static_cast(0), QColor(128, 128, 128)); - palette1.setColor(QPalette::Disabled, static_cast(1), QColor(0, 255, 0)); - palette1.setColor(QPalette::Disabled, static_cast(2), QColor(127, 255, 127)); - palette1.setColor(QPalette::Disabled, static_cast(3), QColor(38, 255, 38)); - palette1.setColor(QPalette::Disabled, static_cast(4), QColor(0, 127, 0)); - palette1.setColor(QPalette::Disabled, static_cast(5), QColor(0, 170, 0)); - palette1.setColor(QPalette::Disabled, static_cast(6), QColor(0, 0, 0)); - palette1.setColor(QPalette::Disabled, static_cast(7), QColor(255, 255, 255)); - palette1.setColor(QPalette::Disabled, static_cast(8), QColor(128, 128, 128)); - palette1.setColor(QPalette::Disabled, static_cast(9), QColor(255, 255, 255)); - palette1.setColor(QPalette::Disabled, static_cast(10), QColor(220, 220, 220)); - palette1.setColor(QPalette::Disabled, static_cast(11), QColor(0, 0, 0)); - palette1.setColor(QPalette::Disabled, static_cast(12), QColor(10, 95, 137)); - palette1.setColor(QPalette::Disabled, static_cast(13), QColor(255, 255, 255)); - palette1.setColor(QPalette::Disabled, static_cast(14), QColor(0, 0, 0)); - palette1.setColor(QPalette::Disabled, static_cast(15), QColor(0, 0, 0)); - gslider->setPalette(palette1); - gslider->setMaximum(400); - gslider->setValue(100); - gslider->setOrientation(Qt::Horizontal); - - gridLayout1->addWidget(gslider, 4, 1, 1, 1); - - glabel = new QLabel(GroupBox1); - glabel->setObjectName(QString::fromUtf8("glabel")); - glabel->setWordWrap(false); - - gridLayout1->addWidget(glabel, 4, 2, 1, 1); - - TextLabel7 = new QLabel(GroupBox1); - TextLabel7->setObjectName(QString::fromUtf8("TextLabel7")); - TextLabel7->setWordWrap(false); - - gridLayout1->addWidget(TextLabel7, 0, 0, 1, 1); - - TextLabel8 = new QLabel(GroupBox1); - TextLabel8->setObjectName(QString::fromUtf8("TextLabel8")); - TextLabel8->setWordWrap(false); - - gridLayout1->addWidget(TextLabel8, 0, 2, 1, 1); - - gammaslider = new QSlider(GroupBox1); - gammaslider->setObjectName(QString::fromUtf8("gammaslider")); - QPalette palette2; - palette2.setColor(QPalette::Active, static_cast(0), QColor(0, 0, 0)); - palette2.setColor(QPalette::Active, static_cast(1), QColor(255, 255, 255)); - palette2.setColor(QPalette::Active, static_cast(2), QColor(255, 255, 255)); - palette2.setColor(QPalette::Active, static_cast(3), QColor(255, 255, 255)); - palette2.setColor(QPalette::Active, static_cast(4), QColor(127, 127, 127)); - palette2.setColor(QPalette::Active, static_cast(5), QColor(170, 170, 170)); - palette2.setColor(QPalette::Active, static_cast(6), QColor(0, 0, 0)); - palette2.setColor(QPalette::Active, static_cast(7), QColor(255, 255, 255)); - palette2.setColor(QPalette::Active, static_cast(8), QColor(0, 0, 0)); - palette2.setColor(QPalette::Active, static_cast(9), QColor(255, 255, 255)); - palette2.setColor(QPalette::Active, static_cast(10), QColor(220, 220, 220)); - palette2.setColor(QPalette::Active, static_cast(11), QColor(0, 0, 0)); - palette2.setColor(QPalette::Active, static_cast(12), QColor(10, 95, 137)); - palette2.setColor(QPalette::Active, static_cast(13), QColor(255, 255, 255)); - palette2.setColor(QPalette::Active, static_cast(14), QColor(0, 0, 0)); - palette2.setColor(QPalette::Active, static_cast(15), QColor(0, 0, 0)); - palette2.setColor(QPalette::Inactive, static_cast(0), QColor(0, 0, 0)); - palette2.setColor(QPalette::Inactive, static_cast(1), QColor(255, 255, 255)); - palette2.setColor(QPalette::Inactive, static_cast(2), QColor(255, 255, 255)); - palette2.setColor(QPalette::Inactive, static_cast(3), QColor(255, 255, 255)); - palette2.setColor(QPalette::Inactive, static_cast(4), QColor(127, 127, 127)); - palette2.setColor(QPalette::Inactive, static_cast(5), QColor(170, 170, 170)); - palette2.setColor(QPalette::Inactive, static_cast(6), QColor(0, 0, 0)); - palette2.setColor(QPalette::Inactive, static_cast(7), QColor(255, 255, 255)); - palette2.setColor(QPalette::Inactive, static_cast(8), QColor(0, 0, 0)); - palette2.setColor(QPalette::Inactive, static_cast(9), QColor(255, 255, 255)); - palette2.setColor(QPalette::Inactive, static_cast(10), QColor(220, 220, 220)); - palette2.setColor(QPalette::Inactive, static_cast(11), QColor(0, 0, 0)); - palette2.setColor(QPalette::Inactive, static_cast(12), QColor(10, 95, 137)); - palette2.setColor(QPalette::Inactive, static_cast(13), QColor(255, 255, 255)); - palette2.setColor(QPalette::Inactive, static_cast(14), QColor(0, 0, 0)); - palette2.setColor(QPalette::Inactive, static_cast(15), QColor(0, 0, 0)); - palette2.setColor(QPalette::Disabled, static_cast(0), QColor(128, 128, 128)); - palette2.setColor(QPalette::Disabled, static_cast(1), QColor(255, 255, 255)); - palette2.setColor(QPalette::Disabled, static_cast(2), QColor(255, 255, 255)); - palette2.setColor(QPalette::Disabled, static_cast(3), QColor(255, 255, 255)); - palette2.setColor(QPalette::Disabled, static_cast(4), QColor(127, 127, 127)); - palette2.setColor(QPalette::Disabled, static_cast(5), QColor(170, 170, 170)); - palette2.setColor(QPalette::Disabled, static_cast(6), QColor(0, 0, 0)); - palette2.setColor(QPalette::Disabled, static_cast(7), QColor(255, 255, 255)); - palette2.setColor(QPalette::Disabled, static_cast(8), QColor(128, 128, 128)); - palette2.setColor(QPalette::Disabled, static_cast(9), QColor(255, 255, 255)); - palette2.setColor(QPalette::Disabled, static_cast(10), QColor(220, 220, 220)); - palette2.setColor(QPalette::Disabled, static_cast(11), QColor(0, 0, 0)); - palette2.setColor(QPalette::Disabled, static_cast(12), QColor(10, 95, 137)); - palette2.setColor(QPalette::Disabled, static_cast(13), QColor(255, 255, 255)); - palette2.setColor(QPalette::Disabled, static_cast(14), QColor(0, 0, 0)); - palette2.setColor(QPalette::Disabled, static_cast(15), QColor(0, 0, 0)); - gammaslider->setPalette(palette2); - gammaslider->setMaximum(400); - gammaslider->setValue(100); - gammaslider->setOrientation(Qt::Horizontal); - - gridLayout1->addWidget(gammaslider, 0, 1, 1, 1); - - TextLabel1_2 = new QLabel(GroupBox1); - TextLabel1_2->setObjectName(QString::fromUtf8("TextLabel1_2")); - TextLabel1_2->setWordWrap(false); - - gridLayout1->addWidget(TextLabel1_2, 2, 0, 1, 1); - - rlabel = new QLabel(GroupBox1); - rlabel->setObjectName(QString::fromUtf8("rlabel")); - rlabel->setWordWrap(false); - - gridLayout1->addWidget(rlabel, 2, 2, 1, 1); - - rslider = new QSlider(GroupBox1); - rslider->setObjectName(QString::fromUtf8("rslider")); - QPalette palette3; - palette3.setColor(QPalette::Active, static_cast(0), QColor(0, 0, 0)); - palette3.setColor(QPalette::Active, static_cast(1), QColor(255, 0, 0)); - palette3.setColor(QPalette::Active, static_cast(2), QColor(255, 127, 127)); - palette3.setColor(QPalette::Active, static_cast(3), QColor(255, 63, 63)); - palette3.setColor(QPalette::Active, static_cast(4), QColor(127, 0, 0)); - palette3.setColor(QPalette::Active, static_cast(5), QColor(170, 0, 0)); - palette3.setColor(QPalette::Active, static_cast(6), QColor(0, 0, 0)); - palette3.setColor(QPalette::Active, static_cast(7), QColor(255, 255, 255)); - palette3.setColor(QPalette::Active, static_cast(8), QColor(0, 0, 0)); - palette3.setColor(QPalette::Active, static_cast(9), QColor(255, 255, 255)); - palette3.setColor(QPalette::Active, static_cast(10), QColor(220, 220, 220)); - palette3.setColor(QPalette::Active, static_cast(11), QColor(0, 0, 0)); - palette3.setColor(QPalette::Active, static_cast(12), QColor(10, 95, 137)); - palette3.setColor(QPalette::Active, static_cast(13), QColor(255, 255, 255)); - palette3.setColor(QPalette::Active, static_cast(14), QColor(0, 0, 0)); - palette3.setColor(QPalette::Active, static_cast(15), QColor(0, 0, 0)); - palette3.setColor(QPalette::Inactive, static_cast(0), QColor(0, 0, 0)); - palette3.setColor(QPalette::Inactive, static_cast(1), QColor(255, 0, 0)); - palette3.setColor(QPalette::Inactive, static_cast(2), QColor(255, 127, 127)); - palette3.setColor(QPalette::Inactive, static_cast(3), QColor(255, 38, 38)); - palette3.setColor(QPalette::Inactive, static_cast(4), QColor(127, 0, 0)); - palette3.setColor(QPalette::Inactive, static_cast(5), QColor(170, 0, 0)); - palette3.setColor(QPalette::Inactive, static_cast(6), QColor(0, 0, 0)); - palette3.setColor(QPalette::Inactive, static_cast(7), QColor(255, 255, 255)); - palette3.setColor(QPalette::Inactive, static_cast(8), QColor(0, 0, 0)); - palette3.setColor(QPalette::Inactive, static_cast(9), QColor(255, 255, 255)); - palette3.setColor(QPalette::Inactive, static_cast(10), QColor(220, 220, 220)); - palette3.setColor(QPalette::Inactive, static_cast(11), QColor(0, 0, 0)); - palette3.setColor(QPalette::Inactive, static_cast(12), QColor(10, 95, 137)); - palette3.setColor(QPalette::Inactive, static_cast(13), QColor(255, 255, 255)); - palette3.setColor(QPalette::Inactive, static_cast(14), QColor(0, 0, 0)); - palette3.setColor(QPalette::Inactive, static_cast(15), QColor(0, 0, 0)); - palette3.setColor(QPalette::Disabled, static_cast(0), QColor(128, 128, 128)); - palette3.setColor(QPalette::Disabled, static_cast(1), QColor(255, 0, 0)); - palette3.setColor(QPalette::Disabled, static_cast(2), QColor(255, 127, 127)); - palette3.setColor(QPalette::Disabled, static_cast(3), QColor(255, 38, 38)); - palette3.setColor(QPalette::Disabled, static_cast(4), QColor(127, 0, 0)); - palette3.setColor(QPalette::Disabled, static_cast(5), QColor(170, 0, 0)); - palette3.setColor(QPalette::Disabled, static_cast(6), QColor(0, 0, 0)); - palette3.setColor(QPalette::Disabled, static_cast(7), QColor(255, 255, 255)); - palette3.setColor(QPalette::Disabled, static_cast(8), QColor(128, 128, 128)); - palette3.setColor(QPalette::Disabled, static_cast(9), QColor(255, 255, 255)); - palette3.setColor(QPalette::Disabled, static_cast(10), QColor(220, 220, 220)); - palette3.setColor(QPalette::Disabled, static_cast(11), QColor(0, 0, 0)); - palette3.setColor(QPalette::Disabled, static_cast(12), QColor(10, 95, 137)); - palette3.setColor(QPalette::Disabled, static_cast(13), QColor(255, 255, 255)); - palette3.setColor(QPalette::Disabled, static_cast(14), QColor(0, 0, 0)); - palette3.setColor(QPalette::Disabled, static_cast(15), QColor(0, 0, 0)); - rslider->setPalette(palette3); - rslider->setMaximum(400); - rslider->setValue(100); - rslider->setOrientation(Qt::Horizontal); - - gridLayout1->addWidget(rslider, 2, 1, 1, 1); - - Spacer2 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout1->addItem(Spacer2, 3, 1, 1, 1); - - Spacer4 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout1->addItem(Spacer4, 1, 1, 1, 1); - - PushButton3 = new QPushButton(GroupBox1); - PushButton3->setObjectName(QString::fromUtf8("PushButton3")); - - gridLayout1->addWidget(PushButton3, 8, 0, 1, 3); - - MyCustomWidget1 = new GammaView(GroupBox1); - MyCustomWidget1->setObjectName(QString::fromUtf8("MyCustomWidget1")); - - gridLayout1->addWidget(MyCustomWidget1, 0, 3, 9, 1); - - Spacer5 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout1->addItem(Spacer5, 7, 1, 1, 1); - - - gridLayout->addWidget(GroupBox1, 3, 0, 1, 2); - - ButtonGroup1 = new Q3ButtonGroup(Config); - ButtonGroup1->setObjectName(QString::fromUtf8("ButtonGroup1")); - QSizePolicy sizePolicy(static_cast(5), static_cast(5)); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(ButtonGroup1->sizePolicy().hasHeightForWidth()); - ButtonGroup1->setSizePolicy(sizePolicy); - ButtonGroup1->setColumnLayout(0, Qt::Vertical); - ButtonGroup1->layout()->setSpacing(6); - ButtonGroup1->layout()->setContentsMargins(11, 11, 11, 11); - vboxLayout = new QVBoxLayout(); - QBoxLayout *boxlayout1 = qobject_cast(ButtonGroup1->layout()); - if (boxlayout1) - boxlayout1->addLayout(vboxLayout); - vboxLayout->setAlignment(Qt::AlignTop); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); - size_240_320 = new QRadioButton(ButtonGroup1); - size_240_320->setObjectName(QString::fromUtf8("size_240_320")); - - vboxLayout->addWidget(size_240_320); - - size_320_240 = new QRadioButton(ButtonGroup1); - size_320_240->setObjectName(QString::fromUtf8("size_320_240")); - - vboxLayout->addWidget(size_320_240); - - size_640_480 = new QRadioButton(ButtonGroup1); - size_640_480->setObjectName(QString::fromUtf8("size_640_480")); - - vboxLayout->addWidget(size_640_480); - - hboxLayout1 = new QHBoxLayout(); - hboxLayout1->setSpacing(6); - hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); - size_custom = new QRadioButton(ButtonGroup1); - size_custom->setObjectName(QString::fromUtf8("size_custom")); - - hboxLayout1->addWidget(size_custom); - - size_width = new QSpinBox(ButtonGroup1); - size_width->setObjectName(QString::fromUtf8("size_width")); - size_width->setMaximum(1280); - size_width->setMinimum(1); - size_width->setSingleStep(16); - size_width->setValue(400); - - hboxLayout1->addWidget(size_width); - - size_height = new QSpinBox(ButtonGroup1); - size_height->setObjectName(QString::fromUtf8("size_height")); - size_height->setMaximum(1024); - size_height->setMinimum(1); - size_height->setSingleStep(16); - size_height->setValue(300); - - hboxLayout1->addWidget(size_height); - - - vboxLayout->addLayout(hboxLayout1); - - hboxLayout2 = new QHBoxLayout(); - hboxLayout2->setSpacing(6); - hboxLayout2->setContentsMargins(0, 0, 0, 0); - hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); - size_skin = new QRadioButton(ButtonGroup1); - size_skin->setObjectName(QString::fromUtf8("size_skin")); - QSizePolicy sizePolicy1(static_cast(0), static_cast(0)); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(size_skin->sizePolicy().hasHeightForWidth()); - size_skin->setSizePolicy(sizePolicy1); - - hboxLayout2->addWidget(size_skin); - - skin = new QComboBox(ButtonGroup1); - skin->setObjectName(QString::fromUtf8("skin")); - QSizePolicy sizePolicy2(static_cast(5), static_cast(0)); - sizePolicy2.setHorizontalStretch(0); - sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(skin->sizePolicy().hasHeightForWidth()); - skin->setSizePolicy(sizePolicy2); - - hboxLayout2->addWidget(skin); - - - vboxLayout->addLayout(hboxLayout2); - - - gridLayout->addWidget(ButtonGroup1, 0, 0, 1, 1); - - TextLabel1 = new QLabel(Config); - TextLabel1->setObjectName(QString::fromUtf8("TextLabel1")); - TextLabel1->setWordWrap(false); - - gridLayout->addWidget(TextLabel1, 1, 0, 1, 2); - - test_for_useless_buttongroupId = new QRadioButton(Config); - test_for_useless_buttongroupId->setObjectName(QString::fromUtf8("test_for_useless_buttongroupId")); - - gridLayout->addWidget(test_for_useless_buttongroupId, 0, 0, 1, 1); - - - retranslateUi(Config); - QObject::connect(buttonOk, SIGNAL(clicked()), Config, SLOT(accept())); - QObject::connect(buttonCancel, SIGNAL(clicked()), Config, SLOT(reject())); - - QMetaObject::connectSlotsByName(Config); - } // setupUi - - void retranslateUi(QDialog *Config) - { - Config->setWindowTitle(QApplication::translate("Config", "Configure", 0, QApplication::UnicodeUTF8)); - ButtonGroup2->setTitle(QApplication::translate("Config", "Depth", 0, QApplication::UnicodeUTF8)); - depth_1->setText(QApplication::translate("Config", "1 bit monochrome", 0, QApplication::UnicodeUTF8)); - depth_4gray->setText(QApplication::translate("Config", "4 bit grayscale", 0, QApplication::UnicodeUTF8)); - depth_8->setText(QApplication::translate("Config", "8 bit", 0, QApplication::UnicodeUTF8)); - depth_12->setText(QApplication::translate("Config", "12 (16) bit", 0, QApplication::UnicodeUTF8)); - depth_16->setText(QApplication::translate("Config", "16 bit", 0, QApplication::UnicodeUTF8)); - depth_32->setText(QApplication::translate("Config", "32 bit", 0, QApplication::UnicodeUTF8)); - buttonOk->setText(QApplication::translate("Config", "&OK", 0, QApplication::UnicodeUTF8)); - buttonCancel->setText(QApplication::translate("Config", "&Cancel", 0, QApplication::UnicodeUTF8)); - touchScreen->setText(QApplication::translate("Config", "Emulate touch screen (no mouse move).", 0, QApplication::UnicodeUTF8)); - GroupBox1->setTitle(QApplication::translate("Config", "Gamma", 0, QApplication::UnicodeUTF8)); - TextLabel3->setText(QApplication::translate("Config", "Blue", 0, QApplication::UnicodeUTF8)); - blabel->setText(QApplication::translate("Config", "1.0", 0, QApplication::UnicodeUTF8)); - TextLabel2->setText(QApplication::translate("Config", "Green", 0, QApplication::UnicodeUTF8)); - glabel->setText(QApplication::translate("Config", "1.0", 0, QApplication::UnicodeUTF8)); - TextLabel7->setText(QApplication::translate("Config", "All", 0, QApplication::UnicodeUTF8)); - TextLabel8->setText(QApplication::translate("Config", "1.0", 0, QApplication::UnicodeUTF8)); - TextLabel1_2->setText(QApplication::translate("Config", "Red", 0, QApplication::UnicodeUTF8)); - rlabel->setText(QApplication::translate("Config", "1.0", 0, QApplication::UnicodeUTF8)); - PushButton3->setText(QApplication::translate("Config", "Set all to 1.0", 0, QApplication::UnicodeUTF8)); - ButtonGroup1->setTitle(QApplication::translate("Config", "Size", 0, QApplication::UnicodeUTF8)); - size_240_320->setText(QApplication::translate("Config", "240x320 \"PDA\"", 0, QApplication::UnicodeUTF8)); - size_320_240->setText(QApplication::translate("Config", "320x240 \"TV\"", 0, QApplication::UnicodeUTF8)); - size_640_480->setText(QApplication::translate("Config", "640x480 \"VGA\"", 0, QApplication::UnicodeUTF8)); - size_custom->setText(QApplication::translate("Config", "Custom", 0, QApplication::UnicodeUTF8)); - size_skin->setText(QApplication::translate("Config", "Skin", 0, QApplication::UnicodeUTF8)); - skin->clear(); - skin->insertItems(0, QStringList() - << QApplication::translate("Config", "pda.skin", 0, QApplication::UnicodeUTF8) - << QApplication::translate("Config", "ipaq.skin", 0, QApplication::UnicodeUTF8) - << QApplication::translate("Config", "qpe.skin", 0, QApplication::UnicodeUTF8) - << QApplication::translate("Config", "cassiopeia.skin", 0, QApplication::UnicodeUTF8) - << QApplication::translate("Config", "other.skin", 0, QApplication::UnicodeUTF8) - ); - TextLabel1->setText(QApplication::translate("Config", "

Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth above. You may freely modify the Gamma below.", 0, QApplication::UnicodeUTF8)); - test_for_useless_buttongroupId->setText(QApplication::translate("Config", "Test", 0, QApplication::UnicodeUTF8)); - } // retranslateUi - - -protected: - enum IconID - { - image0_ID, - unknown_ID - }; - static QPixmap qt_get_icon(IconID id) - { - /* XPM */ - static const char* const image0_data[] = { -"22 22 2 1", -". c None", -"# c #a4c610", -"........######........", -".....###########......", -"....##############....", -"...################...", -"..######......######..", -"..#####........#####..", -".#####.......#..#####.", -".####.......###..####.", -"####.......#####..####", -"####......#####...####", -"####....#######...####", -"####....######....####", -"####...########...####", -".####.##########..####", -".####..####.#########.", -".#####..##...########.", -"..#####.......#######.", -"..######......######..", -"...###################", -"....##################", -"......###########.###.", -"........######.....#.."}; - - - switch (id) { - case image0_ID: return QPixmap((const char**)image0_data); - default: return QPixmap(); - } // switch - } // icon - -}; - -namespace Ui { - class Config: public Ui_Config {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // CONFIG_FROMUIC3_H diff --git a/tests/auto/uic/baseline/mainwindowbase.ui b/tests/auto/uic/baseline/mainwindowbase.ui deleted file mode 100644 index 3bdfecc62c..0000000000 --- a/tests/auto/uic/baseline/mainwindowbase.ui +++ /dev/null @@ -1,1214 +0,0 @@ - - - ********************************************************************* -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the autotests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* - - MainWindowBase - - - - 0 - 0 - 724 - 615 - - - - Qt Configuration - - - - - 0 - 28 - 724 - 587 - - - - - 8 - - - 4 - - - - - - 200 - 0 - - - - true - - - - - - - - Appearance - - - - 4 - - - 4 - - - - - GUI Style - - - - 8 - - - 4 - - - - - Select GUI &Style: - - - gstylecombo - - - - - - - - - - - - - - 5 - 4 - 0 - 0 - - - - Build Palette - - - - 8 - - - 4 - - - - - &3-D Effects: - - - buttonMainColor - - - - - - - - - - - 1 - 1 - 0 - 0 - - - - - 50 - 0 - - - - 1 - - - 0 - - - Window Back&ground: - - - Qt::AlignVCenter - - - 0 - - - buttonMainColor2 - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 70 - 20 - - - - - - - - &Tune Palette... - - - - - - - - - - - 5 - 7 - 0 - 0 - - - - Preview - - - - 8 - - - 4 - - - - - Select &Palette: - - - paletteCombo - - - - - - - - Active Palette - - - - - Inactive Palette - - - - - Disabled Palette - - - - - - - - - 7 - 7 - 0 - 0 - - - - - 410 - 260 - - - - - - - - - - - - Fonts - - - - 8 - - - 4 - - - - - Default Font - - - - 8 - - - 4 - - - - - true - - - false - - - - - - - true - - - false - - - - - - - true - - - true - - - false - - - - - - - &Style: - - - stylecombo - - - - - - - &Point Size: - - - psizecombo - - - - - - - F&amily: - - - familycombo - - - - - - - Sample Text - - - Qt::AlignHCenter - - - - - - - - - - Font Substitution - - - - 8 - - - 4 - - - - - 0 - - - 4 - - - - - S&elect or Enter a Family: - - - familysubcombo - - - - - - - true - - - true - - - false - - - - - - - - - QFrame::HLine - - - QFrame::Sunken - - - Qt::Horizontal - - - - - - - Current Substitutions: - - - - - - - - - - 0 - - - 4 - - - - - Up - - - - - - - Down - - - - - - - Remove - - - - - - - - - QFrame::HLine - - - QFrame::Sunken - - - Qt::Horizontal - - - - - - - 0 - - - 4 - - - - - Select s&ubstitute Family: - - - choosesubcombo - - - - - - - true - - - false - - - - - - - Add - - - - - - - - - - - - - Interface - - - - 7 - - - 4 - - - - - Feel Settings - - - - 8 - - - 4 - - - - - ms - - - 10000 - - - 10 - - - - - - - &Double Click Interval: - - - dcispin - - - - - - - No blinking - - - ms - - - 10000 - - - 9 - - - - - - - &Cursor Flash Time: - - - cfispin - - - - - - - lines - - - 20 - - - 1 - - - - - - - Wheel &Scroll Lines: - - - wslspin - - - - - - - Resolve symlinks in URLs - - - - - - - - - - GUI Effects - - - - 8 - - - 4 - - - - - &Enable - - - Alt+E - - - - - - - QFrame::NoFrame - - - QFrame::Plain - - - - 0 - - - 4 - - - - - &Menu Effect: - - - menueffect - - - - - - - C&omboBox Effect: - - - comboeffect - - - - - - - &ToolTip Effect: - - - tooltipeffect - - - - - - - Tool&Box Effect: - - - toolboxeffect - - - - - - - 0 - - - true - - - - Disable - - - - - Animate - - - - - Fade - - - - - - - - - Disable - - - - - Animate - - - - - - - - - Disable - - - - - Animate - - - - - Fade - - - - - - - - - Disable - - - - - Animate - - - - - - - - - - - - - - Global Strut - - - - 8 - - - 4 - - - - - Minimum &Width: - - - strutwidth - - - - - - - Minimum Hei&ght: - - - strutheight - - - - - - - pixels - - - 1000 - - - - - - - pixels - - - 1000 - - - - - - - - - - Enhanced support for languages written right-to-left - - - - - - - XIM Input Style: - - - - - - - 0 - - - - On The Spot - - - - - Over The Spot - - - - - Off The Spot - - - - - Root - - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 40 - - - - - - - - - Printer - - - - 8 - - - 4 - - - - - Enable Font embedding - - - true - - - - - - - - 5 - 7 - 0 - 0 - - - - Font Paths - - - - 8 - - - 4 - - - - - 0 - - - 4 - - - - - Up - - - - - - - Remove - - - - - - - Down - - - - - - - - - - - - 0 - - - 4 - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 20 - 20 - - - - - - - - Add - - - - - - - Browse... - - - - - - - Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. - - - - - - - - - - - - - - - - - - - - - 0 - 0 - 724 - 27 - - - - - - 0 - 0 - 800 - 480 - - - - &File - - - - - - - - - - - - 0 - 0 - 800 - 480 - - - - &Help - - - - - - - - - - - - - - &Save - - - Save - - - Ctrl+S - - - - - E&xit - - - Exit - - - - - - - - &About - - - About - - - - - - - - About &Qt - - - About Qt - - - - - - - Q3ListBox - -

q3listbox.h
- 0 - - - - ColorButton - -
colorbutton.h
- 0 - -
- - Q3Frame - -
Qt3Support/Q3Frame
- 1 - -
- - PreviewFrame - -
previewframe.h
- 0 - -
- - Q3MainWindow - -
q3mainwindow.h
- 1 - -
- - - helpview - TabWidget3 - familycombo - stylecombo - psizecombo - samplelineedit - familysubcombo - PushButton2 - PushButton3 - PushButton4 - choosesubcombo - PushButton1 - dcispin - cfispin - wslspin - effectcheckbox - menueffect - comboeffect - tooltipeffect - strutwidth - strutheight - sublistbox - - - - diff --git a/tests/auto/uic/baseline/mainwindowbase.ui.h b/tests/auto/uic/baseline/mainwindowbase.ui.h deleted file mode 100644 index abf8ff81d1..0000000000 --- a/tests/auto/uic/baseline/mainwindowbase.ui.h +++ /dev/null @@ -1,968 +0,0 @@ -/* -********************************************************************* -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the autotests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* -*/ - -/******************************************************************************** -** Form generated from reading UI file 'mainwindowbase.ui' -** -** Created: Fri Sep 4 10:17:14 2009 -** by: Qt User Interface Compiler version 4.6.0 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef MAINWINDOWBASE_H -#define MAINWINDOWBASE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "colorbutton.h" -#include "previewframe.h" - -QT_BEGIN_NAMESPACE - -class Ui_MainWindowBase -{ -public: - QAction *fileSaveAction; - QAction *fileExitAction; - QAction *helpAboutAction; - QAction *helpAboutQtAction; - QWidget *widget; - QHBoxLayout *hboxLayout; - QTextEdit *helpview; - QTabWidget *TabWidget3; - QWidget *tab1; - QVBoxLayout *vboxLayout; - QGroupBox *GroupBox40; - QHBoxLayout *hboxLayout1; - QLabel *gstylebuddy; - QComboBox *gstylecombo; - QGroupBox *groupAutoPalette; - QHBoxLayout *hboxLayout2; - QLabel *labelMainColor; - ColorButton *buttonMainColor; - QLabel *labelMainColor2; - ColorButton *buttonMainColor2; - QSpacerItem *spacerItem; - QPushButton *btnAdvanced; - QGroupBox *GroupBox126; - QGridLayout *gridLayout; - QLabel *TextLabel1; - QComboBox *paletteCombo; - PreviewFrame *previewFrame; - QWidget *tab2; - QVBoxLayout *vboxLayout1; - QGroupBox *GroupBox1; - QGridLayout *gridLayout1; - QComboBox *stylecombo; - QComboBox *familycombo; - QComboBox *psizecombo; - QLabel *stylebuddy; - QLabel *psizebuddy; - QLabel *familybuddy; - QLineEdit *samplelineedit; - QGroupBox *GroupBox2; - QVBoxLayout *vboxLayout2; - QHBoxLayout *hboxLayout3; - QLabel *famsubbuddy; - QComboBox *familysubcombo; - QFrame *Line1; - QLabel *TextLabel5; - Q3ListBox *sublistbox; - QHBoxLayout *hboxLayout4; - QPushButton *PushButton2; - QPushButton *PushButton3; - QPushButton *PushButton4; - QFrame *Line2; - QHBoxLayout *hboxLayout5; - QLabel *choosebuddy; - QComboBox *choosesubcombo; - QPushButton *PushButton1; - QWidget *tab; - QVBoxLayout *vboxLayout3; - QGroupBox *GroupBox4; - QGridLayout *gridLayout2; - QSpinBox *dcispin; - QLabel *dcibuddy; - QSpinBox *cfispin; - QLabel *cfibuddy; - QSpinBox *wslspin; - QLabel *wslbuddy; - QCheckBox *resolvelinks; - QGroupBox *GroupBox3; - QVBoxLayout *vboxLayout4; - QCheckBox *effectcheckbox; - Q3Frame *effectbase; - QGridLayout *gridLayout3; - QLabel *meffectbuddy; - QLabel *ceffectbuddy; - QLabel *teffectbuddy; - QLabel *beffectbuddy; - QComboBox *menueffect; - QComboBox *comboeffect; - QComboBox *tooltipeffect; - QComboBox *toolboxeffect; - QGroupBox *GroupBox5; - QGridLayout *gridLayout4; - QLabel *swbuddy; - QLabel *shbuddy; - QSpinBox *strutwidth; - QSpinBox *strutheight; - QCheckBox *rtlExtensions; - QLabel *inputStyleLabel; - QComboBox *inputStyle; - QSpacerItem *spacerItem1; - QWidget *tab3; - QVBoxLayout *vboxLayout5; - QCheckBox *fontembeddingcheckbox; - QGroupBox *GroupBox10; - QVBoxLayout *vboxLayout6; - QGridLayout *gridLayout5; - QPushButton *PushButton11; - QPushButton *PushButton13; - QPushButton *PushButton12; - Q3ListBox *fontpathlistbox; - QGridLayout *gridLayout6; - QSpacerItem *spacerItem2; - QPushButton *PushButton15; - QPushButton *PushButton14; - QLabel *TextLabel15_2; - QLineEdit *fontpathlineedit; - QMenuBar *menubar; - QAction *action; - QAction *action1; - QAction *action2; - QMenu *PopupMenu; - QAction *action3; - QAction *action4; - QAction *action5; - QMenu *PopupMenu_2; - - void setupUi(Q3MainWindow *MainWindowBase) - { - if (MainWindowBase->objectName().isEmpty()) - MainWindowBase->setObjectName(QString::fromUtf8("MainWindowBase")); - MainWindowBase->resize(724, 615); - fileSaveAction = new QAction(MainWindowBase); - fileSaveAction->setObjectName(QString::fromUtf8("fileSaveAction")); - fileExitAction = new QAction(MainWindowBase); - fileExitAction->setObjectName(QString::fromUtf8("fileExitAction")); - helpAboutAction = new QAction(MainWindowBase); - helpAboutAction->setObjectName(QString::fromUtf8("helpAboutAction")); - helpAboutQtAction = new QAction(MainWindowBase); - helpAboutQtAction->setObjectName(QString::fromUtf8("helpAboutQtAction")); - widget = new QWidget(MainWindowBase); - widget->setObjectName(QString::fromUtf8("widget")); - widget->setGeometry(QRect(0, 28, 724, 587)); - hboxLayout = new QHBoxLayout(widget); - hboxLayout->setSpacing(4); - hboxLayout->setContentsMargins(8, 8, 8, 8); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - helpview = new QTextEdit(widget); - helpview->setObjectName(QString::fromUtf8("helpview")); - helpview->setMinimumSize(QSize(200, 0)); - helpview->setReadOnly(true); - - hboxLayout->addWidget(helpview); - - TabWidget3 = new QTabWidget(widget); - TabWidget3->setObjectName(QString::fromUtf8("TabWidget3")); - tab1 = new QWidget(); - tab1->setObjectName(QString::fromUtf8("tab1")); - vboxLayout = new QVBoxLayout(tab1); - vboxLayout->setSpacing(4); - vboxLayout->setContentsMargins(4, 4, 4, 4); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); - GroupBox40 = new QGroupBox(tab1); - GroupBox40->setObjectName(QString::fromUtf8("GroupBox40")); - hboxLayout1 = new QHBoxLayout(GroupBox40); - hboxLayout1->setSpacing(4); - hboxLayout1->setContentsMargins(8, 8, 8, 8); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); - gstylebuddy = new QLabel(GroupBox40); - gstylebuddy->setObjectName(QString::fromUtf8("gstylebuddy")); - - hboxLayout1->addWidget(gstylebuddy); - - gstylecombo = new QComboBox(GroupBox40); - gstylecombo->setObjectName(QString::fromUtf8("gstylecombo")); - - hboxLayout1->addWidget(gstylecombo); - - - vboxLayout->addWidget(GroupBox40); - - groupAutoPalette = new QGroupBox(tab1); - groupAutoPalette->setObjectName(QString::fromUtf8("groupAutoPalette")); - QSizePolicy sizePolicy(static_cast(5), static_cast(4)); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(groupAutoPalette->sizePolicy().hasHeightForWidth()); - groupAutoPalette->setSizePolicy(sizePolicy); - hboxLayout2 = new QHBoxLayout(groupAutoPalette); - hboxLayout2->setSpacing(4); - hboxLayout2->setContentsMargins(8, 8, 8, 8); - hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); - labelMainColor = new QLabel(groupAutoPalette); - labelMainColor->setObjectName(QString::fromUtf8("labelMainColor")); - - hboxLayout2->addWidget(labelMainColor); - - buttonMainColor = new ColorButton(groupAutoPalette); - buttonMainColor->setObjectName(QString::fromUtf8("buttonMainColor")); - - hboxLayout2->addWidget(buttonMainColor); - - labelMainColor2 = new QLabel(groupAutoPalette); - labelMainColor2->setObjectName(QString::fromUtf8("labelMainColor2")); - QSizePolicy sizePolicy1(static_cast(1), static_cast(1)); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(labelMainColor2->sizePolicy().hasHeightForWidth()); - labelMainColor2->setSizePolicy(sizePolicy1); - labelMainColor2->setMinimumSize(QSize(50, 0)); - labelMainColor2->setLineWidth(1); - labelMainColor2->setMidLineWidth(0); - labelMainColor2->setAlignment(Qt::AlignVCenter); - labelMainColor2->setMargin(0); - - hboxLayout2->addWidget(labelMainColor2); - - buttonMainColor2 = new ColorButton(groupAutoPalette); - buttonMainColor2->setObjectName(QString::fromUtf8("buttonMainColor2")); - - hboxLayout2->addWidget(buttonMainColor2); - - spacerItem = new QSpacerItem(70, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout2->addItem(spacerItem); - - btnAdvanced = new QPushButton(groupAutoPalette); - btnAdvanced->setObjectName(QString::fromUtf8("btnAdvanced")); - - hboxLayout2->addWidget(btnAdvanced); - - - vboxLayout->addWidget(groupAutoPalette); - - GroupBox126 = new QGroupBox(tab1); - GroupBox126->setObjectName(QString::fromUtf8("GroupBox126")); - QSizePolicy sizePolicy2(static_cast(5), static_cast(7)); - sizePolicy2.setHorizontalStretch(0); - sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(GroupBox126->sizePolicy().hasHeightForWidth()); - GroupBox126->setSizePolicy(sizePolicy2); - gridLayout = new QGridLayout(GroupBox126); - gridLayout->setSpacing(4); - gridLayout->setContentsMargins(8, 8, 8, 8); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); - TextLabel1 = new QLabel(GroupBox126); - TextLabel1->setObjectName(QString::fromUtf8("TextLabel1")); - - gridLayout->addWidget(TextLabel1, 0, 0, 1, 1); - - paletteCombo = new QComboBox(GroupBox126); - paletteCombo->setObjectName(QString::fromUtf8("paletteCombo")); - - gridLayout->addWidget(paletteCombo, 0, 1, 1, 1); - - previewFrame = new PreviewFrame(GroupBox126); - previewFrame->setObjectName(QString::fromUtf8("previewFrame")); - QSizePolicy sizePolicy3(static_cast(7), static_cast(7)); - sizePolicy3.setHorizontalStretch(0); - sizePolicy3.setVerticalStretch(0); - sizePolicy3.setHeightForWidth(previewFrame->sizePolicy().hasHeightForWidth()); - previewFrame->setSizePolicy(sizePolicy3); - previewFrame->setMinimumSize(QSize(410, 260)); - - gridLayout->addWidget(previewFrame, 1, 0, 1, 2); - - - vboxLayout->addWidget(GroupBox126); - - TabWidget3->addTab(tab1, QString()); - tab2 = new QWidget(); - tab2->setObjectName(QString::fromUtf8("tab2")); - vboxLayout1 = new QVBoxLayout(tab2); - vboxLayout1->setSpacing(4); - vboxLayout1->setContentsMargins(8, 8, 8, 8); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); - GroupBox1 = new QGroupBox(tab2); - GroupBox1->setObjectName(QString::fromUtf8("GroupBox1")); - gridLayout1 = new QGridLayout(GroupBox1); - gridLayout1->setSpacing(4); - gridLayout1->setContentsMargins(8, 8, 8, 8); - gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); - stylecombo = new QComboBox(GroupBox1); - stylecombo->setObjectName(QString::fromUtf8("stylecombo")); - stylecombo->setAutoCompletion(true); - stylecombo->setDuplicatesEnabled(false); - - gridLayout1->addWidget(stylecombo, 1, 1, 1, 1); - - familycombo = new QComboBox(GroupBox1); - familycombo->setObjectName(QString::fromUtf8("familycombo")); - familycombo->setAutoCompletion(true); - familycombo->setDuplicatesEnabled(false); - - gridLayout1->addWidget(familycombo, 0, 1, 1, 1); - - psizecombo = new QComboBox(GroupBox1); - psizecombo->setObjectName(QString::fromUtf8("psizecombo")); - psizecombo->setEditable(true); - psizecombo->setAutoCompletion(true); - psizecombo->setDuplicatesEnabled(false); - - gridLayout1->addWidget(psizecombo, 2, 1, 1, 1); - - stylebuddy = new QLabel(GroupBox1); - stylebuddy->setObjectName(QString::fromUtf8("stylebuddy")); - - gridLayout1->addWidget(stylebuddy, 1, 0, 1, 1); - - psizebuddy = new QLabel(GroupBox1); - psizebuddy->setObjectName(QString::fromUtf8("psizebuddy")); - - gridLayout1->addWidget(psizebuddy, 2, 0, 1, 1); - - familybuddy = new QLabel(GroupBox1); - familybuddy->setObjectName(QString::fromUtf8("familybuddy")); - - gridLayout1->addWidget(familybuddy, 0, 0, 1, 1); - - samplelineedit = new QLineEdit(GroupBox1); - samplelineedit->setObjectName(QString::fromUtf8("samplelineedit")); - samplelineedit->setAlignment(Qt::AlignHCenter); - - gridLayout1->addWidget(samplelineedit, 3, 0, 1, 2); - - - vboxLayout1->addWidget(GroupBox1); - - GroupBox2 = new QGroupBox(tab2); - GroupBox2->setObjectName(QString::fromUtf8("GroupBox2")); - vboxLayout2 = new QVBoxLayout(GroupBox2); - vboxLayout2->setSpacing(4); - vboxLayout2->setContentsMargins(8, 8, 8, 8); - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); - hboxLayout3 = new QHBoxLayout(); - hboxLayout3->setSpacing(4); -#ifndef Q_OS_MAC - hboxLayout3->setContentsMargins(0, 0, 0, 0); -#endif - hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3")); - famsubbuddy = new QLabel(GroupBox2); - famsubbuddy->setObjectName(QString::fromUtf8("famsubbuddy")); - - hboxLayout3->addWidget(famsubbuddy); - - familysubcombo = new QComboBox(GroupBox2); - familysubcombo->setObjectName(QString::fromUtf8("familysubcombo")); - familysubcombo->setEditable(true); - familysubcombo->setAutoCompletion(true); - familysubcombo->setDuplicatesEnabled(false); - - hboxLayout3->addWidget(familysubcombo); - - - vboxLayout2->addLayout(hboxLayout3); - - Line1 = new QFrame(GroupBox2); - Line1->setObjectName(QString::fromUtf8("Line1")); - Line1->setFrameShape(QFrame::HLine); - Line1->setFrameShadow(QFrame::Sunken); - Line1->setFrameShape(QFrame::HLine); - - vboxLayout2->addWidget(Line1); - - TextLabel5 = new QLabel(GroupBox2); - TextLabel5->setObjectName(QString::fromUtf8("TextLabel5")); - - vboxLayout2->addWidget(TextLabel5); - - sublistbox = new Q3ListBox(GroupBox2); - sublistbox->setObjectName(QString::fromUtf8("sublistbox")); - - vboxLayout2->addWidget(sublistbox); - - hboxLayout4 = new QHBoxLayout(); - hboxLayout4->setSpacing(4); - hboxLayout4->setContentsMargins(0, 0, 0, 0); - hboxLayout4->setObjectName(QString::fromUtf8("hboxLayout4")); - PushButton2 = new QPushButton(GroupBox2); - PushButton2->setObjectName(QString::fromUtf8("PushButton2")); - - hboxLayout4->addWidget(PushButton2); - - PushButton3 = new QPushButton(GroupBox2); - PushButton3->setObjectName(QString::fromUtf8("PushButton3")); - - hboxLayout4->addWidget(PushButton3); - - PushButton4 = new QPushButton(GroupBox2); - PushButton4->setObjectName(QString::fromUtf8("PushButton4")); - - hboxLayout4->addWidget(PushButton4); - - - vboxLayout2->addLayout(hboxLayout4); - - Line2 = new QFrame(GroupBox2); - Line2->setObjectName(QString::fromUtf8("Line2")); - Line2->setFrameShape(QFrame::HLine); - Line2->setFrameShadow(QFrame::Sunken); - Line2->setFrameShape(QFrame::HLine); - - vboxLayout2->addWidget(Line2); - - hboxLayout5 = new QHBoxLayout(); - hboxLayout5->setSpacing(4); - hboxLayout5->setContentsMargins(0, 0, 0, 0); - hboxLayout5->setObjectName(QString::fromUtf8("hboxLayout5")); - choosebuddy = new QLabel(GroupBox2); - choosebuddy->setObjectName(QString::fromUtf8("choosebuddy")); - - hboxLayout5->addWidget(choosebuddy); - - choosesubcombo = new QComboBox(GroupBox2); - choosesubcombo->setObjectName(QString::fromUtf8("choosesubcombo")); - choosesubcombo->setAutoCompletion(true); - choosesubcombo->setDuplicatesEnabled(false); - - hboxLayout5->addWidget(choosesubcombo); - - PushButton1 = new QPushButton(GroupBox2); - PushButton1->setObjectName(QString::fromUtf8("PushButton1")); - - hboxLayout5->addWidget(PushButton1); - - - vboxLayout2->addLayout(hboxLayout5); - - - vboxLayout1->addWidget(GroupBox2); - - TabWidget3->addTab(tab2, QString()); - tab = new QWidget(); - tab->setObjectName(QString::fromUtf8("tab")); - vboxLayout3 = new QVBoxLayout(tab); - vboxLayout3->setSpacing(4); - vboxLayout3->setContentsMargins(7, 7, 7, 7); - vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3")); - GroupBox4 = new QGroupBox(tab); - GroupBox4->setObjectName(QString::fromUtf8("GroupBox4")); - gridLayout2 = new QGridLayout(GroupBox4); - gridLayout2->setSpacing(4); - gridLayout2->setContentsMargins(8, 8, 8, 8); - gridLayout2->setObjectName(QString::fromUtf8("gridLayout2")); - dcispin = new QSpinBox(GroupBox4); - dcispin->setObjectName(QString::fromUtf8("dcispin")); - dcispin->setMaximum(10000); - dcispin->setMinimum(10); - - gridLayout2->addWidget(dcispin, 0, 1, 1, 1); - - dcibuddy = new QLabel(GroupBox4); - dcibuddy->setObjectName(QString::fromUtf8("dcibuddy")); - - gridLayout2->addWidget(dcibuddy, 0, 0, 1, 1); - - cfispin = new QSpinBox(GroupBox4); - cfispin->setObjectName(QString::fromUtf8("cfispin")); - cfispin->setMaximum(10000); - cfispin->setMinimum(9); - - gridLayout2->addWidget(cfispin, 1, 1, 1, 1); - - cfibuddy = new QLabel(GroupBox4); - cfibuddy->setObjectName(QString::fromUtf8("cfibuddy")); - - gridLayout2->addWidget(cfibuddy, 1, 0, 1, 1); - - wslspin = new QSpinBox(GroupBox4); - wslspin->setObjectName(QString::fromUtf8("wslspin")); - wslspin->setMaximum(20); - wslspin->setMinimum(1); - - gridLayout2->addWidget(wslspin, 2, 1, 1, 1); - - wslbuddy = new QLabel(GroupBox4); - wslbuddy->setObjectName(QString::fromUtf8("wslbuddy")); - - gridLayout2->addWidget(wslbuddy, 2, 0, 1, 1); - - resolvelinks = new QCheckBox(GroupBox4); - resolvelinks->setObjectName(QString::fromUtf8("resolvelinks")); - - gridLayout2->addWidget(resolvelinks, 3, 0, 1, 2); - - - vboxLayout3->addWidget(GroupBox4); - - GroupBox3 = new QGroupBox(tab); - GroupBox3->setObjectName(QString::fromUtf8("GroupBox3")); - vboxLayout4 = new QVBoxLayout(GroupBox3); - vboxLayout4->setSpacing(4); - vboxLayout4->setContentsMargins(8, 8, 8, 8); - vboxLayout4->setObjectName(QString::fromUtf8("vboxLayout4")); - effectcheckbox = new QCheckBox(GroupBox3); - effectcheckbox->setObjectName(QString::fromUtf8("effectcheckbox")); - - vboxLayout4->addWidget(effectcheckbox); - - effectbase = new Q3Frame(GroupBox3); - effectbase->setObjectName(QString::fromUtf8("effectbase")); - effectbase->setFrameShape(QFrame::NoFrame); - effectbase->setFrameShadow(QFrame::Plain); - gridLayout3 = new QGridLayout(effectbase); - gridLayout3->setSpacing(4); - gridLayout3->setContentsMargins(0, 0, 0, 0); - gridLayout3->setObjectName(QString::fromUtf8("gridLayout3")); - meffectbuddy = new QLabel(effectbase); - meffectbuddy->setObjectName(QString::fromUtf8("meffectbuddy")); - - gridLayout3->addWidget(meffectbuddy, 0, 0, 1, 1); - - ceffectbuddy = new QLabel(effectbase); - ceffectbuddy->setObjectName(QString::fromUtf8("ceffectbuddy")); - - gridLayout3->addWidget(ceffectbuddy, 1, 0, 1, 1); - - teffectbuddy = new QLabel(effectbase); - teffectbuddy->setObjectName(QString::fromUtf8("teffectbuddy")); - - gridLayout3->addWidget(teffectbuddy, 2, 0, 1, 1); - - beffectbuddy = new QLabel(effectbase); - beffectbuddy->setObjectName(QString::fromUtf8("beffectbuddy")); - - gridLayout3->addWidget(beffectbuddy, 3, 0, 1, 1); - - menueffect = new QComboBox(effectbase); - menueffect->setObjectName(QString::fromUtf8("menueffect")); - menueffect->setAutoCompletion(true); - - gridLayout3->addWidget(menueffect, 0, 1, 1, 1); - - comboeffect = new QComboBox(effectbase); - comboeffect->setObjectName(QString::fromUtf8("comboeffect")); - - gridLayout3->addWidget(comboeffect, 1, 1, 1, 1); - - tooltipeffect = new QComboBox(effectbase); - tooltipeffect->setObjectName(QString::fromUtf8("tooltipeffect")); - - gridLayout3->addWidget(tooltipeffect, 2, 1, 1, 1); - - toolboxeffect = new QComboBox(effectbase); - toolboxeffect->setObjectName(QString::fromUtf8("toolboxeffect")); - - gridLayout3->addWidget(toolboxeffect, 3, 1, 1, 1); - - - vboxLayout4->addWidget(effectbase); - - - vboxLayout3->addWidget(GroupBox3); - - GroupBox5 = new QGroupBox(tab); - GroupBox5->setObjectName(QString::fromUtf8("GroupBox5")); - gridLayout4 = new QGridLayout(GroupBox5); - gridLayout4->setSpacing(4); - gridLayout4->setContentsMargins(8, 8, 8, 8); - gridLayout4->setObjectName(QString::fromUtf8("gridLayout4")); - swbuddy = new QLabel(GroupBox5); - swbuddy->setObjectName(QString::fromUtf8("swbuddy")); - - gridLayout4->addWidget(swbuddy, 0, 0, 1, 1); - - shbuddy = new QLabel(GroupBox5); - shbuddy->setObjectName(QString::fromUtf8("shbuddy")); - - gridLayout4->addWidget(shbuddy, 1, 0, 1, 1); - - strutwidth = new QSpinBox(GroupBox5); - strutwidth->setObjectName(QString::fromUtf8("strutwidth")); - strutwidth->setMaximum(1000); - - gridLayout4->addWidget(strutwidth, 0, 1, 1, 1); - - strutheight = new QSpinBox(GroupBox5); - strutheight->setObjectName(QString::fromUtf8("strutheight")); - strutheight->setMaximum(1000); - - gridLayout4->addWidget(strutheight, 1, 1, 1, 1); - - - vboxLayout3->addWidget(GroupBox5); - - rtlExtensions = new QCheckBox(tab); - rtlExtensions->setObjectName(QString::fromUtf8("rtlExtensions")); - - vboxLayout3->addWidget(rtlExtensions); - - inputStyleLabel = new QLabel(tab); - inputStyleLabel->setObjectName(QString::fromUtf8("inputStyleLabel")); - - vboxLayout3->addWidget(inputStyleLabel); - - inputStyle = new QComboBox(tab); - inputStyle->setObjectName(QString::fromUtf8("inputStyle")); - - vboxLayout3->addWidget(inputStyle); - - spacerItem1 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - - vboxLayout3->addItem(spacerItem1); - - TabWidget3->addTab(tab, QString()); - tab3 = new QWidget(); - tab3->setObjectName(QString::fromUtf8("tab3")); - vboxLayout5 = new QVBoxLayout(tab3); - vboxLayout5->setSpacing(4); - vboxLayout5->setContentsMargins(8, 8, 8, 8); - vboxLayout5->setObjectName(QString::fromUtf8("vboxLayout5")); - fontembeddingcheckbox = new QCheckBox(tab3); - fontembeddingcheckbox->setObjectName(QString::fromUtf8("fontembeddingcheckbox")); - fontembeddingcheckbox->setChecked(true); - - vboxLayout5->addWidget(fontembeddingcheckbox); - - GroupBox10 = new QGroupBox(tab3); - GroupBox10->setObjectName(QString::fromUtf8("GroupBox10")); - sizePolicy2.setHeightForWidth(GroupBox10->sizePolicy().hasHeightForWidth()); - GroupBox10->setSizePolicy(sizePolicy2); - vboxLayout6 = new QVBoxLayout(GroupBox10); - vboxLayout6->setSpacing(4); - vboxLayout6->setContentsMargins(8, 8, 8, 8); - vboxLayout6->setObjectName(QString::fromUtf8("vboxLayout6")); - gridLayout5 = new QGridLayout(); - gridLayout5->setSpacing(4); -#ifndef Q_OS_MAC - gridLayout5->setContentsMargins(0, 0, 0, 0); -#endif - gridLayout5->setObjectName(QString::fromUtf8("gridLayout5")); - PushButton11 = new QPushButton(GroupBox10); - PushButton11->setObjectName(QString::fromUtf8("PushButton11")); - - gridLayout5->addWidget(PushButton11, 1, 0, 1, 1); - - PushButton13 = new QPushButton(GroupBox10); - PushButton13->setObjectName(QString::fromUtf8("PushButton13")); - - gridLayout5->addWidget(PushButton13, 1, 2, 1, 1); - - PushButton12 = new QPushButton(GroupBox10); - PushButton12->setObjectName(QString::fromUtf8("PushButton12")); - - gridLayout5->addWidget(PushButton12, 1, 1, 1, 1); - - fontpathlistbox = new Q3ListBox(GroupBox10); - fontpathlistbox->setObjectName(QString::fromUtf8("fontpathlistbox")); - - gridLayout5->addWidget(fontpathlistbox, 0, 0, 1, 3); - - - vboxLayout6->addLayout(gridLayout5); - - gridLayout6 = new QGridLayout(); - gridLayout6->setSpacing(4); - gridLayout6->setContentsMargins(0, 0, 0, 0); - gridLayout6->setObjectName(QString::fromUtf8("gridLayout6")); - spacerItem2 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Minimum); - - gridLayout6->addItem(spacerItem2, 2, 0, 1, 1); - - PushButton15 = new QPushButton(GroupBox10); - PushButton15->setObjectName(QString::fromUtf8("PushButton15")); - - gridLayout6->addWidget(PushButton15, 2, 2, 1, 1); - - PushButton14 = new QPushButton(GroupBox10); - PushButton14->setObjectName(QString::fromUtf8("PushButton14")); - - gridLayout6->addWidget(PushButton14, 2, 1, 1, 1); - - TextLabel15_2 = new QLabel(GroupBox10); - TextLabel15_2->setObjectName(QString::fromUtf8("TextLabel15_2")); - - gridLayout6->addWidget(TextLabel15_2, 0, 0, 1, 3); - - fontpathlineedit = new QLineEdit(GroupBox10); - fontpathlineedit->setObjectName(QString::fromUtf8("fontpathlineedit")); - - gridLayout6->addWidget(fontpathlineedit, 1, 0, 1, 3); - - - vboxLayout6->addLayout(gridLayout6); - - - vboxLayout5->addWidget(GroupBox10); - - TabWidget3->addTab(tab3, QString()); - - hboxLayout->addWidget(TabWidget3); - - MainWindowBase->setCentralWidget(widget); - menubar = new QMenuBar(MainWindowBase); - menubar->setObjectName(QString::fromUtf8("menubar")); - menubar->setGeometry(QRect(0, 0, 724, 27)); - action = new QAction(menubar); - action->setObjectName(QString::fromUtf8("action")); - action1 = new QAction(menubar); - action1->setObjectName(QString::fromUtf8("action1")); - action2 = new QAction(menubar); - action2->setObjectName(QString::fromUtf8("action2")); - PopupMenu = new QMenu(menubar); - PopupMenu->setObjectName(QString::fromUtf8("PopupMenu")); - PopupMenu->setGeometry(QRect(0, 0, 800, 480)); - action3 = new QAction(PopupMenu); - action3->setObjectName(QString::fromUtf8("action3")); - action4 = new QAction(PopupMenu); - action4->setObjectName(QString::fromUtf8("action4")); - action5 = new QAction(PopupMenu); - action5->setObjectName(QString::fromUtf8("action5")); - PopupMenu_2 = new QMenu(menubar); - PopupMenu_2->setObjectName(QString::fromUtf8("PopupMenu_2")); - PopupMenu_2->setGeometry(QRect(0, 0, 800, 480)); -#ifndef QT_NO_SHORTCUT - gstylebuddy->setBuddy(gstylecombo); - labelMainColor->setBuddy(buttonMainColor); - labelMainColor2->setBuddy(buttonMainColor2); - TextLabel1->setBuddy(paletteCombo); - stylebuddy->setBuddy(stylecombo); - psizebuddy->setBuddy(psizecombo); - familybuddy->setBuddy(familycombo); - famsubbuddy->setBuddy(familysubcombo); - choosebuddy->setBuddy(choosesubcombo); - dcibuddy->setBuddy(dcispin); - cfibuddy->setBuddy(cfispin); - wslbuddy->setBuddy(wslspin); - meffectbuddy->setBuddy(menueffect); - ceffectbuddy->setBuddy(comboeffect); - teffectbuddy->setBuddy(tooltipeffect); - beffectbuddy->setBuddy(toolboxeffect); - swbuddy->setBuddy(strutwidth); - shbuddy->setBuddy(strutheight); -#endif // QT_NO_SHORTCUT - QWidget::setTabOrder(helpview, TabWidget3); - QWidget::setTabOrder(TabWidget3, familycombo); - QWidget::setTabOrder(familycombo, stylecombo); - QWidget::setTabOrder(stylecombo, psizecombo); - QWidget::setTabOrder(psizecombo, samplelineedit); - QWidget::setTabOrder(samplelineedit, familysubcombo); - QWidget::setTabOrder(familysubcombo, PushButton2); - QWidget::setTabOrder(PushButton2, PushButton3); - QWidget::setTabOrder(PushButton3, PushButton4); - QWidget::setTabOrder(PushButton4, choosesubcombo); - QWidget::setTabOrder(choosesubcombo, PushButton1); - QWidget::setTabOrder(PushButton1, dcispin); - QWidget::setTabOrder(dcispin, cfispin); - QWidget::setTabOrder(cfispin, wslspin); - QWidget::setTabOrder(wslspin, effectcheckbox); - QWidget::setTabOrder(effectcheckbox, menueffect); - QWidget::setTabOrder(menueffect, comboeffect); - QWidget::setTabOrder(comboeffect, tooltipeffect); - QWidget::setTabOrder(tooltipeffect, strutwidth); - QWidget::setTabOrder(strutwidth, strutheight); - QWidget::setTabOrder(strutheight, sublistbox); - - menubar->addAction(PopupMenu->menuAction()); - menubar->addSeparator(); - menubar->addAction(PopupMenu_2->menuAction()); - PopupMenu->addAction(fileSaveAction); - PopupMenu->addSeparator(); - PopupMenu->addAction(fileExitAction); - PopupMenu_2->addAction(helpAboutAction); - PopupMenu_2->addAction(helpAboutQtAction); - - retranslateUi(MainWindowBase); - - menueffect->setCurrentIndex(0); - inputStyle->setCurrentIndex(0); - - - QMetaObject::connectSlotsByName(MainWindowBase); - } // setupUi - - void retranslateUi(Q3MainWindow *MainWindowBase) - { - MainWindowBase->setWindowTitle(QApplication::translate("MainWindowBase", "Qt Configuration", 0, QApplication::UnicodeUTF8)); - fileSaveAction->setText(QApplication::translate("MainWindowBase", "&Save", 0, QApplication::UnicodeUTF8)); - fileSaveAction->setIconText(QApplication::translate("MainWindowBase", "Save", 0, QApplication::UnicodeUTF8)); - fileSaveAction->setShortcut(QApplication::translate("MainWindowBase", "Ctrl+S", 0, QApplication::UnicodeUTF8)); - fileExitAction->setText(QApplication::translate("MainWindowBase", "E&xit", 0, QApplication::UnicodeUTF8)); - fileExitAction->setIconText(QApplication::translate("MainWindowBase", "Exit", 0, QApplication::UnicodeUTF8)); - fileExitAction->setShortcut(QString()); - helpAboutAction->setText(QApplication::translate("MainWindowBase", "&About", 0, QApplication::UnicodeUTF8)); - helpAboutAction->setIconText(QApplication::translate("MainWindowBase", "About", 0, QApplication::UnicodeUTF8)); - helpAboutAction->setShortcut(QString()); - helpAboutQtAction->setText(QApplication::translate("MainWindowBase", "About &Qt", 0, QApplication::UnicodeUTF8)); - helpAboutQtAction->setIconText(QApplication::translate("MainWindowBase", "About Qt", 0, QApplication::UnicodeUTF8)); - GroupBox40->setTitle(QApplication::translate("MainWindowBase", "GUI Style", 0, QApplication::UnicodeUTF8)); - gstylebuddy->setText(QApplication::translate("MainWindowBase", "Select GUI &Style:", 0, QApplication::UnicodeUTF8)); - groupAutoPalette->setTitle(QApplication::translate("MainWindowBase", "Build Palette", 0, QApplication::UnicodeUTF8)); - labelMainColor->setText(QApplication::translate("MainWindowBase", "&3-D Effects:", 0, QApplication::UnicodeUTF8)); - labelMainColor2->setText(QApplication::translate("MainWindowBase", "Window Back&ground:", 0, QApplication::UnicodeUTF8)); - btnAdvanced->setText(QApplication::translate("MainWindowBase", "&Tune Palette...", 0, QApplication::UnicodeUTF8)); - GroupBox126->setTitle(QApplication::translate("MainWindowBase", "Preview", 0, QApplication::UnicodeUTF8)); - TextLabel1->setText(QApplication::translate("MainWindowBase", "Select &Palette:", 0, QApplication::UnicodeUTF8)); - paletteCombo->clear(); - paletteCombo->insertItems(0, QStringList() - << QApplication::translate("MainWindowBase", "Active Palette", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Inactive Palette", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Disabled Palette", 0, QApplication::UnicodeUTF8) - ); - TabWidget3->setTabText(TabWidget3->indexOf(tab1), QApplication::translate("MainWindowBase", "Appearance", 0, QApplication::UnicodeUTF8)); - GroupBox1->setTitle(QApplication::translate("MainWindowBase", "Default Font", 0, QApplication::UnicodeUTF8)); - stylebuddy->setText(QApplication::translate("MainWindowBase", "&Style:", 0, QApplication::UnicodeUTF8)); - psizebuddy->setText(QApplication::translate("MainWindowBase", "&Point Size:", 0, QApplication::UnicodeUTF8)); - familybuddy->setText(QApplication::translate("MainWindowBase", "F&amily:", 0, QApplication::UnicodeUTF8)); - samplelineedit->setText(QApplication::translate("MainWindowBase", "Sample Text", 0, QApplication::UnicodeUTF8)); - GroupBox2->setTitle(QApplication::translate("MainWindowBase", "Font Substitution", 0, QApplication::UnicodeUTF8)); - famsubbuddy->setText(QApplication::translate("MainWindowBase", "S&elect or Enter a Family:", 0, QApplication::UnicodeUTF8)); - TextLabel5->setText(QApplication::translate("MainWindowBase", "Current Substitutions:", 0, QApplication::UnicodeUTF8)); - PushButton2->setText(QApplication::translate("MainWindowBase", "Up", 0, QApplication::UnicodeUTF8)); - PushButton3->setText(QApplication::translate("MainWindowBase", "Down", 0, QApplication::UnicodeUTF8)); - PushButton4->setText(QApplication::translate("MainWindowBase", "Remove", 0, QApplication::UnicodeUTF8)); - choosebuddy->setText(QApplication::translate("MainWindowBase", "Select s&ubstitute Family:", 0, QApplication::UnicodeUTF8)); - PushButton1->setText(QApplication::translate("MainWindowBase", "Add", 0, QApplication::UnicodeUTF8)); - TabWidget3->setTabText(TabWidget3->indexOf(tab2), QApplication::translate("MainWindowBase", "Fonts", 0, QApplication::UnicodeUTF8)); - GroupBox4->setTitle(QApplication::translate("MainWindowBase", "Feel Settings", 0, QApplication::UnicodeUTF8)); - dcispin->setSuffix(QApplication::translate("MainWindowBase", " ms", 0, QApplication::UnicodeUTF8)); - dcibuddy->setText(QApplication::translate("MainWindowBase", "&Double Click Interval:", 0, QApplication::UnicodeUTF8)); - cfispin->setSpecialValueText(QApplication::translate("MainWindowBase", "No blinking", 0, QApplication::UnicodeUTF8)); - cfispin->setSuffix(QApplication::translate("MainWindowBase", " ms", 0, QApplication::UnicodeUTF8)); - cfibuddy->setText(QApplication::translate("MainWindowBase", "&Cursor Flash Time:", 0, QApplication::UnicodeUTF8)); - wslspin->setSuffix(QApplication::translate("MainWindowBase", " lines", 0, QApplication::UnicodeUTF8)); - wslbuddy->setText(QApplication::translate("MainWindowBase", "Wheel &Scroll Lines:", 0, QApplication::UnicodeUTF8)); - resolvelinks->setText(QApplication::translate("MainWindowBase", "Resolve symlinks in URLs", 0, QApplication::UnicodeUTF8)); - GroupBox3->setTitle(QApplication::translate("MainWindowBase", "GUI Effects", 0, QApplication::UnicodeUTF8)); - effectcheckbox->setText(QApplication::translate("MainWindowBase", "&Enable", 0, QApplication::UnicodeUTF8)); - effectcheckbox->setShortcut(QApplication::translate("MainWindowBase", "Alt+E", 0, QApplication::UnicodeUTF8)); - meffectbuddy->setText(QApplication::translate("MainWindowBase", "&Menu Effect:", 0, QApplication::UnicodeUTF8)); - ceffectbuddy->setText(QApplication::translate("MainWindowBase", "C&omboBox Effect:", 0, QApplication::UnicodeUTF8)); - teffectbuddy->setText(QApplication::translate("MainWindowBase", "&ToolTip Effect:", 0, QApplication::UnicodeUTF8)); - beffectbuddy->setText(QApplication::translate("MainWindowBase", "Tool&Box Effect:", 0, QApplication::UnicodeUTF8)); - menueffect->clear(); - menueffect->insertItems(0, QStringList() - << QApplication::translate("MainWindowBase", "Disable", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Animate", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Fade", 0, QApplication::UnicodeUTF8) - ); - comboeffect->clear(); - comboeffect->insertItems(0, QStringList() - << QApplication::translate("MainWindowBase", "Disable", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Animate", 0, QApplication::UnicodeUTF8) - ); - tooltipeffect->clear(); - tooltipeffect->insertItems(0, QStringList() - << QApplication::translate("MainWindowBase", "Disable", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Animate", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Fade", 0, QApplication::UnicodeUTF8) - ); - toolboxeffect->clear(); - toolboxeffect->insertItems(0, QStringList() - << QApplication::translate("MainWindowBase", "Disable", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Animate", 0, QApplication::UnicodeUTF8) - ); - GroupBox5->setTitle(QApplication::translate("MainWindowBase", "Global Strut", 0, QApplication::UnicodeUTF8)); - swbuddy->setText(QApplication::translate("MainWindowBase", "Minimum &Width:", 0, QApplication::UnicodeUTF8)); - shbuddy->setText(QApplication::translate("MainWindowBase", "Minimum Hei&ght:", 0, QApplication::UnicodeUTF8)); - strutwidth->setSuffix(QApplication::translate("MainWindowBase", " pixels", 0, QApplication::UnicodeUTF8)); - strutheight->setSuffix(QApplication::translate("MainWindowBase", " pixels", 0, QApplication::UnicodeUTF8)); - rtlExtensions->setText(QApplication::translate("MainWindowBase", "Enhanced support for languages written right-to-left", 0, QApplication::UnicodeUTF8)); - inputStyleLabel->setText(QApplication::translate("MainWindowBase", "XIM Input Style:", 0, QApplication::UnicodeUTF8)); - inputStyle->clear(); - inputStyle->insertItems(0, QStringList() - << QApplication::translate("MainWindowBase", "On The Spot", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Over The Spot", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Off The Spot", 0, QApplication::UnicodeUTF8) - << QApplication::translate("MainWindowBase", "Root", 0, QApplication::UnicodeUTF8) - ); - TabWidget3->setTabText(TabWidget3->indexOf(tab), QApplication::translate("MainWindowBase", "Interface", 0, QApplication::UnicodeUTF8)); - fontembeddingcheckbox->setText(QApplication::translate("MainWindowBase", "Enable Font embedding", 0, QApplication::UnicodeUTF8)); - GroupBox10->setTitle(QApplication::translate("MainWindowBase", "Font Paths", 0, QApplication::UnicodeUTF8)); - PushButton11->setText(QApplication::translate("MainWindowBase", "Up", 0, QApplication::UnicodeUTF8)); - PushButton13->setText(QApplication::translate("MainWindowBase", "Remove", 0, QApplication::UnicodeUTF8)); - PushButton12->setText(QApplication::translate("MainWindowBase", "Down", 0, QApplication::UnicodeUTF8)); - PushButton15->setText(QApplication::translate("MainWindowBase", "Add", 0, QApplication::UnicodeUTF8)); - PushButton14->setText(QApplication::translate("MainWindowBase", "Browse...", 0, QApplication::UnicodeUTF8)); - TextLabel15_2->setText(QApplication::translate("MainWindowBase", "Press the Browse button or enter a directory and press Enter to add them to the list.", 0, QApplication::UnicodeUTF8)); - TabWidget3->setTabText(TabWidget3->indexOf(tab3), QApplication::translate("MainWindowBase", "Printer", 0, QApplication::UnicodeUTF8)); - PopupMenu->setTitle(QApplication::translate("MainWindowBase", "&File", 0, QApplication::UnicodeUTF8)); - PopupMenu_2->setTitle(QApplication::translate("MainWindowBase", "&Help", 0, QApplication::UnicodeUTF8)); - } // retranslateUi - -}; - -namespace Ui { - class MainWindowBase: public Ui_MainWindowBase {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // MAINWINDOWBASE_H diff --git a/tests/auto/uic/baseline/mydialog.ui.h b/tests/auto/uic/baseline/mydialog.ui.h index 6114cc3807..474684988e 100644 --- a/tests/auto/uic/baseline/mydialog.ui.h +++ b/tests/auto/uic/baseline/mydialog.ui.h @@ -10,7 +10,6 @@ #ifndef MYDIALOG_H #define MYDIALOG_H -#include #include #include #include diff --git a/tests/auto/uic/baseline/paletteeditoradvancedbase.ui b/tests/auto/uic/baseline/paletteeditoradvancedbase.ui deleted file mode 100644 index a7055281d2..0000000000 --- a/tests/auto/uic/baseline/paletteeditoradvancedbase.ui +++ /dev/null @@ -1,617 +0,0 @@ - - - ********************************************************************* -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the autotests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* - - PaletteEditorAdvancedBase - - - PaletteEditorAdvancedBase - - - true - - - - 0 - 0 - 295 - 346 - - - - Tune Palette - - - true - - - <b>Edit Palette</b><p>Change the palette of the current widget or form.</p><p>Use a generated palette or select colors for each color group and each color role.</p><p>The palette can be tested with different widget layouts in the preview section.</p> - - - - unnamed - - - 11 - - - 6 - - - - - unnamed - - - 0 - - - 6 - - - - - TextLabel1 - - - Select &Palette: - - - paletteCombo - - - - - - - paletteCombo - - - - Active Palette - - - - - Inactive Palette - - - - - Disabled Palette - - - - - - - - - - ButtonGroup1 - - - - 5 - 4 - 0 - 0 - - - - Auto - - - - unnamed - - - 11 - - - 6 - - - - - checkBuildInactive - - - Build inactive palette from active - - - true - - - - - - - checkBuildDisabled - - - Build disabled palette from active - - - true - - - - - - - - - - groupCentral - - - Central color &roles - - - - unnamed - - - 11 - - - 6 - - - - - comboCentral - - - Choose central color role - - - <b>Select a color role.</b><p>Available central roles are: <ul> <li>Window - general background color.</li> <li>WindowText - general foreground color. </li> <li>Base - used as background color for e.g. text entry widgets, usually white or another light color. </li> <li>Text - the foreground color used with Base. Usually this is the same as WindowText, in what case it must provide good contrast both with Window and Base. </li> <li>Button - general button background color, where buttons need a background different from Window, as in the Macintosh style. </li> <li>ButtonText - a foreground color used with the Button color. </li> <li>Highlight - a color to indicate a selected or highlighted item. </li> <li>HighlightedText - a text color that contrasts to Highlight. </li> <li>BrightText - a text color that is very different from WindowText and contrasts well with e.g. black. </li> </ul> </p> - - - - Window - - - - - WindowText - - - - - Button - - - - - Base - - - - - Text - - - - - BrightText - - - - - ButtonText - - - - - Highlight - - - - - HighlightedText - - - - - - - - unnamed - - - 0 - - - 6 - - - - - - 20 - 20 - - - - Expanding - - - Horizontal - - - - - - - labelCentral - - - - 1 - 1 - 0 - 0 - - - - - 0 - 0 - - - - &Select Color: - - - buttonCentral - - - - - - - buttonCentral - - - - 0 - 0 - 0 - 0 - - - - Qt::TabFocus - - - Choose a color - - - Choose a color for the selected central color role. - - - - - - - - - - - - groupEffect - - - 3-D shadow &effects - - - - unnamed - - - 11 - - - 6 - - - - - unnamed - - - 0 - - - 6 - - - - - checkBuildEffect - - - Build &from button color - - - true - - - Generate shadings - - - Check to let 3D-effect colors be calculated from button-color. - - - - - - - comboEffect - - - Choose 3D-effect color role - - - <b>Select a color role.</b><p>Available effect roles are: <ul> <li>Light - lighter than Button color. </li> <li>Midlight - between Button and Light. </li> <li>Mid - between Button and Dark. </li> <li>Dark - darker than Button. </li> <li>Shadow - a very dark color. </li> </ul> - - - - Light - - - - - Midlight - - - - - Mid - - - - - Dark - - - - - Shadow - - - - - - - - - - unnamed - - - 0 - - - 6 - - - - - - 20 - 20 - - - - Expanding - - - Horizontal - - - - - - - labelEffect - - - - 1 - 1 - 0 - 0 - - - - - 0 - 0 - - - - Select Co&lor: - - - buttonEffect - - - - - - - buttonEffect - - - - 0 - 0 - 0 - 0 - - - - Qt::TabFocus - - - Choose a color - - - Choose a color for the selected effect color role. - - - - - - - - - - - - unnamed - - - 0 - - - 6 - - - - - - 20 - 20 - - - - Expanding - - - Horizontal - - - - - - - buttonOk - - - OK - - - true - - - true - - - Close dialog and apply all changes. - - - - - - - buttonCancel - - - Cancel - - - true - - - Close dialog and discard all changes. - - - - - - - - - - - ColorButton - -
colorbutton.h
- - 40 - 25 - - 0 - - 5 - 5 - - image0 - - color - pixmap - -
-
- - buttonOk - buttonCancel - paletteCombo - checkBuildInactive - checkBuildDisabled - comboCentral - buttonCentral - checkBuildEffect - comboEffect - buttonEffect - - - - 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 - - -
diff --git a/tests/auto/uic/baseline/paletteeditoradvancedbase.ui.h b/tests/auto/uic/baseline/paletteeditoradvancedbase.ui.h deleted file mode 100644 index e6841cca49..0000000000 --- a/tests/auto/uic/baseline/paletteeditoradvancedbase.ui.h +++ /dev/null @@ -1,485 +0,0 @@ -/* -********************************************************************* -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the autotests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* -*/ - -/******************************************************************************** -** Form generated from reading UI file 'paletteeditoradvancedbase.ui' -** -** Created: Fri Sep 4 10:17:14 2009 -** by: Qt User Interface Compiler version 4.6.0 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef PALETTEEDITORADVANCEDBASE_H -#define PALETTEEDITORADVANCEDBASE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "colorbutton.h" - -QT_BEGIN_NAMESPACE - -class Ui_PaletteEditorAdvancedBase -{ -public: - QVBoxLayout *vboxLayout; - QHBoxLayout *hboxLayout; - QLabel *TextLabel1; - QComboBox *paletteCombo; - Q3ButtonGroup *ButtonGroup1; - QVBoxLayout *vboxLayout1; - QCheckBox *checkBuildInactive; - QCheckBox *checkBuildDisabled; - Q3GroupBox *groupCentral; - QVBoxLayout *vboxLayout2; - QComboBox *comboCentral; - QHBoxLayout *hboxLayout1; - QSpacerItem *Horizontal_Spacing1; - QLabel *labelCentral; - ColorButton *buttonCentral; - Q3GroupBox *groupEffect; - QVBoxLayout *vboxLayout3; - QHBoxLayout *hboxLayout2; - QCheckBox *checkBuildEffect; - QComboBox *comboEffect; - QHBoxLayout *hboxLayout3; - QSpacerItem *Horizontal_Spacing3; - QLabel *labelEffect; - ColorButton *buttonEffect; - QHBoxLayout *hboxLayout4; - QSpacerItem *Horizontal_Spacing2; - QPushButton *buttonOk; - QPushButton *buttonCancel; - - void setupUi(QDialog *PaletteEditorAdvancedBase) - { - if (PaletteEditorAdvancedBase->objectName().isEmpty()) - PaletteEditorAdvancedBase->setObjectName(QString::fromUtf8("PaletteEditorAdvancedBase")); - PaletteEditorAdvancedBase->setEnabled(true); - PaletteEditorAdvancedBase->resize(295, 346); - PaletteEditorAdvancedBase->setSizeGripEnabled(true); - vboxLayout = new QVBoxLayout(PaletteEditorAdvancedBase); -#ifndef Q_OS_MAC - vboxLayout->setSpacing(6); -#endif - vboxLayout->setContentsMargins(11, 11, 11, 11); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); - vboxLayout->setObjectName(QString::fromUtf8("unnamed")); - hboxLayout = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout->setSpacing(6); -#endif -#ifndef Q_OS_MAC - hboxLayout->setContentsMargins(0, 0, 0, 0); -#endif - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - hboxLayout->setObjectName(QString::fromUtf8("unnamed")); - TextLabel1 = new QLabel(PaletteEditorAdvancedBase); - TextLabel1->setObjectName(QString::fromUtf8("TextLabel1")); - - hboxLayout->addWidget(TextLabel1); - - paletteCombo = new QComboBox(PaletteEditorAdvancedBase); - paletteCombo->setObjectName(QString::fromUtf8("paletteCombo")); - - hboxLayout->addWidget(paletteCombo); - - - vboxLayout->addLayout(hboxLayout); - - ButtonGroup1 = new Q3ButtonGroup(PaletteEditorAdvancedBase); - ButtonGroup1->setObjectName(QString::fromUtf8("ButtonGroup1")); - QSizePolicy sizePolicy(static_cast(5), static_cast(4)); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(ButtonGroup1->sizePolicy().hasHeightForWidth()); - ButtonGroup1->setSizePolicy(sizePolicy); - ButtonGroup1->setColumnLayout(0, Qt::Vertical); -#ifndef Q_OS_MAC - ButtonGroup1->layout()->setSpacing(6); -#endif - ButtonGroup1->layout()->setContentsMargins(11, 11, 11, 11); - vboxLayout1 = new QVBoxLayout(); - QBoxLayout *boxlayout = qobject_cast(ButtonGroup1->layout()); - if (boxlayout) - boxlayout->addLayout(vboxLayout1); - vboxLayout1->setAlignment(Qt::AlignTop); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); - vboxLayout1->setObjectName(QString::fromUtf8("unnamed")); - checkBuildInactive = new QCheckBox(ButtonGroup1); - checkBuildInactive->setObjectName(QString::fromUtf8("checkBuildInactive")); - checkBuildInactive->setChecked(true); - - vboxLayout1->addWidget(checkBuildInactive); - - checkBuildDisabled = new QCheckBox(ButtonGroup1); - checkBuildDisabled->setObjectName(QString::fromUtf8("checkBuildDisabled")); - checkBuildDisabled->setChecked(true); - - vboxLayout1->addWidget(checkBuildDisabled); - - - vboxLayout->addWidget(ButtonGroup1); - - groupCentral = new Q3GroupBox(PaletteEditorAdvancedBase); - groupCentral->setObjectName(QString::fromUtf8("groupCentral")); - groupCentral->setColumnLayout(0, Qt::Vertical); -#ifndef Q_OS_MAC - groupCentral->layout()->setSpacing(6); -#endif - groupCentral->layout()->setContentsMargins(11, 11, 11, 11); - vboxLayout2 = new QVBoxLayout(); - QBoxLayout *boxlayout1 = qobject_cast(groupCentral->layout()); - if (boxlayout1) - boxlayout1->addLayout(vboxLayout2); - vboxLayout2->setAlignment(Qt::AlignTop); - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); - vboxLayout2->setObjectName(QString::fromUtf8("unnamed")); - comboCentral = new QComboBox(groupCentral); - comboCentral->setObjectName(QString::fromUtf8("comboCentral")); - - vboxLayout2->addWidget(comboCentral); - - hboxLayout1 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout1->setSpacing(6); -#endif - hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); - hboxLayout1->setObjectName(QString::fromUtf8("unnamed")); - Horizontal_Spacing1 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout1->addItem(Horizontal_Spacing1); - - labelCentral = new QLabel(groupCentral); - labelCentral->setObjectName(QString::fromUtf8("labelCentral")); - QSizePolicy sizePolicy1(static_cast(1), static_cast(1)); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(labelCentral->sizePolicy().hasHeightForWidth()); - labelCentral->setSizePolicy(sizePolicy1); - labelCentral->setMinimumSize(QSize(0, 0)); - - hboxLayout1->addWidget(labelCentral); - - buttonCentral = new ColorButton(groupCentral); - buttonCentral->setObjectName(QString::fromUtf8("buttonCentral")); - QSizePolicy sizePolicy2(static_cast(0), static_cast(0)); - sizePolicy2.setHorizontalStretch(0); - sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(buttonCentral->sizePolicy().hasHeightForWidth()); - buttonCentral->setSizePolicy(sizePolicy2); - buttonCentral->setFocusPolicy(Qt::TabFocus); - - hboxLayout1->addWidget(buttonCentral); - - - vboxLayout2->addLayout(hboxLayout1); - - - vboxLayout->addWidget(groupCentral); - - groupEffect = new Q3GroupBox(PaletteEditorAdvancedBase); - groupEffect->setObjectName(QString::fromUtf8("groupEffect")); - groupEffect->setColumnLayout(0, Qt::Vertical); -#ifndef Q_OS_MAC - groupEffect->layout()->setSpacing(6); -#endif - groupEffect->layout()->setContentsMargins(11, 11, 11, 11); - vboxLayout3 = new QVBoxLayout(); - QBoxLayout *boxlayout2 = qobject_cast(groupEffect->layout()); - if (boxlayout2) - boxlayout2->addLayout(vboxLayout3); - vboxLayout3->setAlignment(Qt::AlignTop); - vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3")); - vboxLayout3->setObjectName(QString::fromUtf8("unnamed")); - hboxLayout2 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout2->setSpacing(6); -#endif -#ifndef Q_OS_MAC - hboxLayout2->setContentsMargins(0, 0, 0, 0); -#endif - hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); - hboxLayout2->setObjectName(QString::fromUtf8("unnamed")); - checkBuildEffect = new QCheckBox(groupEffect); - checkBuildEffect->setObjectName(QString::fromUtf8("checkBuildEffect")); - checkBuildEffect->setChecked(true); - - hboxLayout2->addWidget(checkBuildEffect); - - comboEffect = new QComboBox(groupEffect); - comboEffect->setObjectName(QString::fromUtf8("comboEffect")); - - hboxLayout2->addWidget(comboEffect); - - - vboxLayout3->addLayout(hboxLayout2); - - hboxLayout3 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout3->setSpacing(6); -#endif - hboxLayout3->setContentsMargins(0, 0, 0, 0); - hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3")); - hboxLayout3->setObjectName(QString::fromUtf8("unnamed")); - Horizontal_Spacing3 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout3->addItem(Horizontal_Spacing3); - - labelEffect = new QLabel(groupEffect); - labelEffect->setObjectName(QString::fromUtf8("labelEffect")); - sizePolicy1.setHeightForWidth(labelEffect->sizePolicy().hasHeightForWidth()); - labelEffect->setSizePolicy(sizePolicy1); - labelEffect->setMinimumSize(QSize(0, 0)); - - hboxLayout3->addWidget(labelEffect); - - buttonEffect = new ColorButton(groupEffect); - buttonEffect->setObjectName(QString::fromUtf8("buttonEffect")); - sizePolicy2.setHeightForWidth(buttonEffect->sizePolicy().hasHeightForWidth()); - buttonEffect->setSizePolicy(sizePolicy2); - buttonEffect->setFocusPolicy(Qt::TabFocus); - - hboxLayout3->addWidget(buttonEffect); - - - vboxLayout3->addLayout(hboxLayout3); - - - vboxLayout->addWidget(groupEffect); - - hboxLayout4 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout4->setSpacing(6); -#endif - hboxLayout4->setContentsMargins(0, 0, 0, 0); - hboxLayout4->setObjectName(QString::fromUtf8("hboxLayout4")); - hboxLayout4->setObjectName(QString::fromUtf8("unnamed")); - Horizontal_Spacing2 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - hboxLayout4->addItem(Horizontal_Spacing2); - - buttonOk = new QPushButton(PaletteEditorAdvancedBase); - buttonOk->setObjectName(QString::fromUtf8("buttonOk")); - buttonOk->setAutoDefault(true); - buttonOk->setDefault(true); - - hboxLayout4->addWidget(buttonOk); - - buttonCancel = new QPushButton(PaletteEditorAdvancedBase); - buttonCancel->setObjectName(QString::fromUtf8("buttonCancel")); - buttonCancel->setAutoDefault(true); - - hboxLayout4->addWidget(buttonCancel); - - - vboxLayout->addLayout(hboxLayout4); - -#ifndef QT_NO_SHORTCUT - TextLabel1->setBuddy(paletteCombo); - labelCentral->setBuddy(buttonCentral); - labelEffect->setBuddy(buttonEffect); -#endif // QT_NO_SHORTCUT - QWidget::setTabOrder(buttonOk, buttonCancel); - QWidget::setTabOrder(buttonCancel, paletteCombo); - QWidget::setTabOrder(paletteCombo, checkBuildInactive); - QWidget::setTabOrder(checkBuildInactive, checkBuildDisabled); - QWidget::setTabOrder(checkBuildDisabled, comboCentral); - QWidget::setTabOrder(comboCentral, buttonCentral); - QWidget::setTabOrder(buttonCentral, checkBuildEffect); - QWidget::setTabOrder(checkBuildEffect, comboEffect); - QWidget::setTabOrder(comboEffect, buttonEffect); - - retranslateUi(PaletteEditorAdvancedBase); - - QMetaObject::connectSlotsByName(PaletteEditorAdvancedBase); - } // setupUi - - void retranslateUi(QDialog *PaletteEditorAdvancedBase) - { - PaletteEditorAdvancedBase->setWindowTitle(QApplication::translate("PaletteEditorAdvancedBase", "Tune Palette", 0, QApplication::UnicodeUTF8)); -#ifndef QT_NO_WHATSTHIS - PaletteEditorAdvancedBase->setProperty("whatsThis", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Edit Palette

Change the palette of the current widget or form.

Use a generated palette or select colors for each color group and each color role.

The palette can be tested with different widget layouts in the preview section.

", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_WHATSTHIS - TextLabel1->setText(QApplication::translate("PaletteEditorAdvancedBase", "Select &Palette:", 0, QApplication::UnicodeUTF8)); - paletteCombo->clear(); - paletteCombo->insertItems(0, QStringList() - << QApplication::translate("PaletteEditorAdvancedBase", "Active Palette", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Inactive Palette", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Disabled Palette", 0, QApplication::UnicodeUTF8) - ); - ButtonGroup1->setTitle(QApplication::translate("PaletteEditorAdvancedBase", "Auto", 0, QApplication::UnicodeUTF8)); - checkBuildInactive->setText(QApplication::translate("PaletteEditorAdvancedBase", "Build inactive palette from active", 0, QApplication::UnicodeUTF8)); - checkBuildDisabled->setText(QApplication::translate("PaletteEditorAdvancedBase", "Build disabled palette from active", 0, QApplication::UnicodeUTF8)); - groupCentral->setTitle(QApplication::translate("PaletteEditorAdvancedBase", "Central color &roles", 0, QApplication::UnicodeUTF8)); - comboCentral->clear(); - comboCentral->insertItems(0, QStringList() - << QApplication::translate("PaletteEditorAdvancedBase", "Window", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "WindowText", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Button", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Base", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Text", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "BrightText", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "ButtonText", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Highlight", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "HighlightedText", 0, QApplication::UnicodeUTF8) - ); -#ifndef QT_NO_TOOLTIP - comboCentral->setProperty("toolTip", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Choose central color role", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS - comboCentral->setProperty("whatsThis", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Select a color role.

Available central roles are:

  • Window - general background color.
  • WindowText - general foreground color.
  • Base - used as background color for e.g. text entry widgets, usually white or another light color.
  • Text - the foreground color used with Base. Usually this is the same as WindowText, in what case it must provide good contrast both with Window and Base.
  • Button - general button background color, where buttons need a background different from Window, as in the Macintosh style.
  • ButtonText - a foreground color used with the Button color.
  • Highlight - a color to indicate a selected or highlighted item.
  • HighlightedText - a text color that contrasts to Highlight.
  • BrightText - a text color that is very different from WindowText and contrasts well with e.g. black.

", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_WHATSTHIS - labelCentral->setText(QApplication::translate("PaletteEditorAdvancedBase", "&Select Color:", 0, QApplication::UnicodeUTF8)); -#ifndef QT_NO_TOOLTIP - buttonCentral->setProperty("toolTip", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Choose a color", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS - buttonCentral->setProperty("whatsThis", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Choose a color for the selected central color role.", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_WHATSTHIS - groupEffect->setTitle(QApplication::translate("PaletteEditorAdvancedBase", "3-D shadow &effects", 0, QApplication::UnicodeUTF8)); - checkBuildEffect->setText(QApplication::translate("PaletteEditorAdvancedBase", "Build &from button color", 0, QApplication::UnicodeUTF8)); -#ifndef QT_NO_TOOLTIP - checkBuildEffect->setProperty("toolTip", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Generate shadings", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS - checkBuildEffect->setProperty("whatsThis", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Check to let 3D-effect colors be calculated from button-color.", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_WHATSTHIS - comboEffect->clear(); - comboEffect->insertItems(0, QStringList() - << QApplication::translate("PaletteEditorAdvancedBase", "Light", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Midlight", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Mid", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Dark", 0, QApplication::UnicodeUTF8) - << QApplication::translate("PaletteEditorAdvancedBase", "Shadow", 0, QApplication::UnicodeUTF8) - ); -#ifndef QT_NO_TOOLTIP - comboEffect->setProperty("toolTip", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Choose 3D-effect color role", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS - comboEffect->setProperty("whatsThis", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Select a color role.

Available effect roles are:

  • Light - lighter than Button color.
  • Midlight - between Button and Light.
  • Mid - between Button and Dark.
  • Dark - darker than Button.
  • Shadow - a very dark color.
", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_WHATSTHIS - labelEffect->setText(QApplication::translate("PaletteEditorAdvancedBase", "Select Co&lor:", 0, QApplication::UnicodeUTF8)); -#ifndef QT_NO_TOOLTIP - buttonEffect->setProperty("toolTip", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Choose a color", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS - buttonEffect->setProperty("whatsThis", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Choose a color for the selected effect color role.", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_WHATSTHIS - buttonOk->setText(QApplication::translate("PaletteEditorAdvancedBase", "OK", 0, QApplication::UnicodeUTF8)); -#ifndef QT_NO_WHATSTHIS - buttonOk->setProperty("whatsThis", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Close dialog and apply all changes.", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_WHATSTHIS - buttonCancel->setText(QApplication::translate("PaletteEditorAdvancedBase", "Cancel", 0, QApplication::UnicodeUTF8)); -#ifndef QT_NO_WHATSTHIS - buttonCancel->setProperty("whatsThis", QVariant(QApplication::translate("PaletteEditorAdvancedBase", "Close dialog and discard all changes.", 0, QApplication::UnicodeUTF8))); -#endif // QT_NO_WHATSTHIS - } // retranslateUi - - -protected: - enum IconID - { - image0_ID, - unknown_ID - }; - static QPixmap qt_get_icon(IconID id) - { - /* XPM */ - static const char* const image0_data[] = { -"22 22 2 1", -". c None", -"# c #a4c610", -"........######........", -".....###########......", -"....##############....", -"...################...", -"..######......######..", -"..#####........#####..", -".#####.......#..#####.", -".####.......###..####.", -"####.......#####..####", -"####......#####...####", -"####....#######...####", -"####....######....####", -"####...########...####", -".####.##########..####", -".####..####.#########.", -".#####..##...########.", -"..#####.......#######.", -"..######......######..", -"...###################", -"....##################", -"......###########.###.", -"........######.....#.."}; - - - switch (id) { - case image0_ID: return QPixmap((const char**)image0_data); - default: return QPixmap(); - } // switch - } // icon - -}; - -namespace Ui { - class PaletteEditorAdvancedBase: public Ui_PaletteEditorAdvancedBase {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // PALETTEEDITORADVANCEDBASE_H diff --git a/tests/auto/uic/baseline/previewwidgetbase.ui b/tests/auto/uic/baseline/previewwidgetbase.ui deleted file mode 100644 index 5f36d49dbe..0000000000 --- a/tests/auto/uic/baseline/previewwidgetbase.ui +++ /dev/null @@ -1,340 +0,0 @@ - - - ********************************************************************* -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the autotests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* - - PreviewWidgetBase - - - PreviewWidgetBase - - - - 0 - 0 - 378 - 236 - - - - - 1 - 1 - 0 - 0 - - - - Preview Window - - - - unnamed - - - 11 - - - 6 - - - - - unnamed - - - 0 - - - 6 - - - - - unnamed - - - 0 - - - 6 - - - - - ButtonGroup1 - - - ButtonGroup - - - - unnamed - - - 11 - - - 6 - - - - - RadioButton1 - - - RadioButton1 - - - true - - - - - - - RadioButton2 - - - RadioButton2 - - - - - - - RadioButton3 - - - RadioButton3 - - - - - - - - - - ButtonGroup2 - - - ButtonGroup2 - - - - unnamed - - - 11 - - - 6 - - - - - CheckBox1 - - - CheckBox1 - - - true - - - - - - - CheckBox2 - - - CheckBox2 - - - - - - - - - - ProgressBar1 - - - 50 - - - - - - - - - unnamed - - - 0 - - - 6 - - - - - LineEdit1 - - - LineEdit - - - - - - - ComboBox1 - - - - ComboBox - - - - - - - - unnamed - - - 0 - - - 6 - - - - - SpinBox1 - - - - - - - PushButton1 - - - PushButton - - - - - - - - - ScrollBar1 - - - Qt::Horizontal - - - - - - - Slider1 - - - Qt::Horizontal - - - - - - - textView - - - - 32767 - 50 - - - - true - - - <p> -<a href="http://qt.nokia.com">http://qt.nokia.com</a> -</p> -<p> -<a href="http://www.kde.org">http://www.kde.org</a> -</p> - - - - - - - - - - - - 20 - 20 - - - - Expanding - - - Vertical - - - - - - qPixmapFromMimeSource - diff --git a/tests/auto/uic/baseline/previewwidgetbase.ui.h b/tests/auto/uic/baseline/previewwidgetbase.ui.h deleted file mode 100644 index ab118e02a0..0000000000 --- a/tests/auto/uic/baseline/previewwidgetbase.ui.h +++ /dev/null @@ -1,316 +0,0 @@ -/* -********************************************************************* -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the autotests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* -*/ - -/******************************************************************************** -** Form generated from reading UI file 'previewwidgetbase.ui' -** -** Created: Fri Sep 4 10:17:14 2009 -** by: Qt User Interface Compiler version 4.6.0 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef PREVIEWWIDGETBASE_H -#define PREVIEWWIDGETBASE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_PreviewWidgetBase -{ -public: - QVBoxLayout *vboxLayout; - QHBoxLayout *hboxLayout; - QVBoxLayout *vboxLayout1; - Q3ButtonGroup *ButtonGroup1; - QVBoxLayout *vboxLayout2; - QRadioButton *RadioButton1; - QRadioButton *RadioButton2; - QRadioButton *RadioButton3; - Q3ButtonGroup *ButtonGroup2; - QVBoxLayout *vboxLayout3; - QCheckBox *CheckBox1; - QCheckBox *CheckBox2; - QProgressBar *ProgressBar1; - QVBoxLayout *vboxLayout4; - QLineEdit *LineEdit1; - QComboBox *ComboBox1; - QHBoxLayout *hboxLayout1; - QSpinBox *SpinBox1; - QPushButton *PushButton1; - QScrollBar *ScrollBar1; - QSlider *Slider1; - QTextEdit *textView; - QSpacerItem *Spacer2; - - void setupUi(QWidget *PreviewWidgetBase) - { - if (PreviewWidgetBase->objectName().isEmpty()) - PreviewWidgetBase->setObjectName(QString::fromUtf8("PreviewWidgetBase")); - PreviewWidgetBase->resize(378, 236); - QSizePolicy sizePolicy(static_cast(1), static_cast(1)); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - sizePolicy.setHeightForWidth(PreviewWidgetBase->sizePolicy().hasHeightForWidth()); - PreviewWidgetBase->setSizePolicy(sizePolicy); - vboxLayout = new QVBoxLayout(PreviewWidgetBase); -#ifndef Q_OS_MAC - vboxLayout->setSpacing(6); -#endif - vboxLayout->setContentsMargins(11, 11, 11, 11); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); - vboxLayout->setObjectName(QString::fromUtf8("unnamed")); - hboxLayout = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout->setSpacing(6); -#endif -#ifndef Q_OS_MAC - hboxLayout->setContentsMargins(0, 0, 0, 0); -#endif - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - hboxLayout->setObjectName(QString::fromUtf8("unnamed")); - vboxLayout1 = new QVBoxLayout(); -#ifndef Q_OS_MAC - vboxLayout1->setSpacing(6); -#endif -#ifndef Q_OS_MAC - vboxLayout1->setContentsMargins(0, 0, 0, 0); -#endif - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); - vboxLayout1->setObjectName(QString::fromUtf8("unnamed")); - ButtonGroup1 = new Q3ButtonGroup(PreviewWidgetBase); - ButtonGroup1->setObjectName(QString::fromUtf8("ButtonGroup1")); - ButtonGroup1->setColumnLayout(0, Qt::Vertical); -#ifndef Q_OS_MAC - ButtonGroup1->layout()->setSpacing(6); -#endif - ButtonGroup1->layout()->setContentsMargins(11, 11, 11, 11); - vboxLayout2 = new QVBoxLayout(); - QBoxLayout *boxlayout = qobject_cast(ButtonGroup1->layout()); - if (boxlayout) - boxlayout->addLayout(vboxLayout2); - vboxLayout2->setAlignment(Qt::AlignTop); - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); - vboxLayout2->setObjectName(QString::fromUtf8("unnamed")); - RadioButton1 = new QRadioButton(ButtonGroup1); - RadioButton1->setObjectName(QString::fromUtf8("RadioButton1")); - RadioButton1->setChecked(true); - - vboxLayout2->addWidget(RadioButton1); - - RadioButton2 = new QRadioButton(ButtonGroup1); - RadioButton2->setObjectName(QString::fromUtf8("RadioButton2")); - - vboxLayout2->addWidget(RadioButton2); - - RadioButton3 = new QRadioButton(ButtonGroup1); - RadioButton3->setObjectName(QString::fromUtf8("RadioButton3")); - - vboxLayout2->addWidget(RadioButton3); - - - vboxLayout1->addWidget(ButtonGroup1); - - ButtonGroup2 = new Q3ButtonGroup(PreviewWidgetBase); - ButtonGroup2->setObjectName(QString::fromUtf8("ButtonGroup2")); - ButtonGroup2->setColumnLayout(0, Qt::Vertical); -#ifndef Q_OS_MAC - ButtonGroup2->layout()->setSpacing(6); -#endif - ButtonGroup2->layout()->setContentsMargins(11, 11, 11, 11); - vboxLayout3 = new QVBoxLayout(); - QBoxLayout *boxlayout1 = qobject_cast(ButtonGroup2->layout()); - if (boxlayout1) - boxlayout1->addLayout(vboxLayout3); - vboxLayout3->setAlignment(Qt::AlignTop); - vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3")); - vboxLayout3->setObjectName(QString::fromUtf8("unnamed")); - CheckBox1 = new QCheckBox(ButtonGroup2); - CheckBox1->setObjectName(QString::fromUtf8("CheckBox1")); - CheckBox1->setChecked(true); - - vboxLayout3->addWidget(CheckBox1); - - CheckBox2 = new QCheckBox(ButtonGroup2); - CheckBox2->setObjectName(QString::fromUtf8("CheckBox2")); - - vboxLayout3->addWidget(CheckBox2); - - - vboxLayout1->addWidget(ButtonGroup2); - - ProgressBar1 = new QProgressBar(PreviewWidgetBase); - ProgressBar1->setObjectName(QString::fromUtf8("ProgressBar1")); - ProgressBar1->setValue(50); - - vboxLayout1->addWidget(ProgressBar1); - - - hboxLayout->addLayout(vboxLayout1); - - vboxLayout4 = new QVBoxLayout(); -#ifndef Q_OS_MAC - vboxLayout4->setSpacing(6); -#endif - vboxLayout4->setContentsMargins(0, 0, 0, 0); - vboxLayout4->setObjectName(QString::fromUtf8("vboxLayout4")); - vboxLayout4->setObjectName(QString::fromUtf8("unnamed")); - LineEdit1 = new QLineEdit(PreviewWidgetBase); - LineEdit1->setObjectName(QString::fromUtf8("LineEdit1")); - - vboxLayout4->addWidget(LineEdit1); - - ComboBox1 = new QComboBox(PreviewWidgetBase); - ComboBox1->setObjectName(QString::fromUtf8("ComboBox1")); - - vboxLayout4->addWidget(ComboBox1); - - hboxLayout1 = new QHBoxLayout(); -#ifndef Q_OS_MAC - hboxLayout1->setSpacing(6); -#endif - hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); - hboxLayout1->setObjectName(QString::fromUtf8("unnamed")); - SpinBox1 = new QSpinBox(PreviewWidgetBase); - SpinBox1->setObjectName(QString::fromUtf8("SpinBox1")); - - hboxLayout1->addWidget(SpinBox1); - - PushButton1 = new QPushButton(PreviewWidgetBase); - PushButton1->setObjectName(QString::fromUtf8("PushButton1")); - - hboxLayout1->addWidget(PushButton1); - - - vboxLayout4->addLayout(hboxLayout1); - - ScrollBar1 = new QScrollBar(PreviewWidgetBase); - ScrollBar1->setObjectName(QString::fromUtf8("ScrollBar1")); - ScrollBar1->setOrientation(Qt::Horizontal); - - vboxLayout4->addWidget(ScrollBar1); - - Slider1 = new QSlider(PreviewWidgetBase); - Slider1->setObjectName(QString::fromUtf8("Slider1")); - Slider1->setOrientation(Qt::Horizontal); - - vboxLayout4->addWidget(Slider1); - - textView = new QTextEdit(PreviewWidgetBase); - textView->setObjectName(QString::fromUtf8("textView")); - textView->setMaximumSize(QSize(32767, 50)); - textView->setReadOnly(true); - - vboxLayout4->addWidget(textView); - - - hboxLayout->addLayout(vboxLayout4); - - - vboxLayout->addLayout(hboxLayout); - - Spacer2 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); - - vboxLayout->addItem(Spacer2); - - - retranslateUi(PreviewWidgetBase); - - QMetaObject::connectSlotsByName(PreviewWidgetBase); - } // setupUi - - void retranslateUi(QWidget *PreviewWidgetBase) - { - PreviewWidgetBase->setWindowTitle(QApplication::translate("PreviewWidgetBase", "Preview Window", 0, QApplication::UnicodeUTF8)); - ButtonGroup1->setTitle(QApplication::translate("PreviewWidgetBase", "ButtonGroup", 0, QApplication::UnicodeUTF8)); - RadioButton1->setText(QApplication::translate("PreviewWidgetBase", "RadioButton1", 0, QApplication::UnicodeUTF8)); - RadioButton2->setText(QApplication::translate("PreviewWidgetBase", "RadioButton2", 0, QApplication::UnicodeUTF8)); - RadioButton3->setText(QApplication::translate("PreviewWidgetBase", "RadioButton3", 0, QApplication::UnicodeUTF8)); - ButtonGroup2->setTitle(QApplication::translate("PreviewWidgetBase", "ButtonGroup2", 0, QApplication::UnicodeUTF8)); - CheckBox1->setText(QApplication::translate("PreviewWidgetBase", "CheckBox1", 0, QApplication::UnicodeUTF8)); - CheckBox2->setText(QApplication::translate("PreviewWidgetBase", "CheckBox2", 0, QApplication::UnicodeUTF8)); - LineEdit1->setText(QApplication::translate("PreviewWidgetBase", "LineEdit", 0, QApplication::UnicodeUTF8)); - ComboBox1->clear(); - ComboBox1->insertItems(0, QStringList() - << QApplication::translate("PreviewWidgetBase", "ComboBox", 0, QApplication::UnicodeUTF8) - ); - PushButton1->setText(QApplication::translate("PreviewWidgetBase", "PushButton", 0, QApplication::UnicodeUTF8)); - textView->setText(QApplication::translate("PreviewWidgetBase", "

\n" -"http://qt.nokia.com\n" -"

\n" -"

\n" -"http://www.kde.org\n" -"

", 0, QApplication::UnicodeUTF8)); - } // retranslateUi - -}; - -namespace Ui { - class PreviewWidgetBase: public Ui_PreviewWidgetBase {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // PREVIEWWIDGETBASE_H -- cgit v1.2.3 From 4135b6b3235d0a87dce586300b54ec4355cc98ca Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 6 May 2011 15:45:37 +0200 Subject: Fix QRawFont::setPixelSize() on Mac When refactoring the setPixelSize() code of QRawFont, it was broken on Mac. To avoid making the same mistake again, I've added a simple autotest to check that the pixel size is actually set. Reviewed-by: Jiang Jiang (cherry picked from commit 821b8b540af491ce60d35bd84d3c91399ecc0d16) --- tests/auto/qrawfont/tst_qrawfont.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qrawfont/tst_qrawfont.cpp b/tests/auto/qrawfont/tst_qrawfont.cpp index 4b42c74bb7..ad16a9a75b 100644 --- a/tests/auto/qrawfont/tst_qrawfont.cpp +++ b/tests/auto/qrawfont/tst_qrawfont.cpp @@ -91,6 +91,9 @@ private slots: void unsupportedWritingSystem_data(); void unsupportedWritingSystem(); + + void rawFontSetPixelSize_data(); + void rawFontSetPixelSize(); #endif // QT_NO_RAWFONT }; @@ -807,6 +810,39 @@ void tst_QRawFont::unsupportedWritingSystem() fontDatabase.removeApplicationFont(id); } +void tst_QRawFont::rawFontSetPixelSize_data() +{ + QTest::addColumn("hintingPreference"); + + QTest::newRow("Default hinting preference") << QFont::PreferDefaultHinting; + QTest::newRow("No hinting preference") << QFont::PreferNoHinting; + QTest::newRow("Vertical hinting preference") << QFont::PreferVerticalHinting; + QTest::newRow("Full hinting preference") << QFont::PreferFullHinting; +} + +void tst_QRawFont::rawFontSetPixelSize() +{ + QFETCH(QFont::HintingPreference, hintingPreference); + + QTextLayout layout("Foobar"); + + QFont font = layout.font(); + font.setHintingPreference(hintingPreference); + font.setPixelSize(12); + layout.setFont(font); + + layout.beginLayout(); + layout.createLine(); + layout.endLayout(); + + QGlyphs glyphs = layout.glyphs().at(0); + QRawFont rawFont = glyphs.font(); + QCOMPARE(rawFont.pixelSize(), 12.0); + + rawFont.setPixelSize(24); + QCOMPARE(rawFont.pixelSize(), 24.0); +} + #endif // QT_NO_RAWFONT QTEST_MAIN(tst_QRawFont) -- cgit v1.2.3 From 724671feca39e6eebaf4d8005bb89d5c14e96386 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Mon, 18 Apr 2011 15:46:19 +0100 Subject: Add autotests for configuration dependent network proxies 1. test that systemProxyForQuery returns something for all configs 2. test that QNetworkAccessManager uses the settings for the configuration it was started with. Task-number: QTBUG-18618 Reviewed-by: Peter Hartmann --- .../qnetworkproxyfactory/qnetworkproxyfactory.pro | 2 +- .../tst_qnetworkproxyfactory.cpp | 144 +++++++++++++++++++++ 2 files changed, 145 insertions(+), 1 deletion(-) (limited to 'tests/auto') diff --git a/tests/auto/qnetworkproxyfactory/qnetworkproxyfactory.pro b/tests/auto/qnetworkproxyfactory/qnetworkproxyfactory.pro index f05c423087..17ad403ba7 100644 --- a/tests/auto/qnetworkproxyfactory/qnetworkproxyfactory.pro +++ b/tests/auto/qnetworkproxyfactory/qnetworkproxyfactory.pro @@ -7,5 +7,5 @@ QT = core network SOURCES += tst_qnetworkproxyfactory.cpp -symbian: TARGET.CAPABILITY = NetworkServices +symbian: TARGET.CAPABILITY = NetworkServices ReadUserData diff --git a/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp b/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp index 2baee27d5f..82a4193e9d 100644 --- a/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp +++ b/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp @@ -41,20 +41,60 @@ #include +#include #include #include #include +#include +#include +#include +#include +#include +#include +#include + +Q_DECLARE_METATYPE(QNetworkConfiguration); +Q_DECLARE_METATYPE(QList); class tst_QNetworkProxyFactory : public QObject { Q_OBJECT + +public: + tst_QNetworkProxyFactory(); + + class QDebugProxyFactory : public QNetworkProxyFactory + { + public: + virtual QList queryProxy(const QNetworkProxyQuery &query = QNetworkProxyQuery()) + { + returnedList = QNetworkProxyFactory::systemProxyForQuery(query); + requestCounter++; + return returnedList; + } + QList returnedList; + int requestCounter; + }; + private slots: void systemProxyForQuery() const; +#ifndef QT_NO_BEARERMANAGEMENT + void fromConfigurations(); + void inNetworkAccessManager_data(); + void inNetworkAccessManager(); +#endif private: QString formatProxyName(const QNetworkProxy & proxy) const; + QDebugProxyFactory *factory; }; +tst_QNetworkProxyFactory::tst_QNetworkProxyFactory() +{ + factory = new QDebugProxyFactory; + QNetworkProxyFactory::setApplicationProxyFactory(factory); +} + QString tst_QNetworkProxyFactory::formatProxyName(const QNetworkProxy & proxy) const { QString proxyName; @@ -96,5 +136,109 @@ void tst_QNetworkProxyFactory::systemProxyForQuery() const QFAIL("One or more system proxy lookup failures occurred."); } +#ifndef QT_NO_BEARERMANAGEMENT + +//Purpose of this test is just to check systemProxyForQuery doesn't hang or crash +//with any given configuration including no configuration. +//We can't test it returns the right proxies without implementing the native proxy code +//again here, which would be testing our implementation against itself. +//Therefore it's just testing that something valid is returned (at least a NoProxy entry) +void tst_QNetworkProxyFactory::fromConfigurations() +{ + QNetworkConfigurationManager manager; + QList proxies; + QUrl url(QLatin1String("http://qt.nokia.com")); + //get from known configurations + foreach (QNetworkConfiguration config, manager.allConfigurations()) { + QNetworkProxyQuery query(config, url, QNetworkProxyQuery::UrlRequest); + proxies = QNetworkProxyFactory::systemProxyForQuery(query); + QVERIFY(!proxies.isEmpty()); + foreach (QNetworkProxy proxy, proxies) { + qDebug() << config.name() << " - " << config.identifier() << " - " << formatProxyName(proxy); + } + } + + //get from default configuration + QNetworkProxyQuery defaultquery(url, QNetworkProxyQuery::UrlRequest); + proxies = QNetworkProxyFactory::systemProxyForQuery(defaultquery); + QVERIFY(!proxies.isEmpty()); + foreach (QNetworkProxy proxy, proxies) { + qDebug() << "default - " << formatProxyName(proxy); + } + + //get from active configuration + QNetworkSession session(manager.defaultConfiguration()); + session.open(); + QVERIFY(session.waitForOpened(30000)); + proxies = QNetworkProxyFactory::systemProxyForQuery(defaultquery); + QVERIFY(!proxies.isEmpty()); + foreach (QNetworkProxy proxy, proxies) { + qDebug() << "active - " << formatProxyName(proxy); + } + + //get from known configurations while there is one active + foreach (QNetworkConfiguration config, manager.allConfigurations()) { + QNetworkProxyQuery query(config, url, QNetworkProxyQuery::UrlRequest); + proxies = QNetworkProxyFactory::systemProxyForQuery(query); + QVERIFY(!proxies.isEmpty()); + foreach (QNetworkProxy proxy, proxies) { + qDebug() << config.name() << " - " << config.identifier() << " - " << formatProxyName(proxy); + } + } +} + +void tst_QNetworkProxyFactory::inNetworkAccessManager_data() +{ + QTest::addColumn("config"); + QTest::addColumn >("proxies"); + QNetworkConfigurationManager manager; + //get from known configurations + foreach (QNetworkConfiguration config, manager.allConfigurations()) { + QNetworkProxyQuery query(config, QUrl(QString("http://qt.nokia.com")), QNetworkProxyQuery::UrlRequest); + QList proxies = QNetworkProxyFactory::systemProxyForQuery(query); + QTest::newRow(config.name().toUtf8()) << config << proxies; + } +} + +//Purpose of this test is to check that QNetworkAccessManager uses the proxy from the configuration it +//has been given. Needs two or more working configurations to be a good test. +void tst_QNetworkProxyFactory::inNetworkAccessManager() +{ + QFETCH(QNetworkConfiguration, config); + QFETCH(QList, proxies); + + int count = factory->requestCounter; + + QNetworkAccessManager manager; + manager.setConfiguration(config); + + //using an internet server, because cellular APs won't have a route to the test server. + QNetworkRequest req(QUrl(QString("http://qt.nokia.com"))); + QNetworkReply *reply = manager.get(req); + connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(30); + delete reply; + + if (count == factory->requestCounter) { + //RND phones are preconfigured with several test access points which won't work without a matching SIM + //If the network fails to start, QNAM won't ask the factory for proxies so we can't test. + QSKIP("network configuration didn't start", SkipSingle); + } + + qDebug() << "testing network configuration for" << config.name(); + foreach (QNetworkProxy proxy, factory->returnedList) { + qDebug() << formatProxyName(proxy); + } + qDebug() << " "; + foreach (QNetworkProxy proxy, proxies) { + qDebug() << formatProxyName(proxy); + } + if (config.type() != QNetworkConfiguration::InternetAccessPoint) + QEXPECT_FAIL("","QNetworkProxyFactory::systemProxyForQuery doesn't work for service networks yet", Continue); + QCOMPARE(factory->returnedList, proxies); +} + +#endif //QT_NO_BEARERMANAGEMENT + QTEST_MAIN(tst_QNetworkProxyFactory) #include "tst_qnetworkproxyfactory.moc" -- cgit v1.2.3 From e01faeb5c7308662c7d727a55ff5c54e23244716 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Wed, 4 May 2011 17:27:36 +0100 Subject: Send User-Agent from the network request in http proxy CONNECT command Some proxies can discriminate based on the User-Agent when sent a CONNECT command for establishing a HTTPS connection. With this change, if the User-Agent header is set in the QNetworkRequest then it will be passed to the http socket engine for use in the connect command sent to the proxy. As before, "Mozilla/5.0" will be used by default when no user agent has been set. Task-number: QTBUG-17223 Reviewed-by: Markus Goetz --- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tests/auto') diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index f7365dfbfd..8e3ba2ac0b 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -4970,7 +4970,9 @@ void tst_QNetworkReply::httpProxyCommands() QNetworkProxy proxy(QNetworkProxy::HttpProxy, "127.0.0.1", proxyServer.serverPort()); manager.setProxy(proxy); - QNetworkReplyPtr reply = manager.get(QNetworkRequest(url)); + QNetworkRequest request(url); + request.setRawHeader("User-Agent", "QNetworkReplyAutoTest/1.0"); + QNetworkReplyPtr reply = manager.get(request); manager.setProxy(QNetworkProxy()); // wait for the finished signal @@ -4988,6 +4990,12 @@ void tst_QNetworkReply::httpProxyCommands() QString receivedHeader = proxyServer.receivedData.left(expectedCommand.length()); QCOMPARE(receivedHeader, expectedCommand); + + //QTBUG-17223 - make sure the user agent from the request is sent to proxy server even for CONNECT + int uapos = proxyServer.receivedData.indexOf("User-Agent"); + int uaend = proxyServer.receivedData.indexOf("\r\n", uapos); + QByteArray uaheader = proxyServer.receivedData.mid(uapos, uaend - uapos); + QCOMPARE(uaheader, QByteArray("User-Agent: QNetworkReplyAutoTest/1.0")); } class ProxyChangeHelper : public QObject { -- cgit v1.2.3 From 9c1293283e02e11525325153f4b85a0a23bfef9f Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 5 May 2011 15:31:49 +0100 Subject: fix tst_qnetworkreply::httpProxyCommands autotest Due to architecture changes in Qt 4.8, clearing the proxy before the request is complete causes the http connection to not use any proxy. The issue is that the proxy isn't resolved until after the bearer has been started (which is correct in the general case, as system proxy is unknown until that time). Also increased the test's timeout from 1 second to 15, as starting a bearer can be slow. Reviewed-by: Markus Goetz --- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 8e3ba2ac0b..6c77f11d03 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -4973,16 +4973,21 @@ void tst_QNetworkReply::httpProxyCommands() QNetworkRequest request(url); request.setRawHeader("User-Agent", "QNetworkReplyAutoTest/1.0"); QNetworkReplyPtr reply = manager.get(request); - manager.setProxy(QNetworkProxy()); + //clearing the proxy here causes the test to fail. + //the proxy isn't used until after the bearer has been started + //which is correct in general, because system proxy isn't known until that time. + //removing this line is safe, as the proxy is also reset by the cleanup() function + //manager.setProxy(QNetworkProxy()); // wait for the finished signal connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(1); + QTestEventLoop::instance().enterLoop(15); QVERIFY(!QTestEventLoop::instance().timeout()); //qDebug() << reply->error() << reply->errorString(); + //qDebug() << proxyServer.receivedData; // we don't really care if the request succeeded // especially since it won't succeed in the HTTPS case -- cgit v1.2.3 From a590e77fd8721acc0c844f86db86d5c9445fa9a6 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Wed, 4 May 2011 13:02:57 +0100 Subject: Fix QNetworkConfigurationManager usage outside main thread first QNetworkConfigurationManager creates the engines loaded from plugins as objects in the main thread. If a QNetworkConfigurationManager instance is created in a worker thread without any instance previously existing in the main thread, then it is uninitialised until the main thread has run. This causes allConfigurations() to return an empty list if called immediately after instantiation, for example. This fix initialises the plugins using blocking queued connections, which causes the worker thread to block until the initialisation function has been called in the context of the main thread. Deadlock is possible if the main thread is for some reason waiting on the worker thread, but it will not deadlock on QNetworkConfigurationManager's mutex. If this is a problem for an application, it should use QNetworkConfigurationManager from the main thread first to preload the plugins. Task-number: QTBUG-18795 Task-number: QTBUG-18799 Reviewed-by: Cristiano Di Flora --- .../tst_qnetworkconfigurationmanager.cpp | 38 ++++++++++++++++++++++ .../tst_qnetworkproxyfactory.cpp | 31 ++++++++++++++++++ 2 files changed, 69 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp b/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp index 7787608485..33595339f2 100644 --- a/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp +++ b/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp @@ -62,6 +62,7 @@ public slots: void cleanup(); private slots: + void usedInThread(); // this test must be first, or it will falsely pass void allConfigurations(); void defaultConfiguration(); void configurationFromIdentifier(); @@ -329,6 +330,43 @@ void tst_QNetworkConfigurationManager::configurationFromIdentifier() QVERIFY(!invalid.isValid()); } +class QNCMTestThread : public QThread +{ +protected: + virtual void run() + { + QNetworkConfigurationManager manager; + preScanConfigs = manager.allConfigurations(); + QSignalSpy spy(&manager, SIGNAL(updateCompleted())); + manager.updateConfigurations(); //initiate scans + QTRY_VERIFY(spy.count() == 1); //wait for scan to complete + configs = manager.allConfigurations(); + } +public: + QList configs; + QList preScanConfigs; +}; + +// regression test for QTBUG-18795 +void tst_QNetworkConfigurationManager::usedInThread() +{ + QNCMTestThread thread; + connect(&thread, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + thread.start(); + QTestEventLoop::instance().enterLoop(5); + QVERIFY(thread.isFinished()); + qDebug() << "prescan:" << thread.preScanConfigs.count(); + qDebug() << "postscan:" << thread.configs.count(); + + QNetworkConfigurationManager manager; + QList preScanConfigs = manager.allConfigurations(); + QSignalSpy spy(&manager, SIGNAL(updateCompleted())); + manager.updateConfigurations(); //initiate scans + QTRY_VERIFY(spy.count() == 1); //wait for scan to complete + QList configs = manager.allConfigurations(); + QCOMPARE(thread.configs, configs); + QCOMPARE(thread.preScanConfigs, preScanConfigs); +} QTEST_MAIN(tst_QNetworkConfigurationManager) #include "tst_qnetworkconfigurationmanager.moc" diff --git a/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp b/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp index 82a4193e9d..90ab8e045d 100644 --- a/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp +++ b/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp @@ -46,6 +46,7 @@ #include #include #include + #include #include #include @@ -57,6 +58,8 @@ Q_DECLARE_METATYPE(QNetworkConfiguration); Q_DECLARE_METATYPE(QList); +#include + class tst_QNetworkProxyFactory : public QObject { Q_OBJECT @@ -77,6 +80,7 @@ public: }; private slots: + void systemProxyForQueryCalledFromThread(); void systemProxyForQuery() const; #ifndef QT_NO_BEARERMANAGEMENT void fromConfigurations(); @@ -240,5 +244,32 @@ void tst_QNetworkProxyFactory::inNetworkAccessManager() #endif //QT_NO_BEARERMANAGEMENT + +class QSPFQThread : public QThread +{ +protected: + virtual void run() + { + proxies = QNetworkProxyFactory::systemProxyForQuery(query); + } +public: + QNetworkProxyQuery query; + QList proxies; +}; + +//regression test for QTBUG-18799 +void tst_QNetworkProxyFactory::systemProxyForQueryCalledFromThread() +{ + QUrl url(QLatin1String("http://qt.nokia.com")); + QNetworkProxyQuery query(url); + QSPFQThread thread; + thread.query = query; + connect(&thread, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + thread.start(); + QTestEventLoop::instance().enterLoop(5); + QVERIFY(thread.isFinished()); + QCOMPARE(thread.proxies, QNetworkProxyFactory::systemProxyForQuery(query)); +} + QTEST_MAIN(tst_QNetworkProxyFactory) #include "tst_qnetworkproxyfactory.moc" -- cgit v1.2.3 From 939886720920f907884b8b32bf501354ed805857 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 5 May 2011 13:53:17 +0100 Subject: Skip test on MacOS due to problems with corewlan plugin Reviewed-by: Cristiano di Flora --- .../tst_qnetworkconfigurationmanager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/auto') diff --git a/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp b/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp index 33595339f2..c270eb8813 100644 --- a/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp +++ b/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp @@ -350,10 +350,13 @@ public: // regression test for QTBUG-18795 void tst_QNetworkConfigurationManager::usedInThread() { +#if defined Q_OS_MAC && !defined (QT_NO_COREWLAN) + QSKIP("QTBUG-19070 Mac CoreWlan plugin is broken", SkipAll); +#else QNCMTestThread thread; connect(&thread, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); thread.start(); - QTestEventLoop::instance().enterLoop(5); + QTestEventLoop::instance().enterLoop(100); //QTRY_VERIFY could take ~90 seconds to time out in the thread QVERIFY(thread.isFinished()); qDebug() << "prescan:" << thread.preScanConfigs.count(); qDebug() << "postscan:" << thread.configs.count(); @@ -366,6 +369,7 @@ void tst_QNetworkConfigurationManager::usedInThread() QList configs = manager.allConfigurations(); QCOMPARE(thread.configs, configs); QCOMPARE(thread.preScanConfigs, preScanConfigs); +#endif } QTEST_MAIN(tst_QNetworkConfigurationManager) -- cgit v1.2.3 From 44b7877c879faabe83310df697d1ec2f013ee8b5 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 10 May 2011 11:38:53 +0200 Subject: Respect capacity in QVector::append(). Fix a bug in QVector::append(), it should use the capacity for new size, when it is implicit shared and capacity is bigger than the new size. Autotest included. Task-number: QTBUG-11763 Reviewed-by: joao Reviewed-by: Olivier Goffart --- tests/auto/qvector/tst_qvector.cpp | 79 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qvector/tst_qvector.cpp b/tests/auto/qvector/tst_qvector.cpp index dde59d73b7..1669c24e5c 100644 --- a/tests/auto/qvector/tst_qvector.cpp +++ b/tests/auto/qvector/tst_qvector.cpp @@ -89,6 +89,8 @@ private slots: void outOfMemory(); void QTBUG6416_reserve(); + void QTBUG11763_data(); + void QTBUG11763(); void initializeList(); }; @@ -847,6 +849,83 @@ void tst_QVector::QTBUG6416_reserve() QCOMPARE(fooCtor, fooDtor); } +void tst_QVector::QTBUG11763_data() +{ + QTest::addColumn("capacity"); + QTest::addColumn("fill_size"); + QTest::addColumn("func_id"); + QTest::addColumn("result1"); + QTest::addColumn("result2"); + QTest::addColumn("result3"); + QTest::addColumn("result4"); + + int result1, result2, result3, result4; + int fill_size; + for (int i = 70; i <= 100; i += 10) { + fill_size = i - 20; + for (int j = 0; j <= 3; j++) { + if (j == 0) { // append + result1 = i; + result2 = i; + result3 = i - 19; + result4 = i - 20; + } else if (j == 1) { // insert(0) + result1 = i; + result2 = i; + result3 = i - 19; + result4 = i - 20; + } else if (j == 2) { // insert(20) + result1 = i; + result2 = i; + result3 = i - 19; + result4 = i - 20; + } else if (j == 3) { // insert(0, 10) + result1 = i; + result2 = i; + result3 = i - 10; + result4 = i - 20; + } + QTest::newRow(qPrintable(QString("QTBUG11763:%1").arg(i))) << i << fill_size << j << result1 << result2 << result3 << result4; + } + } +} + +void tst_QVector::QTBUG11763() +{ + QFETCH(int, capacity); + QFETCH(int, fill_size); + QFETCH(int, func_id); + QFETCH(int, result1); + QFETCH(int, result2); + QFETCH(int, result3); + QFETCH(int, result4); + + QVector v1; + QVector v2; + + v1.reserve(capacity); + v1.resize(0); + v1.fill(qreal(1.0), fill_size); + + v2 = v1; + + // no need to test begin() and end(), there is a detach() in them + if (func_id == 0) { + v1.append(qreal(1.0)); //push_back is same as append + } else if (func_id == 1) { + v1.insert(0, qreal(1.0)); //push_front is same as prepend, insert(0) + } else if (func_id == 2) { + v1.insert(20, qreal(1.0)); + } else if (func_id == 3) { + v1.insert(0, 10, qreal(1.0)); + } + + QCOMPARE(v1.capacity(), result1); + QCOMPARE(v2.capacity(), result2); + QCOMPARE(v1.size(), result3); + QCOMPARE(v2.size(), result4); +} + void tst_QVector::initializeList() { #ifdef Q_COMPILER_INITIALIZER_LISTS -- cgit v1.2.3 From e37d9e969189b43cd7bf289b27394171d31bf063 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Thu, 14 Apr 2011 19:12:59 +0200 Subject: Fix an race condition in the auto test. Deleting the page in the wizard without removing it first leads to a crash when the wizard tries to access a deleted page. Reviewed-by: jasplin (cherry picked from commit 3bff1637cd49617d334c1be63c20e008fac93be1) --- tests/auto/qwizard/tst_qwizard.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qwizard/tst_qwizard.cpp b/tests/auto/qwizard/tst_qwizard.cpp index a8137273ce..bbac8a3ce7 100644 --- a/tests/auto/qwizard/tst_qwizard.cpp +++ b/tests/auto/qwizard/tst_qwizard.cpp @@ -1770,8 +1770,11 @@ public: ~TestWizard() { - foreach (int id, pageIds) - delete page(id); + foreach (int id, pageIds) { + QWizardPage *page_to_delete = page(id); + removePage(id); + delete page_to_delete; + } } void applyOperations(const QList &operations) -- cgit v1.2.3 From 5edb03f8554ee05785c2a98c0c522586f49d7edd Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Fri, 15 Apr 2011 15:05:03 +0200 Subject: Fix an race condition in the auto test. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deleting the page in the wizard without removing it first leads to a crash when the wizard tries to access a deleted page. Reviewed-by: Samuel Rødal (cherry picked from commit 4024a08239c3e69bb2e0ca045ccbdf3fc900f675) --- tests/auto/qwizard/tst_qwizard.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qwizard/tst_qwizard.cpp b/tests/auto/qwizard/tst_qwizard.cpp index bbac8a3ce7..5667d4047a 100644 --- a/tests/auto/qwizard/tst_qwizard.cpp +++ b/tests/auto/qwizard/tst_qwizard.cpp @@ -2551,8 +2551,8 @@ void tst_QWizard::task177022_setFixedSize() QWizard wiz; QWizardPage page1; QWizardPage page2; - wiz.addPage(&page1); - wiz.addPage(&page2); + int page1_id = wiz.addPage(&page1); + int page2_id = wiz.addPage(&page2); wiz.setFixedSize(width, height); if (wiz.wizardStyle() == QWizard::AeroStyle) QEXPECT_FAIL("", "this probably relates to non-client area hack for AeroStyle titlebar " @@ -2579,6 +2579,8 @@ void tst_QWizard::task177022_setFixedSize() QCOMPARE(wiz.maximumWidth(), width); QCOMPARE(wiz.maximumHeight(), height); + wiz.removePage(page1_id); + wiz.removePage(page2_id); } void tst_QWizard::task248107_backButton() -- cgit v1.2.3 From 1dab1ce6af149a1a9b3cc1be7aeb7a09bfd56b19 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Mon, 2 May 2011 10:52:25 +0200 Subject: Fix the update() autotest for raster. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the CoreGraphics engine, we expect the test to fail with update(), but with the raster engine the behavior is the same across platforms. Hence we don't need a special case for Mac OS X with the raster engine. Reviewed-by: Samuel Rødal (cherry picked from commit 75d2387fbf005b022437855ab6433790372639f8) --- tests/auto/qwidget/tst_qwidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/auto') diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 35014c975a..9c2f6ea200 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -4738,7 +4738,8 @@ void tst_QWidget::update() QCOMPARE(w.visibleRegion(), expectedVisible); QCOMPARE(w.paintedRegion, expectedVisible); #ifdef QT_MAC_USE_COCOA - QEXPECT_FAIL(0, "Cocoa compositor says to paint this.", Continue); + if (QApplicationPrivate::graphics_system_name != QLatin1String("raster")) + QEXPECT_FAIL(0, "Cocoa compositor says to paint this.", Continue); #endif QCOMPARE(child.numPaintEvents, 0); -- cgit v1.2.3 From 4367928b5e39987c890ee42d1db533e581d9e5cf Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Tue, 3 May 2011 14:29:36 +0200 Subject: Fix the autotest condition. The previous preprocessor directive was aimed to exclude Mac OS X. With the raster engine, the behavior is unified and we don't need to have a separate path for Mac OS X/Cocoa. The new condition excludes only Mac OS X with a graphics system other than raster or Carbon. Reviewed-by: Jiang Jiang (cherry picked from commit 2c6af885d959f90b801c74dc5d389a720dc9fd1d) --- tests/auto/qwidget/tst_qwidget.cpp | 42 ++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 15 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 9c2f6ea200..e266efb794 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -6337,11 +6337,15 @@ void tst_QWidget::compatibilityChildInsertedEvents() expected = EventRecorder::EventList() << qMakePair(&widget, QEvent::PolishRequest) - << qMakePair(&widget, QEvent::Type(QEvent::User + 1)) -#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_S60) || defined(Q_WS_QPA) - << qMakePair(&widget, QEvent::UpdateRequest) -#endif - ; + << qMakePair(&widget, QEvent::Type(QEvent::User + 1)); + +#ifndef QT_MAC_USE_CARBON +#ifdef QT_MAC_USE_COCOA + if (QApplicationPrivate::graphics_system_name == QLatin1String("raster")) +#endif // QT_MAC_USE_COCOA + expected << qMakePair(&widget, QEvent::UpdateRequest); +#endif // !QT_MAC_USE_CARBON + QCOMPARE(spy.eventList(), expected); } @@ -6433,11 +6437,15 @@ void tst_QWidget::compatibilityChildInsertedEvents() #endif << qMakePair(&widget, QEvent::PolishRequest) << qMakePair(&widget, QEvent::Type(QEvent::User + 1)) - << qMakePair(&widget, QEvent::Type(QEvent::User + 2)) -#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_S60) || defined(Q_WS_QPA) - << qMakePair(&widget, QEvent::UpdateRequest) -#endif - ; + << qMakePair(&widget, QEvent::Type(QEvent::User + 2)); + +#ifndef QT_MAC_USE_CARBON +#ifdef QT_MAC_USE_COCOA + if (QApplicationPrivate::graphics_system_name == QLatin1String("raster")) +#endif // QT_MAC_USE_COCOA + expected << qMakePair(&widget, QEvent::UpdateRequest); +#endif // !QT_MAC_USE_CARBON + QCOMPARE(spy.eventList(), expected); } @@ -6529,11 +6537,15 @@ void tst_QWidget::compatibilityChildInsertedEvents() #endif << qMakePair(&widget, QEvent::PolishRequest) << qMakePair(&widget, QEvent::Type(QEvent::User + 1)) - << qMakePair(&widget, QEvent::Type(QEvent::User + 2)) -#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_S60) || defined(Q_WS_QPA) - << qMakePair(&widget, QEvent::UpdateRequest) -#endif - ; + << qMakePair(&widget, QEvent::Type(QEvent::User + 2)); + +#ifndef QT_MAC_USE_CARBON +#ifdef QT_MAC_USE_COCOA + if (QApplicationPrivate::graphics_system_name == QLatin1String("raster")) +#endif // QT_MAC_USE_COCOA + expected << qMakePair(&widget, QEvent::UpdateRequest); +#endif // !QT_MAC_USE_CARBON + QCOMPARE(spy.eventList(), expected); } } -- cgit v1.2.3 From 051ef6f294e8cbfa1e30e99e7fd4cf5fb38393f4 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 10 May 2011 09:43:00 +0200 Subject: Rename QGlyphs -> QGlyphRun API clean-up for QGlyphRun: 1. QGlyphs -> QGlyphRun 2. QGlyphRun's font()/setFont() -> rawFont()/setRawFont() 3. QPainter::drawGlyphs() -> drawGlyphRun() 4. QTextLayout and QTextFragment's glyphs() -> glyphRuns() Reviewed-by: Jiang Jiang (cherry picked from commit 84ef364302728b68d2d29ea9c4ccbec32c7bb115) --- tests/auto/gui.pro | 2 +- tests/auto/qglyphrun/qglyphrun.pro | 11 + tests/auto/qglyphrun/test.ttf | Bin 0 -> 3712 bytes tests/auto/qglyphrun/tst_qglyphrun.cpp | 582 +++++++++++++++++++++++++++++++++ tests/auto/qglyphs/qglyphs.pro | 11 - tests/auto/qglyphs/test.ttf | Bin 3712 -> 0 bytes tests/auto/qglyphs/tst_qglyphs.cpp | 582 --------------------------------- tests/auto/qrawfont/tst_qrawfont.cpp | 16 +- 8 files changed, 602 insertions(+), 602 deletions(-) create mode 100644 tests/auto/qglyphrun/qglyphrun.pro create mode 100644 tests/auto/qglyphrun/test.ttf create mode 100644 tests/auto/qglyphrun/tst_qglyphrun.cpp delete mode 100644 tests/auto/qglyphs/qglyphs.pro delete mode 100644 tests/auto/qglyphs/test.ttf delete mode 100644 tests/auto/qglyphs/tst_qglyphs.cpp (limited to 'tests/auto') diff --git a/tests/auto/gui.pro b/tests/auto/gui.pro index 0d77fff413..6de8ab9303 100644 --- a/tests/auto/gui.pro +++ b/tests/auto/gui.pro @@ -58,7 +58,7 @@ SUBDIRS=\ qfontdialog \ qfontmetrics \ qformlayout \ - qglyphs \ + qglyphrun \ qgraphicsanchorlayout \ qgraphicsanchorlayout1 \ qgraphicseffect \ diff --git a/tests/auto/qglyphrun/qglyphrun.pro b/tests/auto/qglyphrun/qglyphrun.pro new file mode 100644 index 0000000000..480ad5b9a4 --- /dev/null +++ b/tests/auto/qglyphrun/qglyphrun.pro @@ -0,0 +1,11 @@ +load(qttest_p4) +QT = core gui + +SOURCES += \ + tst_qglyphrun.cpp + +wince*|symbian*: { + DEFINES += SRCDIR=\\\"\\\" +} else { + DEFINES += SRCDIR=\\\"$$PWD/\\\" +} diff --git a/tests/auto/qglyphrun/test.ttf b/tests/auto/qglyphrun/test.ttf new file mode 100644 index 0000000000..9043a576ef Binary files /dev/null and b/tests/auto/qglyphrun/test.ttf differ diff --git a/tests/auto/qglyphrun/tst_qglyphrun.cpp b/tests/auto/qglyphrun/tst_qglyphrun.cpp new file mode 100644 index 0000000000..aefc228001 --- /dev/null +++ b/tests/auto/qglyphrun/tst_qglyphrun.cpp @@ -0,0 +1,582 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include +#include +#include +#include + +// #define DEBUG_SAVE_IMAGE + +class tst_QGlyphRun: public QObject +{ + Q_OBJECT + +#if !defined(QT_NO_RAWFONT) +private slots: + void initTestCase(); + void cleanupTestCase(); + + void constructionAndDestruction(); + void copyConstructor(); + void assignment(); + void equalsOperator_data(); + void equalsOperator(); + void textLayoutGlyphIndexes(); + void drawExistingGlyphs(); + void drawNonExistentGlyphs(); + void drawMultiScriptText1(); + void drawMultiScriptText2(); + void drawStruckOutText(); + void drawOverlinedText(); + void drawUnderlinedText(); + void drawRightToLeft(); + void detach(); + +private: + int m_testFontId; + QFont m_testFont; +#endif // QT_NO_RAWFONT + +}; + +#if !defined(QT_NO_RAWFONT) + +Q_DECLARE_METATYPE(QGlyphRun); + +void tst_QGlyphRun::initTestCase() +{ + m_testFontId = QFontDatabase::addApplicationFont(SRCDIR "test.ttf"); + QVERIFY(m_testFontId >= 0); + + m_testFont = QFont("QtsSpecialTestFont"); + + QCOMPARE(QFontInfo(m_testFont).family(), QString::fromLatin1("QtsSpecialTestFont")); +} + +void tst_QGlyphRun::cleanupTestCase() +{ + QFontDatabase::removeApplicationFont(m_testFontId); +} + +void tst_QGlyphRun::constructionAndDestruction() +{ + QGlyphRun glyphIndexes; +} + +static QGlyphRun make_dummy_indexes() +{ + QGlyphRun glyphs; + + QVector glyphIndexes; + QVector positions; + QFont font; + font.setPointSize(18); + + glyphIndexes.append(1); + glyphIndexes.append(2); + glyphIndexes.append(3); + + positions.append(QPointF(1, 2)); + positions.append(QPointF(3, 4)); + positions.append(QPointF(5, 6)); + + glyphs.setRawFont(QRawFont::fromFont(font)); + glyphs.setGlyphIndexes(glyphIndexes); + glyphs.setPositions(positions); + + return glyphs; +} + +void tst_QGlyphRun::copyConstructor() +{ + QGlyphRun glyphs; + + { + QVector glyphIndexes; + QVector positions; + QFont font; + font.setPointSize(18); + + glyphIndexes.append(1); + glyphIndexes.append(2); + glyphIndexes.append(3); + + positions.append(QPointF(1, 2)); + positions.append(QPointF(3, 4)); + positions.append(QPointF(5, 6)); + + glyphs.setRawFont(QRawFont::fromFont(font)); + glyphs.setGlyphIndexes(glyphIndexes); + glyphs.setPositions(positions); + } + + QGlyphRun otherGlyphs(glyphs); + QCOMPARE(otherGlyphs.rawFont(), glyphs.rawFont()); + QCOMPARE(glyphs.glyphIndexes(), otherGlyphs.glyphIndexes()); + QCOMPARE(glyphs.positions(), otherGlyphs.positions()); +} + +void tst_QGlyphRun::assignment() +{ + QGlyphRun glyphs(make_dummy_indexes()); + + QGlyphRun otherGlyphs = glyphs; + QCOMPARE(otherGlyphs.rawFont(), glyphs.rawFont()); + QCOMPARE(glyphs.glyphIndexes(), otherGlyphs.glyphIndexes()); + QCOMPARE(glyphs.positions(), otherGlyphs.positions()); +} + +void tst_QGlyphRun::equalsOperator_data() +{ + QTest::addColumn("one"); + QTest::addColumn("two"); + QTest::addColumn("equals"); + + QGlyphRun one(make_dummy_indexes()); + QGlyphRun two(make_dummy_indexes()); + + QTest::newRow("Identical") << one << two << true; + + { + QGlyphRun busted(two); + + QVector positions = busted.positions(); + positions[2] += QPointF(1, 1); + busted.setPositions(positions); + + + QTest::newRow("Different positions") << one << busted << false; + } + + { + QGlyphRun busted(two); + + QFont font; + font.setPixelSize(busted.rawFont().pixelSize() * 2); + busted.setRawFont(QRawFont::fromFont(font)); + + QTest::newRow("Different fonts") << one << busted << false; + } + + { + QGlyphRun busted(two); + + QVector glyphIndexes = busted.glyphIndexes(); + glyphIndexes[2] += 1; + busted.setGlyphIndexes(glyphIndexes); + + QTest::newRow("Different glyph indexes") << one << busted << false; + } + +} + +void tst_QGlyphRun::equalsOperator() +{ + QFETCH(QGlyphRun, one); + QFETCH(QGlyphRun, two); + QFETCH(bool, equals); + + QCOMPARE(one == two, equals); + QCOMPARE(one != two, !equals); +} + + +void tst_QGlyphRun::textLayoutGlyphIndexes() +{ + QString s; + s.append(QLatin1Char('A')); + s.append(QChar(0xe000)); + + QTextLayout layout(s); + layout.setFont(m_testFont); + layout.beginLayout(); + layout.createLine(); + layout.endLayout(); + + QList listOfGlyphs = layout.glyphRuns(); + QCOMPARE(listOfGlyphs.size(), 1); + + QGlyphRun glyphs = listOfGlyphs.at(0); + + QCOMPARE(glyphs.glyphIndexes().size(), 2); + QCOMPARE(glyphs.glyphIndexes().at(0), quint32(2)); + QCOMPARE(glyphs.glyphIndexes().at(1), quint32(1)); +} + +void tst_QGlyphRun::drawExistingGlyphs() +{ + QPixmap textLayoutDraw(1000, 1000); + QPixmap drawGlyphs(1000, 1000); + + textLayoutDraw.fill(Qt::white); + drawGlyphs.fill(Qt::white); + + QString s; + s.append(QLatin1Char('A')); + s.append(QChar(0xe000)); + + QTextLayout layout(s); + layout.setFont(m_testFont); + layout.beginLayout(); + layout.createLine(); + layout.endLayout(); + + { + QPainter p(&textLayoutDraw); + layout.draw(&p, QPointF(50, 50)); + } + + QGlyphRun glyphs = layout.glyphRuns().size() > 0 + ? layout.glyphRuns().at(0) + : QGlyphRun(); + + { + QPainter p(&drawGlyphs); + p.drawGlyphRun(QPointF(50, 50), glyphs); + } + +#if defined(DEBUG_SAVE_IMAGE) + textLayoutDraw.save("drawExistingGlyphs_textLayoutDraw.png"); + drawGlyphs.save("drawExistingGlyphs_drawGlyphIndexes.png"); +#endif + + QCOMPARE(textLayoutDraw, drawGlyphs); +} + +void tst_QGlyphRun::drawNonExistentGlyphs() +{ + QVector glyphIndexes; + glyphIndexes.append(3); + + QVector glyphPositions; + glyphPositions.append(QPointF(0, 0)); + + QGlyphRun glyphs; + glyphs.setGlyphIndexes(glyphIndexes); + glyphs.setPositions(glyphPositions); + glyphs.setRawFont(QRawFont::fromFont(m_testFont)); + + QPixmap image(1000, 1000); + image.fill(Qt::white); + + QPixmap imageBefore = image; + { + QPainter p(&image); + p.drawGlyphRun(QPointF(50, 50), glyphs); + } + +#if defined(DEBUG_SAVE_IMAGE) + image.save("drawNonExistentGlyphs.png"); +#endif + + QCOMPARE(image, imageBefore); // Should be unchanged +} + +void tst_QGlyphRun::drawMultiScriptText1() +{ + QString text; + text += QChar(0x03D0); // Greek, beta + + QTextLayout textLayout(text); + textLayout.beginLayout(); + textLayout.createLine(); + textLayout.endLayout(); + + QPixmap textLayoutDraw(1000, 1000); + textLayoutDraw.fill(Qt::white); + + QPixmap drawGlyphs(1000, 1000); + drawGlyphs.fill(Qt::white); + + QList glyphsList = textLayout.glyphRuns(); + QCOMPARE(glyphsList.size(), 1); + + { + QPainter p(&textLayoutDraw); + textLayout.draw(&p, QPointF(50, 50)); + } + + { + QPainter p(&drawGlyphs); + foreach (QGlyphRun glyphs, glyphsList) + p.drawGlyphRun(QPointF(50, 50), glyphs); + } + +#if defined(DEBUG_SAVE_IMAGE) + textLayoutDraw.save("drawMultiScriptText1_textLayoutDraw.png"); + drawGlyphs.save("drawMultiScriptText1_drawGlyphIndexes.png"); +#endif + + QCOMPARE(drawGlyphs, textLayoutDraw); +} + + +void tst_QGlyphRun::drawMultiScriptText2() +{ + QString text; + text += QChar(0x0621); // Arabic, Hamza + text += QChar(0x03D0); // Greek, beta + + QTextLayout textLayout(text); + textLayout.beginLayout(); + textLayout.createLine(); + textLayout.endLayout(); + + QPixmap textLayoutDraw(1000, 1000); + textLayoutDraw.fill(Qt::white); + + QPixmap drawGlyphs(1000, 1000); + drawGlyphs.fill(Qt::white); + + QList glyphsList = textLayout.glyphRuns(); + QCOMPARE(glyphsList.size(), 2); + + { + QPainter p(&textLayoutDraw); + textLayout.draw(&p, QPointF(50, 50)); + } + + { + QPainter p(&drawGlyphs); + foreach (QGlyphRun glyphs, glyphsList) + p.drawGlyphRun(QPointF(50, 50), glyphs); + } + +#if defined(DEBUG_SAVE_IMAGE) + textLayoutDraw.save("drawMultiScriptText2_textLayoutDraw.png"); + drawGlyphs.save("drawMultiScriptText2_drawGlyphIndexes.png"); +#endif + + QCOMPARE(drawGlyphs, textLayoutDraw); +} + +void tst_QGlyphRun::detach() +{ + QGlyphRun glyphs; + + glyphs.setGlyphIndexes(QVector() << 1 << 2 << 3); + + QGlyphRun otherGlyphs; + otherGlyphs = glyphs; + + QCOMPARE(otherGlyphs.glyphIndexes(), glyphs.glyphIndexes()); + + otherGlyphs.setGlyphIndexes(QVector() << 4 << 5 << 6); + + QCOMPARE(otherGlyphs.glyphIndexes(), QVector() << 4 << 5 << 6); + QCOMPARE(glyphs.glyphIndexes(), QVector() << 1 << 2 << 3); +} + +void tst_QGlyphRun::drawStruckOutText() +{ + QPixmap textLayoutDraw(1000, 1000); + QPixmap drawGlyphs(1000, 1000); + + textLayoutDraw.fill(Qt::white); + drawGlyphs.fill(Qt::white); + + QString s = QString::fromLatin1("Foobar"); + + QFont font; + font.setStrikeOut(true); + + QTextLayout layout(s); + layout.setFont(font); + layout.beginLayout(); + layout.createLine(); + layout.endLayout(); + + { + QPainter p(&textLayoutDraw); + layout.draw(&p, QPointF(50, 50)); + } + + QGlyphRun glyphs = layout.glyphRuns().size() > 0 + ? layout.glyphRuns().at(0) + : QGlyphRun(); + + { + QPainter p(&drawGlyphs); + p.drawGlyphRun(QPointF(50, 50), glyphs); + } + +#if defined(DEBUG_SAVE_IMAGE) + textLayoutDraw.save("drawStruckOutText_textLayoutDraw.png"); + drawGlyphs.save("drawStruckOutText_drawGlyphIndexes.png"); +#endif + + QCOMPARE(textLayoutDraw, drawGlyphs); +} + +void tst_QGlyphRun::drawOverlinedText() +{ + QPixmap textLayoutDraw(1000, 1000); + QPixmap drawGlyphs(1000, 1000); + + textLayoutDraw.fill(Qt::white); + drawGlyphs.fill(Qt::white); + + QString s = QString::fromLatin1("Foobar"); + + QFont font; + font.setOverline(true); + + QTextLayout layout(s); + layout.setFont(font); + layout.beginLayout(); + layout.createLine(); + layout.endLayout(); + + { + QPainter p(&textLayoutDraw); + layout.draw(&p, QPointF(50, 50)); + } + + QGlyphRun glyphs = layout.glyphRuns().size() > 0 + ? layout.glyphRuns().at(0) + : QGlyphRun(); + + { + QPainter p(&drawGlyphs); + p.drawGlyphRun(QPointF(50, 50), glyphs); + } + +#if defined(DEBUG_SAVE_IMAGE) + textLayoutDraw.save("drawOverlineText_textLayoutDraw.png"); + drawGlyphs.save("drawOverlineText_drawGlyphIndexes.png"); +#endif + + QCOMPARE(textLayoutDraw, drawGlyphs); +} + +void tst_QGlyphRun::drawUnderlinedText() +{ + QPixmap textLayoutDraw(1000, 1000); + QPixmap drawGlyphs(1000, 1000); + + textLayoutDraw.fill(Qt::white); + drawGlyphs.fill(Qt::white); + + QString s = QString::fromLatin1("Foobar"); + + QFont font; + font.setUnderline(true); + + QTextLayout layout(s); + layout.setFont(font); + layout.beginLayout(); + layout.createLine(); + layout.endLayout(); + + { + QPainter p(&textLayoutDraw); + layout.draw(&p, QPointF(50, 50)); + } + + QGlyphRun glyphs = layout.glyphRuns().size() > 0 + ? layout.glyphRuns().at(0) + : QGlyphRun(); + + { + QPainter p(&drawGlyphs); + p.drawGlyphRun(QPointF(50, 50), glyphs); + } + +#if defined(DEBUG_SAVE_IMAGE) + textLayoutDraw.save("drawUnderlineText_textLayoutDraw.png"); + drawGlyphs.save("drawUnderlineText_drawGlyphIndexes.png"); +#endif + + QCOMPARE(textLayoutDraw, drawGlyphs); +} + +void tst_QGlyphRun::drawRightToLeft() +{ + QString s; + s.append(QChar(1575)); + s.append(QChar(1578)); + + QPixmap textLayoutDraw(1000, 1000); + QPixmap drawGlyphs(1000, 1000); + + textLayoutDraw.fill(Qt::white); + drawGlyphs.fill(Qt::white); + + QFont font; + font.setUnderline(true); + + QTextLayout layout(s); + layout.setFont(font); + layout.beginLayout(); + layout.createLine(); + layout.endLayout(); + + { + QPainter p(&textLayoutDraw); + layout.draw(&p, QPointF(50, 50)); + } + + QGlyphRun glyphs = layout.glyphRuns().size() > 0 + ? layout.glyphRuns().at(0) + : QGlyphRun(); + + { + QPainter p(&drawGlyphs); + p.drawGlyphRun(QPointF(50, 50), glyphs); + } + +#if defined(DEBUG_SAVE_IMAGE) + textLayoutDraw.save("drawRightToLeft_textLayoutDraw.png"); + drawGlyphs.save("drawRightToLeft_drawGlyphIndexes.png"); +#endif + + QCOMPARE(textLayoutDraw, drawGlyphs); + +} + +#endif // QT_NO_RAWFONT + +QTEST_MAIN(tst_QGlyphRun) +#include "tst_qglyphrun.moc" + diff --git a/tests/auto/qglyphs/qglyphs.pro b/tests/auto/qglyphs/qglyphs.pro deleted file mode 100644 index 5084cf9908..0000000000 --- a/tests/auto/qglyphs/qglyphs.pro +++ /dev/null @@ -1,11 +0,0 @@ -load(qttest_p4) -QT = core gui - -SOURCES += \ - tst_qglyphs.cpp - -wince*|symbian*: { - DEFINES += SRCDIR=\\\"\\\" -} else { - DEFINES += SRCDIR=\\\"$$PWD/\\\" -} \ No newline at end of file diff --git a/tests/auto/qglyphs/test.ttf b/tests/auto/qglyphs/test.ttf deleted file mode 100644 index 9043a576ef..0000000000 Binary files a/tests/auto/qglyphs/test.ttf and /dev/null differ diff --git a/tests/auto/qglyphs/tst_qglyphs.cpp b/tests/auto/qglyphs/tst_qglyphs.cpp deleted file mode 100644 index ffa0d002c3..0000000000 --- a/tests/auto/qglyphs/tst_qglyphs.cpp +++ /dev/null @@ -1,582 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include -#include -#include -#include - -// #define DEBUG_SAVE_IMAGE - -class tst_QGlyphs: public QObject -{ - Q_OBJECT - -#if !defined(QT_NO_RAWFONT) -private slots: - void initTestCase(); - void cleanupTestCase(); - - void constructionAndDestruction(); - void copyConstructor(); - void assignment(); - void equalsOperator_data(); - void equalsOperator(); - void textLayoutGlyphIndexes(); - void drawExistingGlyphs(); - void drawNonExistentGlyphs(); - void drawMultiScriptText1(); - void drawMultiScriptText2(); - void drawStruckOutText(); - void drawOverlinedText(); - void drawUnderlinedText(); - void drawRightToLeft(); - void detach(); - -private: - int m_testFontId; - QFont m_testFont; -#endif // QT_NO_RAWFONT - -}; - -#if !defined(QT_NO_RAWFONT) - -Q_DECLARE_METATYPE(QGlyphs); - -void tst_QGlyphs::initTestCase() -{ - m_testFontId = QFontDatabase::addApplicationFont(SRCDIR "test.ttf"); - QVERIFY(m_testFontId >= 0); - - m_testFont = QFont("QtsSpecialTestFont"); - - QCOMPARE(QFontInfo(m_testFont).family(), QString::fromLatin1("QtsSpecialTestFont")); -} - -void tst_QGlyphs::cleanupTestCase() -{ - QFontDatabase::removeApplicationFont(m_testFontId); -} - -void tst_QGlyphs::constructionAndDestruction() -{ - QGlyphs glyphIndexes; -} - -static QGlyphs make_dummy_indexes() -{ - QGlyphs glyphs; - - QVector glyphIndexes; - QVector positions; - QFont font; - font.setPointSize(18); - - glyphIndexes.append(1); - glyphIndexes.append(2); - glyphIndexes.append(3); - - positions.append(QPointF(1, 2)); - positions.append(QPointF(3, 4)); - positions.append(QPointF(5, 6)); - - glyphs.setFont(QRawFont::fromFont(font)); - glyphs.setGlyphIndexes(glyphIndexes); - glyphs.setPositions(positions); - - return glyphs; -} - -void tst_QGlyphs::copyConstructor() -{ - QGlyphs glyphs; - - { - QVector glyphIndexes; - QVector positions; - QFont font; - font.setPointSize(18); - - glyphIndexes.append(1); - glyphIndexes.append(2); - glyphIndexes.append(3); - - positions.append(QPointF(1, 2)); - positions.append(QPointF(3, 4)); - positions.append(QPointF(5, 6)); - - glyphs.setFont(QRawFont::fromFont(font)); - glyphs.setGlyphIndexes(glyphIndexes); - glyphs.setPositions(positions); - } - - QGlyphs otherGlyphs(glyphs); - QCOMPARE(otherGlyphs.font(), glyphs.font()); - QCOMPARE(glyphs.glyphIndexes(), otherGlyphs.glyphIndexes()); - QCOMPARE(glyphs.positions(), otherGlyphs.positions()); -} - -void tst_QGlyphs::assignment() -{ - QGlyphs glyphs(make_dummy_indexes()); - - QGlyphs otherGlyphs = glyphs; - QCOMPARE(otherGlyphs.font(), glyphs.font()); - QCOMPARE(glyphs.glyphIndexes(), otherGlyphs.glyphIndexes()); - QCOMPARE(glyphs.positions(), otherGlyphs.positions()); -} - -void tst_QGlyphs::equalsOperator_data() -{ - QTest::addColumn("one"); - QTest::addColumn("two"); - QTest::addColumn("equals"); - - QGlyphs one(make_dummy_indexes()); - QGlyphs two(make_dummy_indexes()); - - QTest::newRow("Identical") << one << two << true; - - { - QGlyphs busted(two); - - QVector positions = busted.positions(); - positions[2] += QPointF(1, 1); - busted.setPositions(positions); - - - QTest::newRow("Different positions") << one << busted << false; - } - - { - QGlyphs busted(two); - - QFont font; - font.setPixelSize(busted.font().pixelSize() * 2); - busted.setFont(QRawFont::fromFont(font)); - - QTest::newRow("Different fonts") << one << busted << false; - } - - { - QGlyphs busted(two); - - QVector glyphIndexes = busted.glyphIndexes(); - glyphIndexes[2] += 1; - busted.setGlyphIndexes(glyphIndexes); - - QTest::newRow("Different glyph indexes") << one << busted << false; - } - -} - -void tst_QGlyphs::equalsOperator() -{ - QFETCH(QGlyphs, one); - QFETCH(QGlyphs, two); - QFETCH(bool, equals); - - QCOMPARE(one == two, equals); - QCOMPARE(one != two, !equals); -} - - -void tst_QGlyphs::textLayoutGlyphIndexes() -{ - QString s; - s.append(QLatin1Char('A')); - s.append(QChar(0xe000)); - - QTextLayout layout(s); - layout.setFont(m_testFont); - layout.beginLayout(); - layout.createLine(); - layout.endLayout(); - - QList listOfGlyphs = layout.glyphs(); - QCOMPARE(listOfGlyphs.size(), 1); - - QGlyphs glyphs = listOfGlyphs.at(0); - - QCOMPARE(glyphs.glyphIndexes().size(), 2); - QCOMPARE(glyphs.glyphIndexes().at(0), quint32(2)); - QCOMPARE(glyphs.glyphIndexes().at(1), quint32(1)); -} - -void tst_QGlyphs::drawExistingGlyphs() -{ - QPixmap textLayoutDraw(1000, 1000); - QPixmap drawGlyphs(1000, 1000); - - textLayoutDraw.fill(Qt::white); - drawGlyphs.fill(Qt::white); - - QString s; - s.append(QLatin1Char('A')); - s.append(QChar(0xe000)); - - QTextLayout layout(s); - layout.setFont(m_testFont); - layout.beginLayout(); - layout.createLine(); - layout.endLayout(); - - { - QPainter p(&textLayoutDraw); - layout.draw(&p, QPointF(50, 50)); - } - - QGlyphs glyphs = layout.glyphs().size() > 0 - ? layout.glyphs().at(0) - : QGlyphs(); - - { - QPainter p(&drawGlyphs); - p.drawGlyphs(QPointF(50, 50), glyphs); - } - -#if defined(DEBUG_SAVE_IMAGE) - textLayoutDraw.save("drawExistingGlyphs_textLayoutDraw.png"); - drawGlyphs.save("drawExistingGlyphs_drawGlyphIndexes.png"); -#endif - - QCOMPARE(textLayoutDraw, drawGlyphs); -} - -void tst_QGlyphs::drawNonExistentGlyphs() -{ - QVector glyphIndexes; - glyphIndexes.append(3); - - QVector glyphPositions; - glyphPositions.append(QPointF(0, 0)); - - QGlyphs glyphs; - glyphs.setGlyphIndexes(glyphIndexes); - glyphs.setPositions(glyphPositions); - glyphs.setFont(QRawFont::fromFont(m_testFont)); - - QPixmap image(1000, 1000); - image.fill(Qt::white); - - QPixmap imageBefore = image; - { - QPainter p(&image); - p.drawGlyphs(QPointF(50, 50), glyphs); - } - -#if defined(DEBUG_SAVE_IMAGE) - image.save("drawNonExistentGlyphs.png"); -#endif - - QCOMPARE(image, imageBefore); // Should be unchanged -} - -void tst_QGlyphs::drawMultiScriptText1() -{ - QString text; - text += QChar(0x03D0); // Greek, beta - - QTextLayout textLayout(text); - textLayout.beginLayout(); - textLayout.createLine(); - textLayout.endLayout(); - - QPixmap textLayoutDraw(1000, 1000); - textLayoutDraw.fill(Qt::white); - - QPixmap drawGlyphs(1000, 1000); - drawGlyphs.fill(Qt::white); - - QList glyphsList = textLayout.glyphs(); - QCOMPARE(glyphsList.size(), 1); - - { - QPainter p(&textLayoutDraw); - textLayout.draw(&p, QPointF(50, 50)); - } - - { - QPainter p(&drawGlyphs); - foreach (QGlyphs glyphs, glyphsList) - p.drawGlyphs(QPointF(50, 50), glyphs); - } - -#if defined(DEBUG_SAVE_IMAGE) - textLayoutDraw.save("drawMultiScriptText1_textLayoutDraw.png"); - drawGlyphs.save("drawMultiScriptText1_drawGlyphIndexes.png"); -#endif - - QCOMPARE(drawGlyphs, textLayoutDraw); -} - - -void tst_QGlyphs::drawMultiScriptText2() -{ - QString text; - text += QChar(0x0621); // Arabic, Hamza - text += QChar(0x03D0); // Greek, beta - - QTextLayout textLayout(text); - textLayout.beginLayout(); - textLayout.createLine(); - textLayout.endLayout(); - - QPixmap textLayoutDraw(1000, 1000); - textLayoutDraw.fill(Qt::white); - - QPixmap drawGlyphs(1000, 1000); - drawGlyphs.fill(Qt::white); - - QList glyphsList = textLayout.glyphs(); - QCOMPARE(glyphsList.size(), 2); - - { - QPainter p(&textLayoutDraw); - textLayout.draw(&p, QPointF(50, 50)); - } - - { - QPainter p(&drawGlyphs); - foreach (QGlyphs glyphs, glyphsList) - p.drawGlyphs(QPointF(50, 50), glyphs); - } - -#if defined(DEBUG_SAVE_IMAGE) - textLayoutDraw.save("drawMultiScriptText2_textLayoutDraw.png"); - drawGlyphs.save("drawMultiScriptText2_drawGlyphIndexes.png"); -#endif - - QCOMPARE(drawGlyphs, textLayoutDraw); -} - -void tst_QGlyphs::detach() -{ - QGlyphs glyphs; - - glyphs.setGlyphIndexes(QVector() << 1 << 2 << 3); - - QGlyphs otherGlyphs; - otherGlyphs = glyphs; - - QCOMPARE(otherGlyphs.glyphIndexes(), glyphs.glyphIndexes()); - - otherGlyphs.setGlyphIndexes(QVector() << 4 << 5 << 6); - - QCOMPARE(otherGlyphs.glyphIndexes(), QVector() << 4 << 5 << 6); - QCOMPARE(glyphs.glyphIndexes(), QVector() << 1 << 2 << 3); -} - -void tst_QGlyphs::drawStruckOutText() -{ - QPixmap textLayoutDraw(1000, 1000); - QPixmap drawGlyphs(1000, 1000); - - textLayoutDraw.fill(Qt::white); - drawGlyphs.fill(Qt::white); - - QString s = QString::fromLatin1("Foobar"); - - QFont font; - font.setStrikeOut(true); - - QTextLayout layout(s); - layout.setFont(font); - layout.beginLayout(); - layout.createLine(); - layout.endLayout(); - - { - QPainter p(&textLayoutDraw); - layout.draw(&p, QPointF(50, 50)); - } - - QGlyphs glyphs = layout.glyphs().size() > 0 - ? layout.glyphs().at(0) - : QGlyphs(); - - { - QPainter p(&drawGlyphs); - p.drawGlyphs(QPointF(50, 50), glyphs); - } - -#if defined(DEBUG_SAVE_IMAGE) - textLayoutDraw.save("drawStruckOutText_textLayoutDraw.png"); - drawGlyphs.save("drawStruckOutText_drawGlyphIndexes.png"); -#endif - - QCOMPARE(textLayoutDraw, drawGlyphs); -} - -void tst_QGlyphs::drawOverlinedText() -{ - QPixmap textLayoutDraw(1000, 1000); - QPixmap drawGlyphs(1000, 1000); - - textLayoutDraw.fill(Qt::white); - drawGlyphs.fill(Qt::white); - - QString s = QString::fromLatin1("Foobar"); - - QFont font; - font.setOverline(true); - - QTextLayout layout(s); - layout.setFont(font); - layout.beginLayout(); - layout.createLine(); - layout.endLayout(); - - { - QPainter p(&textLayoutDraw); - layout.draw(&p, QPointF(50, 50)); - } - - QGlyphs glyphs = layout.glyphs().size() > 0 - ? layout.glyphs().at(0) - : QGlyphs(); - - { - QPainter p(&drawGlyphs); - p.drawGlyphs(QPointF(50, 50), glyphs); - } - -#if defined(DEBUG_SAVE_IMAGE) - textLayoutDraw.save("drawOverlineText_textLayoutDraw.png"); - drawGlyphs.save("drawOverlineText_drawGlyphIndexes.png"); -#endif - - QCOMPARE(textLayoutDraw, drawGlyphs); -} - -void tst_QGlyphs::drawUnderlinedText() -{ - QPixmap textLayoutDraw(1000, 1000); - QPixmap drawGlyphs(1000, 1000); - - textLayoutDraw.fill(Qt::white); - drawGlyphs.fill(Qt::white); - - QString s = QString::fromLatin1("Foobar"); - - QFont font; - font.setUnderline(true); - - QTextLayout layout(s); - layout.setFont(font); - layout.beginLayout(); - layout.createLine(); - layout.endLayout(); - - { - QPainter p(&textLayoutDraw); - layout.draw(&p, QPointF(50, 50)); - } - - QGlyphs glyphs = layout.glyphs().size() > 0 - ? layout.glyphs().at(0) - : QGlyphs(); - - { - QPainter p(&drawGlyphs); - p.drawGlyphs(QPointF(50, 50), glyphs); - } - -#if defined(DEBUG_SAVE_IMAGE) - textLayoutDraw.save("drawUnderlineText_textLayoutDraw.png"); - drawGlyphs.save("drawUnderlineText_drawGlyphIndexes.png"); -#endif - - QCOMPARE(textLayoutDraw, drawGlyphs); -} - -void tst_QGlyphs::drawRightToLeft() -{ - QString s; - s.append(QChar(1575)); - s.append(QChar(1578)); - - QPixmap textLayoutDraw(1000, 1000); - QPixmap drawGlyphs(1000, 1000); - - textLayoutDraw.fill(Qt::white); - drawGlyphs.fill(Qt::white); - - QFont font; - font.setUnderline(true); - - QTextLayout layout(s); - layout.setFont(font); - layout.beginLayout(); - layout.createLine(); - layout.endLayout(); - - { - QPainter p(&textLayoutDraw); - layout.draw(&p, QPointF(50, 50)); - } - - QGlyphs glyphs = layout.glyphs().size() > 0 - ? layout.glyphs().at(0) - : QGlyphs(); - - { - QPainter p(&drawGlyphs); - p.drawGlyphs(QPointF(50, 50), glyphs); - } - -#if defined(DEBUG_SAVE_IMAGE) - textLayoutDraw.save("drawRightToLeft_textLayoutDraw.png"); - drawGlyphs.save("drawRightToLeft_drawGlyphIndexes.png"); -#endif - - QCOMPARE(textLayoutDraw, drawGlyphs); - -} - -#endif // QT_NO_RAWFONT - -QTEST_MAIN(tst_QGlyphs) -#include "tst_qglyphs.moc" - diff --git a/tests/auto/qrawfont/tst_qrawfont.cpp b/tests/auto/qrawfont/tst_qrawfont.cpp index ad16a9a75b..cf46471033 100644 --- a/tests/auto/qrawfont/tst_qrawfont.cpp +++ b/tests/auto/qrawfont/tst_qrawfont.cpp @@ -296,12 +296,12 @@ void tst_QRawFont::textLayout() layout.createLine(); layout.endLayout(); - QList glyphss = layout.glyphs(); - QCOMPARE(glyphss.size(), 1); + QList glyphRuns = layout.glyphRuns(); + QCOMPARE(glyphRuns.size(), 1); - QGlyphs glyphs = glyphss.at(0); + QGlyphRun glyphs = glyphRuns.at(0); - QRawFont rawFont = glyphs.font(); + QRawFont rawFont = glyphs.rawFont(); QVERIFY(rawFont.isValid()); QCOMPARE(rawFont.familyName(), familyName); QCOMPARE(rawFont.pixelSize(), 18.0); @@ -795,11 +795,11 @@ void tst_QRawFont::unsupportedWritingSystem() layout.createLine(); layout.endLayout(); - QList glyphss = layout.glyphs(); - QCOMPARE(glyphss.size(), 1); + QList glyphRuns = layout.glyphRuns(); + QCOMPARE(glyphRuns.size(), 1); - QGlyphs glyphs = glyphss.at(0); - QRawFont layoutFont = glyphs.font(); + QGlyphRun glyphs = glyphRuns.at(0); + QRawFont layoutFont = glyphs.rawFont(); QVERIFY(layoutFont.familyName() != QString::fromLatin1("QtBidiTestFont")); QCOMPARE(layoutFont.pixelSize(), 12.0); -- cgit v1.2.3 From 3880eee2d0e9f116c0ee4bde1dc8c1c8acaaae1e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 12 Dec 2010 22:11:23 +0100 Subject: Use the virtual API to clear a selection. Reviewed-by: Gabriel de Dietrich Merge-request: 980 (cherry picked from commit e3cd651d92a9e550fe52360d1be6ae41d0f2ab85) --- .../tst_qitemselectionmodel.cpp | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp index 6e20fb23c4..d91b068c5f 100644 --- a/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp +++ b/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp @@ -101,6 +101,7 @@ private slots: void testDifferentModels(); void testValidRangesInSelectionsAfterReset(); + void testChainedSelectionClear(); private: QAbstractItemModel *model; @@ -2655,5 +2656,58 @@ void tst_QItemSelectionModel::testValidRangesInSelectionsAfterReset() model.setStringList(strings); } +class DuplicateItemSelectionModel : public QItemSelectionModel +{ + Q_OBJECT +public: + DuplicateItemSelectionModel(QItemSelectionModel *target, QAbstractItemModel *model, QObject *parent = 0) + : QItemSelectionModel(model, parent), m_target(target) + { + + } + + void select(const QItemSelection &selection, QItemSelectionModel::SelectionFlags command) + { + QItemSelectionModel::select(selection, command); + m_target->select(selection, command); + } + + using QItemSelectionModel::select; + +private: + QItemSelectionModel *m_target; + +}; + +void tst_QItemSelectionModel::testChainedSelectionClear() +{ + QStringListModel model(QStringList() << "Apples" << "Pears"); + + QItemSelectionModel selectionModel(&model, 0); + DuplicateItemSelectionModel duplicate(&selectionModel, &model, 0); + + duplicate.select(model.index(0, 0), QItemSelectionModel::Select); + + { + QModelIndexList selectedIndexes = selectionModel.selection().indexes(); + QModelIndexList duplicatedIndexes = duplicate.selection().indexes(); + + QVERIFY(selectedIndexes.size() == duplicatedIndexes.size()); + QVERIFY(selectedIndexes.size() == 1); + QVERIFY(selectedIndexes.first() == model.index(0, 0)); + } + + duplicate.clearSelection(); + + { + QModelIndexList selectedIndexes = selectionModel.selection().indexes(); + QModelIndexList duplicatedIndexes = duplicate.selection().indexes(); + + QVERIFY(selectedIndexes.size() == duplicatedIndexes.size()); + QVERIFY(selectedIndexes.size() == 0); + } + +} + QTEST_MAIN(tst_QItemSelectionModel) #include "tst_qitemselectionmodel.moc" -- cgit v1.2.3 From 74060f05d1821bb6150511f861a33214acb36f37 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 22 Mar 2011 14:32:02 +0100 Subject: Unit test for characterRect in Accessible TextInterface. (cherry picked from commit 8888cef411ce1d1fc898970429e951f9ef623b0e) --- tests/auto/qaccessibility/tst_qaccessibility.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp index 8d9603b6d7..72254bed74 100644 --- a/tests/auto/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp @@ -2679,6 +2679,11 @@ void tst_QAccessibility::textEditTest() QCOMPARE(iface->text(QAccessible::Value, 4), QString("hello world")); QCOMPARE(iface->text(QAccessible::Value, 5), QString("how are you today?")); QCOMPARE(iface->text(QAccessible::Value, 6), QString()); + QCOMPARE(iface->textInterface()->characterCount(), 31); + QFontMetrics fm(edit.font()); + QCOMPARE(iface->textInterface()->characterRect(0, QAccessible2::RelativeToParent).size(), QSize(fm.width("h"), fm.height())); + QCOMPARE(iface->textInterface()->characterRect(5, QAccessible2::RelativeToParent).size(), QSize(fm.width(" "), fm.height())); + QCOMPARE(iface->textInterface()->characterRect(6, QAccessible2::RelativeToParent).size(), QSize(fm.width("w"), fm.height())); } QTestAccessibility::clearEvents(); #else -- cgit v1.2.3 From 8f5b2faaaca3fd108cccc2db03ff0851221066f2 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 17 Feb 2011 19:56:30 +0100 Subject: Call QAccessible::updateAccessibility when changing accessible name. Reviewed-by: Jan-Arve (cherry picked from commit e783275cfb71e7325472b3aea54e109a7a854bf7) --- tests/auto/qaccessibility/tst_qaccessibility.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp index 72254bed74..f82502eec9 100644 --- a/tests/auto/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp @@ -479,6 +479,11 @@ void tst_QAccessibility::eventTest() QVERIFY_EVENT(button, 0, QAccessible::StateChanged); QVERIFY_EVENT(button, 0, QAccessible::StateChanged); + button->setAccessibleName("Olaf the second"); + QVERIFY_EVENT(button, 0, QAccessible::NameChanged); + button->setAccessibleDescription("This is a button labeled Olaf"); + QVERIFY_EVENT(button, 0, QAccessible::DescriptionChanged); + button->hide(); QVERIFY_EVENT(button, 0, QAccessible::ObjectHide); -- cgit v1.2.3 From a5e191de57a86e6cf2d5836f2cc950046bfdabe9 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 17 Feb 2011 15:37:43 +0100 Subject: Window and Application fixes for accessibility. Return app name instead of window title for root accessibility object. Return Window as accessible type for the main window. Reviewed-by: Jan-Arve (cherry picked from commit 9a5b0d7a579572cd7e7faf869ab1a6684800f592) --- tests/auto/qaccessibility/tst_qaccessibility.cpp | 37 ++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp index f82502eec9..6a35843ed1 100644 --- a/tests/auto/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp @@ -245,6 +245,8 @@ private slots: void actionText(); void doAction(); + void applicationTest(); + void mainWindowTest(); void buttonTest(); void sliderTest(); void scrollBarTest(); @@ -1826,6 +1828,41 @@ void tst_QAccessibility::doAction() #endif } +void tst_QAccessibility::applicationTest() +{ +#ifdef QTEST_ACCESSIBILITY + QLatin1String name = QLatin1String("My Name"); + qApp->setApplicationName(name); + QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(qApp); + QCOMPARE(interface->text(QAccessible::Name, 0), name); + QCOMPARE(interface->role(0), QAccessible::Application); + delete interface; +#else + QSKIP("Test needs accessibility support.", SkipAll); +#endif +} + +void tst_QAccessibility::mainWindowTest() +{ +#ifdef QTEST_ACCESSIBILITY + QMainWindow mw; + mw.resize(300, 200); + mw.show(); // triggers layout + + QLatin1String name = QLatin1String("I am the main window"); + mw.setWindowTitle(name); + QTest::qWaitForWindowShown(&mw); + + QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(&mw); + QCOMPARE(interface->text(QAccessible::Name, 0), name); + QCOMPARE(interface->role(0), QAccessible::Window); + delete interface; + +#else + QSKIP("Test needs accessibility support.", SkipAll); +#endif +} + void tst_QAccessibility::buttonTest() { //#ifdef QTEST_ACCESSIBILITY -- cgit v1.2.3 From d27fb341ec55121b48ac0ac6ece8214dc9b99e64 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Mon, 14 Mar 2011 18:57:27 +0100 Subject: Fix text for checkable buttons, unit tests. Return Check/Uncheck for checkable buttons. Partially revive the buttons unit test. Reviewed-by: Jan-Arve (cherry picked from commit 6040eeebfb1ab3be3906295c373033cd5b5d9dc3) --- tests/auto/qaccessibility/tst_qaccessibility.cpp | 290 ++++++++++++----------- 1 file changed, 158 insertions(+), 132 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp index 6a35843ed1..64bd879293 100644 --- a/tests/auto/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp @@ -1863,49 +1863,67 @@ void tst_QAccessibility::mainWindowTest() #endif } +class CounterButton : public QPushButton { + Q_OBJECT +public: + CounterButton(const QString& name, QWidget* parent) + : QPushButton(name, parent), clickCount(0) + { + connect(this, SIGNAL(clicked(bool)), SLOT(incClickCount())); + } + int clickCount; +public Q_SLOTS: + void incClickCount() { + ++clickCount; + } +}; + void tst_QAccessibility::buttonTest() { -//#ifdef QTEST_ACCESSIBILITY -#if 0 +#ifdef QTEST_ACCESSIBILITY QAccessibleInterface *test = 0; - Q3VBox vbox; + + QWidget window; + window.setLayout(new QVBoxLayout); // Standard push button - QPushButton pushButton("Ok", &vbox); + CounterButton pushButton("Ok", &window); // toggle push button - QPushButton togglepush("Toggle", &vbox); - togglepush.setToggleButton(TRUE); + QPushButton togglepush("Toggle", &window); + togglepush.setToggleButton(true); - // push button with a menu - QPushButton menuButton("Menu", &vbox); - Q3PopupMenu buttonMenu(&menuButton); - buttonMenu.insertItem("Some item"); - menuButton.setPopup(&buttonMenu); // standard checkbox - QCheckBox checkBox("Check me!", &vbox); + QCheckBox checkBox("Check me!", &window); // tristate checkbox - QCheckBox tristate("Tristate!", &vbox); + QCheckBox tristate("Tristate!", &window); tristate.setTristate(TRUE); // radiobutton - QRadioButton radio("Radio me!", &vbox); + QRadioButton radio("Radio me!", &window); // standard toolbutton - QToolButton toolbutton(&vbox); + QToolButton toolbutton(&window); toolbutton.setText("Tool"); toolbutton.setMinimumSize(20,20); // standard toolbutton - QToolButton toggletool(&vbox); + QToolButton toggletool(&window); toggletool.setToggleButton(TRUE); toggletool.setText("Toggle"); toggletool.setMinimumSize(20,20); +#ifdef QT3_SUPPORT + // push button with a menu + QPushButton menuButton("Menu", &window); + Q3PopupMenu buttonMenu(&menuButton); + buttonMenu.insertItem("Some item"); + menuButton.setPopup(&buttonMenu); + // menu toolbutton - QToolButton menuToolButton(&vbox); + QToolButton menuToolButton(&window); menuToolButton.setText("Menu Tool"); Q3PopupMenu toolMenu(&menuToolButton); toolMenu.insertItem("Some item"); @@ -1913,141 +1931,149 @@ void tst_QAccessibility::buttonTest() menuToolButton.setMinimumSize(20,20); // splitted menu toolbutton - QToolButton splitToolButton(&vbox); + QToolButton splitToolButton(&window); splitToolButton.setTextLabel("Split Tool"); Q3PopupMenu splitMenu(&splitToolButton); splitMenu.insertItem("Some item"); splitToolButton.setPopup(&splitMenu); splitToolButton.setPopupDelay(0); splitToolButton.setMinimumSize(20,20); +#endif // test push button - QVERIFY(QAccessible::queryAccessibleInterface(&pushButton, &test)); - QCOMPARE(test->role(0), QAccessible::PushButton); - QCOMPARE(test->defaultAction(0), QAccessible::Press); - QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Press")); - QCOMPARE(test->state(0), (int)QAccessible::Normal); - pushButton.setDown(TRUE); - QCOMPARE(test->state(0), (int)QAccessible::Pressed); - QVERIFY(test->doAction(QAccessible::Press, 0)); + QAccessibleInterface* interface = QAccessible::queryAccessibleInterface(&pushButton); + QAccessibleActionInterface* actionInterface = interface->actionInterface(); + QVERIFY(actionInterface != 0); + + QCOMPARE(interface->role(0), QAccessible::PushButton); + + // currently our buttons only have click as action, press and release are missing + QCOMPARE(actionInterface->actionCount(), 1); + QCOMPARE(actionInterface->name(0), QString("Click")); + QCOMPARE(pushButton.clickCount, 0); + actionInterface->doAction(0); QTest::qWait(500); - QCOMPARE(test->state(0), (int)QAccessible::Normal); - test->release(); - - // test toggle push button - QVERIFY(QAccessible::queryAccessibleInterface(&togglepush, &test)); - QCOMPARE(test->role(0), QAccessible::CheckBox); - QCOMPARE(test->defaultAction(0), QAccessible::Press); - QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Check")); - QCOMPARE(test->state(0), (int)QAccessible::Normal); - QVERIFY(test->doAction(QAccessible::Press, 0)); + QCOMPARE(pushButton.clickCount, 1); + delete interface; + + // test toggle button + interface = QAccessible::queryAccessibleInterface(&togglepush); + actionInterface = interface->actionInterface(); + QCOMPARE(interface->role(0), QAccessible::CheckBox); + QCOMPARE(actionInterface->description(0), QString("Toggles the button.")); + QCOMPARE(actionInterface->name(0), QString("Check")); + QVERIFY(!togglepush.isChecked()); + QVERIFY((interface->state(0) & QAccessible::Checked) == 0); + actionInterface->doAction(0); QTest::qWait(500); - QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Uncheck")); - QCOMPARE(test->state(0), (int)QAccessible::Checked); - test->release(); - - // test menu push button - QVERIFY(QAccessible::queryAccessibleInterface(&menuButton, &test)); - QCOMPARE(test->role(0), QAccessible::ButtonMenu); - QCOMPARE(test->defaultAction(0), QAccessible::Press); - QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Open")); - QCOMPARE(test->state(0), (int)QAccessible::HasPopup); - test->release(); + QCOMPARE(actionInterface->name(0), QString("Uncheck")); + QVERIFY(togglepush.isChecked()); + QVERIFY((interface->state(0) & QAccessible::Checked)); + delete interface; + +// // test menu push button +// QVERIFY(QAccessible::queryAccessibleInterface(&menuButton, &test)); +// QCOMPARE(test->role(0), QAccessible::ButtonMenu); +// QCOMPARE(test->defaultAction(0), QAccessible::Press); +// QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Open")); +// QCOMPARE(test->state(0), (int)QAccessible::HasPopup); +// test->release(); // test check box - QVERIFY(QAccessible::queryAccessibleInterface(&checkBox, &test)); - QCOMPARE(test->role(0), QAccessible::CheckBox); - QCOMPARE(test->defaultAction(0), QAccessible::Press); - QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Check")); - QCOMPARE(test->state(0), (int)QAccessible::Normal); - QVERIFY(test->doAction(QAccessible::Press, 0)); - QTest::qWait(500); - QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Uncheck")); - QCOMPARE(test->state(0), (int)QAccessible::Checked); - test->release(); - - // test tristate check box - QVERIFY(QAccessible::queryAccessibleInterface(&tristate, &test)); - QCOMPARE(test->role(0), QAccessible::CheckBox); - QCOMPARE(test->defaultAction(0), QAccessible::Press); - QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Toggle")); - QCOMPARE(test->state(0), (int)QAccessible::Normal); - QVERIFY(test->doAction(QAccessible::Press, 0)); + interface = QAccessible::queryAccessibleInterface(&checkBox); + actionInterface = interface->actionInterface(); + QCOMPARE(interface->role(0), QAccessible::CheckBox); + QCOMPARE(actionInterface->name(0), QString("Check")); + QVERIFY((interface->state(0) & QAccessible::Checked) == 0); + actionInterface->doAction(0); QTest::qWait(500); - QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Check")); - QCOMPARE(test->state(0), (int)QAccessible::Mixed); - QVERIFY(test->doAction(QAccessible::Press, 0)); - QTest::qWait(500); - QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Uncheck")); - QCOMPARE(test->state(0), (int)QAccessible::Checked); - test->release(); + QCOMPARE(actionInterface->name(0), QString("Uncheck")); + QVERIFY(interface->state(0) & QAccessible::Checked); + QVERIFY(checkBox.isChecked()); + delete interface; + +// // test tristate check box +// QVERIFY(QAccessible::queryAccessibleInterface(&tristate, &test)); +// QCOMPARE(test->role(0), QAccessible::CheckBox); +// QCOMPARE(test->defaultAction(0), QAccessible::Press); +// QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Toggle")); +// QCOMPARE(test->state(0), (int)QAccessible::Normal); +// QVERIFY(test->doAction(QAccessible::Press, 0)); +// QTest::qWait(500); +// QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Check")); +// QCOMPARE(test->state(0), (int)QAccessible::Mixed); +// QVERIFY(test->doAction(QAccessible::Press, 0)); +// QTest::qWait(500); +// QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Uncheck")); +// QCOMPARE(test->state(0), (int)QAccessible::Checked); +// test->release(); // test radiobutton - QVERIFY(QAccessible::queryAccessibleInterface(&radio, &test)); - QCOMPARE(test->role(0), QAccessible::RadioButton); - QCOMPARE(test->defaultAction(0), QAccessible::Press); - QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Check")); - QCOMPARE(test->state(0), (int)QAccessible::Normal); - QVERIFY(test->doAction(QAccessible::Press, 0)); + interface = QAccessible::queryAccessibleInterface(&radio); + actionInterface = interface->actionInterface(); + QCOMPARE(interface->role(0), QAccessible::RadioButton); + QCOMPARE(actionInterface->name(0), QString("Check")); + QVERIFY((interface->state(0) & QAccessible::Checked) == 0); + actionInterface->doAction(0); QTest::qWait(500); - QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Check")); - QCOMPARE(test->state(0), (int)QAccessible::Checked); - test->release(); - - // test standard toolbutton - QVERIFY(QAccessible::queryAccessibleInterface(&toolbutton, &test)); - QCOMPARE(test->role(0), QAccessible::PushButton); - QCOMPARE(test->defaultAction(0), QAccessible::Press); - QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Press")); - QCOMPARE(test->state(0), (int)QAccessible::Normal); - test->release(); - - // toggle tool button - QVERIFY(QAccessible::queryAccessibleInterface(&toggletool, &test)); - QCOMPARE(test->role(0), QAccessible::CheckBox); - QCOMPARE(test->defaultAction(0), QAccessible::Press); - QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Check")); - QCOMPARE(test->state(0), (int)QAccessible::Normal); - QVERIFY(test->doAction(QAccessible::Press, 0)); - QTest::qWait(500); - QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Uncheck")); - QCOMPARE(test->state(0), (int)QAccessible::Checked); - test->release(); - - // test menu toolbutton - QVERIFY(QAccessible::queryAccessibleInterface(&menuToolButton, &test)); - QCOMPARE(test->role(0), QAccessible::ButtonMenu); - QCOMPARE(test->defaultAction(0), 1); - QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Open")); - QCOMPARE(test->state(0), (int)QAccessible::HasPopup); - QCOMPARE(test->actionCount(0), 1); - QCOMPARE(test->actionText(QAccessible::Press, QAccessible::Name, 0), QString("Press")); - test->release(); - - // test splitted menu toolbutton - QVERIFY(QAccessible::queryAccessibleInterface(&splitToolButton, &test)); - QCOMPARE(test->childCount(), 2); - QCOMPARE(test->role(0), QAccessible::ButtonDropDown); - QCOMPARE(test->role(1), QAccessible::PushButton); - QCOMPARE(test->role(2), QAccessible::ButtonMenu); - QCOMPARE(test->defaultAction(0), QAccessible::Press); - QCOMPARE(test->defaultAction(1), QAccessible::Press); - QCOMPARE(test->defaultAction(2), QAccessible::Press); - QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Press")); - QCOMPARE(test->state(0), (int)QAccessible::HasPopup); - QCOMPARE(test->actionCount(0), 1); - QCOMPARE(test->actionText(1, QAccessible::Name, 0), QString("Open")); - QCOMPARE(test->actionText(test->defaultAction(1), QAccessible::Name, 1), QString("Press")); - QCOMPARE(test->state(1), (int)QAccessible::Normal); - QCOMPARE(test->actionText(test->defaultAction(2), QAccessible::Name, 2), QString("Open")); - QCOMPARE(test->state(2), (int)QAccessible::HasPopup); - test->release(); + QCOMPARE(actionInterface->name(0), QString("Uncheck")); + QVERIFY(interface->state(0) & QAccessible::Checked); + QVERIFY(checkBox.isChecked()); + delete interface; + +// // test standard toolbutton +// QVERIFY(QAccessible::queryAccessibleInterface(&toolbutton, &test)); +// QCOMPARE(test->role(0), QAccessible::PushButton); +// QCOMPARE(test->defaultAction(0), QAccessible::Press); +// QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Press")); +// QCOMPARE(test->state(0), (int)QAccessible::Normal); +// test->release(); + +// // toggle tool button +// QVERIFY(QAccessible::queryAccessibleInterface(&toggletool, &test)); +// QCOMPARE(test->role(0), QAccessible::CheckBox); +// QCOMPARE(test->defaultAction(0), QAccessible::Press); +// QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Check")); +// QCOMPARE(test->state(0), (int)QAccessible::Normal); +// QVERIFY(test->doAction(QAccessible::Press, 0)); +// QTest::qWait(500); +// QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Uncheck")); +// QCOMPARE(test->state(0), (int)QAccessible::Checked); +// test->release(); + +// // test menu toolbutton +// QVERIFY(QAccessible::queryAccessibleInterface(&menuToolButton, &test)); +// QCOMPARE(test->role(0), QAccessible::ButtonMenu); +// QCOMPARE(test->defaultAction(0), 1); +// QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Open")); +// QCOMPARE(test->state(0), (int)QAccessible::HasPopup); +// QCOMPARE(test->actionCount(0), 1); +// QCOMPARE(test->actionText(QAccessible::Press, QAccessible::Name, 0), QString("Press")); +// test->release(); + +// // test splitted menu toolbutton +// QVERIFY(QAccessible::queryAccessibleInterface(&splitToolButton, &test)); +// QCOMPARE(test->childCount(), 2); +// QCOMPARE(test->role(0), QAccessible::ButtonDropDown); +// QCOMPARE(test->role(1), QAccessible::PushButton); +// QCOMPARE(test->role(2), QAccessible::ButtonMenu); +// QCOMPARE(test->defaultAction(0), QAccessible::Press); +// QCOMPARE(test->defaultAction(1), QAccessible::Press); +// QCOMPARE(test->defaultAction(2), QAccessible::Press); +// QCOMPARE(test->actionText(test->defaultAction(0), QAccessible::Name, 0), QString("Press")); +// QCOMPARE(test->state(0), (int)QAccessible::HasPopup); +// QCOMPARE(test->actionCount(0), 1); +// QCOMPARE(test->actionText(1, QAccessible::Name, 0), QString("Open")); +// QCOMPARE(test->actionText(test->defaultAction(1), QAccessible::Name, 1), QString("Press")); +// QCOMPARE(test->state(1), (int)QAccessible::Normal); +// QCOMPARE(test->actionText(test->defaultAction(2), QAccessible::Name, 2), QString("Open")); +// QCOMPARE(test->state(2), (int)QAccessible::HasPopup); +// test->release(); QTestAccessibility::clearEvents(); #else -// QSKIP("Test needs accessibility support.", SkipAll); - QSKIP("No action interface in Qt 4 yet.", SkipAll); + QSKIP("Test needs accessibility support.", SkipAll); #endif } -- cgit v1.2.3 From 0fbeed69a42415b375e33a9c8dcceff887a5df1c Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Fri, 18 Mar 2011 17:41:01 +0100 Subject: Make navigation in TabWidgets consistent. navigate would not return the right index in the parent if the current widget was not the visible one. Reviewed-by: Jan-Arve (cherry picked from commit fdeeaa9d61efea9cca783a1d4098ae505df24390) --- tests/auto/qaccessibility/tst_qaccessibility.cpp | 93 +++++++++++++++++++++++- 1 file changed, 90 insertions(+), 3 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp index 64bd879293..b8301be7eb 100644 --- a/tests/auto/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp @@ -251,6 +251,7 @@ private slots: void sliderTest(); void scrollBarTest(); void tabTest(); + void tabWidgetTest(); void menuTest(); void spinBoxTest(); void doubleSpinBoxTest(); @@ -1881,8 +1882,6 @@ public Q_SLOTS: void tst_QAccessibility::buttonTest() { #ifdef QTEST_ACCESSIBILITY - QAccessibleInterface *test = 0; - QWidget window; window.setLayout(new QVBoxLayout); @@ -1915,7 +1914,8 @@ void tst_QAccessibility::buttonTest() toggletool.setText("Toggle"); toggletool.setMinimumSize(20,20); -#ifdef QT3_SUPPORT +#if 0 + // QT3_SUPPORT // push button with a menu QPushButton menuButton("Menu", &window); Q3PopupMenu buttonMenu(&menuButton); @@ -2418,6 +2418,93 @@ void tst_QAccessibility::tabTest() #endif } +void tst_QAccessibility::tabWidgetTest() +{ +#ifdef QTEST_ACCESSIBILITY + QTabWidget *tabWidget = new QTabWidget(); + tabWidget->show(); + + // the interface for the tab is just a container for tabbar and stacked widget + QAccessibleInterface * const interface = QAccessible::queryAccessibleInterface(tabWidget); + QVERIFY(interface); + QCOMPARE(interface->childCount(), 2); + QCOMPARE(interface->role(0), QAccessible::Client); + + // Create pages, check navigation + QLabel *label1 = new QLabel("Page 1", tabWidget); + tabWidget->addTab(label1, "Tab 1"); + QLabel *label2 = new QLabel("Page 2", tabWidget); + tabWidget->addTab(label2, "Tab 2"); + + QCOMPARE(interface->childCount(), 2); + + QAccessibleInterface* tabBarInterface = 0; + // there is no special logic to sort the children, so the contents will be 1, the tab bar 2 + QCOMPARE(interface->navigate(QAccessible::Child, 2 , &tabBarInterface), 0); + QVERIFY(tabBarInterface); + QCOMPARE(tabBarInterface->childCount(), 4); + QCOMPARE(tabBarInterface->role(0), QAccessible::PageTabList); + + QAccessibleInterface* tabButton1Interface = 0; + QCOMPARE(tabBarInterface->navigate(QAccessible::Child, 1 , &tabButton1Interface), 1); + QVERIFY(tabButton1Interface == 0); + + QCOMPARE(tabBarInterface->role(1), QAccessible::PageTab); + QCOMPARE(tabBarInterface->text(QAccessible::Name, 1), QLatin1String("Tab 1")); + QCOMPARE(tabBarInterface->role(2), QAccessible::PageTab); + QCOMPARE(tabBarInterface->text(QAccessible::Name, 2), QLatin1String("Tab 2")); + QCOMPARE(tabBarInterface->role(3), QAccessible::PushButton); + QCOMPARE(tabBarInterface->text(QAccessible::Name, 3), QLatin1String("Scroll Left")); + QCOMPARE(tabBarInterface->role(4), QAccessible::PushButton); + QCOMPARE(tabBarInterface->text(QAccessible::Name, 4), QLatin1String("Scroll Right")); + + QAccessibleInterface* stackWidgetInterface = 0; + QCOMPARE(interface->navigate(QAccessible::Child, 1, &stackWidgetInterface), 0); + QVERIFY(stackWidgetInterface); + QCOMPARE(stackWidgetInterface->childCount(), 2); + QCOMPARE(stackWidgetInterface->role(0), QAccessible::LayeredPane); + + QAccessibleInterface* stackChild1Interface = 0; + QCOMPARE(stackWidgetInterface->navigate(QAccessible::Child, 1, &stackChild1Interface), 0); + QVERIFY(stackChild1Interface); + QCOMPARE(stackChild1Interface->childCount(), 0); + QCOMPARE(stackChild1Interface->role(0), QAccessible::StaticText); + QCOMPARE(stackChild1Interface->text(QAccessible::Name, 0), QLatin1String("Page 1")); + QCOMPARE(label1, stackChild1Interface->object()); + + // Navigation in stack widgets should be consistent + QAccessibleInterface* parent = 0; + QCOMPARE(stackChild1Interface->navigate(QAccessible::Ancestor, 1, &parent), 0); + QVERIFY(parent); + QCOMPARE(parent->childCount(), 2); + QCOMPARE(parent->role(0), QAccessible::LayeredPane); + delete parent; + + QAccessibleInterface* stackChild2Interface = 0; + QCOMPARE(stackWidgetInterface->navigate(QAccessible::Child, 2, &stackChild2Interface), 0); + QVERIFY(stackChild2Interface); + QCOMPARE(stackChild2Interface->childCount(), 0); + QCOMPARE(stackChild2Interface->role(0), QAccessible::StaticText); + QCOMPARE(label2, stackChild2Interface->object()); // the text will be empty since it is not visible + + QCOMPARE(stackChild2Interface->navigate(QAccessible::Ancestor, 1, &parent), 0); + QVERIFY(parent); + QCOMPARE(parent->childCount(), 2); + QCOMPARE(parent->role(0), QAccessible::LayeredPane); + delete parent; + + delete tabBarInterface; + delete stackChild1Interface; + delete stackChild2Interface; + delete stackWidgetInterface; + delete interface; + delete tabWidget; + QTestAccessibility::clearEvents(); +#else + QSKIP("Test needs accessibility support.", SkipAll); +#endif +} + void tst_QAccessibility::menuTest() { #ifdef QTEST_ACCESSIBILITY -- cgit v1.2.3 From 4195f078819eacbe7bf86b30c25bc3096d9fb273 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Fri, 25 Mar 2011 10:41:32 +0100 Subject: Fix autotest. I changed a string by accident. (cherry picked from commit 77cbbe9e47c62047ff88973d8158c42dc30fbd00) --- tests/auto/qaccessibility/tst_qaccessibility.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto') diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp index b8301be7eb..7de0512d7e 100644 --- a/tests/auto/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp @@ -1949,7 +1949,7 @@ void tst_QAccessibility::buttonTest() // currently our buttons only have click as action, press and release are missing QCOMPARE(actionInterface->actionCount(), 1); - QCOMPARE(actionInterface->name(0), QString("Click")); + QCOMPARE(actionInterface->name(0), QString("Press")); QCOMPARE(pushButton.clickCount, 0); actionInterface->doAction(0); QTest::qWait(500); -- cgit v1.2.3 From 6d401a9eb03fea16494327e43d71d97c63b09faf Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Mon, 4 Apr 2011 11:50:31 +0200 Subject: Remove Qt3ism: setToggleButton - setCheckable Reviewed-by: Jan-Arve (cherry picked from commit d8941c0c0e3e3019a2048ae470e4e46111a2cfcf) --- tests/auto/qaccessibility/tst_qaccessibility.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp index 7de0512d7e..b13f6dd632 100644 --- a/tests/auto/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp @@ -1888,10 +1888,9 @@ void tst_QAccessibility::buttonTest() // Standard push button CounterButton pushButton("Ok", &window); - // toggle push button - QPushButton togglepush("Toggle", &window); - togglepush.setToggleButton(true); - + // toggle button + QPushButton toggleButton("Toggle", &window); + toggleButton.setCheckable(true); // standard checkbox QCheckBox checkBox("Check me!", &window); @@ -1910,7 +1909,7 @@ void tst_QAccessibility::buttonTest() // standard toolbutton QToolButton toggletool(&window); - toggletool.setToggleButton(TRUE); + toggletool.setCheckable(true); toggletool.setText("Toggle"); toggletool.setMinimumSize(20,20); @@ -1957,17 +1956,17 @@ void tst_QAccessibility::buttonTest() delete interface; // test toggle button - interface = QAccessible::queryAccessibleInterface(&togglepush); + interface = QAccessible::queryAccessibleInterface(&toggleButton); actionInterface = interface->actionInterface(); QCOMPARE(interface->role(0), QAccessible::CheckBox); QCOMPARE(actionInterface->description(0), QString("Toggles the button.")); QCOMPARE(actionInterface->name(0), QString("Check")); - QVERIFY(!togglepush.isChecked()); + QVERIFY(!toggleButton.isChecked()); QVERIFY((interface->state(0) & QAccessible::Checked) == 0); actionInterface->doAction(0); QTest::qWait(500); QCOMPARE(actionInterface->name(0), QString("Uncheck")); - QVERIFY(togglepush.isChecked()); + QVERIFY(toggleButton.isChecked()); QVERIFY((interface->state(0) & QAccessible::Checked)); delete interface; -- cgit v1.2.3 From 55bfa460d2974ebe5ace4def554c5f54d6103312 Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Mon, 27 Dec 2010 11:59:40 +1100 Subject: QFileSystemModel: Handle QDir::NoDot and QDir::NoDotDot for setFilter Add support for QDir::NoDot and QDir::NoDotDot for setFilter in QFileSystemModel. Task-number: QTBUG-14760 Reviewed-by: Frederik (cherry picked from commit b60d82fd56897b1a1d3cc730172f71c27a497ede) --- .../auto/qfilesystemmodel/tst_qfilesystemmodel.cpp | 31 +++++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp index 53781c9f0f..e8d0f575df 100644 --- a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -632,7 +632,12 @@ void tst_QFileSystemModel::filters_data() QTest::addColumn("rowCount"); #if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) QTest::newRow("no dirs") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs) << QStringList() << 2; - QTest::newRow("one dir - dotdot") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs | QDir::NoDotAndDotDot) << QStringList() << 1; + QTest::newRow("no dirs - dot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDot) << QStringList() << 1; + QTest::newRow("no dirs - dotdot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDotDot) << QStringList() << 1; + QTest::newRow("no dirs - dotanddotdot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDotAndDotDot) << QStringList() << 0; + QTest::newRow("one dir - dot") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs | QDir::NoDot) << QStringList() << 2; + QTest::newRow("one dir - dotdot") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs | QDir::NoDotDot) << QStringList() << 2; + QTest::newRow("one dir - dotanddotdot") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs | QDir::NoDotAndDotDot) << QStringList() << 1; QTest::newRow("one dir") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs) << QStringList() << 3; QTest::newRow("no dir + hidden") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::Hidden) << QStringList() << 2; QTest::newRow("dir+hid+files") << (QStringList() << "a" << "b" << "c") << QStringList() << @@ -650,7 +655,12 @@ void tst_QFileSystemModel::filters_data() #else QTest::qWait(3000); // We need to calm down a bit... QTest::newRow("no dirs") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs) << QStringList() << 0; - QTest::newRow("one dir - dotdot") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs | QDir::NoDotAndDotDot) << QStringList() << 1; + QTest::newRow("no dirs - dot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDot) << QStringList() << 1; + QTest::newRow("no dirs - dotdot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDotDot) << QStringList() << 1; + QTest::newRow("no dirs - dotanddotdot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDotAndDotDot) << QStringList() << 0; + QTest::newRow("one dir - dot") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs | QDir::NoDot) << QStringList() << 2; + QTest::newRow("one dir - dotdot") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs | QDir::NoDotDot) << QStringList() << 2; + QTest::newRow("one dir - dotanddotdot") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs | QDir::NoDotAndDotDot) << QStringList() << 1; QTest::newRow("one dir") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs) << QStringList() << 1; QTest::newRow("no dir + hidden") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::Hidden) << QStringList() << 0; QTest::newRow("dir+hid+files") << (QStringList() << "a" << "b" << "c") << QStringList() << @@ -699,10 +709,23 @@ void tst_QFileSystemModel::filters() // Make sure that we do what QDir does QDir xFactor(tmp); QDir::Filters filters = (QDir::Filters)dirFilters; + QStringList dirEntries; + if (nameFilters.count() > 0) - QCOMPARE(xFactor.entryList(nameFilters, filters).count(), rowCount); + dirEntries = xFactor.entryList(nameFilters, filters); else - QVERIFY(xFactor.entryList(filters).count() == rowCount); + dirEntries = xFactor.entryList(filters); + + QCOMPARE(dirEntries.count(), rowCount); + + QStringList modelEntries; + + for (int i = 0; i < rowCount; ++i) + modelEntries.append(model->data(model->index(i, 0, root), QFileSystemModel::FileNameRole).toString()); + + qSort(dirEntries); + qSort(modelEntries); + QCOMPARE(dirEntries, modelEntries); #ifdef Q_OS_LINUX if (files.count() >= 3 && rowCount >= 3 && rowCount != 5) { -- cgit v1.2.3 From 4a2f95a3077b25acebce935718bb2d8485fc3cf9 Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Tue, 5 Apr 2011 16:30:58 +0200 Subject: Fix autotest breakage in QTableWidget Reviewed-by: gabi (cherry picked from commit 76a2a3278107d2713e6d999cf82db4e134c3d034) --- tests/auto/qtablewidget/tst_qtablewidget.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qtablewidget/tst_qtablewidget.cpp b/tests/auto/qtablewidget/tst_qtablewidget.cpp index d17e06484b..baa99eac2d 100644 --- a/tests/auto/qtablewidget/tst_qtablewidget.cpp +++ b/tests/auto/qtablewidget/tst_qtablewidget.cpp @@ -1471,6 +1471,8 @@ void tst_QTableWidget::task219380_removeLastRow() testWidget->removeRow(19); //we remove the last row + QApplication::processEvents(); // See QTBUG-18551 and its fix + //we make sure the editor is at the cell position QCOMPARE(testWidget->cellWidget(18, 0)->geometry(), testWidget->visualItemRect(&item)); } -- cgit v1.2.3 From e05443367f60e591556ae8854ecb634a7cf6ea33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 13 Apr 2011 10:15:06 +0200 Subject: Improved gradient table generation performance for two-stop gradients. Two stops is a fairly common case so we gain quite a bit by special casing it. Improves performance by 10 % in parcycle benchmark, and by 90 % in a synthetic benchmark. Reviewed-by: Andreas Kling (cherry picked from commit 5b74a70ac630073582be56f8a0539624a1080185) --- tests/auto/qpainter/tst_qpainter.cpp | 39 +++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index c21514b9c6..fa80635cdc 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -77,6 +77,7 @@ # define SRCDIR "." #endif +Q_DECLARE_METATYPE(QGradientStops) Q_DECLARE_METATYPE(QLine) Q_DECLARE_METATYPE(QRect) Q_DECLARE_METATYPE(QSize) @@ -189,6 +190,7 @@ private slots: void fillRect_stretchToDeviceMode(); void monoImages(); + void linearGradientSymmetry_data(); void linearGradientSymmetry(); void gradientInterpolation(); @@ -3983,8 +3985,39 @@ static QLinearGradient inverseGradient(QLinearGradient g) return g2; } +void tst_QPainter::linearGradientSymmetry_data() +{ + QTest::addColumn("stops"); + + { + QGradientStops stops; + stops << qMakePair(qreal(0.0), QColor(Qt::blue)); + stops << qMakePair(qreal(0.2), QColor(220, 220, 220, 0)); + stops << qMakePair(qreal(0.6), QColor(Qt::red)); + stops << qMakePair(qreal(0.9), QColor(220, 220, 220, 255)); + stops << qMakePair(qreal(1.0), QColor(Qt::black)); + QTest::newRow("multiple stops") << stops; + } + + { + QGradientStops stops; + stops << qMakePair(qreal(0.0), QColor(Qt::blue)); + stops << qMakePair(qreal(1.0), QColor(Qt::black)); + QTest::newRow("two stops") << stops; + } + + { + QGradientStops stops; + stops << qMakePair(qreal(0.3), QColor(Qt::blue)); + stops << qMakePair(qreal(0.6), QColor(Qt::black)); + QTest::newRow("two stops 2") << stops; + } +} + void tst_QPainter::linearGradientSymmetry() { + QFETCH(QGradientStops, stops); + QImage a(64, 8, QImage::Format_ARGB32_Premultiplied); QImage b(64, 8, QImage::Format_ARGB32_Premultiplied); @@ -3992,11 +4025,7 @@ void tst_QPainter::linearGradientSymmetry() b.fill(0); QLinearGradient gradient(QRectF(b.rect()).topLeft(), QRectF(b.rect()).topRight()); - gradient.setColorAt(0.0, Qt::blue); - gradient.setColorAt(0.2, QColor(220, 220, 220, 0)); - gradient.setColorAt(0.6, Qt::red); - gradient.setColorAt(0.9, QColor(220, 220, 220, 255)); - gradient.setColorAt(1.0, Qt::black); + gradient.setStops(stops); QPainter pa(&a); pa.fillRect(a.rect(), gradient); -- cgit v1.2.3 From d00555862c1a94a9fe08a7b4aa42830475ea1740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 18 Apr 2011 10:31:05 +0200 Subject: Made linearGradientSymmetry test pass on qreal=float platforms. We need to loosen the requirements a bit when qreal is float... Just skip the two failing test cases for now. Reviewed-by: Eskil Abrahamsen Blomfeldt (cherry picked from commit 3c659eb590aecbcdb40cb498901e757e780fa892) --- tests/auto/qpainter/tst_qpainter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index fa80635cdc..64dacec64a 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -3989,7 +3989,7 @@ void tst_QPainter::linearGradientSymmetry_data() { QTest::addColumn("stops"); - { + if (sizeof(qreal) != sizeof(float)) { QGradientStops stops; stops << qMakePair(qreal(0.0), QColor(Qt::blue)); stops << qMakePair(qreal(0.2), QColor(220, 220, 220, 0)); @@ -4006,7 +4006,7 @@ void tst_QPainter::linearGradientSymmetry_data() QTest::newRow("two stops") << stops; } - { + if (sizeof(qreal) != sizeof(float)) { QGradientStops stops; stops << qMakePair(qreal(0.3), QColor(Qt::blue)); stops << qMakePair(qreal(0.6), QColor(Qt::black)); -- cgit v1.2.3 From 6c42aa3b0f86a5c6e1407006db4c4485fa29aeca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 19 Apr 2011 11:45:29 +0200 Subject: Skip linearGradientSymmetry test on QWS. QWS defines GRADIENT_STOPTABLE_SIZE to be 256, which is not enough resolution for this test to pass. Reviewed-by: Eskil Abrahamsen Blomfeldt (cherry picked from commit 0201d5f5a8c95bd4f6b94726ed0db2b83cd3efc7) --- tests/auto/qpainter/tst_qpainter.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index 64dacec64a..76bc5d6370 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -4016,6 +4016,9 @@ void tst_QPainter::linearGradientSymmetry_data() void tst_QPainter::linearGradientSymmetry() { +#ifdef Q_WS_QWS + QSKIP("QWS has limited resolution in the gradient color table", SkipAll); +#else QFETCH(QGradientStops, stops); QImage a(64, 8, QImage::Format_ARGB32_Premultiplied); @@ -4037,6 +4040,7 @@ void tst_QPainter::linearGradientSymmetry() b = b.mirrored(true); QCOMPARE(a, b); +#endif } void tst_QPainter::gradientInterpolation() -- cgit v1.2.3 From 560114a415a7734fbd4c006feabba895afbeba1c Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Thu, 21 Apr 2011 13:25:23 +0200 Subject: Fix tst_QTableWidget::task219380_removeLastRow Again, dure to the fix to QTBUG-18551. Reviewed-by: Olivier (cherry picked from commit 1e4d824462b44315944a27ec328f7e400a67c96c) --- tests/auto/qtablewidget/tst_qtablewidget.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qtablewidget/tst_qtablewidget.cpp b/tests/auto/qtablewidget/tst_qtablewidget.cpp index baa99eac2d..40aece4b36 100644 --- a/tests/auto/qtablewidget/tst_qtablewidget.cpp +++ b/tests/auto/qtablewidget/tst_qtablewidget.cpp @@ -41,6 +41,7 @@ #include +#include "../../shared/util.h" #include #include #include @@ -1471,10 +1472,8 @@ void tst_QTableWidget::task219380_removeLastRow() testWidget->removeRow(19); //we remove the last row - QApplication::processEvents(); // See QTBUG-18551 and its fix - //we make sure the editor is at the cell position - QCOMPARE(testWidget->cellWidget(18, 0)->geometry(), testWidget->visualItemRect(&item)); + QTRY_COMPARE(testWidget->cellWidget(18, 0)->geometry(), testWidget->visualItemRect(&item)); } void tst_QTableWidget::task262056_sortDuplicate() -- cgit v1.2.3 From 4d38a48a7005ac279bdde5048f2f2152eed3407a Mon Sep 17 00:00:00 2001 From: mae Date: Tue, 26 Apr 2011 15:41:21 +0200 Subject: Fix insert and scroll to bottom case When using QtextCursor::insert() with a large text followed by setting the vertical scrollbar to its maximum value (scroll to bottom), QPlainTextEdit would not behave properly if a document size change was triggered by the insertion due to line wrapping. This was visible in Qt Creator. Auto test included. Reviewed-by: con (cherry picked from commit 5d144faf3c524ab557b88f69c4b755e20237e846) --- tests/auto/qplaintextedit/tst_qplaintextedit.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp index d3e4fd0258..8da5ba5d9a 100644 --- a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp +++ b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp @@ -150,6 +150,7 @@ private slots: void lineWrapProperty(); void selectionChanged(); void blockCountChanged(); + void insertAndScrollToBottom(); private: void createSelection(); @@ -1504,5 +1505,22 @@ void tst_QPlainTextEdit::blockCountChanged() } +void tst_QPlainTextEdit::insertAndScrollToBottom() +{ + ed->setPlainText("First Line"); + ed->show(); + QString text; + for(int i = 0; i < 2000; ++i) { + text += QLatin1String("this is another line of text to be appended. It is quite long and will probably wrap around, meaning the number of lines is larger than the number of blocks in the text.\n"); + } + QTextCursor cursor = ed->textCursor(); + cursor.beginEditBlock(); + cursor.insertText(text); + cursor.endEditBlock(); + ed->verticalScrollBar()->setValue(ed->verticalScrollBar()->maximum()); + QCOMPARE(ed->verticalScrollBar()->value(), ed->verticalScrollBar()->maximum()); +} + + QTEST_MAIN(tst_QPlainTextEdit) #include "tst_qplaintextedit.moc" -- cgit v1.2.3 From c9cf5b45e3d71b077e11a89fed989967917a48e3 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 26 Apr 2011 16:01:08 +0200 Subject: Added autotest for threaded text rendering. Task-number: QTBUG-18516 Reviewed-by: TRUSTME (cherry picked from commit 903d4dc2196df2775255c24c707bfeb571992bb7) --- tests/auto/qpainter/tst_qpainter.cpp | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index 76bc5d6370..984443490f 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -72,6 +72,7 @@ #include #include #include +#include #if defined(Q_OS_SYMBIAN) # define SRCDIR "." @@ -266,6 +267,8 @@ private slots: void QTBUG17053_zeroDashPattern(); + void drawTextOutsideGuiThread(); + private: void fillData(); void setPenColor(QPainter& p); @@ -4739,6 +4742,44 @@ void tst_QPainter::QTBUG17053_zeroDashPattern() QCOMPARE(image, original); } +class TextDrawerThread : public QThread +{ +public: + void run(); + QImage rendering; +}; + +void TextDrawerThread::run() +{ + rendering = QImage(100, 100, QImage::Format_ARGB32_Premultiplied); + rendering.fill(0); + QPainter p(&rendering); + p.fillRect(10, 10, 100, 100, Qt::blue); + p.setPen(Qt::green); + p.drawText(20, 20, "some text"); + p.end(); +} + +void tst_QPainter::drawTextOutsideGuiThread() +{ + if (!QFontDatabase::supportsThreadedFontRendering()) + QSKIP("No threaded font rendering", SkipAll); + + QImage referenceRendering(100, 100, QImage::Format_ARGB32_Premultiplied); + referenceRendering.fill(0); + QPainter p(&referenceRendering); + p.fillRect(10, 10, 100, 100, Qt::blue); + p.setPen(Qt::green); + p.drawText(20, 20, "some text"); + p.end(); + + TextDrawerThread t; + t.start(); + t.wait(); + + QCOMPARE(referenceRendering, t.rendering); +} + QTEST_MAIN(tst_QPainter) #include "tst_qpainter.moc" -- cgit v1.2.3 From a759518a989d5302c632cef4c725ea24156f21ba Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 26 Apr 2011 16:20:39 +0200 Subject: Removing the "resetInternalData" slot in QAbstractProxyModel This reverts commits 0916a68056154ecb60e4ea2c79726ab2e49b1532 and 6f1384fcbeea993d5be47590c696de60215b7608. This effectively reverts most of MR 694. Reviewed-by: Olivier (cherry picked from commit 06e104b9c305d3db0dd1848e6e633ee3888fd1de) --- .../tst_qsortfilterproxymodel.cpp | 137 --------------------- 1 file changed, 137 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp index d26f0cd0f5..8e7f39335c 100644 --- a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp +++ b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp @@ -149,7 +149,6 @@ private slots: void testMultipleProxiesWithSelection(); void mapSelectionFromSource(); - void testResetInternalData(); void filteredColumns(); protected: @@ -3183,142 +3182,6 @@ void tst_QSortFilterProxyModel::taskQTBUG_10287_unnecessaryMapCreation() // No assert failure, it passes. } -/** - * A proxy which changes the background color for items ending in 'y' or 'r' - */ -class CustomDataProxy : public QSortFilterProxyModel -{ - Q_OBJECT - -public: - CustomDataProxy(QObject *parent = 0) - : QSortFilterProxyModel(parent) - { - setDynamicSortFilter(true); - } - - void setSourceModel(QAbstractItemModel *sourceModel) - { - // It would be possible to use only the modelReset signal of the source model to clear - // the data in *this, however, this requires that the slot is connected - // before QSortFilterProxyModel::setSourceModel is called, and even then depends - // on the order of invokation of slots being the same as the order of connection. - // ie, not reliable. -// connect(sourceModel, SIGNAL(modelReset()), SLOT(resetInternalData())); - QSortFilterProxyModel::setSourceModel(sourceModel); - // Making the connect after the setSourceModel call clears the data too late. -// connect(sourceModel, SIGNAL(modelReset()), SLOT(resetInternalData())); - - // This could be done in data(), but the point is to need to cache something in the proxy - // which needs to be cleared on reset. - for (int i = 0; i < sourceModel->rowCount(); ++i) - { - if (sourceModel->index(i, 0).data().toString().endsWith(QLatin1Char('y'))) - { - m_backgroundColours.insert(i, Qt::blue); - } else if (sourceModel->index(i, 0).data().toString().endsWith(QLatin1Char('r'))) - { - m_backgroundColours.insert(i, Qt::red); - } - } - } - - QVariant data(const QModelIndex &index, int role) const - { - if (role != Qt::BackgroundRole) - return QSortFilterProxyModel::data(index, role); - return m_backgroundColours.value(index.row()); - } - -private slots: - void resetInternalData() - { - m_backgroundColours.clear(); - } - -private: - QHash m_backgroundColours; -}; - -class ModelObserver : public QObject -{ - Q_OBJECT -public: - ModelObserver(QAbstractItemModel *model, QObject *parent = 0) - : QObject(parent), m_model(model) - { - connect(m_model, SIGNAL(modelAboutToBeReset()), SLOT(modelAboutToBeReset())); - connect(m_model, SIGNAL(modelReset()), SLOT(modelReset())); - } - -public slots: - void modelAboutToBeReset() - { - int reds = 0, blues = 0; - for (int i = 0; i < m_model->rowCount(); ++i) - { - QColor color = m_model->index(i, 0).data(Qt::BackgroundRole).value(); - if (color == Qt::blue) - ++blues; - if (color == Qt::red) - ++reds; - } - QCOMPARE(blues, 11); - QCOMPARE(reds, 4); - } - - void modelReset() - { - int reds = 0, blues = 0; - for (int i = 0; i < m_model->rowCount(); ++i) - { - QColor color = m_model->index(i, 0).data(Qt::BackgroundRole).value(); - if (color == Qt::blue) - ++blues; - if (color == Qt::red) - ++reds; - } - QCOMPARE(reds, 0); - QCOMPARE(blues, 0); - } - -private: - QAbstractItemModel * const m_model; - -}; - -void tst_QSortFilterProxyModel::testResetInternalData() -{ - - QStringListModel model(QStringList() << "Monday" - << "Tuesday" - << "Wednesday" - << "Thursday" - << "Friday" - << "January" - << "February" - << "March" - << "April" - << "May" - << "Saturday" - << "June" - << "Sunday" - << "July" - << "August" - << "September" - << "October" - << "November" - << "December"); - - CustomDataProxy proxy; - proxy.setSourceModel(&model); - - ModelObserver observer(&proxy); - - // Cause the source model to reset. - model.setStringList(QStringList() << "Spam" << "Eggs"); -} - class FilteredColumnProxyModel : public QSortFilterProxyModel { Q_OBJECT -- cgit v1.2.3 From 8691b6ea5124d035109fae309368af70e8030281 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Wed, 27 Apr 2011 13:03:09 +0200 Subject: Skip child count test on Intel compiler. For some reason this test is sometimes giving false results with intel compilers. The child count is most likely style dependent. For now ignore it in the test. Reviewed-by: Thierry (cherry picked from commit 0ddecd383c91afb18ce2776eed5608bb1a0c2129) --- tests/auto/qaccessibility/tst_qaccessibility.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp index b13f6dd632..ab1a8f732d 100644 --- a/tests/auto/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp @@ -2466,7 +2466,9 @@ void tst_QAccessibility::tabWidgetTest() QAccessibleInterface* stackChild1Interface = 0; QCOMPARE(stackWidgetInterface->navigate(QAccessible::Child, 1, &stackChild1Interface), 0); QVERIFY(stackChild1Interface); +#ifndef Q_CC_INTEL QCOMPARE(stackChild1Interface->childCount(), 0); +#endif QCOMPARE(stackChild1Interface->role(0), QAccessible::StaticText); QCOMPARE(stackChild1Interface->text(QAccessible::Name, 0), QLatin1String("Page 1")); QCOMPARE(label1, stackChild1Interface->object()); @@ -2475,7 +2477,9 @@ void tst_QAccessibility::tabWidgetTest() QAccessibleInterface* parent = 0; QCOMPARE(stackChild1Interface->navigate(QAccessible::Ancestor, 1, &parent), 0); QVERIFY(parent); +#ifndef Q_CC_INTEL QCOMPARE(parent->childCount(), 2); +#endif QCOMPARE(parent->role(0), QAccessible::LayeredPane); delete parent; @@ -2488,7 +2492,9 @@ void tst_QAccessibility::tabWidgetTest() QCOMPARE(stackChild2Interface->navigate(QAccessible::Ancestor, 1, &parent), 0); QVERIFY(parent); +#ifndef Q_CC_INTEL QCOMPARE(parent->childCount(), 2); +#endif QCOMPARE(parent->role(0), QAccessible::LayeredPane); delete parent; -- cgit v1.2.3 From 0683ff9f7495273508b49475410fcaea34b85e01 Mon Sep 17 00:00:00 2001 From: Jens Georg Date: Wed, 13 Apr 2011 10:14:46 +0200 Subject: Add test for ISODate change in QDateTime::toString Merge-request: 1149 Reviewed-by: Zeno Albisser (cherry picked from commit d9e0c2ea4d64b8fdfb31b28e71373735be38101b) --- tests/auto/qdatetime/tst_qdatetime.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qdatetime/tst_qdatetime.cpp b/tests/auto/qdatetime/tst_qdatetime.cpp index f8836a6b79..d612911727 100644 --- a/tests/auto/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/qdatetime/tst_qdatetime.cpp @@ -85,6 +85,8 @@ private slots: void setTime_t(); void setMSecsSinceEpoch_data(); void setMSecsSinceEpoch(); + void toString_isoDate_data(); + void toString_isoDate(); void toString_enumformat(); void toString_strformat_data(); void toString_strformat(); @@ -506,6 +508,36 @@ void tst_QDateTime::setMSecsSinceEpoch() QCOMPARE(dt, reference.addMSecs(msecs)); } +void tst_QDateTime::toString_isoDate_data() +{ + QTest::addColumn("dt"); + QTest::addColumn("formatted"); + + QTest::newRow("localtime") + << QDateTime(QDate(1978, 11, 9), QTime(13, 28, 34)) + << QString("1978-11-09T13:28:34"); + QTest::newRow("UTC") + << QDateTime(QDate(1978, 11, 9), QTime(13, 28, 34), Qt::UTC) + << QString("1978-11-09T13:28:34Z"); + QDateTime dt(QDate(1978, 11, 9), QTime(13, 28, 34)); + dt.setUtcOffset(19800); + QTest::newRow("positive OffsetFromUTC") + << dt + << QString("1978-11-09T13:28:34+05:30"); + dt.setUtcOffset(-7200); + QTest::newRow("negative OffsetFromUTC") + << dt + << QString("1978-11-09T13:28:34-02:00"); +} + +void tst_QDateTime::toString_isoDate() +{ + QFETCH(QDateTime, dt); + QFETCH(QString, formatted); + + QCOMPARE(dt.toString(Qt::ISODate), formatted); +} + void tst_QDateTime::toString_enumformat() { QDateTime dt1(QDate(1995, 5, 20), QTime(12, 34, 56)); -- cgit v1.2.3 From 45baf4ed0b2b6c7862d4df5d8b9878cec88237f3 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Fri, 22 Apr 2011 16:39:00 +0200 Subject: Fix warning (unused variable) in QAccessibility test. Reviewed-by: Morten Sorvig (cherry picked from commit c3ebd1d38826739cb989e65770d2a22b9a39dcc4) --- tests/auto/qaccessibility/tst_qaccessibility.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp index ab1a8f732d..7ff1a0867c 100644 --- a/tests/auto/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp @@ -4048,10 +4048,10 @@ void tst_QAccessibility::pushButtonTest() QAccessibleInterface *acc; QAccessibleInterface *acc2; int entry = accToplevel->childAt(pt.x(), pt.y()); - int child = accToplevel->navigate(QAccessible::Child, entry, &acc); + accToplevel->navigate(QAccessible::Child, entry, &acc); if (acc) { entry = acc->childAt(pt.x(), pt.y()); - child = acc->navigate(QAccessible::Child, entry, &acc2); + acc->navigate(QAccessible::Child, entry, &acc2); delete acc; acc = acc2; } -- cgit v1.2.3 From 4212ee7ec7f9ac77a4acd0796e56dbdd1e2c7baa Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 21 Apr 2011 18:32:36 +0200 Subject: make QProcessEnvironment on Windows preserve variable name case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit while windows itself does not care which case the variable names are in, they may be passed to unix tools which *do* care. note that this uses true case folding for string comparisons while windows uses uppercasing. this means that "ess" and "eß" will be considered the same by us, while not by windows. this is not expected to have real-world impact, particularly because non-ascii variable names are not used much. Task-number: QTCREATORBUG-3110 Reviewed-by: thiago Reviewed-by: dt (cherry picked from commit f3db5603871928ebed43a085a496397e65952b39) --- tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp b/tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp index 1c26343e74..98d48900a5 100644 --- a/tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp +++ b/tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp @@ -43,10 +43,6 @@ #include #include -// Note: -// in cross-platform tests, ALWAYS use UPPERCASE variable names -// That's because on Windows, the variables are uppercased - class tst_QProcessEnvironment: public QObject { Q_OBJECT @@ -214,7 +210,7 @@ void tst_QProcessEnvironment::caseSensitivity() e.insert("foo", "bar"); #ifdef Q_OS_WIN - // on Windows, it's uppercased + // Windows is case-insensitive, but case-preserving QVERIFY(e.contains("foo")); QVERIFY(e.contains("FOO")); QVERIFY(e.contains("FoO")); @@ -223,8 +219,12 @@ void tst_QProcessEnvironment::caseSensitivity() QCOMPARE(e.value("FOO"), QString("bar")); QCOMPARE(e.value("FoO"), QString("bar")); + // Per Windows, this overwrites the value, but keeps the name's original capitalization + e.insert("Foo", "Bar"); + QStringList list = e.toStringList(); - QCOMPARE(list.at(0), QString("FOO=bar")); + QCOMPARE(list.length(), 1); + QCOMPARE(list.at(0), QString("foo=Bar")); #else // otherwise, it's case sensitive QVERIFY(e.contains("foo")); @@ -236,6 +236,7 @@ void tst_QProcessEnvironment::caseSensitivity() QCOMPARE(e.value("foo"), QString("bar")); QStringList list = e.toStringList(); + QCOMPARE(list.length(), 2); QVERIFY(list.contains("foo=bar")); QVERIFY(list.contains("FOO=baz")); #endif -- cgit v1.2.3 From 3a0f5d04fce00812cddd44e54ef25f7ab7d9240d Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 3 May 2011 11:53:34 +0200 Subject: Fix the tst_QPluginLoader::loadCorruptElf on 64 bit The error message do not match Reviewed-by: Arvid Ephraim Picciani (cherry picked from commit 383f57dd2669b71fd14cf9b6b56213423a3d2d01) --- tests/auto/qpluginloader/tst_qpluginloader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qpluginloader/tst_qpluginloader.cpp b/tests/auto/qpluginloader/tst_qpluginloader.cpp index 591ef5ee52..76c2f6e5b3 100644 --- a/tests/auto/qpluginloader/tst_qpluginloader.cpp +++ b/tests/auto/qpluginloader/tst_qpluginloader.cpp @@ -370,15 +370,15 @@ if (sizeof(void*) == 8) { QPluginLoader lib1(SRCDIR "elftest/corrupt1.elf64.so"); QCOMPARE(lib1.load(), false); - QVERIFY(lib1.errorString().contains("not an ELF object")); + QVERIFY(lib1.errorString().contains("not a valid Qt plugin")); QPluginLoader lib2(SRCDIR "elftest/corrupt2.elf64.so"); QCOMPARE(lib2.load(), false); - QVERIFY(lib2.errorString().contains("invalid")); + QVERIFY(lib2.errorString().contains("not a valid Qt plugin")); QPluginLoader lib3(SRCDIR "elftest/corrupt3.elf64.so"); QCOMPARE(lib3.load(), false); - QVERIFY(lib3.errorString().contains("invalid")); + QVERIFY(lib3.errorString().contains("not a valid Qt plugin")); } else if (sizeof(void*) == 4) { QPluginLoader libW(SRCDIR "elftest/corrupt3.elf64.so"); QCOMPARE(libW.load(), false); -- cgit v1.2.3 From 5a7409a423ac55a97b0ff9044b392c5847c2833c Mon Sep 17 00:00:00 2001 From: aavit Date: Tue, 3 May 2011 13:32:23 +0200 Subject: Make autotest more resilient against network timeout (cherry picked from commit 50be38737507f5c23b4d050e635a200024164a13) --- tests/auto/lancelot/tst_lancelot.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/auto') diff --git a/tests/auto/lancelot/tst_lancelot.cpp b/tests/auto/lancelot/tst_lancelot.cpp index 972166514a..2eb3f200ed 100644 --- a/tests/auto/lancelot/tst_lancelot.cpp +++ b/tests/auto/lancelot/tst_lancelot.cpp @@ -254,7 +254,8 @@ void tst_Lancelot::runTestSuite(GraphicsEngine engine, QImage::Format format) if (baseline.status == ImageItem::BaselineNotFound) { - proto.submitNewBaseline(rendered, 0); + if (!proto.submitNewBaseline(rendered, 0)) + QWARN("Failed to submit new baseline: " + proto.errorMessage().toLatin1()); QSKIP("Baseline not found; new baseline created.", SkipSingle); } -- cgit v1.2.3 From 0bb70c316437c2b654ef2fd0555e04a57a6b3620 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Thu, 5 May 2011 10:49:59 +0200 Subject: Ensure that QDateTimeEdit::calendarWidget() will always return a valid widget. This case may be triggered in the (admittedly slightly abnormal) case where a user wishes to embed the calendar widget in a layout or, for whatever reason, do something else that will change its ownership. We work around this by detecting when it is deleted and recreating the widget. This will also have a positive side effect if setCalendarWidget() is called with a widget which is then subsequently deleted, returning the default widget instead of a pointer to (now deleted) memory. Reviewed-by: Denis Dzyubenko Merge-request: 2568 Reviewed-by: Denis Dzyubenko (cherry picked from commit 124ec3200f8453142717fcfe7a4aa0a55164aaa6) --- tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp index c8c3b90712..9d0c5f7d22 100644 --- a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp +++ b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp @@ -275,6 +275,8 @@ private slots: void focusNextPrevChild(); void taskQTBUG_12384_timeSpecShowTimeOnly(); + + void deleteCalendarWidget(); private: EditorDateEdit* testWidget; @@ -3438,5 +3440,26 @@ void tst_QDateTimeEdit::taskQTBUG_12384_timeSpecShowTimeOnly() QCOMPARE(edit.time(), time.time()); } +void tst_QDateTimeEdit::deleteCalendarWidget() +{ + { + // setup + QCalendarWidget *cw = 0; + QDateEdit edit; + QVERIFY(!edit.calendarWidget()); + edit.setCalendarPopup(true); + QVERIFY(edit.calendarWidget()); + edit.calendarWidget()->setObjectName("cw1");; + + // delete + cw = edit.calendarWidget(); + delete cw; + + // it should create a new widget + QVERIFY(edit.calendarWidget()); + QVERIFY(edit.calendarWidget()->objectName() != "cw1"); + } +} + QTEST_MAIN(tst_QDateTimeEdit) #include "tst_qdatetimeedit.moc" -- cgit v1.2.3 From ec4d346f95de4933b660d5ce005751abdced4c7d Mon Sep 17 00:00:00 2001 From: Alexander Potashev Date: Mon, 9 May 2011 10:35:29 +0200 Subject: Allow using not only prefixes for undo command text Functions QUndo{Group,Stack}::create{Undo,Redo}Action() now use action text templates "Undo %1" and "Redo %1" if no custom prefix was provided. This makes more flexible translations possible. The surrounding text (like "Undo" and "Redo") can now be suffixed to the command name as German and Korean languages require ("%1 rueckgaengig machen" for German). Also, now the default action text (when no command can be undone) can be translated differently from the prefix. For example, it can be translated as "Undo action", not just "Undo". When a non-empty prefix is passed to QUndo*****::create****Action(), those functions work as before, and the features described above become unavailable. Task-number: QTBUG-14442 Merge-request: 1212 Reviewed-by: ossi (cherry picked from commit 213c25ad24e4f3b0a44f82f23d34746cd294f8d6) --- tests/auto/qundogroup/testdata/qundogroup.ts | 25 +++++++++++++++++++ tests/auto/qundogroup/tst_qundogroup.cpp | 37 ++++++++++++++++++++++++++++ tests/auto/qundostack/testdata/qundostack.ts | 25 +++++++++++++++++++ tests/auto/qundostack/tst_qundostack.cpp | 35 ++++++++++++++++++++++++++ 4 files changed, 122 insertions(+) create mode 100644 tests/auto/qundogroup/testdata/qundogroup.ts create mode 100644 tests/auto/qundostack/testdata/qundostack.ts (limited to 'tests/auto') diff --git a/tests/auto/qundogroup/testdata/qundogroup.ts b/tests/auto/qundogroup/testdata/qundogroup.ts new file mode 100644 index 0000000000..a059bcb486 --- /dev/null +++ b/tests/auto/qundogroup/testdata/qundogroup.ts @@ -0,0 +1,25 @@ + + + + + QUndoGroup + + Undo %1 + undo-prefix %1 undo-suffix + + + Undo + Default text for undo action + Undo-default-text + + + Redo %1 + redo-prefix %1 redo-suffix + + + Redo + Default text for redo action + Redo-default-text + + + diff --git a/tests/auto/qundogroup/tst_qundogroup.cpp b/tests/auto/qundogroup/tst_qundogroup.cpp index 8927f859ec..d2909b733e 100644 --- a/tests/auto/qundogroup/tst_qundogroup.cpp +++ b/tests/auto/qundogroup/tst_qundogroup.cpp @@ -201,6 +201,7 @@ private slots: void deleteStack(); void checkSignals(); void addStackAndDie(); + void commandTextFormat(); }; tst_QUndoGroup::tst_QUndoGroup() @@ -604,6 +605,42 @@ void tst_QUndoGroup::addStackAndDie() delete stack; } +void tst_QUndoGroup::commandTextFormat() +{ + QString binDir = QLibraryInfo::location(QLibraryInfo::BinariesPath); + QVERIFY(!QProcess::execute(binDir + "/lrelease testdata/qundogroup.ts")); + + QTranslator translator; + QVERIFY(translator.load("testdata/qundogroup.qm")); + qApp->installTranslator(&translator); + + QUndoGroup group; + QAction *undo_action = group.createUndoAction(0); + QAction *redo_action = group.createRedoAction(0); + + QCOMPARE(undo_action->text(), QString("Undo-default-text")); + QCOMPARE(redo_action->text(), QString("Redo-default-text")); + + QUndoStack stack(&group); + stack.setActive(); + QString str; + + stack.push(new AppendCommand(&str, "foo")); + QCOMPARE(undo_action->text(), QString("undo-prefix append undo-suffix")); + QCOMPARE(redo_action->text(), QString("Redo-default-text")); + + stack.push(new InsertCommand(&str, 0, "bar")); + stack.undo(); + QCOMPARE(undo_action->text(), QString("undo-prefix append undo-suffix")); + QCOMPARE(redo_action->text(), QString("redo-prefix insert redo-suffix")); + + stack.undo(); + QCOMPARE(undo_action->text(), QString("Undo-default-text")); + QCOMPARE(redo_action->text(), QString("redo-prefix append redo-suffix")); + + qApp->removeTranslator(&translator); +} + #else class tst_QUndoGroup : public QObject { diff --git a/tests/auto/qundostack/testdata/qundostack.ts b/tests/auto/qundostack/testdata/qundostack.ts new file mode 100644 index 0000000000..4584036af2 --- /dev/null +++ b/tests/auto/qundostack/testdata/qundostack.ts @@ -0,0 +1,25 @@ + + + + + QUndoStack + + Undo %1 + undo-prefix %1 undo-suffix + + + Undo + Default text for undo action + Undo-default-text + + + Redo %1 + redo-prefix %1 redo-suffix + + + Redo + Default text for redo action + Redo-default-text + + + diff --git a/tests/auto/qundostack/tst_qundostack.cpp b/tests/auto/qundostack/tst_qundostack.cpp index 739d3f2682..bcab43d4af 100644 --- a/tests/auto/qundostack/tst_qundostack.cpp +++ b/tests/auto/qundostack/tst_qundostack.cpp @@ -220,6 +220,7 @@ private slots: void macroBeginEnd(); void compression(); void undoLimit(); + void commandTextFormat(); }; tst_QUndoStack::tst_QUndoStack() @@ -2935,6 +2936,40 @@ void tst_QUndoStack::undoLimit() true); // redoChanged } +void tst_QUndoStack::commandTextFormat() +{ + QString binDir = QLibraryInfo::location(QLibraryInfo::BinariesPath); + QVERIFY(!QProcess::execute(binDir + "/lrelease testdata/qundostack.ts")); + + QTranslator translator; + QVERIFY(translator.load("testdata/qundostack.qm")); + qApp->installTranslator(&translator); + + QUndoStack stack; + QAction *undo_action = stack.createUndoAction(0); + QAction *redo_action = stack.createRedoAction(0); + + QCOMPARE(undo_action->text(), QString("Undo-default-text")); + QCOMPARE(redo_action->text(), QString("Redo-default-text")); + + QString str; + + stack.push(new AppendCommand(&str, "foo")); + QCOMPARE(undo_action->text(), QString("undo-prefix append undo-suffix")); + QCOMPARE(redo_action->text(), QString("Redo-default-text")); + + stack.push(new InsertCommand(&str, 0, "bar")); + stack.undo(); + QCOMPARE(undo_action->text(), QString("undo-prefix append undo-suffix")); + QCOMPARE(redo_action->text(), QString("redo-prefix insert redo-suffix")); + + stack.undo(); + QCOMPARE(undo_action->text(), QString("Undo-default-text")); + QCOMPARE(redo_action->text(), QString("redo-prefix append redo-suffix")); + + qApp->removeTranslator(&translator); +} + QTEST_MAIN(tst_QUndoStack) #include "tst_qundostack.moc" -- cgit v1.2.3 From 342d2a253ca14d9d8dff843f682661d4933d1dd3 Mon Sep 17 00:00:00 2001 From: Alexander Potashev Date: Mon, 9 May 2011 10:39:18 +0200 Subject: Allow different text for undo actions and items in QUndoView Now the texts used for undo actions and for items in QUndoView can be set separately. This introduces an extended format of text that can be passed to QUndoCommand::setText or QUndoCommand constructor. The action text can now contain two strings separated by a "\n". The first string (that goes before "\n") is then returned by QUndoCommand::text() and used as name of item in QUndoView. The second string (that goes after "\n") is returned by QUndoCommand::actionText() and used when the text properties of the undo and redo actions are updated. If the text passed to QUndoCommand does not contain "\n", everything works as before, and both QUndoCommand::text() and QUndoCommand::actionText() return the same string. Even though action text in English usually does not need different forms for undo actions and QUndoView item, translators can employ this new command text format, for example to adjust the grammatical case used in command text to match the context of "Undo %1"/"Redo %1". Merge-request: 2610 Reviewed-by: ossi (cherry picked from commit 9b784789c75d59b27530bbf1d12676cc44f64f46) --- tests/auto/qundostack/tst_qundostack.cpp | 59 ++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qundostack/tst_qundostack.cpp b/tests/auto/qundostack/tst_qundostack.cpp index bcab43d4af..5aea0a15d3 100644 --- a/tests/auto/qundostack/tst_qundostack.cpp +++ b/tests/auto/qundostack/tst_qundostack.cpp @@ -101,6 +101,16 @@ private: QString m_text; }; +class IdleCommand : public QUndoCommand +{ +public: + IdleCommand(QUndoCommand *parent = 0); + ~IdleCommand(); + + virtual void undo(); + virtual void redo(); +}; + InsertCommand::InsertCommand(QString *str, int idx, const QString &text, QUndoCommand *parent) : QUndoCommand(parent) @@ -201,6 +211,26 @@ bool AppendCommand::mergeWith(const QUndoCommand *other) return true; } +IdleCommand::IdleCommand(QUndoCommand *parent) + : QUndoCommand(parent) +{ + // "idle-item" goes to QUndoStack::{redo,undo}Text + // "idle-action" goes to all other places (e.g. QUndoView) + setText("idle-item\nidle-action"); +} + +IdleCommand::~IdleCommand() +{ +} + +void IdleCommand::redo() +{ +} + +void IdleCommand::undo() +{ +} + /****************************************************************************** ** tst_QUndoStack */ @@ -221,6 +251,7 @@ private slots: void compression(); void undoLimit(); void commandTextFormat(); + void separateUndoText(); }; tst_QUndoStack::tst_QUndoStack() @@ -2970,6 +3001,34 @@ void tst_QUndoStack::commandTextFormat() qApp->removeTranslator(&translator); } +void tst_QUndoStack::separateUndoText() +{ + QUndoStack stack; + QAction *undo_action = stack.createUndoAction(0); + QAction *redo_action = stack.createRedoAction(0); + + QUndoCommand *command1 = new IdleCommand(); + QUndoCommand *command2 = new IdleCommand(); + stack.push(command1); + stack.push(command2); + stack.undo(); + + QCOMPARE(undo_action->text(), QString("Undo idle-action")); + QCOMPARE(redo_action->text(), QString("Redo idle-action")); + QCOMPARE(command1->actionText(), QString("idle-action")); + + QCOMPARE(command1->text(), QString("idle-item")); + QCOMPARE(stack.text(0), QString("idle-item")); + + command1->setText("idle"); + QCOMPARE(command1->actionText(), QString("idle")); + QCOMPARE(command1->text(), QString("idle")); + + command1->setText("idle-item\nidle-action"); + QCOMPARE(command1->actionText(), QString("idle-action")); + QCOMPARE(command1->text(), QString("idle-item")); +} + QTEST_MAIN(tst_QUndoStack) #include "tst_qundostack.moc" -- cgit v1.2.3 From ed8c43b5eef3da60900b169a66f0baf8afd6f0a7 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Wed, 11 May 2011 10:05:36 +1000 Subject: tests: mark some tests as using private API These autotests are all using private symbols, available only when Qt is configured with -developer-build. So, gracefully disable them when the private symbols are not available. Reviewed-by: Jason McDonald Change-Id: Iafd1c7af486feeee810110bc021e75984827f78a --- tests/auto/corelib.pro | 3 +++ tests/auto/gui.pro | 12 ++++++++++++ tests/auto/network.pro | 4 +++- tests/auto/other.pro | 2 ++ 4 files changed, 20 insertions(+), 1 deletion(-) (limited to 'tests/auto') diff --git a/tests/auto/corelib.pro b/tests/auto/corelib.pro index 6810f766c4..95a16f67d9 100644 --- a/tests/auto/corelib.pro +++ b/tests/auto/corelib.pro @@ -112,3 +112,6 @@ symbian:SUBDIRS -= \ qtconcurrentrun \ qtconcurrentthreadengine \ +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + qfileinfo \ + diff --git a/tests/auto/gui.pro b/tests/auto/gui.pro index 6de8ab9303..b7d4ad30b7 100644 --- a/tests/auto/gui.pro +++ b/tests/auto/gui.pro @@ -209,11 +209,23 @@ SUBDIRS=\ win32:SUBDIRS -= qtextpiecetable !contains(QT_CONFIG, private_tests): SUBDIRS -= \ + qcolumnview \ + qgraphicsanchorlayout \ + qgraphicsanchorlayout1 \ + qgraphicsitem \ + qgraphicsscene \ qgraphicssceneindex \ + qlistwidget \ + qmainwindow \ qnetworkreply \ qpathclipper \ + qpixmapcache \ + qsidebar \ qstylesheetstyle \ + qtextlayout \ qtextpiecetable \ + qtipc \ + qtoolbar \ symbian:SUBDIRS -= \ qsystemtrayicon \ diff --git a/tests/auto/network.pro b/tests/auto/network.pro index e4cecce450..7f9ef3c04e 100644 --- a/tests/auto/network.pro +++ b/tests/auto/network.pro @@ -45,10 +45,12 @@ SUBDIRS=\ # qnetworkproxyfactory \ # Uses a hardcoded proxy configuration !contains(QT_CONFIG, private_tests): SUBDIRS -= \ + platformsocketengine \ qauthenticator \ + qhostinfo \ qhttpnetworkconnection \ qhttpnetworkreply \ - platformsocketengine \ + qhttpsocketengine \ qsocketnotifier \ qsocks5socketengine \ diff --git a/tests/auto/other.pro b/tests/auto/other.pro index 881987910b..7da2505750 100644 --- a/tests/auto/other.pro +++ b/tests/auto/other.pro @@ -58,5 +58,7 @@ symbian { # Following tests depends on private API !contains(QT_CONFIG, private_tests): SUBDIRS -= \ + qcombobox \ qcssparser \ + qtextedit \ -- cgit v1.2.3 From 0012bd57a905828dc1f99ae64a182b702455f3bb Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Wed, 11 May 2011 09:53:54 +1000 Subject: tests: make tst_qrawfont compile for QGlyphs -> QGlyphRun API change Broken by 051ef6f294e8cbfa1e30e99e7fd4cf5fb38393f4 Reviewed-by: Jason McDonald Change-Id: Ia8589aba1bfb71d000d8fad455d90e704ba28972 --- tests/auto/qrawfont/tst_qrawfont.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qrawfont/tst_qrawfont.cpp b/tests/auto/qrawfont/tst_qrawfont.cpp index cf46471033..8c5840703a 100644 --- a/tests/auto/qrawfont/tst_qrawfont.cpp +++ b/tests/auto/qrawfont/tst_qrawfont.cpp @@ -835,8 +835,8 @@ void tst_QRawFont::rawFontSetPixelSize() layout.createLine(); layout.endLayout(); - QGlyphs glyphs = layout.glyphs().at(0); - QRawFont rawFont = glyphs.font(); + QGlyphRun glyphs = layout.glyphRuns().at(0); + QRawFont rawFont = glyphs.rawFont(); QCOMPARE(rawFont.pixelSize(), 12.0); rawFont.setPixelSize(24); -- cgit v1.2.3 From 838cf9abd9c724283319be8ef46651f90a3e1d4b Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Wed, 11 May 2011 14:02:41 +1000 Subject: tests: disable tests in qtbase which depend on qtsvg Reviewed-by: Jason McDonald Change-Id: I2416d34b5c262e20ee18f7121e8745327d5614f8 --- tests/auto/host.pro | 2 +- tests/auto/other.pro | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/host.pro b/tests/auto/host.pro index 44216ae101..2b862d2447 100644 --- a/tests/auto/host.pro +++ b/tests/auto/host.pro @@ -3,7 +3,7 @@ SUBDIRS=\ compiler \ headersclean \ maketestselftest \ - moc \ + #moc \ # FIXME: cannot be built as part of qtbase, since it depends on qtsvg uic \ qmake \ rcc \ diff --git a/tests/auto/other.pro b/tests/auto/other.pro index 7da2505750..c52014a192 100644 --- a/tests/auto/other.pro +++ b/tests/auto/other.pro @@ -10,7 +10,8 @@ SUBDIRS=\ qalgorithms \ qcombobox \ qcssparser \ - qdatastream \ + #qdatastream \ # FIXME: cannot be enabled by default in qtbase, + # since it depends on qtsvg qdir \ qfocusevent \ qimage \ -- cgit v1.2.3 From fda40e37df1152b5a8c572fe4bc53620bfcbcc45 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Wed, 11 May 2011 14:02:54 +1000 Subject: tests: fix private header inclusion in qtbase autotests Any test which needs private headers from some Qt module must do: QT += modulename-private Reviewed-by: Jason McDonald Change-Id: I6924a577a960e4990f4379b02bca4822d8248fb4 --- tests/auto/languagechange/languagechange.pro | 1 + tests/auto/nativeimagehandleprovider/nativeimagehandleprovider.pro | 3 +++ tests/auto/qapplication/test/test.pro | 2 ++ tests/auto/qbytearray/qbytearray.pro | 2 +- tests/auto/qchar/qchar.pro | 2 +- tests/auto/qcomplextext/qcomplextext.pro | 1 + tests/auto/qdatetime/qdatetime.pro | 2 +- tests/auto/qdbusabstractadaptor/qdbusabstractadaptor.pro | 2 +- tests/auto/qdbusabstractadaptor/test/test.pro | 3 +-- tests/auto/qdbusinterface/test/test.pro | 3 +-- tests/auto/qdbusmarshall/qdbusmarshall.pro | 2 ++ tests/auto/qdbusmetaobject/qdbusmetaobject.pro | 2 +- tests/auto/qdbustype/qdbustype.pro | 4 ++-- tests/auto/qdbusxmlparser/qdbusxmlparser.pro | 4 ++-- tests/auto/qdockwidget/qdockwidget.pro | 3 +++ tests/auto/qfiledialog2/qfiledialog2.pro | 6 ++---- tests/auto/qfilesystementry/qfilesystementry.pro | 2 +- tests/auto/qfontdialog/qfontdialog.pro | 3 +++ tests/auto/qftp/qftp.pro | 2 +- tests/auto/qfuture/qfuture.pro | 2 +- tests/auto/qfuturewatcher/qfuturewatcher.pro | 2 +- tests/auto/qgraphicseffect/qgraphicseffect.pro | 3 +++ tests/auto/qgraphicseffectsource/qgraphicseffectsource.pro | 3 +++ tests/auto/qgraphicsobject/qgraphicsobject.pro | 5 ++++- tests/auto/qgraphicsproxywidget/qgraphicsproxywidget.pro | 3 +++ tests/auto/qgraphicsview/qgraphicsview.pro | 3 +++ tests/auto/qgraphicswidget/qgraphicswidget.pro | 3 +++ tests/auto/qgridlayout/qgridlayout.pro | 3 +++ tests/auto/qheaderview/qheaderview.pro | 3 +++ tests/auto/qimage/qimage.pro | 2 ++ tests/auto/qimagereader/qimagereader.pro | 2 +- tests/auto/qkeysequence/qkeysequence.pro | 5 ++++- tests/auto/qlabel/qlabel.pro | 3 +++ tests/auto/qlayout/qlayout.pro | 6 ++---- tests/auto/qmdiarea/qmdiarea.pro | 3 +++ tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro | 2 +- tests/auto/qpainter/qpainter.pro | 3 +++ tests/auto/qpauseanimation/qpauseanimation.pro | 2 +- tests/auto/qpixmap/qpixmap.pro | 3 +++ tests/auto/qpixmapfilter/qpixmapfilter.pro | 3 +++ tests/auto/qplaintextedit/qplaintextedit.pro | 2 ++ tests/auto/qrawfont/qrawfont.pro | 3 ++- tests/auto/qregion/qregion.pro | 3 +++ tests/auto/qringbuffer/qringbuffer.pro | 2 +- tests/auto/qsettings/qsettings.pro | 3 +++ tests/auto/qsql/qsql.pro | 2 +- tests/auto/qstandarditemmodel/qstandarditemmodel.pro | 3 +++ tests/auto/qstatemachine/qstatemachine.pro | 2 +- tests/auto/qstatictext/qstatictext.pro | 2 +- tests/auto/qtableview/qtableview.pro | 3 +++ tests/auto/qtabwidget/qtabwidget.pro | 2 ++ tests/auto/qtessellator/qtessellator.pro | 3 +++ tests/auto/qtextblock/qtextblock.pro | 3 +++ tests/auto/qtextdocument/qtextdocument.pro | 2 +- tests/auto/qtextdocumentfragment/qtextdocumentfragment.pro | 3 +++ tests/auto/qtextlist/qtextlist.pro | 3 +++ tests/auto/qtextscriptengine/qtextscriptengine.pro | 3 +++ tests/auto/qvolatileimage/qvolatileimage.pro | 3 +++ tests/auto/qwidget/qwidget.pro | 3 +++ tests/auto/qwindowsurface/qwindowsurface.pro | 3 +++ tests/auto/selftests/benchlibtickcounter/benchlibtickcounter.pro | 2 +- tests/auto/selftests/test/test.pro | 2 +- 62 files changed, 132 insertions(+), 38 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/languagechange/languagechange.pro b/tests/auto/languagechange/languagechange.pro index 1a1d91e90a..f161c50864 100644 --- a/tests/auto/languagechange/languagechange.pro +++ b/tests/auto/languagechange/languagechange.pro @@ -1,3 +1,4 @@ load(qttest_p4) +QT += core-private SOURCES += tst_languagechange.cpp diff --git a/tests/auto/nativeimagehandleprovider/nativeimagehandleprovider.pro b/tests/auto/nativeimagehandleprovider/nativeimagehandleprovider.pro index fb8ecb0042..70ea53c369 100644 --- a/tests/auto/nativeimagehandleprovider/nativeimagehandleprovider.pro +++ b/tests/auto/nativeimagehandleprovider/nativeimagehandleprovider.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += gui-private + SOURCES += tst_nativeimagehandleprovider.cpp symbian { LIBS += -lfbscli -lbitgdi diff --git a/tests/auto/qapplication/test/test.pro b/tests/auto/qapplication/test/test.pro index 73799f4e2b..adda481829 100644 --- a/tests/auto/qapplication/test/test.pro +++ b/tests/auto/qapplication/test/test.pro @@ -1,5 +1,7 @@ load(qttest_p4) +QT += core-private gui-private + SOURCES += ../tst_qapplication.cpp TARGET = ../tst_qapplication diff --git a/tests/auto/qbytearray/qbytearray.pro b/tests/auto/qbytearray/qbytearray.pro index f195dc8c71..2c58db6b84 100644 --- a/tests/auto/qbytearray/qbytearray.pro +++ b/tests/auto/qbytearray/qbytearray.pro @@ -2,7 +2,7 @@ load(qttest_p4) SOURCES += tst_qbytearray.cpp -QT = core +QT = core core-private wince*|symbian { addFile.files = rfc3252.txt diff --git a/tests/auto/qchar/qchar.pro b/tests/auto/qchar/qchar.pro index 1681220117..154c37e1af 100644 --- a/tests/auto/qchar/qchar.pro +++ b/tests/auto/qchar/qchar.pro @@ -1,7 +1,7 @@ load(qttest_p4) SOURCES += tst_qchar.cpp -QT = core +QT = core core-private wince*|symbian: { deploy.files += NormalizationTest.txt diff --git a/tests/auto/qcomplextext/qcomplextext.pro b/tests/auto/qcomplextext/qcomplextext.pro index 9c64b40241..bd85daa6b4 100644 --- a/tests/auto/qcomplextext/qcomplextext.pro +++ b/tests/auto/qcomplextext/qcomplextext.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += core-private gui-private SOURCES += tst_qcomplextext.cpp INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src diff --git a/tests/auto/qdatetime/qdatetime.pro b/tests/auto/qdatetime/qdatetime.pro index 08a321ef75..cd335826ec 100644 --- a/tests/auto/qdatetime/qdatetime.pro +++ b/tests/auto/qdatetime/qdatetime.pro @@ -1,7 +1,7 @@ load(qttest_p4) SOURCES += tst_qdatetime.cpp -QT = core +QT = core core-private # For some reason using optimization here triggers a compiler issue, which causes an exception # However, the code is correct diff --git a/tests/auto/qdbusabstractadaptor/qdbusabstractadaptor.pro b/tests/auto/qdbusabstractadaptor/qdbusabstractadaptor.pro index c3e3f7f503..480509853f 100644 --- a/tests/auto/qdbusabstractadaptor/qdbusabstractadaptor.pro +++ b/tests/auto/qdbusabstractadaptor/qdbusabstractadaptor.pro @@ -1,5 +1,5 @@ load(qttest_p4) -QT = core +QT = core core-private contains(QT_CONFIG,dbus): { TEMPLATE = subdirs CONFIG += ordered diff --git a/tests/auto/qdbusabstractadaptor/test/test.pro b/tests/auto/qdbusabstractadaptor/test/test.pro index 014a9e81f6..52aa578fd4 100644 --- a/tests/auto/qdbusabstractadaptor/test/test.pro +++ b/tests/auto/qdbusabstractadaptor/test/test.pro @@ -3,5 +3,4 @@ SOURCES += ../tst_qdbusabstractadaptor.cpp HEADERS += ../myobject.h TARGET = ../tst_qdbusabstractadaptor -QT = core -QT += dbus +QT = core core-private dbus diff --git a/tests/auto/qdbusinterface/test/test.pro b/tests/auto/qdbusinterface/test/test.pro index 3252188b6e..2ef7a89c56 100644 --- a/tests/auto/qdbusinterface/test/test.pro +++ b/tests/auto/qdbusinterface/test/test.pro @@ -3,5 +3,4 @@ SOURCES += ../tst_qdbusinterface.cpp HEADERS += ../myobject.h TARGET = ../tst_qdbusinterface -QT = core -QT += dbus +QT = core core-private dbus diff --git a/tests/auto/qdbusmarshall/qdbusmarshall.pro b/tests/auto/qdbusmarshall/qdbusmarshall.pro index ad40c0d0b2..1b6408a2f9 100644 --- a/tests/auto/qdbusmarshall/qdbusmarshall.pro +++ b/tests/auto/qdbusmarshall/qdbusmarshall.pro @@ -4,6 +4,8 @@ contains(QT_CONFIG,dbus): { CONFIG += ordered SUBDIRS = qpong test + QT += core-private + requires(contains(QT_CONFIG,private_tests)) } else { SOURCES += dummy.cpp diff --git a/tests/auto/qdbusmetaobject/qdbusmetaobject.pro b/tests/auto/qdbusmetaobject/qdbusmetaobject.pro index c7b5eacaf0..fa59c06c8e 100644 --- a/tests/auto/qdbusmetaobject/qdbusmetaobject.pro +++ b/tests/auto/qdbusmetaobject/qdbusmetaobject.pro @@ -2,7 +2,7 @@ load(qttest_p4) QT = core contains(QT_CONFIG,dbus): { SOURCES += tst_qdbusmetaobject.cpp - QT += dbus + QT += dbus dbus-private } else { SOURCES += ../qdbusmarshall/dummy.cpp } diff --git a/tests/auto/qdbustype/qdbustype.pro b/tests/auto/qdbustype/qdbustype.pro index e2f0c9017c..9b6808b562 100644 --- a/tests/auto/qdbustype/qdbustype.pro +++ b/tests/auto/qdbustype/qdbustype.pro @@ -1,8 +1,8 @@ load(qttest_p4) -QT = core +QT = core core-private contains(QT_CONFIG,dbus): { SOURCES += tst_qdbustype.cpp - QT += dbus + QT += dbus dbus-private QMAKE_CXXFLAGS += $$QT_CFLAGS_DBUS LIBS_PRIVATE += $$QT_LIBS_DBUS } else { diff --git a/tests/auto/qdbusxmlparser/qdbusxmlparser.pro b/tests/auto/qdbusxmlparser/qdbusxmlparser.pro index e8fd4c7722..0ac0d9e198 100644 --- a/tests/auto/qdbusxmlparser/qdbusxmlparser.pro +++ b/tests/auto/qdbusxmlparser/qdbusxmlparser.pro @@ -1,8 +1,8 @@ load(qttest_p4) -QT = core +QT = core core-private contains(QT_CONFIG,dbus): { SOURCES += tst_qdbusxmlparser.cpp - QT += dbus + QT += dbus dbus-private } else { SOURCES += ../qdbusmarshall/dummy.cpp } diff --git a/tests/auto/qdockwidget/qdockwidget.pro b/tests/auto/qdockwidget/qdockwidget.pro index 14963720dd..5f92e5db19 100644 --- a/tests/auto/qdockwidget/qdockwidget.pro +++ b/tests/auto/qdockwidget/qdockwidget.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += core-private gui-private + SOURCES += tst_qdockwidget.cpp diff --git a/tests/auto/qfiledialog2/qfiledialog2.pro b/tests/auto/qfiledialog2/qfiledialog2.pro index b8924c161b..5d1d72195d 100644 --- a/tests/auto/qfiledialog2/qfiledialog2.pro +++ b/tests/auto/qfiledialog2/qfiledialog2.pro @@ -1,9 +1,7 @@ -############################################################ -# Project file for autotest for file qfiledialog.h -############################################################ - load(qttest_p4) +QT += core-private gui-private + SOURCES += tst_qfiledialog2.cpp wince*|symbian { diff --git a/tests/auto/qfilesystementry/qfilesystementry.pro b/tests/auto/qfilesystementry/qfilesystementry.pro index b9b43e6a9f..31f0064bd1 100644 --- a/tests/auto/qfilesystementry/qfilesystementry.pro +++ b/tests/auto/qfilesystementry/qfilesystementry.pro @@ -3,6 +3,6 @@ load(qttest_p4) SOURCES += tst_qfilesystementry.cpp \ ../../../src/corelib/io/qfilesystementry.cpp HEADERS += ../../../src/corelib/io/qfilesystementry_p.h -QT = core +QT = core core-private CONFIG += parallel_test diff --git a/tests/auto/qfontdialog/qfontdialog.pro b/tests/auto/qfontdialog/qfontdialog.pro index 8a4485d94f..637e896518 100644 --- a/tests/auto/qfontdialog/qfontdialog.pro +++ b/tests/auto/qfontdialog/qfontdialog.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += core-private gui-private + SOURCES += tst_qfontdialog.cpp mac { diff --git a/tests/auto/qftp/qftp.pro b/tests/auto/qftp/qftp.pro index ac1702e715..69f89572ba 100644 --- a/tests/auto/qftp/qftp.pro +++ b/tests/auto/qftp/qftp.pro @@ -2,7 +2,7 @@ load(qttest_p4) SOURCES += tst_qftp.cpp -QT = core network +QT = core network network-private wince*: { addFiles.files = rfc3252.txt diff --git a/tests/auto/qfuture/qfuture.pro b/tests/auto/qfuture/qfuture.pro index d6faae716c..0e74f47678 100644 --- a/tests/auto/qfuture/qfuture.pro +++ b/tests/auto/qfuture/qfuture.pro @@ -1,5 +1,5 @@ load(qttest_p4) DEFINES += QT_STRICT_ITERATORS SOURCES += tst_qfuture.cpp -QT = core +QT = core core-private CONFIG += parallel_test diff --git a/tests/auto/qfuturewatcher/qfuturewatcher.pro b/tests/auto/qfuturewatcher/qfuturewatcher.pro index 67f04ef0e5..9de37d014f 100644 --- a/tests/auto/qfuturewatcher/qfuturewatcher.pro +++ b/tests/auto/qfuturewatcher/qfuturewatcher.pro @@ -1,4 +1,4 @@ load(qttest_p4) SOURCES += tst_qfuturewatcher.cpp -QT = core +QT = core core-private CONFIG += parallel_test diff --git a/tests/auto/qgraphicseffect/qgraphicseffect.pro b/tests/auto/qgraphicseffect/qgraphicseffect.pro index 94b3ce619e..963eca25c4 100644 --- a/tests/auto/qgraphicseffect/qgraphicseffect.pro +++ b/tests/auto/qgraphicseffect/qgraphicseffect.pro @@ -1,3 +1,6 @@ load(qttest_p4) + +QT += core-private gui-private + SOURCES += tst_qgraphicseffect.cpp CONFIG += parallel_test diff --git a/tests/auto/qgraphicseffectsource/qgraphicseffectsource.pro b/tests/auto/qgraphicseffectsource/qgraphicseffectsource.pro index 5658ad7851..da437e959c 100644 --- a/tests/auto/qgraphicseffectsource/qgraphicseffectsource.pro +++ b/tests/auto/qgraphicseffectsource/qgraphicseffectsource.pro @@ -1,3 +1,6 @@ load(qttest_p4) + +QT += core-private gui-private + SOURCES += tst_qgraphicseffectsource.cpp CONFIG += parallel_test diff --git a/tests/auto/qgraphicsobject/qgraphicsobject.pro b/tests/auto/qgraphicsobject/qgraphicsobject.pro index 2418845b73..648a81f6c6 100644 --- a/tests/auto/qgraphicsobject/qgraphicsobject.pro +++ b/tests/auto/qgraphicsobject/qgraphicsobject.pro @@ -1,3 +1,6 @@ load(qttest_p4) + +QT += core-private + SOURCES += tst_qgraphicsobject.cpp -CONFIG += parallel_test \ No newline at end of file +CONFIG += parallel_test diff --git a/tests/auto/qgraphicsproxywidget/qgraphicsproxywidget.pro b/tests/auto/qgraphicsproxywidget/qgraphicsproxywidget.pro index 08d7b1ab91..7217008317 100644 --- a/tests/auto/qgraphicsproxywidget/qgraphicsproxywidget.pro +++ b/tests/auto/qgraphicsproxywidget/qgraphicsproxywidget.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += core-private gui-private + SOURCES += tst_qgraphicsproxywidget.cpp diff --git a/tests/auto/qgraphicsview/qgraphicsview.pro b/tests/auto/qgraphicsview/qgraphicsview.pro index 5e7e53da6e..4d80caebaf 100644 --- a/tests/auto/qgraphicsview/qgraphicsview.pro +++ b/tests/auto/qgraphicsview/qgraphicsview.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += core-private gui-private + SOURCES += tst_qgraphicsview.cpp tst_qgraphicsview_2.cpp DEFINES += QT_NO_CAST_TO_ASCII diff --git a/tests/auto/qgraphicswidget/qgraphicswidget.pro b/tests/auto/qgraphicswidget/qgraphicswidget.pro index ae61c2abca..4f568eefda 100644 --- a/tests/auto/qgraphicswidget/qgraphicswidget.pro +++ b/tests/auto/qgraphicswidget/qgraphicswidget.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += core-private gui-private + SOURCES += tst_qgraphicswidget.cpp diff --git a/tests/auto/qgridlayout/qgridlayout.pro b/tests/auto/qgridlayout/qgridlayout.pro index 00cc5eede7..d034f1d031 100644 --- a/tests/auto/qgridlayout/qgridlayout.pro +++ b/tests/auto/qgridlayout/qgridlayout.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += core-private gui-private + SOURCES += tst_qgridlayout.cpp FORMS += sortdialog.ui diff --git a/tests/auto/qheaderview/qheaderview.pro b/tests/auto/qheaderview/qheaderview.pro index 3436d4fc20..9910e4e89d 100644 --- a/tests/auto/qheaderview/qheaderview.pro +++ b/tests/auto/qheaderview/qheaderview.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += core-private gui-private + SOURCES += tst_qheaderview.cpp diff --git a/tests/auto/qimage/qimage.pro b/tests/auto/qimage/qimage.pro index 798c82ea2d..f845ad7b1c 100644 --- a/tests/auto/qimage/qimage.pro +++ b/tests/auto/qimage/qimage.pro @@ -1,6 +1,8 @@ load(qttest_p4) SOURCES += tst_qimage.cpp +QT += core-private gui-private + wince*: { addImages.files = images/* addImages.path = images diff --git a/tests/auto/qimagereader/qimagereader.pro b/tests/auto/qimagereader/qimagereader.pro index 827819dea5..bf77fb7a2e 100644 --- a/tests/auto/qimagereader/qimagereader.pro +++ b/tests/auto/qimagereader/qimagereader.pro @@ -1,7 +1,7 @@ load(qttest_p4) SOURCES += tst_qimagereader.cpp MOC_DIR=tmp -QT += network +QT += core-private gui-private network RESOURCES += qimagereader.qrc !symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/qkeysequence/qkeysequence.pro b/tests/auto/qkeysequence/qkeysequence.pro index bd85402e31..720c53d627 100644 --- a/tests/auto/qkeysequence/qkeysequence.pro +++ b/tests/auto/qkeysequence/qkeysequence.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += core-private gui-private + SOURCES += tst_qkeysequence.cpp -RESOURCES += qkeysequence.qrc \ No newline at end of file +RESOURCES += qkeysequence.qrc diff --git a/tests/auto/qlabel/qlabel.pro b/tests/auto/qlabel/qlabel.pro index 057a6f1509..4b510cca52 100644 --- a/tests/auto/qlabel/qlabel.pro +++ b/tests/auto/qlabel/qlabel.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += core-private gui-private + SOURCES += tst_qlabel.cpp wince*::DEFINES += SRCDIR=\\\"\\\" else:!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\" diff --git a/tests/auto/qlayout/qlayout.pro b/tests/auto/qlayout/qlayout.pro index bb1ae4a322..3fbc580d5c 100644 --- a/tests/auto/qlayout/qlayout.pro +++ b/tests/auto/qlayout/qlayout.pro @@ -1,9 +1,7 @@ -############################################################ -# Project file for autotest for file qlayout.h -############################################################ - load(qttest_p4) +QT += gui-private + SOURCES += tst_qlayout.cpp contains(QT_CONFIG, qt3support): QT += qt3support wince*|symbian: { diff --git a/tests/auto/qmdiarea/qmdiarea.pro b/tests/auto/qmdiarea/qmdiarea.pro index 3b81c9e011..a84eeab45d 100644 --- a/tests/auto/qmdiarea/qmdiarea.pro +++ b/tests/auto/qmdiarea/qmdiarea.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += gui-private + INCLUDEPATH += . SOURCES += tst_qmdiarea.cpp DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII diff --git a/tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro b/tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro index 6d75fab758..4e5f01745a 100644 --- a/tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro +++ b/tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro @@ -1,5 +1,5 @@ load(qttest_p4) SOURCES += tst_qnetworkcookiejar.cpp -QT = core network +QT = core core-private network network-private symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qpainter/qpainter.pro b/tests/auto/qpainter/qpainter.pro index ee624e1ef6..2db6ff381e 100644 --- a/tests/auto/qpainter/qpainter.pro +++ b/tests/auto/qpainter/qpainter.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += gui-private + contains(QT_CONFIG, qt3support): QT += qt3support SOURCES += tst_qpainter.cpp wince*|symbian: { diff --git a/tests/auto/qpauseanimation/qpauseanimation.pro b/tests/auto/qpauseanimation/qpauseanimation.pro index 4599cf0fb5..7f612b69fe 100644 --- a/tests/auto/qpauseanimation/qpauseanimation.pro +++ b/tests/auto/qpauseanimation/qpauseanimation.pro @@ -1,5 +1,5 @@ load(qttest_p4) -QT = core gui +QT = core core-private gui gui-private SOURCES += tst_qpauseanimation.cpp diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro index e73c130827..9f8e2f4166 100644 --- a/tests/auto/qpixmap/qpixmap.pro +++ b/tests/auto/qpixmap/qpixmap.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += core-private gui-private + SOURCES += tst_qpixmap.cpp contains(QT_CONFIG, qt3support): QT += qt3support wince*|symbian: { diff --git a/tests/auto/qpixmapfilter/qpixmapfilter.pro b/tests/auto/qpixmapfilter/qpixmapfilter.pro index 964e56d6f3..d52a3c39a3 100644 --- a/tests/auto/qpixmapfilter/qpixmapfilter.pro +++ b/tests/auto/qpixmapfilter/qpixmapfilter.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += gui-private + SOURCES += tst_qpixmapfilter.cpp wince*: { diff --git a/tests/auto/qplaintextedit/qplaintextedit.pro b/tests/auto/qplaintextedit/qplaintextedit.pro index f3d359dd47..fef1ac83aa 100644 --- a/tests/auto/qplaintextedit/qplaintextedit.pro +++ b/tests/auto/qplaintextedit/qplaintextedit.pro @@ -1,5 +1,7 @@ load(qttest_p4) +QT += gui-private + INCLUDEPATH += ../ HEADERS += diff --git a/tests/auto/qrawfont/qrawfont.pro b/tests/auto/qrawfont/qrawfont.pro index ccdccfb0eb..1f73055b00 100644 --- a/tests/auto/qrawfont/qrawfont.pro +++ b/tests/auto/qrawfont/qrawfont.pro @@ -1,5 +1,6 @@ load(qttest_p4) -QT = core gui + +QT = core core-private gui gui-private SOURCES += \ tst_qrawfont.cpp diff --git a/tests/auto/qregion/qregion.pro b/tests/auto/qregion/qregion.pro index b264d351b0..8dbb4844a0 100644 --- a/tests/auto/qregion/qregion.pro +++ b/tests/auto/qregion/qregion.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += gui-private + SOURCES += tst_qregion.cpp diff --git a/tests/auto/qringbuffer/qringbuffer.pro b/tests/auto/qringbuffer/qringbuffer.pro index 2e4f166619..dc572d0633 100644 --- a/tests/auto/qringbuffer/qringbuffer.pro +++ b/tests/auto/qringbuffer/qringbuffer.pro @@ -1,7 +1,7 @@ load(qttest_p4) SOURCES += tst_qringbuffer.cpp -QT = core +QT = core core-private CONFIG += parallel_test diff --git a/tests/auto/qsettings/qsettings.pro b/tests/auto/qsettings/qsettings.pro index fe104dfaa9..151660d21c 100644 --- a/tests/auto/qsettings/qsettings.pro +++ b/tests/auto/qsettings/qsettings.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += core-private + SOURCES += tst_qsettings.cpp RESOURCES += qsettings.qrc diff --git a/tests/auto/qsql/qsql.pro b/tests/auto/qsql/qsql.pro index 9bf30f8055..6d132f5b68 100644 --- a/tests/auto/qsql/qsql.pro +++ b/tests/auto/qsql/qsql.pro @@ -1,7 +1,7 @@ load(qttest_p4) SOURCES += tst_qsql.cpp -QT += sql +QT += sql sql-private contains(QT_CONFIG, qt3support): QT += qt3support diff --git a/tests/auto/qstandarditemmodel/qstandarditemmodel.pro b/tests/auto/qstandarditemmodel/qstandarditemmodel.pro index cc622e2e74..0fc47b3624 100644 --- a/tests/auto/qstandarditemmodel/qstandarditemmodel.pro +++ b/tests/auto/qstandarditemmodel/qstandarditemmodel.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += core-private gui-private + SOURCES += tst_qstandarditemmodel.cpp diff --git a/tests/auto/qstatemachine/qstatemachine.pro b/tests/auto/qstatemachine/qstatemachine.pro index e5b32b570a..ab71202f18 100644 --- a/tests/auto/qstatemachine/qstatemachine.pro +++ b/tests/auto/qstatemachine/qstatemachine.pro @@ -1,4 +1,4 @@ load(qttest_p4) -QT = core gui +QT = core core-private gui SOURCES += tst_qstatemachine.cpp diff --git a/tests/auto/qstatictext/qstatictext.pro b/tests/auto/qstatictext/qstatictext.pro index 0f1ca68595..0c16c4c149 100644 --- a/tests/auto/qstatictext/qstatictext.pro +++ b/tests/auto/qstatictext/qstatictext.pro @@ -1,4 +1,4 @@ load(qttest_p4) -QT = core gui +QT = core core-private gui gui-private SOURCES += tst_qstatictext.cpp diff --git a/tests/auto/qtableview/qtableview.pro b/tests/auto/qtableview/qtableview.pro index 72099d45c2..16284b23b4 100644 --- a/tests/auto/qtableview/qtableview.pro +++ b/tests/auto/qtableview/qtableview.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += core-private gui-private + TARGET.EPOCHEAPSIZE = 0x200000 0x800000 SOURCES += tst_qtableview.cpp diff --git a/tests/auto/qtabwidget/qtabwidget.pro b/tests/auto/qtabwidget/qtabwidget.pro index 0c2fc66981..37aec5fc2a 100644 --- a/tests/auto/qtabwidget/qtabwidget.pro +++ b/tests/auto/qtabwidget/qtabwidget.pro @@ -1,5 +1,7 @@ load(qttest_p4) +QT += gui-private + INCLUDEPATH += ../ HEADERS += diff --git a/tests/auto/qtessellator/qtessellator.pro b/tests/auto/qtessellator/qtessellator.pro index e043a4dc8b..6821d0e909 100644 --- a/tests/auto/qtessellator/qtessellator.pro +++ b/tests/auto/qtessellator/qtessellator.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += gui-private + SOURCES += tst_tessellator.cpp testtessellator.cpp oldtessellator.cpp utils.cpp simple.cpp dataparser.cpp arc.cpp HEADERS += oldtessellator.h testtessellator.h utils.h XRenderFake.h simple.h qnum.h dataparser.h arc.h diff --git a/tests/auto/qtextblock/qtextblock.pro b/tests/auto/qtextblock/qtextblock.pro index 14a705f910..5558a71506 100644 --- a/tests/auto/qtextblock/qtextblock.pro +++ b/tests/auto/qtextblock/qtextblock.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += core-private gui-private + SOURCES += tst_qtextblock.cpp diff --git a/tests/auto/qtextdocument/qtextdocument.pro b/tests/auto/qtextdocument/qtextdocument.pro index 1e44a9c1b4..69517589cc 100644 --- a/tests/auto/qtextdocument/qtextdocument.pro +++ b/tests/auto/qtextdocument/qtextdocument.pro @@ -1,5 +1,5 @@ load(qttest_p4) -QT += xml +QT += core-private gui-private xml HEADERS += common.h SOURCES += tst_qtextdocument.cpp diff --git a/tests/auto/qtextdocumentfragment/qtextdocumentfragment.pro b/tests/auto/qtextdocumentfragment/qtextdocumentfragment.pro index 5df193788e..e6ddd45f85 100644 --- a/tests/auto/qtextdocumentfragment/qtextdocumentfragment.pro +++ b/tests/auto/qtextdocumentfragment/qtextdocumentfragment.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += core-private gui-private + SOURCES += tst_qtextdocumentfragment.cpp diff --git a/tests/auto/qtextlist/qtextlist.pro b/tests/auto/qtextlist/qtextlist.pro index 846350bc49..f66fb96dd0 100644 --- a/tests/auto/qtextlist/qtextlist.pro +++ b/tests/auto/qtextlist/qtextlist.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += core-private gui-private + SOURCES += tst_qtextlist.cpp HEADERS += ../qtextdocument/common.h diff --git a/tests/auto/qtextscriptengine/qtextscriptengine.pro b/tests/auto/qtextscriptengine/qtextscriptengine.pro index 128b9afb9a..e40ddff777 100644 --- a/tests/auto/qtextscriptengine/qtextscriptengine.pro +++ b/tests/auto/qtextscriptengine/qtextscriptengine.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += core-private gui-private + HEADERS += SOURCES += tst_qtextscriptengine.cpp INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src diff --git a/tests/auto/qvolatileimage/qvolatileimage.pro b/tests/auto/qvolatileimage/qvolatileimage.pro index 5a0a613ffa..4be93896c4 100644 --- a/tests/auto/qvolatileimage/qvolatileimage.pro +++ b/tests/auto/qvolatileimage/qvolatileimage.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += gui-private + SOURCES += tst_qvolatileimage.cpp symbian { diff --git a/tests/auto/qwidget/qwidget.pro b/tests/auto/qwidget/qwidget.pro index e39431b9b4..fbbed3d8fa 100644 --- a/tests/auto/qwidget/qwidget.pro +++ b/tests/auto/qwidget/qwidget.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += core-private gui-private + SOURCES += tst_qwidget.cpp RESOURCES = qwidget.qrc diff --git a/tests/auto/qwindowsurface/qwindowsurface.pro b/tests/auto/qwindowsurface/qwindowsurface.pro index e5686beb6a..f236793b91 100644 --- a/tests/auto/qwindowsurface/qwindowsurface.pro +++ b/tests/auto/qwindowsurface/qwindowsurface.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT += gui-private + SOURCES += tst_qwindowsurface.cpp diff --git a/tests/auto/selftests/benchlibtickcounter/benchlibtickcounter.pro b/tests/auto/selftests/benchlibtickcounter/benchlibtickcounter.pro index 3621449862..4f7f141a58 100644 --- a/tests/auto/selftests/benchlibtickcounter/benchlibtickcounter.pro +++ b/tests/auto/selftests/benchlibtickcounter/benchlibtickcounter.pro @@ -1,6 +1,6 @@ load(qttest_p4) SOURCES += tst_benchlibtickcounter.cpp -QT = core +QT = core testlib-private mac:CONFIG -= app_bundle CONFIG -= debug_and_release_target diff --git a/tests/auto/selftests/test/test.pro b/tests/auto/selftests/test/test.pro index d61606cefb..f0e0f7593c 100644 --- a/tests/auto/selftests/test/test.pro +++ b/tests/auto/selftests/test/test.pro @@ -1,6 +1,6 @@ load(qttest_p4) SOURCES += ../tst_selftests.cpp -QT += core xml +QT += core xml testlib-private TARGET = ../tst_selftests -- cgit v1.2.3