From b798fc523446b4b7c7e888f7ef504202730e6cb5 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 28 Sep 2009 14:56:03 +0200 Subject: Mac: backport efd84105355 to silence visibility warnings Make sure that we build objective c files with visibility hidden as default Reviewed-by: prasanth --- mkspecs/features/mac/objective_c.prf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mkspecs/features/mac/objective_c.prf b/mkspecs/features/mac/objective_c.prf index 0a73af9..0df7013 100644 --- a/mkspecs/features/mac/objective_c.prf +++ b/mkspecs/features/mac/objective_c.prf @@ -1,6 +1,5 @@ isEmpty(QMAKE_OBJECTIVE_CC):QMAKE_OBJECTIVE_CC = $$QMAKE_CC -isEmpty(QMAKE_OBJECTIVE_CFLAGS) { #bootstrap QMAKE_OBJECTIVE_CFLAGS = $$QMAKE_CFLAGS QMAKE_OBJECTIVE_CFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON QMAKE_OBJECTIVE_CFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF @@ -9,7 +8,7 @@ isEmpty(QMAKE_OBJECTIVE_CFLAGS) { #bootstrap QMAKE_OBJECTIVE_CFLAGS_X86 = $$QMAKE_CFLAGS_X86 QMAKE_OBJECTIVE_CFLAGS_PPC = $$QMAKE_CFLAGS_PPC QMAKE_OBJECTIVE_CFLAGS_HIDESYMS = $$QMAKE_CXXFLAGS_HIDESYMS -} + OBJECTIVE_C_OBJECTS_DIR = $$OBJECTS_DIR isEmpty(OBJECTIVE_C_OBJECTS_DIR):OBJECTIVE_C_OBJECTS_DIR = . isEmpty(QMAKE_EXT_OBJECTIVE_C):QMAKE_EXT_OBJECTIVE_C = .mm .m -- cgit v0.12 From 62624c575bd784b36b1d080d32f168e0668ca15b Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 28 Sep 2009 15:07:24 +0200 Subject: Mac: build issue (autotest stalls build) When building Qt static on Mac, the test included actually stops the build process, prompting the user for 'Promteroo?' The reason is that configure runs qmake on all the tests inside the test/auto directory, including the one that is meant for testing qmake itself. In other words, this test should not be qmake'ed when running configure, only when running the qmake auto test. However, the qmake auto test does not run the prompt test anymore either. So the solution for now is to just comment out the test project as well. Reviewed-by: alexis --- tests/auto/qmake/testdata/prompt/prompt.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qmake/testdata/prompt/prompt.pro b/tests/auto/qmake/testdata/prompt/prompt.pro index 02db4fe..238022c 100644 --- a/tests/auto/qmake/testdata/prompt/prompt.pro +++ b/tests/auto/qmake/testdata/prompt/prompt.pro @@ -1,2 +1,2 @@ -a = $$prompt(Prompteroo) +# a = $$prompt(Prompteroo) -- cgit v0.12 From 6c58b17004d35ed652b5e93316f3f1c9d002d3b6 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 28 Sep 2009 15:33:55 +0200 Subject: tst_qnetworkcookiejar: Backported 4.6 changes Reviewed-by: TrustMe --- .../qnetworkcookiejar/tst_qnetworkcookiejar.cpp | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp b/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp index 946f4d3..9b9c56a 100644 --- a/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp +++ b/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp @@ -220,21 +220,21 @@ void tst_QNetworkCookieJar::cookiesForUrl_data() QNetworkCookie cookie; cookie.setName("a"); cookie.setPath("/web"); - cookie.setDomain(".trolltech.com"); + cookie.setDomain(".nokia.com"); allCookies += cookie; QTest::newRow("no-match-1") << allCookies << "http://foo.bar/" << result; QTest::newRow("no-match-2") << allCookies << "http://foo.bar/web" << result; QTest::newRow("no-match-3") << allCookies << "http://foo.bar/web/wiki" << result; - QTest::newRow("no-match-4") << allCookies << "http://trolltech.com" << result; + QTest::newRow("no-match-4") << allCookies << "http://nokia.com" << result; QTest::newRow("no-match-5") << allCookies << "http://qt.nokia.com" << result; - QTest::newRow("no-match-6") << allCookies << "http://trolltech.com/webinar" << result; + QTest::newRow("no-match-6") << allCookies << "http://nokia.com/webinar" << result; QTest::newRow("no-match-7") << allCookies << "http://qt.nokia.com/webinar" << result; result = allCookies; - QTest::newRow("match-1") << allCookies << "http://trolltech.com/web" << result; - QTest::newRow("match-2") << allCookies << "http://trolltech.com/web/" << result; - QTest::newRow("match-3") << allCookies << "http://trolltech.com/web/content" << result; + QTest::newRow("match-1") << allCookies << "http://nokia.com/web" << result; + QTest::newRow("match-2") << allCookies << "http://nokia.com/web/" << result; + QTest::newRow("match-3") << allCookies << "http://nokia.com/web/content" << result; QTest::newRow("match-4") << allCookies << "http://qt.nokia.com/web" << result; QTest::newRow("match-4") << allCookies << "http://qt.nokia.com/web/" << result; QTest::newRow("match-6") << allCookies << "http://qt.nokia.com/web/content" << result; @@ -243,21 +243,21 @@ void tst_QNetworkCookieJar::cookiesForUrl_data() allCookies += cookie; // exact same results as before: - QTest::newRow("one-match-1") << allCookies << "http://trolltech.com/web" << result; - QTest::newRow("one-match-2") << allCookies << "http://trolltech.com/web/" << result; - QTest::newRow("one-match-3") << allCookies << "http://trolltech.com/web/content" << result; + QTest::newRow("one-match-1") << allCookies << "http://nokia.com/web" << result; + QTest::newRow("one-match-2") << allCookies << "http://nokia.com/web/" << result; + QTest::newRow("one-match-3") << allCookies << "http://nokia.com/web/content" << result; QTest::newRow("one-match-4") << allCookies << "http://qt.nokia.com/web" << result; QTest::newRow("one-match-4") << allCookies << "http://qt.nokia.com/web/" << result; QTest::newRow("one-match-6") << allCookies << "http://qt.nokia.com/web/content" << result; result.prepend(cookie); // longer path, it must match first - QTest::newRow("two-matches-1") << allCookies << "http://trolltech.com/web/wiki" << result; + QTest::newRow("two-matches-1") << allCookies << "http://nokia.com/web/wiki" << result; QTest::newRow("two-matches-2") << allCookies << "http://qt.nokia.com/web/wiki" << result; // invert the order; allCookies.clear(); allCookies << result.at(1) << result.at(0); - QTest::newRow("two-matches-3") << allCookies << "http://trolltech.com/web/wiki" << result; + QTest::newRow("two-matches-3") << allCookies << "http://nokia.com/web/wiki" << result; QTest::newRow("two-matches-4") << allCookies << "http://qt.nokia.com/web/wiki" << result; // expired cookie @@ -265,9 +265,9 @@ void tst_QNetworkCookieJar::cookiesForUrl_data() cookie.setExpirationDate(QDateTime::fromString("09-Nov-1999", "dd-MMM-yyyy")); allCookies += cookie; result.clear(); - QTest::newRow("exp-match-1") << allCookies << "http://trolltech.com/web" << result; - QTest::newRow("exp-match-2") << allCookies << "http://trolltech.com/web/" << result; - QTest::newRow("exp-match-3") << allCookies << "http://trolltech.com/web/content" << result; + QTest::newRow("exp-match-1") << allCookies << "http://nokia.com/web" << result; + QTest::newRow("exp-match-2") << allCookies << "http://nokia.com/web/" << result; + QTest::newRow("exp-match-3") << allCookies << "http://nokia.com/web/content" << result; QTest::newRow("exp-match-4") << allCookies << "http://qt.nokia.com/web" << result; QTest::newRow("exp-match-4") << allCookies << "http://qt.nokia.com/web/" << result; QTest::newRow("exp-match-6") << allCookies << "http://qt.nokia.com/web/content" << result; -- cgit v0.12 From 9167aabca46c46dff0630cfc349f777211734219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 28 Sep 2009 19:26:47 +0200 Subject: Added my 4.5.3 changes to changelog. --- dist/changes-4.5.3 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dist/changes-4.5.3 b/dist/changes-4.5.3 index d797b4c..ac5a1f7 100644 --- a/dist/changes-4.5.3 +++ b/dist/changes-4.5.3 @@ -52,6 +52,18 @@ Third party components HTTP request. * [256630] Fix usage of QProgressDialog together with QNetworkReply. +- QPainter + * [254105] Fixed potential segmentation fault when setting empty clip + rectangle. + * [256549] Fixed inconsistent behavior between paint engines when + setting an IntersectClip after doing setClipping(false). + * [254407] Fixed rendering issue with outline drawing using + projective transforms. + * [258776] Fixed rounding bug in drawImage(). + +- QPainterPath + * [251909] Fixed bug in QPainterPath::united() / simplified(). + - QSslCertificate * [256066] Fix loading of a PEM when the length was a multiple of 64. -- cgit v0.12 From 390c40d7d2bbc622e18aa1c096d0b5fee5a04344 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Fri, 25 Sep 2009 09:25:22 -0700 Subject: Update changes file for 4.5.3 for DirectFB Reviewed-by: TrustMe --- dist/changes-4.5.3 | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/dist/changes-4.5.3 b/dist/changes-4.5.3 index ac5a1f7..0bec84d 100644 --- a/dist/changes-4.5.3 +++ b/dist/changes-4.5.3 @@ -74,7 +74,7 @@ Third party components **************************************************************************** * Database Drivers * **************************************************************************** -- [QT-353] (ODBC) Fixed issue of forward only datasets failing when not +- [QT-353] (ODBC) Fixed issue of forward only datasets failing when not explicitly set so. - [222678] Fixed QSqlTableModel: trying to delete the wrong row. - (Interbase) Fixed crash when calling numRows on unknown query type. @@ -107,7 +107,7 @@ Qt for Windows Qt for Mac OS X --------------- -[252088] Drag and drop events will now consider the WA_TransparentForMouseEvents +[252088] Drag and drop events will now consider the WA_TransparentForMouseEvents in Cocoa port. [255428] Fixed an an issue when Calling QWidget::raise() on hidden windows making them visible in Cocoa port. @@ -116,7 +116,7 @@ Qt for Mac OS X [258822] Fixed a crash when inserting the same menu twice in a menubar in Cocoa port. - Fixed the wizard background images for Snow Leopard. - + Qt for Embedded Linux --------------------- @@ -179,6 +179,17 @@ Qt for Windows CE * Plugins * **************************************************************************** +- DirectFB + * Make autorepeat work for DirectFB keyboard driver + * Fix a crash when resizing windows + * Fix an off by one when flipping surfaces that could lead to artifacts + * Make painting operations with QRegion clips go to DirectFB rather than + Raster (when possible) + * Make porter duff operations work for blits + * Various optimizations + * Handle more operations in hw + + **************************************************************************** * Important Behavior Changes * -- cgit v0.12 From 5170774f96c87e73f997fb9a9bc856d5f78741ac Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 29 Sep 2009 14:58:04 +1000 Subject: Tidy changes file for 4.5.3. Reviewed-by: Trust Me --- dist/changes-4.5.3 | 123 +++++++++++------------------------------------------ 1 file changed, 24 insertions(+), 99 deletions(-) diff --git a/dist/changes-4.5.3 b/dist/changes-4.5.3 index 0bec84d..f3a36d3 100644 --- a/dist/changes-4.5.3 +++ b/dist/changes-4.5.3 @@ -17,34 +17,21 @@ Each of these identifiers can be entered in the task tracker to obtain more information about a particular change. **************************************************************************** -* General * -**************************************************************************** - -General Improvements --------------------- - -- Documentation and Examples - -Third party components ----------------------- - - -**************************************************************************** * Library * **************************************************************************** +- QColorDialog + * [256164] Fixed the setting of alpha values in QColorDialog. + - QDirIterator * [258230] Fixed inconsistencies in value returned from QDirIterator::next(). -- QColorDialog - * [256164] Fixed the setting of alpha values in QColorDialog. - - QDoubleSpinBox * [255019] Fixed a crash when using large value for decimals. - QInputDialog - * [255502] Fixed bug in getDouble() + * [255502] Fixed bug in getDouble(). - QNetworkAccessManager * [256240] Proper handling of HTTP redirect in AlwaysCache mode. @@ -74,15 +61,16 @@ Third party components **************************************************************************** * Database Drivers * **************************************************************************** + - [QT-353] (ODBC) Fixed issue of forward only datasets failing when not - explicitly set so. + explicitly set so. - [222678] Fixed QSqlTableModel: trying to delete the wrong row. - (Interbase) Fixed crash when calling numRows on unknown query type. - Fixed several database autotests. - Fixed determination of end of odbc string on deficient driver. - Fixed formatting of date strings in psql driver. - Fixed mysql queries automatically getting prepared. Now have to explicitly - prepare them if you want that functionality. + prepare them if you want that functionality. - Fixed failure when QSqlTableModel has null fields to update. - Fixed missing isnan/isinf on some platforms (needed for postgres driver) - Fixed ::record for dialect 3 named tables in interbase/firebird. @@ -95,84 +83,27 @@ Third party components Qt for Linux/X11 ---------------- - - Fixed a bug where an empty KDEDIRS variable would bring /share into the icon search path. - [KDE 191759] Plasma spinning in endless loop. -Qt for Windows --------------- - - Qt for Mac OS X --------------- -[252088] Drag and drop events will now consider the WA_TransparentForMouseEvents - in Cocoa port. -[255428] Fixed an an issue when Calling QWidget::raise() on hidden windows making - them visible in Cocoa port. -[256269] Window resize events triggered from QWidget::adjustSize() will now - be sent as non-spontaneous event in the Cocoa port. -[258822] Fixed a crash when inserting the same menu twice in a menubar in Cocoa port. - -- Fixed the wizard background images for Snow Leopard. - - -Qt for Embedded Linux ---------------------- +- [252088] Drag and drop events will now consider the + WA_TransparentForMouseEvents in Cocoa port. +- [255428] Fixed an issue when calling QWidget::raise() on hidden windows + making them visible in Cocoa port. +- [256269] Window resize events triggered from QWidget::adjustSize() will now + be sent as a non-spontaneous event in the Cocoa port. +- [258822] Fixed a crash when inserting the same menu twice in a menubar in + Cocoa port. +- Fixed the wizard background images for Snow Leopard. Qt for Windows CE ----------------- -[260702] Fixed restoring of minimized Windows. - -**************************************************************************** -* Compiler Specific Changes * -**************************************************************************** - - -**************************************************************************** -* Tools * -**************************************************************************** - -- Build System - -- Assistant - - -- Designer - - -- Linguist - - Linguist GUI - - - lupdate - - - lrelease - - -- rcc - - -- moc - - -- uic - - -- uic3 - - -- qmake - - -- configure - - -- qtconfig - - -- qt3to4 +- [260702] Fixed restoring of minimized Windows. **************************************************************************** @@ -180,18 +111,12 @@ Qt for Windows CE **************************************************************************** - DirectFB - * Make autorepeat work for DirectFB keyboard driver - * Fix a crash when resizing windows - * Fix an off by one when flipping surfaces that could lead to artifacts + * Make autorepeat work for DirectFB keyboard driver. + * Fix a crash when resizing windows. + * Fix an off by one when flipping surfaces that could lead to artifacts. * Make painting operations with QRegion clips go to DirectFB rather than - Raster (when possible) - * Make porter duff operations work for blits - * Various optimizations - * Handle more operations in hw - - - -**************************************************************************** -* Important Behavior Changes * -**************************************************************************** + Raster (when possible). + * Make porter duff operations work for blits. + * Various optimizations. + * Handle more operations in hw. -- cgit v0.12 From e9d63b7824e9105074dee9ad624582e5894d9c8b Mon Sep 17 00:00:00 2001 From: Andreas Aardal Hanssen Date: Mon, 28 Sep 2009 16:13:19 +0200 Subject: QGraphicsItem: cached embedded widget item is not repainted when widget is updated When calling QGraphicsItem::update() on a cached item, the cache is meant to be invalidated. In the reported bug, the user had a fixed scene rect set for his scene, and removing an item caused the entire scene to be updated (marked as "all needs to be updated"). In this case, calling update() on the cached item did not cause the item's cache to be invalidated. The item's new appearance didn't show up until the next invalidation, which was the same call to update(), but this time without a preceeding full scene update. The fix is to always invalidate the cache, regardless. But only schedule a repaint of the item in some cases (e.g., in this case the whole scene was marked for update, in which case it's unnessary for this one item to schedule a repaint of itself). It's worth noting that in 4.6, removing an item be delete does not cause the whole scene to be updated, and because of that this error was not exposed. It's there nevertheless. Reviewed-by: bnilsen --- src/gui/graphicsview/qgraphicsitem.cpp | 26 +++++++++------------ tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 31 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 16 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 5799fe7..4f77aa8 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -3975,26 +3975,20 @@ void QGraphicsItem::update(const QRectF &rect) return; if (CacheMode(d_ptr->cacheMode) != NoCache) { + // Invalidate cache. QGraphicsItemCache *cache = d_ptr->extraItemCache(); - if (d_ptr->discardUpdateRequest(/* ignoreVisibleBit = */ false, - /* ignoreClipping = */ false, - /* ignoreDirtyBit = */ true)) { - return; + if (!cache->allExposed) { + if (rect.isNull()) { + cache->allExposed = true; + cache->exposed.clear(); + } else { + cache->exposed.append(rect); + } } + } - // Invalidate cache. - if (rect.isNull()) { - cache->allExposed = true; - cache->exposed.clear(); - } else { - cache->exposed.append(rect); - } - // Only invalidate cache; item is already dirty. - if (d_ptr->dirty) - return; - } else if (d_ptr->discardUpdateRequest()) { + if (d_ptr->discardUpdateRequest()) return; - } // Effectively the same as updateHelper(rect); if (rect.isNull()) diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 391ccf8..55e9b34 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -56,6 +56,7 @@ #include #include #include +#include "../../shared/util.h" //TESTED_CLASS= //TESTED_FILES= @@ -230,6 +231,7 @@ private slots: void task240400_clickOnTextItem(); void task243707_addChildBeforeParent(); void task197802_childrenVisibility(); + void QTBUG_4233_updateCachedWithSceneRect(); }; void tst_QGraphicsItem::init() @@ -6454,5 +6456,34 @@ void tst_QGraphicsItem::deviceTransform() QCOMPARE(rect3->deviceTransform(deviceX).map(QPointF(50, 50)), mapResult3); } +void tst_QGraphicsItem::QTBUG_4233_updateCachedWithSceneRect() +{ + EventTester *tester = new EventTester; + tester->setCacheMode(QGraphicsItem::ItemCoordinateCache); + + QGraphicsScene scene; + scene.addItem(tester); + scene.setSceneRect(-100, -100, 200, 200); // contains the tester item + + QGraphicsView view(&scene); + view.show(); + QTRY_COMPARE(QApplication::activeWindow(), (QWidget *)&view); + + QCOMPARE(tester->repaints, 1); + + scene.update(); // triggers "updateAll" optimization + qApp->processEvents(); + qApp->processEvents(); // in 4.6 only one processEvents is necessary + + QCOMPARE(tester->repaints, 1); + + scene.update(); // triggers "updateAll" optimization + tester->update(); + qApp->processEvents(); + qApp->processEvents(); // in 4.6 only one processEvents is necessary + + QCOMPARE(tester->repaints, 2); +} + QTEST_MAIN(tst_QGraphicsItem) #include "tst_qgraphicsitem.moc" -- cgit v0.12 From 36623ef3b5d3804de2ced689af2329c9ab81c265 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 29 Sep 2009 19:07:01 +1000 Subject: Remove mention of QtSW. Reviewed-by: Trust Me --- doc/src/platform-notes.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/platform-notes.qdoc b/doc/src/platform-notes.qdoc index 64749e7..dce7349 100644 --- a/doc/src/platform-notes.qdoc +++ b/doc/src/platform-notes.qdoc @@ -650,7 +650,7 @@ \section1 MIPSpro (IRIX) \bold{IRIX is an unsupported platform. See the \l{Supported Platforms} page - and Qt's Software's online \l{Platform Support Policy} page for details.} + and Qt's online \l{Platform Support Policy} page for details.} Qt 4.4.x requires MIPSpro version 7.4.2m. -- cgit v0.12 From aa65b608b96f0b41e96093e6eb26ccc0f301afc9 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 29 Sep 2009 19:13:30 +1000 Subject: Remove mentions of QtSW. Reviewed-by: Trust Me --- src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp | 4 ++-- src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/simple/main.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp index d2bb124..8e4c581 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp @@ -136,7 +136,7 @@ void QWebPluginFactory::refreshPlugins() For example: \code - + @@ -149,7 +149,7 @@ void QWebPluginFactory::refreshPlugins() \row \o mimeType \o "application/x-pdf" \row \o url - \o "http://qtsoftware.com/document.pdf" + \o "http://www.example.com/document.pdf" \row \o argumentNames \o "showTableOfContents" "hideThumbnails" \row \o argumentVaues diff --git a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/simple/main.cpp b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/simple/main.cpp index 82f5b6c..408630e 100644 --- a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/simple/main.cpp +++ b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/simple/main.cpp @@ -27,7 +27,7 @@ int main(int argc, char *argv[]) QWidget *parent = 0; //! [Using QWebView] QWebView *view = new QWebView(parent); - view->load(QUrl("http://qtsoftware.com/")); + view->load(QUrl("http://qt.nokia.com/")); view->show(); //! [Using QWebView] return app.exec(); -- cgit v0.12 From 9a7ca912ce72476bda57f2306b38e5f6e928fbf5 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Tue, 29 Sep 2009 13:41:33 +0300 Subject: Softkey fixes to QMenu tests. Softkeys add two extra "Select" and "Back" actions to menu by default. First two actions in menu will be "Select" and "Back". Reviewed-by: Janne Anttila --- tests/auto/qactiongroup/tst_qactiongroup.cpp | 14 ++++++++--- tests/auto/qmainwindow/tst_qmainwindow.cpp | 35 +++++++++++++++++----------- tests/auto/qmenu/tst_qmenu.cpp | 12 ++++++++-- 3 files changed, 43 insertions(+), 18 deletions(-) diff --git a/tests/auto/qactiongroup/tst_qactiongroup.cpp b/tests/auto/qactiongroup/tst_qactiongroup.cpp index c290941..2d215a0 100644 --- a/tests/auto/qactiongroup/tst_qactiongroup.cpp +++ b/tests/auto/qactiongroup/tst_qactiongroup.cpp @@ -226,6 +226,14 @@ void tst_QActionGroup::separators() mw.show(); +#ifdef QT_SOFTKEYS_ENABLED + // Softkeys add extra "Select" and "Back" actions to menu by default. + // Two first actions will be Select and Back when softkeys are enabled + int numSoftkeyActions = 2; +#else + int numSoftkeyActions = 0; +#endif + QAction *action = new QAction(&actGroup); action->setText("test one"); @@ -237,13 +245,13 @@ void tst_QActionGroup::separators() while (it.hasNext()) menu.addAction(it.next()); - QCOMPARE((int)menu.actions().size(), 2); + QCOMPARE((int)menu.actions().size(), 2 + numSoftkeyActions); it = QListIterator(actGroup.actions()); while (it.hasNext()) menu.removeAction(it.next()); - QCOMPARE((int)menu.actions().size(), 0); + QCOMPARE((int)menu.actions().size(), 0 + numSoftkeyActions); action = new QAction(&actGroup); action->setText("test two"); @@ -252,7 +260,7 @@ void tst_QActionGroup::separators() while (it.hasNext()) menu.addAction(it.next()); - QCOMPARE((int)menu.actions().size(), 3); + QCOMPARE((int)menu.actions().size(), 3 + numSoftkeyActions); } void tst_QActionGroup::testActionInTwoQActionGroup() diff --git a/tests/auto/qmainwindow/tst_qmainwindow.cpp b/tests/auto/qmainwindow/tst_qmainwindow.cpp index 38d23b6..9615c63 100644 --- a/tests/auto/qmainwindow/tst_qmainwindow.cpp +++ b/tests/auto/qmainwindow/tst_qmainwindow.cpp @@ -1297,18 +1297,27 @@ void tst_QMainWindow::createPopupMenu() mainwindow.addDockWidget(Qt::LeftDockWidgetArea, &dockwidget3); mainwindow.addDockWidget(Qt::LeftDockWidgetArea, &dockwidget4); + +#ifdef QT_SOFTKEYS_ENABLED + // Softkeys add extra "Select" and "Back" actions to menu by default. + // Two first actions will be Select and Back when softkeys are enabled + int numSoftkeyActions = 2; +#else + int numSoftkeyActions = 0; +#endif + QMenu *menu = mainwindow.createPopupMenu(); QVERIFY(menu != 0); QList actions = menu->actions(); - QCOMPARE(actions.size(), 7); + QCOMPARE(actions.size(), 7 + numSoftkeyActions); - QCOMPARE(actions.at(0), dockwidget1.toggleViewAction()); - QCOMPARE(actions.at(1), dockwidget2.toggleViewAction()); - QCOMPARE(actions.at(2), dockwidget3.toggleViewAction()); - QCOMPARE(actions.at(3), dockwidget4.toggleViewAction()); - QVERIFY(actions.at(4)->isSeparator()); - QCOMPARE(actions.at(5), toolbar1.toggleViewAction()); - QCOMPARE(actions.at(6), toolbar2.toggleViewAction()); + QCOMPARE(actions.at(0 + numSoftkeyActions), dockwidget1.toggleViewAction()); + QCOMPARE(actions.at(1 + numSoftkeyActions), dockwidget2.toggleViewAction()); + QCOMPARE(actions.at(2 + numSoftkeyActions), dockwidget3.toggleViewAction()); + QCOMPARE(actions.at(3 + numSoftkeyActions), dockwidget4.toggleViewAction()); + QVERIFY(actions.at(4 + numSoftkeyActions)->isSeparator()); + QCOMPARE(actions.at(5 + numSoftkeyActions), toolbar1.toggleViewAction()); + QCOMPARE(actions.at(6 + numSoftkeyActions), toolbar2.toggleViewAction()); delete menu; @@ -1319,12 +1328,12 @@ void tst_QMainWindow::createPopupMenu() menu = mainwindow.createPopupMenu(); QVERIFY(menu != 0); actions = menu->actions(); - QCOMPARE(actions.size(), 4); + QCOMPARE(actions.size(), 4 + numSoftkeyActions); - QCOMPARE(actions.at(0), dockwidget2.toggleViewAction()); - QCOMPARE(actions.at(1), dockwidget3.toggleViewAction()); - QVERIFY(actions.at(2)->isSeparator()); - QCOMPARE(actions.at(3), toolbar2.toggleViewAction()); + QCOMPARE(actions.at(0 + numSoftkeyActions), dockwidget2.toggleViewAction()); + QCOMPARE(actions.at(1 + numSoftkeyActions), dockwidget3.toggleViewAction()); + QVERIFY(actions.at(2 + numSoftkeyActions)->isSeparator()); + QCOMPARE(actions.at(3 + numSoftkeyActions), toolbar2.toggleViewAction()); delete menu; } diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp index e467229..726ca55 100644 --- a/tests/auto/qmenu/tst_qmenu.cpp +++ b/tests/auto/qmenu/tst_qmenu.cpp @@ -260,9 +260,17 @@ void tst_QMenu::onStatusMessageChanged(const QString &s) void tst_QMenu::addActionsAndClear() { - QCOMPARE(menus[0]->actions().count(), 0); +#ifdef QT_SOFTKEYS_ENABLED + // Softkeys add extra "Select" and "Back" actions to menu by default. + // Two first actions will be Select and Back when softkeys are enabled + int numSoftkeyActions = 2; +#else + int numSoftkeyActions = 0; +#endif + + QCOMPARE(menus[0]->actions().count(), 0 + numSoftkeyActions); createActions(); - QCOMPARE(menus[0]->actions().count(), 8); + QCOMPARE(menus[0]->actions().count(), 8 + numSoftkeyActions); menus[0]->clear(); QCOMPARE(menus[0]->actions().count(), 0); } -- cgit v0.12 From 381c6c5dd816d7a8921c76b44c7edf607482ebba Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 29 Sep 2009 12:28:03 +0200 Subject: Stabilize tests --- tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp | 92 ++++++++++------------ tests/auto/qprogressbar/tst_qprogressbar.cpp | 2 +- 2 files changed, 42 insertions(+), 52 deletions(-) diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp index 9045acf..b6750ea 100644 --- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp @@ -824,7 +824,8 @@ void tst_QGraphicsWidget::initStyleOption() if (underMouse) { view.resize(300, 300); view.show(); - QTest::qWait(125); + QTest::qWaitForWindowShown(&view); + QTest::qWait(20); sendMouseMove(view.viewport(), view.mapFromScene(widget->mapToScene(widget->boundingRect().center()))); } @@ -877,7 +878,7 @@ void tst_QGraphicsWidget::layout() } widget.setLayout(layout); - QTest::qWait(250); + QTest::qWait(25); QCOMPARE(widget.layout(), static_cast(layout)); for (int i = 0; i < children.count(); ++i) { @@ -917,13 +918,13 @@ void tst_QGraphicsWidget::layoutDirection() widget.setLayoutDirection(layoutDirection); QCOMPARE(widget.testAttribute(Qt::WA_SetLayoutDirection), true); view->show(); - QTest::qWait(100); + QTest::qWaitForWindowShown(view); for (int i = 0; i < children.count(); ++i) { QCOMPARE(children[i]->layoutDirection(), layoutDirection); QCOMPARE(children[i]->testAttribute(Qt::WA_SetLayoutDirection), false); view->repaint(); - QTest::qWait(200); - QCOMPARE(children[i]->m_painterLayoutDirection, layoutDirection); + QApplication::processEvents(); + QTRY_COMPARE(children[i]->m_painterLayoutDirection, layoutDirection); } delete view; } @@ -1156,8 +1157,8 @@ void tst_QGraphicsWidget::setTabOrder() if (!children.isEmpty()) { QGraphicsWidget *first = children.first(); view.viewport()->setFocus(); - QTest::qWait(250); - QVERIFY(view.viewport()->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(view.viewport()->hasFocus()); first->setFocus(); QVERIFY(first->hasFocus()); QVERIFY(scene.hasFocus()); @@ -1198,11 +1199,8 @@ void tst_QGraphicsWidget::setTabOrderAndReparent() QGraphicsScene scene; QGraphicsView view(&scene); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif QApplication::setActiveWindow(&view); - QTest::qWait(25); + QTest::qWaitForWindowShown(&view); QTRY_COMPARE(QApplication::activeWindow(), &view); int i; @@ -1341,11 +1339,8 @@ void tst_QGraphicsWidget::verifyFocusChain() QGraphicsScene scene; QGraphicsView view(&scene); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif QApplication::setActiveWindow(&view); - QTest::qWait(25); + QTest::qWaitForWindowShown(&view); QTRY_COMPARE(QApplication::activeWindow(), &view); { @@ -1419,39 +1414,38 @@ void tst_QGraphicsWidget::verifyFocusChain() w1_2->setFocusPolicy(Qt::StrongFocus); scene.addItem(w1_2); window->show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(window); -#endif + QApplication::setActiveWindow(window); + QTest::qWaitForWindowShown(window); lineEdit->setFocus(); - QTest::qWait(250); - QVERIFY(lineEdit->hasFocus()); + QTest::qWait(25); + QTRY_VERIFY(lineEdit->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(250); - QVERIFY(w1_1->hasFocus()); + QTest::qWait(25); + QTRY_VERIFY(w1_1->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(250); - QVERIFY(w1_2->hasFocus()); + QTest::qWait(25); + QTRY_VERIFY(w1_2->hasFocus()); // remove the tabFocusFirst and insert new item delete w1_1; // calls _q_removeItemLater - QTest::qWait(250); + QTest::qWait(25); SubQGraphicsWidget *w1_3 = new SubQGraphicsWidget; w1_3->setFocusPolicy(Qt::StrongFocus); w1_3->setData(0, "w1_3"); w1_3->setGeometry(50,0,25, 25); scene.addItem(w1_3); - QVERIFY(w1_2->hasFocus()); + QTRY_VERIFY(w1_2->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(250); - QVERIFY(lineEdit->hasFocus()); + QTest::qWait(25); + QTRY_VERIFY(lineEdit->hasFocus()); // tabFocusFirst should now point to w1_2 QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(250); - QVERIFY(w1_2->hasFocus()); + QTest::qWait(25); + QTRY_VERIFY(w1_2->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(250); - QVERIFY(w1_3->hasFocus()); + QTest::qWait(25); + QTRY_VERIFY(w1_3->hasFocus()); scene.removeItem(w1_2); // does not call _q_removeItemLater delete w1_2; // calls _q_removeItemLater @@ -1460,18 +1454,18 @@ void tst_QGraphicsWidget::verifyFocusChain() w1_4->setData(0, "w1_4"); w1_4->setGeometry(75,0,25, 25); scene.addItem(w1_4); - QVERIFY(w1_3->hasFocus()); - QTest::qWait(250); + QTRY_VERIFY(w1_3->hasFocus()); + QTest::qWait(25); QVERIFY(compareFocusChain(view, QList() << w1_3 << w1_4)); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(250); - QVERIFY(lineEdit->hasFocus()); + QTest::qWait(25); + QTRY_VERIFY(lineEdit->hasFocus()); // tabFocusFirst should now point to w1_3 QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(250); - QVERIFY(w1_3->hasFocus()); - QTest::qWait(250); - QVERIFY(compareFocusChain(view, QList() << w1_3 << w1_4)); + QTest::qWait(25); + QTRY_VERIFY(w1_3->hasFocus()); + QTest::qWait(25); + QTRY_VERIFY(compareFocusChain(view, QList() << w1_3 << w1_4)); delete window; } } @@ -2353,9 +2347,7 @@ void tst_QGraphicsWidget::painterStateProtectionOnWindowFrame() QGraphicsView view(&scene); scene.addItem(widget); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif + QTest::qWaitForWindowShown(&view); QTest::qWait(500); } @@ -2561,14 +2553,11 @@ void tst_QGraphicsWidget::ensureClipping() QGraphicsView view(&scene); view.setOptimizationFlag(QGraphicsView::IndirectPainting); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif - QTest::qWait(250); + QTest::qWaitForWindowShown(&view); QList expected; expected << clipWidget << childWidget << childitem; - QVERIFY(scene.drawnItems.contains(clipWidget)); + QTRY_VERIFY(scene.drawnItems.contains(clipWidget)); QVERIFY(scene.drawnItems.contains(childWidget)); QVERIFY(scene.drawnItems.contains(childitem)); } @@ -2630,11 +2619,12 @@ void tst_QGraphicsWidget::respectHFW() view->show(); window->setGeometry(0, 0, 70, 70); + QTest::qWaitForWindowShown(view); { // here we go - simulate a interactive resize of the window - QTest::qWait(200); + QTest::qWait(100); QTest::mouseMove(view, view->mapFromScene(71, 71)); // bottom right corner - QTest::qWait(200); + QTest::qWait(100); QTest::mousePress(view->viewport(), Qt::LeftButton, 0, view->mapFromScene(71, 71), 200); view->grabMouse(); @@ -2648,7 +2638,7 @@ void tst_QGraphicsWidget::respectHFW() QApplication::sendEvent(view->viewport(), &e); view->releaseMouse(); } - QTest::qWait(200); + QTest::qWait(100); const QSizeF winSize = window->size(); qreal minHFW = window->effectiveSizeHint(Qt::MinimumSize, QSizeF(winSize.width(), -1)).height(); QVERIFY(qAbs(minHFW - winSize.height()) < 1); diff --git a/tests/auto/qprogressbar/tst_qprogressbar.cpp b/tests/auto/qprogressbar/tst_qprogressbar.cpp index d86094d..bc4583e 100644 --- a/tests/auto/qprogressbar/tst_qprogressbar.cpp +++ b/tests/auto/qprogressbar/tst_qprogressbar.cpp @@ -175,7 +175,7 @@ void tst_QProgressBar::format() bar.repainted = false; bar.setFormat("%v of %m (%p%)"); QTest::qWait(20); - QVERIFY(bar.repainted); + QTRY_VERIFY(bar.repainted); bar.repainted = false; bar.setFormat("%v of %m (%p%)"); qApp->processEvents(); -- cgit v0.12 From 02989fc21d15dcbf5ceb6a55fc124b5eaf191169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Tue, 29 Sep 2009 09:45:39 +0200 Subject: Add missing docs for QGraphicsAnchor --- src/gui/graphicsview/qgraphicsanchorlayout.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp index b3ebb2b..baea5d9 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp @@ -80,6 +80,24 @@ PM_LayoutHorizontalSpacing (or PM_LayoutVerticalSpacing for vertical anchors). */ +/*! + \class QGraphicsAnchor + \brief The QGraphicsAnchor class represents an anchor between two items in a + QGraphicsAnchorLayout. + \since 4.6 + \ingroup appearance + \ingroup geomanagement + \ingroup graphicsview-api + + The graphics anchor provides an API that enables you to query and manipulate the + properties an anchor has. When an anchor is added to the layout with + QGraphicsAnchorLayout::addAnchor(), a QGraphicsAnchor instance is returned where the properties + are initialized to their default values. The properties can then be further changed, and they + will be picked up the next time the layout is activated. + + \sa QGraphicsAnchorLayout::anchor() + +*/ #include "qgraphicsanchorlayout_p.h" QT_BEGIN_NAMESPACE -- cgit v0.12 From cdfcdbacc543bc0b67e615adf7bb8d885285b425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Tue, 29 Sep 2009 09:46:06 +0200 Subject: After some discussion we decided to remove hasConflicts() from the API. hasConflicts() does only make sense for a tool/editor of the layout, and how this function would help the tool is only guesswork at the moment. We keep the private API though, in order to let the autotests we inherited from Orbit pass. --- src/gui/graphicsview/qgraphicsanchorlayout.cpp | 12 ----- src/gui/graphicsview/qgraphicsanchorlayout.h | 1 - src/gui/graphicsview/qgraphicsanchorlayout_p.cpp | 7 +++ src/gui/graphicsview/qgraphicsanchorlayout_p.h | 7 ++- .../tst_qgraphicsanchorlayout.cpp | 52 ++++++++-------------- .../tst_qgraphicsanchorlayout1.cpp | 5 ++- 6 files changed, 35 insertions(+), 49 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp index baea5d9..fdb1708 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp @@ -306,18 +306,6 @@ void QGraphicsAnchorLayout::addAnchors(QGraphicsLayoutItem *firstItem, } /*! - Returns true if there are no arrangement that satisfies all constraints. - Otherwise returns false. - - \sa addAnchor() -*/ -bool QGraphicsAnchorLayout::hasConflicts() const -{ - Q_D(const QGraphicsAnchorLayout); - return d->hasConflicts(); -} - -/*! Sets the default horizontal spacing for the anchor layout to \a spacing. \sa horizontalSpacing(), setVerticalSpacing(), setSpacing() diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.h b/src/gui/graphicsview/qgraphicsanchorlayout.h index 44074d1..d9a87ba 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout.h +++ b/src/gui/graphicsview/qgraphicsanchorlayout.h @@ -93,7 +93,6 @@ public: QGraphicsLayoutItem *secondItem, Qt::Orientations orientations = Qt::Horizontal | Qt::Vertical); - bool hasConflicts() const; void setHorizontalSpacing(qreal spacing); void setVerticalSpacing(qreal spacing); void setSpacing(qreal spacing); diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp index 49aabf5..f75118b 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp @@ -2287,6 +2287,13 @@ bool QGraphicsAnchorLayoutPrivate::solvePreferred(QList co return feasible; } +/*! + \internal + Returns true if there are no arrangement that satisfies all constraints. + Otherwise returns false. + + \sa addAnchor() +*/ bool QGraphicsAnchorLayoutPrivate::hasConflicts() const { QGraphicsAnchorLayoutPrivate *that = const_cast(this); diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h index 4e1bcd4..c86bfa3 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h @@ -343,7 +343,7 @@ public: QGraphicsAnchorLayout private methods and attributes. */ -class QGraphicsAnchorLayoutPrivate : public QGraphicsLayoutPrivate +class Q_AUTOTEST_EXPORT QGraphicsAnchorLayoutPrivate : public QGraphicsLayoutPrivate { Q_DECLARE_PUBLIC(QGraphicsAnchorLayout) @@ -370,6 +370,11 @@ public: QGraphicsAnchorLayoutPrivate(); + static QGraphicsAnchorLayoutPrivate *get(QGraphicsAnchorLayout *q) + { + return q ? q->d_func() : 0; + } + static Qt::AnchorPoint oppositeEdge( Qt::AnchorPoint edge); diff --git a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp index 2fee98d..9f13aca 100644 --- a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp +++ b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp @@ -40,9 +40,10 @@ ****************************************************************************/ #include -#include -#include -#include +#include +#include +#include +#include #include class tst_QGraphicsAnchorLayout : public QObject { @@ -142,6 +143,11 @@ static bool checkReverseDirection(QGraphicsWidget *w) return true; } +static bool layoutHasConflict(QGraphicsAnchorLayout *l) +{ + return QGraphicsAnchorLayoutPrivate::get(l)->hasConflicts(); +} + void tst_QGraphicsAnchorLayout::simple() { QGraphicsWidget *w1 = createItem(); @@ -154,8 +160,6 @@ void tst_QGraphicsAnchorLayout::simple() QGraphicsWidget p; p.setLayout(l); - QVERIFY(l->hasConflicts() == false); - QCOMPARE(l->count(), 2); } @@ -185,8 +189,6 @@ void tst_QGraphicsAnchorLayout::simple_center() setAnchor(l, b, Qt::AnchorBottom, c, Qt::AnchorTop, 0); setAnchor(l, c, Qt::AnchorBottom, l, Qt::AnchorBottom, 0); - QVERIFY(l->hasConflicts() == false); - QCOMPARE(l->count(), 3); QGraphicsWidget *p = new QGraphicsWidget(0, Qt::Window); @@ -234,8 +236,6 @@ void tst_QGraphicsAnchorLayout::simple_semifloat() setAnchor(l, a, Qt::AnchorBottom, l, Qt::AnchorBottom, 0); setAnchor(l, b, Qt::AnchorBottom, l, Qt::AnchorBottom, 0); - QVERIFY(l->hasConflicts() == false); - QCOMPARE(l->count(), 4); QGraphicsWidget *p = new QGraphicsWidget(0, Qt::Window); @@ -296,7 +296,6 @@ void tst_QGraphicsAnchorLayout::layoutDirection() view->show(); QCOMPARE(checkReverseDirection(p), true); - QVERIFY(l->hasConflicts() == false); delete p; delete view; @@ -340,8 +339,6 @@ void tst_QGraphicsAnchorLayout::diagonal() l->addAnchor(e, Qt::AnchorRight, l, Qt::AnchorRight); l->addAnchor(d, Qt::AnchorRight, e, Qt::AnchorLeft); - QVERIFY(l->hasConflicts() == false); - QCOMPARE(l->count(), 5); QGraphicsWidget p; @@ -391,7 +388,7 @@ void tst_QGraphicsAnchorLayout::diagonal() QCOMPARE(checkReverseDirection(&p), true); c->setMinimumWidth(300); - QVERIFY(l->hasConflicts()); + QVERIFY(layoutHasConflict(l)); } void tst_QGraphicsAnchorLayout::parallel() @@ -484,8 +481,6 @@ void tst_QGraphicsAnchorLayout::parallel() QCOMPARE(e->geometry(), QRectF(375, 400, 175, 100)); QCOMPARE(f->geometry(), QRectF(550, 500, 200, 100)); QCOMPARE(p.size(), layoutMaximumSize); - - QVERIFY(l->hasConflicts() == false); } void tst_QGraphicsAnchorLayout::parallel2() @@ -510,7 +505,6 @@ void tst_QGraphicsAnchorLayout::parallel2() l->addAnchor(l, Qt::AnchorLeft, b, Qt::AnchorLeft); l->addAnchor(b, Qt::AnchorRight, a, Qt::AnchorRight); - QVERIFY(l->hasConflicts() == false); QCOMPARE(l->count(), 2); QGraphicsWidget p; @@ -592,8 +586,6 @@ void tst_QGraphicsAnchorLayout::snake() QCOMPARE(b->geometry(), QRectF(90.0, 100.0, 10.0, 100.0)); QCOMPARE(c->geometry(), QRectF(90.0, 200.0, 100.0, 100.0)); QCOMPARE(p.size(), layoutMaximumSize); - - QVERIFY(l->hasConflicts() == false); } void tst_QGraphicsAnchorLayout::snakeOppositeDirections() @@ -627,7 +619,6 @@ void tst_QGraphicsAnchorLayout::snakeOppositeDirections() l->addAnchor(c, Qt::AnchorRight, l, Qt::AnchorRight); - QVERIFY(l->hasConflicts() == false); QCOMPARE(l->count(), 3); QGraphicsWidget p; @@ -731,8 +722,6 @@ void tst_QGraphicsAnchorLayout::fairDistribution() QCOMPARE(c->geometry(), QRectF(200.0, 200.0, 100.0, 100.0)); QCOMPARE(d->geometry(), QRectF(0.0, 300.0, 300.0, 100.0)); QCOMPARE(p.size(), layoutMaximumSize); - - QVERIFY(l->hasConflicts() == false); } void tst_QGraphicsAnchorLayout::fairDistributionOppositeDirections() @@ -809,8 +798,6 @@ void tst_QGraphicsAnchorLayout::fairDistributionOppositeDirections() QCOMPARE(a->size(), d->size()); QCOMPARE(e->size().width(), 4 * a->size().width()); QCOMPARE(p.size(), layoutMaximumSize); - - QVERIFY(l->hasConflicts() == false); } void tst_QGraphicsAnchorLayout::proportionalPreferred() @@ -873,8 +860,6 @@ void tst_QGraphicsAnchorLayout::proportionalPreferred() QCOMPARE(a->size().width(), 10 * factor); QCOMPARE(c->size().width(), 14 * factor); QCOMPARE(p.size(), QSizeF(12, 400)); - - QVERIFY(l->hasConflicts() == false); } void tst_QGraphicsAnchorLayout::example() @@ -928,7 +913,6 @@ void tst_QGraphicsAnchorLayout::example() l->addAnchor(l, Qt::AnchorLeft, g, Qt::AnchorLeft); l->addAnchor(f, Qt::AnchorRight, g, Qt::AnchorRight); - QVERIFY(l->hasConflicts() == false); QCOMPARE(l->count(), 7); QGraphicsWidget p; @@ -1017,8 +1001,6 @@ void tst_QGraphicsAnchorLayout::setSpacing() QCOMPARE(b->geometry(), QRectF(24, 0, 20, 20)); QCOMPARE(c->geometry(), QRectF(0, 20, 44, 20)); - QVERIFY(l->hasConflicts() == false); - delete p; delete view; } @@ -1103,7 +1085,6 @@ void tst_QGraphicsAnchorLayout::hardComplexS60() QSizeF layoutMaximumSize = l->effectiveSizeHint(Qt::MaximumSize); QCOMPARE(layoutMaximumSize, QSizeF(240, 40)); - QVERIFY(l->hasConflicts() == false); delete p; } @@ -1166,7 +1147,6 @@ void tst_QGraphicsAnchorLayout::delete_anchor() QGraphicsWidget *p = new QGraphicsWidget; p->setLayout(l); - QVERIFY(l->hasConflicts() == false); QCOMPARE(l->count(), 3); scene.addItem(p); @@ -1281,6 +1261,12 @@ void tst_QGraphicsAnchorLayout::sizePolicy() delete view; } +/*! + \internal + + Uses private API. (We have decided to pull hasConflicts() out of the API). However, it also + tests some tight conditions (almost-in-conflict) that we really want to test. +*/ void tst_QGraphicsAnchorLayout::conflicts() { QGraphicsWidget *a = createItem(QSizeF(80,10), QSizeF(90,10), QSizeF(100,10), "a"); @@ -1311,13 +1297,13 @@ void tst_QGraphicsAnchorLayout::conflicts() p->setLayout(l); - QCOMPARE(l->hasConflicts(), true); + QCOMPARE(layoutHasConflict(l), true); a->setMinimumSize(QSizeF(29,10)); - QCOMPARE(l->hasConflicts(), false); + QCOMPARE(layoutHasConflict(l), false); a->setMinimumSize(QSizeF(30,10)); - QCOMPARE(l->hasConflicts(), false); + QCOMPARE(layoutHasConflict(l), false); delete p; } diff --git a/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp b/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp index a6746db..a521b78 100644 --- a/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp +++ b/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp @@ -43,7 +43,8 @@ #include #include #include -#include +#include +#include #define TEST_COMPLEX_CASES @@ -60,7 +61,7 @@ public: bool isValid() { - return !hasConflicts(); + return !QGraphicsAnchorLayoutPrivate::get(this)->hasConflicts(); } void setAnchor( -- cgit v0.12 From e9ef0cd651bcfeb85262e877c693f5efe07dff8e Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Tue, 29 Sep 2009 13:03:42 +0200 Subject: fix warnings about declarations shadowing class members (autotest reported) Reviewed-by: Olivier --- src/gui/kernel/qevent.h | 2 +- src/gui/math3d/qmatrix4x4.h | 40 ++++++++++++++++++++-------------------- src/gui/math3d/qquaternion.h | 34 +++++++++++++++++----------------- src/gui/math3d/qvector2d.h | 4 ++-- src/gui/math3d/qvector3d.h | 6 +++--- src/gui/math3d/qvector4d.h | 8 ++++---- src/testlib/qtestcoreelement.h | 6 +++--- 7 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index fa2b22f..4396766 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -807,7 +807,7 @@ public: // internal inline void setWidget(QWidget *awidget) { _widget = awidget; } inline void setDeviceType(DeviceType adeviceType) { _deviceType = adeviceType; } - inline void setTouchPointStates(Qt::TouchPointStates touchPointStates) { _touchPointStates = touchPointStates; } + inline void setTouchPointStates(Qt::TouchPointStates aTouchPointStates) { _touchPointStates = aTouchPointStates; } inline void setTouchPoints(const QList &atouchPoints) { _touchPoints = atouchPoints; } protected: diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.h index cfa3f2a..b32e00a 100644 --- a/src/gui/math3d/qmatrix4x4.h +++ b/src/gui/math3d/qmatrix4x4.h @@ -228,14 +228,14 @@ Q_INLINE_TEMPLATE QMatrix4x4::QMatrix4x4 (const QGenericMatrix& matrix) { const qreal *values = matrix.constData(); - for (int col = 0; col < 4; ++col) { - for (int row = 0; row < 4; ++row) { - if (col < N && row < M) - m[col][row] = values[col * M + row]; - else if (col == row) - m[col][row] = 1.0f; + for (int matrixCol = 0; matrixCol < 4; ++matrixCol) { + for (int matrixRow = 0; matrixRow < 4; ++matrixRow) { + if (matrixCol < N && matrixRow < M) + m[matrixCol][matrixRow] = values[matrixCol * M + matrixRow]; + else if (matrixCol == matrixRow) + m[matrixCol][matrixRow] = 1.0f; else - m[col][row] = 0.0f; + m[matrixCol][matrixRow] = 0.0f; } } flagBits = General; @@ -246,14 +246,14 @@ QGenericMatrix QMatrix4x4::toGenericMatrix() const { QGenericMatrix result; qreal *values = result.data(); - for (int col = 0; col < N; ++col) { - for (int row = 0; row < M; ++row) { - if (col < 4 && row < 4) - values[col * M + row] = m[col][row]; - else if (col == row) - values[col * M + row] = 1.0f; + for (int matrixCol = 0; matrixCol < N; ++matrixCol) { + for (int matrixRow = 0; matrixRow < M; ++matrixRow) { + if (matrixCol < 4 && matrixRow < 4) + values[matrixCol * M + matrixRow] = m[matrixCol][matrixRow]; + else if (matrixCol == matrixRow) + values[matrixCol * M + matrixRow] = 1.0f; else - values[col * M + row] = 0.0f; + values[matrixCol * M + matrixRow] = 0.0f; } } return result; @@ -261,17 +261,17 @@ QGenericMatrix QMatrix4x4::toGenericMatrix() const #endif -inline const qreal& QMatrix4x4::operator()(int row, int column) const +inline const qreal& QMatrix4x4::operator()(int aRow, int aColumn) const { - Q_ASSERT(row >= 0 && row < 4 && column >= 0 && column < 4); - return m[column][row]; + Q_ASSERT(aRow >= 0 && aRow < 4 && aColumn >= 0 && aColumn < 4); + return m[aColumn][aRow]; } -inline qreal& QMatrix4x4::operator()(int row, int column) +inline qreal& QMatrix4x4::operator()(int aRow, int aColumn) { - Q_ASSERT(row >= 0 && row < 4 && column >= 0 && column < 4); + Q_ASSERT(aRow >= 0 && aRow < 4 && aColumn >= 0 && aColumn < 4); flagBits = General; - return m[column][row]; + return m[aColumn][aRow]; } inline QVector4D QMatrix4x4::column(int index) const diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h index dd5dddc..7480a5c 100644 --- a/src/gui/math3d/qquaternion.h +++ b/src/gui/math3d/qquaternion.h @@ -138,7 +138,7 @@ private: inline QQuaternion::QQuaternion() : wp(1.0f), xp(0.0f), yp(0.0f), zp(0.0f) {} -inline QQuaternion::QQuaternion(qreal scalar, qreal xpos, qreal ypos, qreal zpos) : wp(scalar), xp(xpos), yp(ypos), zp(zpos) {} +inline QQuaternion::QQuaternion(qreal aScalar, qreal xpos, qreal ypos, qreal zpos) : wp(aScalar), xp(xpos), yp(ypos), zp(zpos) {} inline bool QQuaternion::isNull() const @@ -156,10 +156,10 @@ inline qreal QQuaternion::y() const { return qreal(yp); } inline qreal QQuaternion::z() const { return qreal(zp); } inline qreal QQuaternion::scalar() const { return qreal(wp); } -inline void QQuaternion::setX(qreal x) { xp = x; } -inline void QQuaternion::setY(qreal y) { yp = y; } -inline void QQuaternion::setZ(qreal z) { zp = z; } -inline void QQuaternion::setScalar(qreal scalar) { wp = scalar; } +inline void QQuaternion::setX(qreal aX) { xp = aX; } +inline void QQuaternion::setY(qreal aY) { yp = aY; } +inline void QQuaternion::setZ(qreal aZ) { zp = aZ; } +inline void QQuaternion::setScalar(qreal aScalar) { wp = aScalar; } inline QQuaternion QQuaternion::conjugate() const { @@ -274,14 +274,14 @@ inline bool qFuzzyCompare(const QQuaternion& q1, const QQuaternion& q2) #ifndef QT_NO_VECTOR3D -inline QQuaternion::QQuaternion(qreal scalar, const QVector3D& vector) - : wp(scalar), xp(vector.x()), yp(vector.y()), zp(vector.z()) {} +inline QQuaternion::QQuaternion(qreal aScalar, const QVector3D& aVector) + : wp(aScalar), xp(aVector.x()), yp(aVector.y()), zp(aVector.z()) {} -inline void QQuaternion::setVector(const QVector3D& vector) +inline void QQuaternion::setVector(const QVector3D& aVector) { - xp = vector.x(); - yp = vector.y(); - zp = vector.z(); + xp = aVector.x(); + yp = aVector.y(); + zp = aVector.z(); } inline QVector3D QQuaternion::vector() const @@ -291,17 +291,17 @@ inline QVector3D QQuaternion::vector() const #endif -inline void QQuaternion::setVector(qreal x, qreal y, qreal z) +inline void QQuaternion::setVector(qreal aX, qreal aY, qreal aZ) { - xp = x; - yp = y; - zp = z; + xp = aX; + yp = aY; + zp = aZ; } #ifndef QT_NO_VECTOR4D -inline QQuaternion::QQuaternion(const QVector4D& vector) - : wp(vector.w()), xp(vector.x()), yp(vector.y()), zp(vector.z()) {} +inline QQuaternion::QQuaternion(const QVector4D& aVector) + : wp(aVector.w()), xp(aVector.x()), yp(aVector.y()), zp(aVector.z()) {} inline QVector4D QQuaternion::toVector4D() const { diff --git a/src/gui/math3d/qvector2d.h b/src/gui/math3d/qvector2d.h index 570e864..cd9a12c 100644 --- a/src/gui/math3d/qvector2d.h +++ b/src/gui/math3d/qvector2d.h @@ -144,8 +144,8 @@ inline bool QVector2D::isNull() const inline qreal QVector2D::x() const { return qreal(xp); } inline qreal QVector2D::y() const { return qreal(yp); } -inline void QVector2D::setX(qreal x) { xp = x; } -inline void QVector2D::setY(qreal y) { yp = y; } +inline void QVector2D::setX(qreal aX) { xp = aX; } +inline void QVector2D::setY(qreal aY) { yp = aY; } inline QVector2D &QVector2D::operator+=(const QVector2D &vector) { diff --git a/src/gui/math3d/qvector3d.h b/src/gui/math3d/qvector3d.h index 1291c96..60bd693 100644 --- a/src/gui/math3d/qvector3d.h +++ b/src/gui/math3d/qvector3d.h @@ -160,9 +160,9 @@ inline qreal QVector3D::x() const { return qreal(xp); } inline qreal QVector3D::y() const { return qreal(yp); } inline qreal QVector3D::z() const { return qreal(zp); } -inline void QVector3D::setX(qreal x) { xp = x; } -inline void QVector3D::setY(qreal y) { yp = y; } -inline void QVector3D::setZ(qreal z) { zp = z; } +inline void QVector3D::setX(qreal aX) { xp = aX; } +inline void QVector3D::setY(qreal aY) { yp = aY; } +inline void QVector3D::setZ(qreal aZ) { zp = aZ; } inline QVector3D &QVector3D::operator+=(const QVector3D &vector) { diff --git a/src/gui/math3d/qvector4d.h b/src/gui/math3d/qvector4d.h index ad0718a..c35b536 100644 --- a/src/gui/math3d/qvector4d.h +++ b/src/gui/math3d/qvector4d.h @@ -158,10 +158,10 @@ inline qreal QVector4D::y() const { return qreal(yp); } inline qreal QVector4D::z() const { return qreal(zp); } inline qreal QVector4D::w() const { return qreal(wp); } -inline void QVector4D::setX(qreal x) { xp = x; } -inline void QVector4D::setY(qreal y) { yp = y; } -inline void QVector4D::setZ(qreal z) { zp = z; } -inline void QVector4D::setW(qreal w) { wp = w; } +inline void QVector4D::setX(qreal aX) { xp = aX; } +inline void QVector4D::setY(qreal aY) { yp = aY; } +inline void QVector4D::setZ(qreal aZ) { zp = aZ; } +inline void QVector4D::setW(qreal aW) { wp = aW; } inline QVector4D &QVector4D::operator+=(const QVector4D &vector) { diff --git a/src/testlib/qtestcoreelement.h b/src/testlib/qtestcoreelement.h index e9691d5..b5e5d0f 100644 --- a/src/testlib/qtestcoreelement.h +++ b/src/testlib/qtestcoreelement.h @@ -93,9 +93,9 @@ void QTestCoreElement::addAttribute(const QTest::AttributeIndex att if (attribute(attributeIndex)) return; - QTestElementAttribute *attribute = new QTestElementAttribute; - attribute->setPair(attributeIndex, value); - attribute->addToList(&listOfAttributes); + QTestElementAttribute *testAttribute = new QTestElementAttribute; + testAttribute->setPair(attributeIndex, value); + testAttribute->addToList(&listOfAttributes); } template -- cgit v0.12 From b31159a4e2ce5383a800b4b2e7210cf5423b418d Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Tue, 29 Sep 2009 13:10:54 +0200 Subject: Recorrect formextractor example build break after updating 3rdparty/webkit --- examples/webkit/formextractor/formextractor.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/webkit/formextractor/formextractor.cpp b/examples/webkit/formextractor/formextractor.cpp index 3ce888c..4b181e8 100644 --- a/examples/webkit/formextractor/formextractor.cpp +++ b/examples/webkit/formextractor/formextractor.cpp @@ -67,15 +67,15 @@ void FormExtractor::submit() QWebElement femaleGender = frame->findFirstElement("#genderFemale"); QWebElement updates = frame->findFirstElement("#updates"); - ui.firstNameEdit->setText(firstName.evaluateScript("this.value").toString()); - ui.lastNameEdit->setText(lastName.evaluateScript("this.value").toString()); + ui.firstNameEdit->setText(firstName.evaluateJavaScript("this.value").toString()); + ui.lastNameEdit->setText(lastName.evaluateJavaScript("this.value").toString()); - if (maleGender.evaluateScript("this.checked").toBool()) - ui.genderEdit->setText(maleGender.evaluateScript("this.value").toString()); - else if (femaleGender.evaluateScript("this.checked").toBool()) - ui.genderEdit->setText(femaleGender.evaluateScript("this.value").toString()); + if (maleGender.evaluateJavaScript("this.checked").toBool()) + ui.genderEdit->setText(maleGender.evaluateJavaScript("this.value").toString()); + else if (femaleGender.evaluateJavaScript("this.checked").toBool()) + ui.genderEdit->setText(femaleGender.evaluateJavaScript("this.value").toString()); - if (updates.evaluateScript("this.checked").toBool()) + if (updates.evaluateJavaScript("this.checked").toBool()) ui.updatesEdit->setText("Yes"); else ui.updatesEdit->setText("No"); -- cgit v0.12 From 640ae542541b66a5da85ce76309f9595ed2c8bf3 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 29 Sep 2009 13:18:05 +0200 Subject: added my changes to the changelog Reviewed-by: trustme --- dist/changes-4.5.3 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.5.3 b/dist/changes-4.5.3 index f3a36d3..1edacac 100644 --- a/dist/changes-4.5.3 +++ b/dist/changes-4.5.3 @@ -86,6 +86,8 @@ Qt for Linux/X11 - Fixed a bug where an empty KDEDIRS variable would bring /share into the icon search path. - [KDE 191759] Plasma spinning in endless loop. +- QClipboard can copy/paste on all screens in a multiscreen configuration. +- Fixed a bug that prevented QClipboard to work after some time. Qt for Mac OS X @@ -101,11 +103,14 @@ Qt for Mac OS X - Fixed the wizard background images for Snow Leopard. +Qt for Windows +----------------- +- [250188] Fixed size windows will show the maximize button if asked explicitely. + Qt for Windows CE ----------------- - [260702] Fixed restoring of minimized Windows. - **************************************************************************** * Plugins * **************************************************************************** -- cgit v0.12 From 7931a2eda156a4250f4d0283c2b6b0d5434bbecd Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Tue, 29 Sep 2009 13:21:35 +0200 Subject: Fix typo. Reviewed-by: TrustMe --- src/gui/widgets/qvalidator.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qvalidator.h b/src/gui/widgets/qvalidator.h index 268ecaa..a0d9534 100644 --- a/src/gui/widgets/qvalidator.h +++ b/src/gui/widgets/qvalidator.h @@ -61,7 +61,7 @@ class Q_GUI_EXPORT QValidator : public QObject { Q_OBJECT public: - explicit QValidator(QObject * parent=0); + explicit QValidator(QObject * parent = 0); ~QValidator(); enum State { @@ -100,7 +100,7 @@ class Q_GUI_EXPORT QIntValidator : public QValidator Q_PROPERTY(int top READ top WRITE setTop) public: - explicit QIntValidator(QObject * parent=0); + explicit QIntValidator(QObject * parent = 0); QIntValidator(int bottom, int top, QObject * parent); ~QIntValidator(); -- cgit v0.12 From b2d756ff77ff4446499292ffbaede38ab5d0e894 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Tue, 29 Sep 2009 11:09:01 +0200 Subject: Fix EGL/GLX surface leak when using texture-from-pixmap The QScopedPointer changes mean that the pixmap data's reference count is now decremented after the cleanup hooks are called. The hooks should also only be called when the pixmap data gets deleted, so we don't actually have to check the reference count at all. Reviewed-by: TrustMe --- src/opengl/qgl.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 0ad6772..1276443 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1624,9 +1624,8 @@ void QGLTextureCache::pixmapCleanupHook(QPixmap* pixmap) } #if defined(Q_WS_X11) QPixmapData *pd = pixmap->data_ptr().data(); - // Only need to delete the gl surface if the pixmap is about to be deleted - if (pd->ref == 0) - QGLContextPrivate::destroyGlSurfaceForPixmap(pd); + Q_ASSERT(pd->ref == 1); // Make sure reference counting isn't broken + QGLContextPrivate::destroyGlSurfaceForPixmap(pd); #endif } -- cgit v0.12 From 0140f76b4238f69e0b8886fca24b4afef33f106f Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 29 Sep 2009 13:36:21 +0200 Subject: Disable ECMAScript date test. On slow machines, the time in which the reference and the result are computed may vary by one second. Task-number: QTBUG-4614 Reviewed-by: Kent Hansen --- tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp index c305221..94f08d9 100644 --- a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp +++ b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp @@ -640,6 +640,7 @@ tst_Suite::tst_Suite() addExpectedFailure("ecma_3/Unicode/regress-352044-01.js", "issues with Unicode escape sequences in JavaScript source code", willFixInNextReleaseMessage); addExpectedFailure("ecma_3/Unicode/uc-001.js", "Unicode format-control character test (Category Cf.)", willFixInNextReleaseMessage); + addFileExclusion(".+/15\\.9\\.2\\..+", "unstable on slow machines"); addFileExclusion(".+/15\\.9\\.5\\..+", "too slooow"); addFileExclusion("regress-130451.js", "asserts"); addFileExclusion("regress-322135-01.js", "asserts"); -- cgit v0.12 From 950f80620b56e9ed277240dc16087f3e4b53cc4a Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Tue, 29 Sep 2009 13:55:41 +0200 Subject: Enable QtScript by default on Windows Reviewed-by: Simon Hausmann --- tools/configure/configureapp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 48d9370..b9f8ed8 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -2025,9 +2025,9 @@ bool Configure::checkAvailability(const QString &part) if (!findFile("msdmo.lib")) cout << "msdmo.lib not found" << endl; if (!findFile("d3d9.h")) cout << "d3d9.h not found" << endl; } - } else if (part == "MULTIMEDIA") { + } else if (part == "MULTIMEDIA" || part == "SCRIPT" || part == "SCRIPTTOOLS") { available = true; - } else if (part == "WEBKIT" || part == "SCRIPT" || part == "SCRIPTTOOLS") { + } else if (part == "WEBKIT") { available = (dictionary.value("QMAKESPEC") == "win32-msvc2005") || (dictionary.value("QMAKESPEC") == "win32-msvc2008") || (dictionary.value("QMAKESPEC") == "win32-g++"); } -- cgit v0.12 From e128abf27b5668bfce7ac471ed283d1fba007499 Mon Sep 17 00:00:00 2001 From: Espen Riskedal Date: Tue, 29 Sep 2009 14:07:29 +0200 Subject: make sure QtWebKit and QtScript are included in the .sis file Task-number: QTBUG-4613 Reviewed-by: Aleksandar Babic --- src/s60installs/s60installs.pro | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index 62661ed..2bf64e3 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -19,6 +19,7 @@ symbian: { QtXml.dll \ QtGui.dll \ QtNetwork.dll \ + QtScript.dll \ QtTest.dll \ QtSql.dll @@ -86,6 +87,10 @@ symbian: { qtlibraries.sources += Phonon.dll } + contains(QT_CONFIG, webkit): { + qtlibraries.sources += QtWebKit.dll + } + graphicssystems_plugins.path = $$QT_PLUGINS_BASE_DIR/graphicssystems contains(QT_CONFIG, openvg) { qtlibraries.sources = QtOpenVG.dll -- cgit v0.12 From 51a556f7e65f3e9c3c011f309f62a819eec07727 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Tue, 29 Sep 2009 14:51:06 +0200 Subject: Fix auto-test failure for QFileSystemModel::sort This test was failing on the farm because the rootPath for the model was invalid. QDir::rootPath on Windows return C:\ but in the farm the temp directory is in E:\ therefore the sort was only triggered on C:\ and this explain the failure. I also make comparaisons a bit more robust. Reviewed-by:TrustMe --- .../auto/qfilesystemmodel/tst_qfilesystemmodel.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp index a388f0a..63bc90c 100644 --- a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -823,7 +823,7 @@ void tst_QFileSystemModel::sort() out2 << "The magic number is : " << 49 << " but i write some stuff in the file \n"; tempFile2.close(); - myModel->setRootPath(QDir::rootPath()); + myModel->setRootPath(""); myModel->setFilter(QDir::AllEntries | QDir::System | QDir::Hidden); tree->setSortingEnabled(true); tree->setModel(myModel); @@ -846,11 +846,22 @@ void tst_QFileSystemModel::sort() tree->expand(myModel->index(dirPath, 0)); QTest::qWait(500); QModelIndex parent = myModel->index(dirPath, 0); + QList expectedOrder; + expectedOrder << tempFile2.fileName() << tempFile.fileName() << dirPath + QChar('/') + "." << dirPath + QChar('/') + ".."; //File dialog Mode means sub trees are not sorted, only the current root - if (fileDialogMode) - QVERIFY(dirPath + QChar('/') + myModel->index(0, 1, parent).data(QFileSystemModel::FileNameRole).toString() != tempFile2.fileName()); - else - QCOMPARE(dirPath + QChar('/') + myModel->index(0, 1, parent).data(QFileSystemModel::FileNameRole).toString(), tempFile2.fileName()); + if (fileDialogMode) { + QList actualRows; + for(int i = 0; i < myModel->rowCount(parent); ++i) + { + actualRows << dirPath + QChar('/') + myModel->index(i, 1, parent).data(QFileSystemModel::FileNameRole).toString(); + } + QVERIFY(actualRows != expectedOrder); + } else { + for(int i = 0; i < myModel->rowCount(parent); ++i) + { + QVERIFY(dirPath + QChar('/') + myModel->index(i, 1, parent).data(QFileSystemModel::FileNameRole).toString() == expectedOrder.at(i)); + } + } delete tree; delete myModel; -- cgit v0.12 From 1fd189619149c6d3489a35e42c4034d4145237dc Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Tue, 29 Sep 2009 12:42:09 +0200 Subject: Fix bug with posting events from HandleCommandL on Symbian. Increase the loop level counter here because this is a system event entry point. Previously, posting a deferred delete event from this function (or triggering an action that posted this event) would end up with the event not being processed on time. The reason is that these events are only processed when the event loop that posted the event returns. Since the loop counter was not previously incremented, this "nested loop" was not detected so the event would only be processed when the main event loop returned which is typically at the end of the application. Reviewed-by: axis --- src/gui/kernel/qapplication_s60.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 99d188e..0650f6c 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1457,6 +1457,7 @@ bool QApplication::s60EventFilter(TWsEvent * /* aEvent */) */ void QApplication::symbianHandleCommand(int command) { + QScopedLoopLevelCounter counter(d_func()->threadData); switch (command) { #ifdef Q_WS_S60 case EAknSoftkeyExit: { -- cgit v0.12 From f6a6e30eb16616b90d90fd6e20f9d840da41b9d1 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Tue, 29 Sep 2009 15:04:09 +0200 Subject: Introduce state machine event priority, make it possible to cancel events The priority specifies whether the event should be posted to what the SCXML spec refers to as the "external" (NormalPriority) queue, or the "internal" (HighPriority) queue. Delayed events are now posted through a separate function, postDelayedEvent(). That function returns an id that can be passed to cancelDelayedEvent() to cancel it. Reviewed-by: Eskil Abrahamsen Blomfeldt --- examples/statemachine/pingpong/main.cpp | 4 +- src/corelib/statemachine/qstatemachine.cpp | 98 +++++++++++++++++++++----- src/corelib/statemachine/qstatemachine.h | 11 ++- tests/auto/qstatemachine/tst_qstatemachine.cpp | 49 +++++++++++-- 4 files changed, 135 insertions(+), 27 deletions(-) diff --git a/examples/statemachine/pingpong/main.cpp b/examples/statemachine/pingpong/main.cpp index 7e3d8b1..358c499 100644 --- a/examples/statemachine/pingpong/main.cpp +++ b/examples/statemachine/pingpong/main.cpp @@ -86,7 +86,7 @@ protected: } virtual void onTransition(QEvent *) { - machine()->postEvent(new PingEvent(), 500); + machine()->postDelayedEvent(new PingEvent(), 500); fprintf(stdout, "ping?\n"); } }; @@ -104,7 +104,7 @@ protected: } virtual void onTransition(QEvent *) { - machine()->postEvent(new PongEvent(), 500); + machine()->postDelayedEvent(new PongEvent(), 500); fprintf(stdout, "pong!\n"); } }; diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index 8d50870c..256763b 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -1587,6 +1587,18 @@ QStateMachine::~QStateMachine() { } +/*! + \enum QStateMachine::EventPriority + + This enum type specifies the priority of an event posted to the state + machine using postEvent(). + + Events of high priority are processed before events of normal priority. + + \value NormalPriority The event has normal priority. + \value HighPriority The event has high priority. +*/ + /*! \enum QStateMachine::Error This enum type defines errors that can occur in the state machine at run time. When the state @@ -1798,47 +1810,99 @@ void QStateMachine::stop() } /*! - Posts the given \a event for processing by this state machine, with a delay - of \a delay milliseconds. + Posts the given \a event of the given \a priority for processing by this + state machine. This function returns immediately. The event is added to the state machine's event queue. Events are processed in the order posted. The state machine takes ownership of the event and deletes it once it has been processed. You can only post events when the state machine is running. + + \sa postDelayedEvent() */ -void QStateMachine::postEvent(QEvent *event, int delay) +void QStateMachine::postEvent(QEvent *event, EventPriority priority) { Q_D(QStateMachine); if (d->state != QStateMachinePrivate::Running) { qWarning("QStateMachine::postEvent: cannot post event when the state machine is not running"); return; } + if (!event) { + qWarning("QStateMachine::postEvent: cannot post null event"); + return; + } #ifdef QSTATEMACHINE_DEBUG - qDebug() << this << ": posting external event" << event << "with delay" << delay; + qDebug() << this << ": posting event" << event; #endif - if (delay) { - int tid = startTimer(delay); - d->delayedEvents[tid] = event; - } else { + switch (priority) { + case NormalPriority: d->externalEventQueue.append(event); - d->processEvents(QStateMachinePrivate::QueuedProcessing); + break; + case HighPriority: + d->internalEventQueue.append(event); + break; } + d->processEvents(QStateMachinePrivate::QueuedProcessing); } /*! - \internal + Posts the given \a event for processing by this state machine, with the + given \a delay in milliseconds. Returns an identifier associated with the + delayed event, or -1 if the event could not be posted. + + This function returns immediately. When the delay has expired, the event + will be added to the state machine's event queue for processing. The state + machine takes ownership of the event and deletes it once it has been + processed. + + You can only post events when the state machine is running. - Posts the given internal \a event for processing by this state machine. + \sa cancelDelayedEvent(), postEvent() */ -void QStateMachine::postInternalEvent(QEvent *event) +int QStateMachine::postDelayedEvent(QEvent *event, int delay) { Q_D(QStateMachine); + if (d->state != QStateMachinePrivate::Running) { + qWarning("QStateMachine::postDelayedEvent: cannot post event when the state machine is not running"); + return -1; + } + if (!event) { + qWarning("QStateMachine::postDelayedEvent: cannot post null event"); + return -1; + } + if (delay < 0) { + qWarning("QStateMachine::postDelayedEvent: delay cannot be negative"); + return -1; + } #ifdef QSTATEMACHINE_DEBUG - qDebug() << this << ": posting internal event" << event; + qDebug() << this << ": posting event" << event << "with delay" << delay; #endif - d->internalEventQueue.append(event); - d->processEvents(QStateMachinePrivate::QueuedProcessing); + int tid = startTimer(delay); + d->delayedEvents[tid] = event; + return tid; +} + +/*! + Cancels the delayed event identified by the given \a id. The id should be a + value returned by a call to postDelayedEvent(). Returns true if the event + was successfully cancelled, otherwise returns false. + + \sa postDelayedEvent() +*/ +bool QStateMachine::cancelDelayedEvent(int id) +{ + Q_D(QStateMachine); + if (d->state != QStateMachinePrivate::Running) { + qWarning("QStateMachine::cancelDelayedEvent: the machine is not running"); + return false; + } + QEvent *e = d->delayedEvents.take(id); + if (!e) + return false; + killTimer(id); + delete e; + return true; } /*! @@ -1882,9 +1946,9 @@ bool QStateMachine::event(QEvent *e) if (e->type() == QEvent::Timer) { QTimerEvent *te = static_cast(e); int tid = te->timerId(); - if (d->delayedEvents.contains(tid)) { + QEvent *ee = d->delayedEvents.take(tid); + if (ee != 0) { killTimer(tid); - QEvent *ee = d->delayedEvents.take(tid); d->externalEventQueue.append(ee); d->processEvents(QStateMachinePrivate::DirectProcessing); return true; diff --git a/src/corelib/statemachine/qstatemachine.h b/src/corelib/statemachine/qstatemachine.h index a0b2b14..321a05c 100644 --- a/src/corelib/statemachine/qstatemachine.h +++ b/src/corelib/statemachine/qstatemachine.h @@ -102,6 +102,11 @@ public: QEvent *m_event; }; + enum EventPriority { + NormalPriority, + HighPriority + }; + enum RestorePolicy { DoNotRestoreProperties, RestoreProperties @@ -138,7 +143,9 @@ public: QStateMachine::RestorePolicy globalRestorePolicy() const; void setGlobalRestorePolicy(QStateMachine::RestorePolicy restorePolicy); - void postEvent(QEvent *event, int delay = 0); + void postEvent(QEvent *event, EventPriority priority = NormalPriority); + int postDelayedEvent(QEvent *event, int delay); + bool cancelDelayedEvent(int id); QSet configuration() const; @@ -158,8 +165,6 @@ protected: void onEntry(QEvent *event); void onExit(QEvent *event); - void postInternalEvent(QEvent *event); - virtual void beginSelectTransitions(QEvent *event); virtual void endSelectTransitions(QEvent *event); diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index 37b34bf..463dbf6 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -119,6 +119,7 @@ private slots: void assignProperty(); void assignPropertyWithAnimation(); void postEvent(); + void cancelDelayedEvent(); void stateFinished(); void parallelStates(); void parallelRootState(); @@ -1543,8 +1544,8 @@ private: class StringEventPoster : public QState { public: - StringEventPoster(QStateMachine *machine, const QString &value, QState *parent = 0) - : QState(parent), m_machine(machine), m_value(value), m_delay(0) {} + StringEventPoster(const QString &value, QState *parent = 0) + : QState(parent), m_value(value), m_delay(-1) {} void setString(const QString &value) { m_value = value; } @@ -1554,12 +1555,14 @@ public: protected: virtual void onEntry(QEvent *) { - m_machine->postEvent(new StringEvent(m_value), m_delay); + if (m_delay == -1) + machine()->postEvent(new StringEvent(m_value)); + else + machine()->postDelayedEvent(new StringEvent(m_value), m_delay); } virtual void onExit(QEvent *) {} private: - QStateMachine *m_machine; QString m_value; int m_delay; }; @@ -1573,7 +1576,7 @@ void tst_QStateMachine::postEvent() QTest::ignoreMessage(QtWarningMsg, "QStateMachine::postEvent: cannot post event when the state machine is not running"); machine.postEvent(&e); } - StringEventPoster *s1 = new StringEventPoster(&machine, "a"); + StringEventPoster *s1 = new StringEventPoster("a"); if (x == 1) s1->setDelay(100); QFinalState *s2 = new QFinalState; @@ -1599,6 +1602,42 @@ void tst_QStateMachine::postEvent() } } +void tst_QStateMachine::cancelDelayedEvent() +{ + QStateMachine machine; + QTest::ignoreMessage(QtWarningMsg, "QStateMachine::cancelDelayedEvent: the machine is not running"); + QVERIFY(!machine.cancelDelayedEvent(-1)); + + QState *s1 = new QState(&machine); + QFinalState *s2 = new QFinalState(&machine); + s1->addTransition(new StringTransition("a", s2)); + machine.setInitialState(s1); + + QSignalSpy startedSpy(&machine, SIGNAL(started())); + machine.start(); + QTRY_COMPARE(startedSpy.count(), 1); + QCOMPARE(machine.configuration().size(), 1); + QVERIFY(machine.configuration().contains(s1)); + + int id1 = machine.postDelayedEvent(new StringEvent("c"), 50000); + QVERIFY(id1 != -1); + int id2 = machine.postDelayedEvent(new StringEvent("b"), 25000); + QVERIFY(id2 != -1); + QVERIFY(id2 != id1); + int id3 = machine.postDelayedEvent(new StringEvent("a"), 100); + QVERIFY(id3 != -1); + QVERIFY(id3 != id2); + QVERIFY(machine.cancelDelayedEvent(id1)); + QVERIFY(!machine.cancelDelayedEvent(id1)); + QVERIFY(machine.cancelDelayedEvent(id2)); + QVERIFY(!machine.cancelDelayedEvent(id2)); + + QSignalSpy finishedSpy(&machine, SIGNAL(finished())); + QTRY_COMPARE(finishedSpy.count(), 1); + QCOMPARE(machine.configuration().size(), 1); + QVERIFY(machine.configuration().contains(s2)); +} + void tst_QStateMachine::stateFinished() { QStateMachine machine; -- cgit v0.12 From 75666d254304746ead69892e92fa4ab39d219df1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 29 Sep 2009 15:43:02 +0200 Subject: Fix tr-Errors/remove QObject::tr(), mainly in ScriptTools Note: Those messages are to be translated in Qt 4.6 for the first time. Reviewed-by: Kent Hansen --- src/gui/kernel/qsoftkeymanager.cpp | 2 +- src/network/kernel/qhostinfo_win.cpp | 2 +- .../debugging/qscriptbreakpointsmodel.cpp | 13 ++--- .../debugging/qscriptbreakpointswidget.cpp | 6 +-- src/scripttools/debugging/qscriptdebugger.cpp | 58 +++++++++++----------- .../debugging/qscriptdebuggercodefinderwidget.cpp | 2 +- .../debugging/qscriptdebuggerlocalsmodel.cpp | 5 +- .../debugging/qscriptdebuggerstackmodel.cpp | 7 +-- src/scripttools/debugging/qscriptedit.cpp | 8 +-- .../debugging/qscriptenginedebugger.cpp | 20 ++++---- 10 files changed, 63 insertions(+), 60 deletions(-) diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 91f4163..45695d9 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -238,7 +238,7 @@ void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList &softkeys) } if (needsExitButton) - QT_TRAP_THROWING(nativeContainer->SetCommandL(2, EAknSoftkeyExit, qt_QString2TPtrC(QObject::tr("Exit")))); + QT_TRAP_THROWING(nativeContainer->SetCommandL(2, EAknSoftkeyExit, qt_QString2TPtrC(QSoftKeyManager::tr("Exit")))); nativeContainer->DrawDeferred(); // 3.1 needs an extra invitation } diff --git a/src/network/kernel/qhostinfo_win.cpp b/src/network/kernel/qhostinfo_win.cpp index 55aa77a..d9d7234 100644 --- a/src/network/kernel/qhostinfo_win.cpp +++ b/src/network/kernel/qhostinfo_win.cpp @@ -186,7 +186,7 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName) results.setHostName(hostName); if (aceHostname.isEmpty()) { results.setError(QHostInfo::HostNotFound); - results.setErrorString(hostName.isEmpty() ? QObject::tr("No host name given") : QObject::tr("Invalid hostname")); + results.setErrorString(hostName.isEmpty() ? tr("No host name given") : tr("Invalid hostname")); return results; } } else { diff --git a/src/scripttools/debugging/qscriptbreakpointsmodel.cpp b/src/scripttools/debugging/qscriptbreakpointsmodel.cpp index 82a7c6a..40acebb 100644 --- a/src/scripttools/debugging/qscriptbreakpointsmodel.cpp +++ b/src/scripttools/debugging/qscriptbreakpointsmodel.cpp @@ -47,6 +47,7 @@ #include "private/qabstractitemmodel_p.h" #include +#include #include #include @@ -451,17 +452,17 @@ QVariant QScriptBreakpointsModel::headerData(int section, Qt::Orientation orient if (orient == Qt::Horizontal) { if (role == Qt::DisplayRole) { if (section == 0) - return QObject::tr("ID"); + return QCoreApplication::translate("QScriptBreakpointsModel", "ID"); else if (section == 1) - return QObject::tr("Location"); + return QCoreApplication::translate("QScriptBreakpointsModel", "Location"); else if (section == 2) - return QObject::tr("Condition"); + return QCoreApplication::translate("QScriptBreakpointsModel", "Condition"); else if (section == 3) - return QObject::tr("Ignore-count"); + return QCoreApplication::translate("QScriptBreakpointsModel", "Ignore-count"); else if (section == 4) - return QObject::tr("Single-shot"); + return QCoreApplication::translate("QScriptBreakpointsModel", "Single-shot"); else if (section == 5) - return QObject::tr("Hit-count"); + return QCoreApplication::translate("QScriptBreakpointsModel", "Hit-count"); } } return QVariant(); diff --git a/src/scripttools/debugging/qscriptbreakpointswidget.cpp b/src/scripttools/debugging/qscriptbreakpointswidget.cpp index 356c6d5..688c7c8 100644 --- a/src/scripttools/debugging/qscriptbreakpointswidget.cpp +++ b/src/scripttools/debugging/qscriptbreakpointswidget.cpp @@ -78,7 +78,7 @@ public: toolClose = new QToolButton(this); toolClose->setIcon(QIcon(QString::fromUtf8(":/qt/scripttools/debugging/images/%1/closetab.png").arg(system))); toolClose->setAutoRaise(true); - toolClose->setText(QObject::tr("Close")); + toolClose->setText(tr("Close")); hboxLayout->addWidget(toolClose); fileNameEdit = new QLineEdit(); @@ -295,13 +295,13 @@ QScriptBreakpointsWidget::QScriptBreakpointsWidget(QWidget *parent) QIcon newBreakpointIcon; newBreakpointIcon.addPixmap(d->pixmap(QString::fromLatin1("new.png")), QIcon::Normal); - QAction *newBreakpointAction = new QAction(newBreakpointIcon, QObject::tr("New"), this); + QAction *newBreakpointAction = new QAction(newBreakpointIcon, tr("New"), this); QObject::connect(newBreakpointAction, SIGNAL(triggered()), this, SLOT(_q_newBreakpoint())); QIcon deleteBreakpointIcon; deleteBreakpointIcon.addPixmap(d->pixmap(QString::fromLatin1("delete.png")), QIcon::Normal); - d->deleteBreakpointAction = new QAction(deleteBreakpointIcon, QObject::tr("Delete"), this); + d->deleteBreakpointAction = new QAction(deleteBreakpointIcon, tr("Delete"), this); d->deleteBreakpointAction->setEnabled(false); QObject::connect(d->deleteBreakpointAction, SIGNAL(triggered()), this, SLOT(_q_deleteBreakpoint())); diff --git a/src/scripttools/debugging/qscriptdebugger.cpp b/src/scripttools/debugging/qscriptdebugger.cpp index c09e494..58d707f 100644 --- a/src/scripttools/debugging/qscriptdebugger.cpp +++ b/src/scripttools/debugging/qscriptdebugger.cpp @@ -882,8 +882,8 @@ void QScriptDebuggerPrivate::_q_goToLine() if (!view) return; bool ok = false; - int lineNumber = QInputDialog::getInteger(0, QObject::tr("Go to Line"), - QObject::tr("Line:"), + int lineNumber = QInputDialog::getInteger(0, QScriptDebugger::tr("Go to Line"), + QScriptDebugger::tr("Line:"), view->cursorLineNumber(), 1, INT_MAX, 1, &ok); if (ok) @@ -1674,9 +1674,9 @@ QAction *QScriptDebugger::interruptAction(QObject *parent) const interruptIcon.addPixmap(d->pixmap(QString::fromLatin1("interrupt.png")), QIcon::Normal); interruptIcon.addPixmap(d->pixmap(QString::fromLatin1("d_interrupt.png")), QIcon::Disabled); QScriptDebugger *that = const_cast(this); - that->d_func()->interruptAction = new QAction(interruptIcon, QObject::tr("Interrupt"), parent); + that->d_func()->interruptAction = new QAction(interruptIcon, QScriptDebugger::tr("Interrupt"), parent); d->interruptAction->setEnabled(!d->interactive); - d->interruptAction->setShortcut(QObject::tr("Shift+F5")); + d->interruptAction->setShortcut(QScriptDebugger::tr("Shift+F5")); QObject::connect(d->interruptAction, SIGNAL(triggered()), that, SLOT(_q_interrupt())); } @@ -1691,9 +1691,9 @@ QAction *QScriptDebugger::continueAction(QObject *parent) const continueIcon.addPixmap(d->pixmap(QString::fromLatin1("play.png")), QIcon::Normal); continueIcon.addPixmap(d->pixmap(QString::fromLatin1("d_play.png")), QIcon::Disabled); QScriptDebugger *that = const_cast(this); - that->d_func()->continueAction = new QAction(continueIcon, QObject::tr("Continue"), parent); + that->d_func()->continueAction = new QAction(continueIcon, QScriptDebugger::tr("Continue"), parent); d->continueAction->setEnabled(d->interactive); - d->continueAction->setShortcut(QObject::tr("F5")); + d->continueAction->setShortcut(QScriptDebugger::tr("F5")); QObject::connect(d->continueAction, SIGNAL(triggered()), that, SLOT(_q_continue())); } @@ -1708,9 +1708,9 @@ QAction *QScriptDebugger::stepIntoAction(QObject *parent) const stepIntoIcon.addPixmap(d->pixmap(QString::fromLatin1("stepinto.png")), QIcon::Normal); stepIntoIcon.addPixmap(d->pixmap(QString::fromLatin1("d_stepinto.png")), QIcon::Disabled); QScriptDebugger *that = const_cast(this); - that->d_func()->stepIntoAction = new QAction(stepIntoIcon, QObject::tr("Step Into"), parent); + that->d_func()->stepIntoAction = new QAction(stepIntoIcon, QScriptDebugger::tr("Step Into"), parent); d->stepIntoAction->setEnabled(d->interactive); - d->stepIntoAction->setShortcut(QObject::tr("F11")); + d->stepIntoAction->setShortcut(QScriptDebugger::tr("F11")); QObject::connect(d->stepIntoAction, SIGNAL(triggered()), that, SLOT(_q_stepInto())); } @@ -1725,9 +1725,9 @@ QAction *QScriptDebugger::stepOverAction(QObject *parent) const stepOverIcon.addPixmap(d->pixmap(QString::fromLatin1("stepover.png")), QIcon::Normal); stepOverIcon.addPixmap(d->pixmap(QString::fromLatin1("d_stepover.png")), QIcon::Disabled); QScriptDebugger *that = const_cast(this); - that->d_func()->stepOverAction = new QAction(stepOverIcon, QObject::tr("Step Over"), parent); + that->d_func()->stepOverAction = new QAction(stepOverIcon, QScriptDebugger::tr("Step Over"), parent); d->stepOverAction->setEnabled(d->interactive); - d->stepOverAction->setShortcut(QObject::tr("F10")); + d->stepOverAction->setShortcut(QScriptDebugger::tr("F10")); QObject::connect(d->stepOverAction, SIGNAL(triggered()), that, SLOT(_q_stepOver())); } @@ -1742,9 +1742,9 @@ QAction *QScriptDebugger::stepOutAction(QObject *parent) const stepOutIcon.addPixmap(d->pixmap(QString::fromLatin1("stepout.png")), QIcon::Normal); stepOutIcon.addPixmap(d->pixmap(QString::fromLatin1("d_stepout.png")), QIcon::Disabled); QScriptDebugger *that = const_cast(this); - that->d_func()->stepOutAction = new QAction(stepOutIcon, QObject::tr("Step Out"), parent); + that->d_func()->stepOutAction = new QAction(stepOutIcon, QScriptDebugger::tr("Step Out"), parent); d->stepOutAction->setEnabled(d->interactive); - d->stepOutAction->setShortcut(QObject::tr("Shift+F11")); + d->stepOutAction->setShortcut(QScriptDebugger::tr("Shift+F11")); QObject::connect(d->stepOutAction, SIGNAL(triggered()), that, SLOT(_q_stepOut())); } @@ -1759,9 +1759,9 @@ QAction *QScriptDebugger::runToCursorAction(QObject *parent) const runToCursorIcon.addPixmap(d->pixmap(QString::fromLatin1("runtocursor.png")), QIcon::Normal); runToCursorIcon.addPixmap(d->pixmap(QString::fromLatin1("d_runtocursor.png")), QIcon::Disabled); QScriptDebugger *that = const_cast(this); - that->d_func()->runToCursorAction = new QAction(runToCursorIcon, QObject::tr("Run to Cursor"), parent); + that->d_func()->runToCursorAction = new QAction(runToCursorIcon, QScriptDebugger::tr("Run to Cursor"), parent); d->runToCursorAction->setEnabled(d->interactive); - d->runToCursorAction->setShortcut(QObject::tr("Ctrl+F10")); + d->runToCursorAction->setShortcut(QScriptDebugger::tr("Ctrl+F10")); QObject::connect(d->runToCursorAction, SIGNAL(triggered()), that, SLOT(_q_runToCursor())); } @@ -1777,7 +1777,7 @@ QAction *QScriptDebugger::runToNewScriptAction(QObject *parent) const runToNewScriptIcon.addPixmap(d->pixmap(QString::fromLatin1("d_breakonscriptload.png")), QIcon::Disabled); QScriptDebugger *that = const_cast(this); that->d_func()->runToNewScriptAction = new QAction(runToNewScriptIcon, - QObject::tr("Run to New Script"), parent); + QScriptDebugger::tr("Run to New Script"), parent); d->runToNewScriptAction->setEnabled(d->interactive); QObject::connect(d->runToNewScriptAction, SIGNAL(triggered()), that, SLOT(_q_runToNewScript())); @@ -1792,8 +1792,8 @@ QAction *QScriptDebugger::toggleBreakpointAction(QObject *parent) const QIcon toggleBreakpointIcon; QScriptDebugger *that = const_cast(this); that->d_func()->toggleBreakpointAction = new QAction(toggleBreakpointIcon, - QObject::tr("Toggle Breakpoint"), parent); - d->toggleBreakpointAction->setShortcut(QObject::tr("F9")); + QScriptDebugger::tr("Toggle Breakpoint"), parent); + d->toggleBreakpointAction->setShortcut(QScriptDebugger::tr("F9")); d->toggleBreakpointAction->setEnabled((d->codeWidget != 0) && (d->codeWidget->currentView() != 0)); QObject::connect(d->toggleBreakpointAction, SIGNAL(triggered()), that, SLOT(_q_toggleBreakpoint())); @@ -1807,7 +1807,7 @@ QAction *QScriptDebugger::clearDebugOutputAction(QObject *parent) const if (!d->clearDebugOutputAction) { QIcon clearDebugOutputIcon; QScriptDebugger *that = const_cast(this); - that->d_func()->clearDebugOutputAction = new QAction(clearDebugOutputIcon, QObject::tr("Clear Debug Output"), parent); + that->d_func()->clearDebugOutputAction = new QAction(clearDebugOutputIcon, QScriptDebugger::tr("Clear Debug Output"), parent); QObject::connect(d->clearDebugOutputAction, SIGNAL(triggered()), that, SLOT(_q_clearDebugOutput())); } @@ -1820,7 +1820,7 @@ QAction *QScriptDebugger::clearErrorLogAction(QObject *parent) const if (!d->clearErrorLogAction) { QIcon clearErrorLogIcon; QScriptDebugger *that = const_cast(this); - that->d_func()->clearErrorLogAction = new QAction(clearErrorLogIcon, QObject::tr("Clear Error Log"), parent); + that->d_func()->clearErrorLogAction = new QAction(clearErrorLogIcon, QScriptDebugger::tr("Clear Error Log"), parent); QObject::connect(d->clearErrorLogAction, SIGNAL(triggered()), that, SLOT(_q_clearErrorLog())); } @@ -1833,7 +1833,7 @@ QAction *QScriptDebugger::clearConsoleAction(QObject *parent) const if (!d->clearConsoleAction) { QIcon clearConsoleIcon; QScriptDebugger *that = const_cast(this); - that->d_func()->clearConsoleAction = new QAction(clearConsoleIcon, QObject::tr("Clear Console"), parent); + that->d_func()->clearConsoleAction = new QAction(clearConsoleIcon, QScriptDebugger::tr("Clear Console"), parent); QObject::connect(d->clearConsoleAction, SIGNAL(triggered()), that, SLOT(_q_clearConsole())); } @@ -1847,8 +1847,8 @@ QAction *QScriptDebugger::findInScriptAction(QObject *parent) const QIcon findInScriptIcon; findInScriptIcon.addPixmap(d->pixmap(QString::fromLatin1("find.png")), QIcon::Normal); QScriptDebugger *that = const_cast(this); - that->d_func()->findInScriptAction = new QAction(findInScriptIcon, QObject::tr("&Find in Script..."), parent); - d->findInScriptAction->setShortcut(QObject::tr("Ctrl+F")); + that->d_func()->findInScriptAction = new QAction(findInScriptIcon, QScriptDebugger::tr("&Find in Script..."), parent); + d->findInScriptAction->setShortcut(QScriptDebugger::tr("Ctrl+F")); d->findInScriptAction->setEnabled( (d->codeFinderWidget != 0) && (d->codeWidget != 0) @@ -1865,9 +1865,9 @@ QAction *QScriptDebugger::findNextInScriptAction(QObject *parent) const if (!d->findNextInScriptAction) { QIcon findNextInScriptIcon; QScriptDebugger *that = const_cast(this); - that->d_func()->findNextInScriptAction = new QAction(findNextInScriptIcon, QObject::tr("Find &Next"), parent); + that->d_func()->findNextInScriptAction = new QAction(findNextInScriptIcon, QScriptDebugger::tr("Find &Next"), parent); d->findNextInScriptAction->setEnabled(d->codeFinderWidget && !d->codeFinderWidget->text().isEmpty()); - d->findNextInScriptAction->setShortcut(QObject::tr("F3")); + d->findNextInScriptAction->setShortcut(QScriptDebugger::tr("F3")); QObject::connect(d->findNextInScriptAction, SIGNAL(triggered()), that, SLOT(_q_findNextInScript())); } @@ -1880,9 +1880,9 @@ QAction *QScriptDebugger::findPreviousInScriptAction(QObject *parent) const if (!d->findPreviousInScriptAction) { QIcon findPreviousInScriptIcon; QScriptDebugger *that = const_cast(this); - that->d_func()->findPreviousInScriptAction = new QAction(findPreviousInScriptIcon, QObject::tr("Find &Previous"), parent); + that->d_func()->findPreviousInScriptAction = new QAction(findPreviousInScriptIcon, QScriptDebugger::tr("Find &Previous"), parent); d->findPreviousInScriptAction->setEnabled(d->codeFinderWidget && !d->codeFinderWidget->text().isEmpty()); - d->findPreviousInScriptAction->setShortcut(QObject::tr("Shift+F3")); + d->findPreviousInScriptAction->setShortcut(QScriptDebugger::tr("Shift+F3")); QObject::connect(d->findPreviousInScriptAction, SIGNAL(triggered()), that, SLOT(_q_findPreviousInScript())); } @@ -1895,8 +1895,8 @@ QAction *QScriptDebugger::goToLineAction(QObject *parent) const if (!d->goToLineAction) { QIcon goToLineIcon; QScriptDebugger *that = const_cast(this); - that->d_func()->goToLineAction = new QAction(goToLineIcon, QObject::tr("Go to Line"), parent); - d->goToLineAction->setShortcut(QObject::tr("Ctrl+G")); + that->d_func()->goToLineAction = new QAction(goToLineIcon, QScriptDebugger::tr("Go to Line"), parent); + d->goToLineAction->setShortcut(QScriptDebugger::tr("Ctrl+G")); d->goToLineAction->setEnabled((d->codeWidget != 0) && (d->codeWidget->currentView() != 0)); QObject::connect(d->goToLineAction, SIGNAL(triggered()), that, SLOT(_q_goToLine())); @@ -1907,7 +1907,7 @@ QAction *QScriptDebugger::goToLineAction(QObject *parent) const QMenu *QScriptDebugger::createStandardMenu(QWidget *widgetParent, QObject *actionParent) { QMenu *menu = new QMenu(widgetParent); - menu->setTitle(QObject::tr("Debug")); + menu->setTitle(QScriptDebugger::tr("Debug")); menu->addAction(action(ContinueAction, actionParent)); menu->addAction(action(InterruptAction, actionParent)); menu->addAction(action(StepIntoAction, actionParent)); diff --git a/src/scripttools/debugging/qscriptdebuggercodefinderwidget.cpp b/src/scripttools/debugging/qscriptdebuggercodefinderwidget.cpp index 5ef5a0c..8ed0aaa 100644 --- a/src/scripttools/debugging/qscriptdebuggercodefinderwidget.cpp +++ b/src/scripttools/debugging/qscriptdebuggercodefinderwidget.cpp @@ -138,7 +138,7 @@ QScriptDebuggerCodeFinderWidget::QScriptDebuggerCodeFinderWidget(QWidget *parent d->toolClose = new QToolButton(this); d->toolClose->setIcon(QIcon(QString::fromUtf8(":/qt/scripttools/debugging/images/%1/closetab.png").arg(system))); d->toolClose->setAutoRaise(true); - d->toolClose->setText(QObject::tr("Close")); + d->toolClose->setText(tr("Close")); hboxLayout->addWidget(d->toolClose); d->editFind = new QLineEdit(this); diff --git a/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp b/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp index 15d43f4..9caefce 100644 --- a/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp +++ b/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp @@ -53,6 +53,7 @@ #include "private/qabstractitemmodel_p.h" #include +#include #include #include @@ -868,9 +869,9 @@ QVariant QScriptDebuggerLocalsModel::headerData(int section, Qt::Orientation ori if (orient == Qt::Horizontal) { if (role == Qt::DisplayRole) { if (section == 0) - return QObject::tr("Name"); + return QCoreApplication::translate("QScriptDebuggerLocalsModel", "Name"); else if (section == 1) - return QObject::tr("Value"); + return QCoreApplication::translate("QScriptDebuggerLocalsModel", "Value"); } } return QVariant(); diff --git a/src/scripttools/debugging/qscriptdebuggerstackmodel.cpp b/src/scripttools/debugging/qscriptdebuggerstackmodel.cpp index a63ea73..2d56e17 100644 --- a/src/scripttools/debugging/qscriptdebuggerstackmodel.cpp +++ b/src/scripttools/debugging/qscriptdebuggerstackmodel.cpp @@ -45,6 +45,7 @@ #include #include +#include QT_BEGIN_NAMESPACE @@ -157,11 +158,11 @@ QVariant QScriptDebuggerStackModel::headerData(int section, Qt::Orientation orie return QVariant(); if (role == Qt::DisplayRole) { if (section == 0) - return QObject::tr("Level"); + return QCoreApplication::translate("QScriptDebuggerStackModel", "Level"); else if (section == 1) - return QObject::tr("Name"); + return QCoreApplication::translate("QScriptDebuggerStackModel", "Name"); else if (section == 2) - return QObject::tr("Location"); + return QCoreApplication::translate("QScriptDebuggerStackModel", "Location"); } return QVariant(); } diff --git a/src/scripttools/debugging/qscriptedit.cpp b/src/scripttools/debugging/qscriptedit.cpp index 8db9cea..7f0a5e0 100644 --- a/src/scripttools/debugging/qscriptedit.cpp +++ b/src/scripttools/debugging/qscriptedit.cpp @@ -408,14 +408,14 @@ void QScriptEdit::extraAreaMouseEvent(QMouseEvent *e) return; bool has = m_breakpoints.contains(lineNumber); QMenu *popup = new QMenu(); - QAction *toggleAct = new QAction(QObject::tr("Toggle Breakpoint"), popup); + QAction *toggleAct = new QAction(tr("Toggle Breakpoint"), popup); popup->addAction(toggleAct); - QAction *disableAct = new QAction(QObject::tr("Disable Breakpoint"), popup); - QAction *enableAct = new QAction(QObject::tr("Enable Breakpoint"), popup); + QAction *disableAct = new QAction(tr("Disable Breakpoint"), popup); + QAction *enableAct = new QAction(tr("Enable Breakpoint"), popup); QWidget *conditionWidget = new QWidget(); { QHBoxLayout *hbox = new QHBoxLayout(conditionWidget); - hbox->addWidget(new QLabel(QObject::tr("Breakpoint Condition:"))); + hbox->addWidget(new QLabel(tr("Breakpoint Condition:"))); hbox->addWidget(new QLineEdit()); } // QWidgetAction *conditionAct = new QWidgetAction(popup); diff --git a/src/scripttools/debugging/qscriptenginedebugger.cpp b/src/scripttools/debugging/qscriptenginedebugger.cpp index 7456da0..915d511 100644 --- a/src/scripttools/debugging/qscriptenginedebugger.cpp +++ b/src/scripttools/debugging/qscriptenginedebugger.cpp @@ -520,43 +520,43 @@ QMainWindow *QScriptEngineDebugger::standardWindow() const QMainWindow *win = new QMainWindow(); QDockWidget *scriptsDock = new QDockWidget(win); scriptsDock->setObjectName(QLatin1String("qtscriptdebugger_scriptsDockWidget")); - scriptsDock->setWindowTitle(QObject::tr("Loaded Scripts")); + scriptsDock->setWindowTitle(tr("Loaded Scripts")); scriptsDock->setWidget(widget(ScriptsWidget)); win->addDockWidget(Qt::LeftDockWidgetArea, scriptsDock); QDockWidget *breakpointsDock = new QDockWidget(win); breakpointsDock->setObjectName(QLatin1String("qtscriptdebugger_breakpointsDockWidget")); - breakpointsDock->setWindowTitle(QObject::tr("Breakpoints")); + breakpointsDock->setWindowTitle(tr("Breakpoints")); breakpointsDock->setWidget(widget(BreakpointsWidget)); win->addDockWidget(Qt::LeftDockWidgetArea, breakpointsDock); QDockWidget *stackDock = new QDockWidget(win); stackDock->setObjectName(QLatin1String("qtscriptdebugger_stackDockWidget")); - stackDock->setWindowTitle(QObject::tr("Stack")); + stackDock->setWindowTitle(tr("Stack")); stackDock->setWidget(widget(StackWidget)); win->addDockWidget(Qt::RightDockWidgetArea, stackDock); QDockWidget *localsDock = new QDockWidget(win); localsDock->setObjectName(QLatin1String("qtscriptdebugger_localsDockWidget")); - localsDock->setWindowTitle(QObject::tr("Locals")); + localsDock->setWindowTitle(tr("Locals")); localsDock->setWidget(widget(LocalsWidget)); win->addDockWidget(Qt::RightDockWidgetArea, localsDock); QDockWidget *consoleDock = new QDockWidget(win); consoleDock->setObjectName(QLatin1String("qtscriptdebugger_consoleDockWidget")); - consoleDock->setWindowTitle(QObject::tr("Console")); + consoleDock->setWindowTitle(tr("Console")); consoleDock->setWidget(widget(ConsoleWidget)); win->addDockWidget(Qt::BottomDockWidgetArea, consoleDock); QDockWidget *debugOutputDock = new QDockWidget(win); debugOutputDock->setObjectName(QLatin1String("qtscriptdebugger_debugOutputDockWidget")); - debugOutputDock->setWindowTitle(QObject::tr("Debug Output")); + debugOutputDock->setWindowTitle(tr("Debug Output")); debugOutputDock->setWidget(widget(DebugOutputWidget)); win->addDockWidget(Qt::BottomDockWidgetArea, debugOutputDock); QDockWidget *errorLogDock = new QDockWidget(win); errorLogDock->setObjectName(QLatin1String("qtscriptdebugger_errorLogDockWidget")); - errorLogDock->setWindowTitle(QObject::tr("Error Log")); + errorLogDock->setWindowTitle(tr("Error Log")); errorLogDock->setWidget(widget(ErrorLogWidget)); win->addDockWidget(Qt::BottomDockWidgetArea, errorLogDock); @@ -568,14 +568,14 @@ QMainWindow *QScriptEngineDebugger::standardWindow() const #ifndef QT_NO_MENUBAR win->menuBar()->addMenu(that->createStandardMenu(win)); - QMenu *editMenu = win->menuBar()->addMenu(QObject::tr("Search")); + QMenu *editMenu = win->menuBar()->addMenu(tr("Search")); editMenu->addAction(action(FindInScriptAction)); editMenu->addAction(action(FindNextInScriptAction)); editMenu->addAction(action(FindPreviousInScriptAction)); editMenu->addSeparator(); editMenu->addAction(action(GoToLineAction)); - QMenu *viewMenu = win->menuBar()->addMenu(QObject::tr("View")); + QMenu *viewMenu = win->menuBar()->addMenu(tr("View")); viewMenu->addAction(scriptsDock->toggleViewAction()); viewMenu->addAction(breakpointsDock->toggleViewAction()); viewMenu->addAction(stackDock->toggleViewAction()); @@ -593,7 +593,7 @@ QMainWindow *QScriptEngineDebugger::standardWindow() const widget(CodeFinderWidget)->hide(); win->setCentralWidget(central); - win->setWindowTitle(QObject::tr("Qt Script Debugger")); + win->setWindowTitle(tr("Qt Script Debugger")); win->setUnifiedTitleAndToolBarOnMac(true); QSettings settings(QSettings::UserScope, QLatin1String("Trolltech")); -- cgit v0.12