From 0068bd9279b5f7a12f00ffea66cb264930f88138 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 2 Jun 2009 16:29:32 +0200 Subject: missing deployment rule added to examples/richtext/textobject The example SVG must be deployed on Windows CE devices to be used. Reviewed-by: mauricek BT: yes --- examples/richtext/textobject/textobject.pro | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/richtext/textobject/textobject.pro b/examples/richtext/textobject/textobject.pro index fbb809c..4fa9cb0 100644 --- a/examples/richtext/textobject/textobject.pro +++ b/examples/richtext/textobject/textobject.pro @@ -12,3 +12,7 @@ sources.files = $$SOURCES $$HEADERS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/richtext/textobject INSTALLS += target sources +filesToDeploy.sources = files/*.svg +filesToDeploy.path = files +DEPLOYMENT += filesToDeploy + -- cgit v0.12 From d69f28f00fe7efda12f9bb236ecd6a0de39232e4 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 2 Jun 2009 16:50:57 +0200 Subject: my changes for 4.5.2 --- dist/changes-4.5.2 | 1 + 1 file changed, 1 insertion(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index c87ad92..f5e93f8 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -128,6 +128,7 @@ Qt for Embedded Linux Qt for Windows CE ----------------- +[248846] handle the back soft key on Windows mobile. **************************************************************************** -- cgit v0.12 From e8c6c0cf4d341572e4740940590b0301d208d239 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 2 Jun 2009 17:17:16 +0200 Subject: Update my changelog for 4.5.2 --- dist/changes-4.5.2 | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index f5e93f8..5149eba 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -46,9 +46,23 @@ Third party components Plugins (r41346, r43550, r43915, r43917, r43923) Clipboard (r41360) +- QAbstractItemView + * [250754] Changing the font of the view would not update the size of the + items if there is an application stylesheet. + * [252532] Pressing enter in a QPlainTextEdit embedded on a itemview now + insert a newline + - QAbstractNetworkCache * Only cache responses to HTTP GET by default, not HTTP PUT or POST +- QComboBox + * [253944] Changing the style doesn't reset custom item delegate anymore. + * [254589] Fixed the frame appearing if setting a stylesheet with a border + on the embedded itemview while there is a stylesheet on the application + +- QDir + * Fix reentrency (listing directories in different threads) + - QMacStyle * [253339] Don't draw arrows on toolbuttons that have a menu and text only. * [252301] Ensure that small and mini spin boxes are drawn correctly. @@ -68,6 +82,10 @@ Third party components * [253448] Prevent a crash when using the Qt::WA_MacBrushedMetal attribute in conjunction with style sheets. +- QObject + * Fixed possible race condition if two QObject connected together with + signals and slot are destroyed in different threads + - QPainter * [253783] Fixed text shaping bugs when using ligatures and different scripts in a single text item. @@ -78,16 +96,37 @@ Third party components * [251534] Fixed issue where text with non-opaque color from widget palette would be blitted instead of blended. +- QSelectionModel + * [252069] fix QSelectionModel::rowIntersectsSelection or QSelectionModel::columnsIntersectsSelection not reporting right result if some items are disabled. + +- QSortFilterProxyModel + * [250023] Fixes QSortFilterProxyModel not reporting child if the model + need to fetchMore + * [251296] In dynamic filter model, childs of temporarly filtered items + where not correctly updated. + * [252507] Show a warning instead of crashing if invalid indexes are passed. + * [254234] Fixed setDynamicSortFilter not working when setting the model initially + +- QString + * Fixed reentrency of QString::squeeze() + - QTransform * Fixed issue in QTransform::type() causing a projective transform to be treated as a scaling transform. +- QVector + * Fixed reentrency of QVector::reserve() + - QtOpenGL * [247083] Re-enabled antialiasing for large font sizes in OpenGL paint engine. * [251485] Fixed crash that could occur with projective transforms and high quality antialiasing. +- QCssParser + * [252311] "font-family:" now handle fallback font specified with a comas + separated list. + **************************************************************************** * Database Drivers * **************************************************************************** -- cgit v0.12 From b3ebeff77de9f3e53bea08bfd09eac9cb3a32be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Tue, 2 Jun 2009 17:55:58 +0200 Subject: Fixed a byte ordering issue when using the raster graphicssystem. The R and B channels were swapped on little endian machines with BGR layout. Task-number: 254934 Reviewed-by: Samuel --- src/gui/painting/qpaintengine_x11.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp index 9cc9683..2e6d593 100644 --- a/src/gui/painting/qpaintengine_x11.cpp +++ b/src/gui/painting/qpaintengine_x11.cpp @@ -1826,9 +1826,10 @@ Q_GUI_EXPORT void qt_x11_drawImage(const QRect &rect, const QPoint &pos, const Q const int h = rect.height(); QImage im; - if ((QSysInfo::ByteOrder == QSysInfo::BigEndian - && ((ImageByteOrder(X11->display) == LSBFirst) || bgr_layout)) - || (ImageByteOrder(X11->display) == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian)) + int image_byte_order = ImageByteOrder(X11->display); + if ((QSysInfo::ByteOrder == QSysInfo::BigEndian && ((image_byte_order == LSBFirst) || bgr_layout)) + || (image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian) + || (image_byte_order == LSBFirst && bgr_layout)) { im = image.copy(rect); const int iw = im.bytesPerLine() / 4; @@ -1836,19 +1837,21 @@ Q_GUI_EXPORT void qt_x11_drawImage(const QRect &rect, const QPoint &pos, const Q for (int i=0; i < h; i++) { uint *p = data; uint *end = p + w; - if (bgr_layout && ImageByteOrder(X11->display) == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian) { + if (bgr_layout && image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian) { while (p < end) { *p = ((*p << 8) & 0xffffff00) | ((*p >> 24) & 0x000000ff); p++; } - } else if ((ImageByteOrder(X11->display) == LSBFirst && QSysInfo::ByteOrder == QSysInfo::BigEndian) - || (ImageByteOrder(X11->display) == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian)) { + } else if ((image_byte_order == LSBFirst && QSysInfo::ByteOrder == QSysInfo::BigEndian) + || (image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian)) { while (p < end) { *p = ((*p << 24) & 0xff000000) | ((*p << 8) & 0x00ff0000) | ((*p >> 8) & 0x0000ff00) | ((*p >> 24) & 0x000000ff); p++; } - } else if (ImageByteOrder(X11->display) == MSBFirst && QSysInfo::ByteOrder == QSysInfo::BigEndian) { + } else if ((image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::BigEndian) + || (image_byte_order == LSBFirst && bgr_layout)) + { while (p < end) { *p = ((*p << 16) & 0x00ff0000) | ((*p >> 16) & 0x000000ff) | ((*p ) & 0xff00ff00); -- cgit v0.12 From b469fd9aac5c0e4a87ea1a9be254b566c0353702 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 3 Jun 2009 09:15:57 +0200 Subject: _networktest compile fix Reviewed-by: mauricek --- tests/auto/_networkselftest/tst_networkselftest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/_networkselftest/tst_networkselftest.cpp b/tests/auto/_networkselftest/tst_networkselftest.cpp index dab4433..0fa001a 100644 --- a/tests/auto/_networkselftest/tst_networkselftest.cpp +++ b/tests/auto/_networkselftest/tst_networkselftest.cpp @@ -463,7 +463,7 @@ void tst_NetworkSelfTest::httpsServer() << Chat::expect("200 ") << Chat::DiscardUntilDisconnect); #else - QSKIP("SSL not enabled, cannot test"); + QSKIP("SSL not enabled, cannot test", SkipAll); #endif } -- cgit v0.12 From 10b1e68d07746fde5ec6d6d2fc3f46fb803a2462 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Wed, 3 Jun 2009 10:14:49 +0200 Subject: Doc - fixed a typo Reviewed-By: TrustMe --- doc/src/tutorials/addressbook.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc index 3b0d2bc..3ec883f 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -303,7 +303,7 @@ Within the constructor of \c AddressBook, we set the \c nameLine and \c addressText to read-only, so that we can only display but not edit - existing cotact details. + existing contact details. \dots \snippet tutorials/addressbook/part2/addressbook.cpp setting readonly 1 -- cgit v0.12 From 716e2105dce4487baa32a4e11b69f1d394515a86 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 3 Jun 2009 11:11:41 +0200 Subject: Add a note about what happens when passing 0 to qobject_cast in the doc Reviewed-by: Kavindra Palaraja --- src/corelib/kernel/qobject.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 7e5f779..6583b85 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -912,7 +912,8 @@ QObject::~QObject() \relates QObject Returns the given \a object cast to type T if the object is of type - T (or of a subclass); otherwise returns 0. + T (or of a subclass); otherwise returns 0. If \a object is 0 then + it will also return 0. The class T must inherit (directly or indirectly) QObject and be declared with the \l Q_OBJECT macro. -- cgit v0.12 From 4948f4b188c6aa40e628d74d6d6fce747ee535bd Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 2 Jun 2009 15:26:43 +0200 Subject: open pipes in overlapped mode also on the client side otherwise PeekNamedPipe() may block in threaded environments. Reviewed-by: thiago --- src/network/socket/qlocalsocket_win.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp index 39c9284..ace3bc5 100644 --- a/src/network/socket/qlocalsocket_win.cpp +++ b/src/network/socket/qlocalsocket_win.cpp @@ -144,7 +144,7 @@ void QLocalSocket::connectToServer(const QString &name, OpenMode openMode) 0, // no sharing NULL, // default security attributes OPEN_EXISTING, // opens existing pipe - 0, // default attributes + FILE_FLAG_OVERLAPPED, NULL); // no template file }, { localSocket = CreateFileA( @@ -153,7 +153,7 @@ void QLocalSocket::connectToServer(const QString &name, OpenMode openMode) 0, // no sharing NULL, // default security attributes OPEN_EXISTING, // opens existing pipe - 0, // default attributes + FILE_FLAG_OVERLAPPED, NULL); // no template file }); if (localSocket != INVALID_HANDLE_VALUE) -- cgit v0.12 From 61926772f3c628baefbfe61c28004ffb9ae2b175 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 2 Jun 2009 18:17:13 +0200 Subject: centralize removeServer() invocation for some more determinism --- tests/auto/qlocalsocket/tst_qlocalsocket.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp index deabda6..12be540 100644 --- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp @@ -113,8 +113,6 @@ tst_QLocalSocket::tst_QLocalSocket() #endif )) qWarning() << "lackey executable doesn't exists!"; - - QLocalServer::removeServer("tst_localsocket"); } tst_QLocalSocket::~tst_QLocalSocket() @@ -139,7 +137,13 @@ public: LocalServer() : QLocalServer() { connect(this, SIGNAL(newConnection()), this, SLOT(slotNewConnection())); - }; + } + + bool listen(const QString &name) + { + removeServer(name); + return QLocalServer::listen(name); + } QList hits; @@ -528,7 +532,7 @@ void tst_QLocalSocket::sendData() // QLocalSocket/Server can take a name or path, check that it works as expected void tst_QLocalSocket::fullPath() { - QLocalServer server; + LocalServer server; QString name = "qlocalsocket_pathtest"; #if defined(QT_LOCALSOCKET_TCP) QString path = "QLocalServer"; @@ -822,7 +826,7 @@ void tst_QLocalSocket::removeServer() void tst_QLocalSocket::recycleServer() { - QLocalServer server; + LocalServer server; QLocalSocket client; QVERIFY(server.listen("recycletest1")); -- cgit v0.12 From 517ebf6f06db90a46d62c397d8e4c940cd7ac62b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 2 Jun 2009 13:05:13 +0200 Subject: fix lithuanian plural rules --- tools/linguist/shared/numerus.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/linguist/shared/numerus.cpp b/tools/linguist/shared/numerus.cpp index f3a29cc..dd9c5ee 100644 --- a/tools/linguist/shared/numerus.cpp +++ b/tools/linguist/shared/numerus.cpp @@ -74,7 +74,7 @@ static const uchar macedonianRules[] = Q_MOD_10 | Q_EQ, 2 }; static const uchar lithuanianRules[] = { Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11, Q_NEWRULE, - Q_MOD_10 | Q_EQ, 2, Q_AND, Q_MOD_100 | Q_NOT_BETWEEN, 10, 19 }; + Q_MOD_10 | Q_NEQ, 0, Q_AND, Q_MOD_100 | Q_NOT_BETWEEN, 10, 19 }; static const uchar russianStyleRules[] = { Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11, Q_NEWRULE, Q_MOD_10 | Q_BETWEEN, 2, 4, Q_AND, Q_MOD_100 | Q_NOT_BETWEEN, 10, 19 }; @@ -112,7 +112,7 @@ static const char * const irishStyleForms[] = { "Singular", "Dual", "Plural", 0 static const char * const czechForms[] = { "Singular", "Dual", "Plural", 0 }; static const char * const slovakForms[] = { "Singular", "Dual", "Plural", 0 }; static const char * const macedonianForms[] = { "Singular", "Dual", "Plural", 0 }; -static const char * const lithuanianForms[] = { "Singular", "Dual", "Plural", 0 }; +static const char * const lithuanianForms[] = { "Singular", "Paucal", "Plural", 0 }; static const char * const russianStyleForms[] = { "Singular", "Dual", "Plural", 0 }; static const char * const polishForms[] = { "Singular", "Paucal", "Plural", 0 }; static const char * const romanianForms[] = -- cgit v0.12 From 70be10968c8f547b464b3150ba582766e679ec7d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 2 Jun 2009 14:11:31 +0200 Subject: fix icelandic plural forms --- tools/linguist/shared/numerus.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/linguist/shared/numerus.cpp b/tools/linguist/shared/numerus.cpp index dd9c5ee..8ca6ef6 100644 --- a/tools/linguist/shared/numerus.cpp +++ b/tools/linguist/shared/numerus.cpp @@ -60,6 +60,8 @@ static const uchar frenchStyleRules[] = static const uchar latvianRules[] = { Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11, Q_NEWRULE, Q_NEQ, 0 }; +static const uchar icelandicRules[] = + { Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11 }; static const uchar irishStyleRules[] = { Q_EQ, 1, Q_NEWRULE, Q_EQ, 2 }; @@ -107,6 +109,7 @@ static const uchar arabicRules[] = static const char * const japaneseStyleForms[] = { "Universal Form", 0 }; static const char * const englishStyleForms[] = { "Singular", "Plural", 0 }; static const char * const frenchStyleForms[] = { "Singular", "Plural", 0 }; +static const char * const icelandicForms[] = { "Singular", "Plural", 0 }; static const char * const latvianForms[] = { "Singular", "Plural", "Nullar", 0 }; static const char * const irishStyleForms[] = { "Singular", "Dual", "Plural", 0 }; static const char * const czechForms[] = { "Singular", "Dual", "Plural", 0 }; @@ -190,7 +193,6 @@ static const QLocale::Language englishStyleLanguages[] = { QLocale::Hausa, QLocale::Hebrew, QLocale::Hindi, - QLocale::Icelandic, QLocale::Interlingua, QLocale::Interlingue, QLocale::Italian, @@ -261,6 +263,7 @@ static const QLocale::Language frenchStyleLanguages[] = { EOL }; static const QLocale::Language latvianLanguage[] = { QLocale::Latvian, EOL }; +static const QLocale::Language icelandicLanguage[] = { QLocale::Icelandic, EOL }; static const QLocale::Language irishStyleLanguages[] = { QLocale::Divehi, QLocale::Gaelic, @@ -320,6 +323,7 @@ static const NumerusTableEntry numerusTable[] = { { frenchStyleRules, sizeof(frenchStyleRules), frenchStyleForms, frenchStyleLanguages, frenchStyleCountries }, { latvianRules, sizeof(latvianRules), latvianForms, latvianLanguage, 0 }, + { icelandicRules, sizeof(icelandicRules), icelandicForms, icelandicLanguage, 0 }, { irishStyleRules, sizeof(irishStyleRules), irishStyleForms, irishStyleLanguages, 0 }, { czechRules, sizeof(czechRules), czechForms, czechLanguage, 0 }, { slovakRules, sizeof(slovakRules), slovakForms, slovakLanguage, 0 }, -- cgit v0.12 From a9472cb582fe155dd21f7bd3189afb64d5b08ab8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 2 Jun 2009 14:40:51 +0200 Subject: fix tagalog plural forms --- tools/linguist/shared/numerus.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/linguist/shared/numerus.cpp b/tools/linguist/shared/numerus.cpp index 8ca6ef6..239b4c7 100644 --- a/tools/linguist/shared/numerus.cpp +++ b/tools/linguist/shared/numerus.cpp @@ -105,6 +105,9 @@ static const uchar arabicRules[] = Q_EQ, 2, Q_NEWRULE, Q_MOD_100 | Q_BETWEEN, 3, 10, Q_NEWRULE, Q_MOD_100 | Q_NEQ, 0 }; +static const uchar tagalogRules[] = + { Q_LEQ, 1, Q_NEWRULE, + Q_MOD_10 | Q_EQ, 4, Q_OR, Q_MOD_10 | Q_EQ, 6, Q_OR, Q_MOD_10 | Q_EQ, 9 }; static const char * const japaneseStyleForms[] = { "Universal Form", 0 }; static const char * const englishStyleForms[] = { "Singular", "Plural", 0 }; @@ -127,6 +130,8 @@ static const char * const welshForms[] = { "Nullar", "Singular", "Dual", "Sexal", "Plural", 0 }; static const char * const arabicForms[] = { "Nullar", "Singular", "Dual", "Minority Plural", "Plural", "Plural Form for 100, 200, ...", 0 }; +static const char * const tagalogForms[] = + { "Singular", "Plural (consonant-ended)", "Plural (vowel-ended)", 0 }; #define EOL QLocale::C @@ -233,7 +238,6 @@ static const QLocale::Language englishStyleLanguages[] = { QLocale::Spanish, QLocale::Swahili, QLocale::Swedish, - QLocale::Tagalog, QLocale::Tajik, QLocale::Tamil, QLocale::Tatar, @@ -301,6 +305,7 @@ static const QLocale::Language slovenianLanguage[] = { QLocale::Slovenian, EOL } static const QLocale::Language malteseLanguage[] = { QLocale::Maltese, EOL }; static const QLocale::Language welshLanguage[] = { QLocale::Welsh, EOL }; static const QLocale::Language arabicLanguage[] = { QLocale::Arabic, EOL }; +static const QLocale::Language tagalogLanguage[] = { QLocale::Tagalog, EOL }; static const QLocale::Country frenchStyleCountries[] = { // keep synchronized with frenchStyleLanguages @@ -335,7 +340,8 @@ static const NumerusTableEntry numerusTable[] = { { slovenianRules, sizeof(slovenianRules), slovenianForms, slovenianLanguage, 0 }, { malteseRules, sizeof(malteseRules), malteseForms, malteseLanguage, 0 }, { welshRules, sizeof(welshRules), welshForms, welshLanguage, 0 }, - { arabicRules, sizeof(arabicRules), arabicForms, arabicLanguage, 0 } + { arabicRules, sizeof(arabicRules), arabicForms, arabicLanguage, 0 }, + { tagalogRules, sizeof(tagalogRules), tagalogForms, tagalogLanguage, 0 } }; static const int NumerusTableSize = sizeof(numerusTable) / sizeof(numerusTable[0]); -- cgit v0.12 From 4cc2d62669b1638d34b6588bd3b164fb17138596 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 2 Jun 2009 14:42:24 +0200 Subject: fix turkish plural forms --- tools/linguist/shared/numerus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/linguist/shared/numerus.cpp b/tools/linguist/shared/numerus.cpp index 239b4c7..3a06065 100644 --- a/tools/linguist/shared/numerus.cpp +++ b/tools/linguist/shared/numerus.cpp @@ -155,6 +155,7 @@ static const QLocale::Language japaneseStyleLanguages[] = { QLocale::Sundanese, QLocale::Thai, QLocale::Tibetan, + QLocale::Turkish, QLocale::Vietnamese, QLocale::Yoruba, QLocale::Zhuang, @@ -244,7 +245,6 @@ static const QLocale::Language englishStyleLanguages[] = { QLocale::Telugu, QLocale::TongaLanguage, QLocale::Tsonga, - QLocale::Turkish, QLocale::Turkmen, QLocale::Twi, QLocale::Uigur, -- cgit v0.12 From 78b44fdb2b505833a9b60fcd63e1fe8c8a59d9ed Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 3 Jun 2009 11:14:46 +0200 Subject: drop traditional czech plural rules in favor of today's slovak-like rules --- tools/linguist/shared/numerus.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/linguist/shared/numerus.cpp b/tools/linguist/shared/numerus.cpp index 3a06065..408877f 100644 --- a/tools/linguist/shared/numerus.cpp +++ b/tools/linguist/shared/numerus.cpp @@ -65,9 +65,6 @@ static const uchar icelandicRules[] = static const uchar irishStyleRules[] = { Q_EQ, 1, Q_NEWRULE, Q_EQ, 2 }; -static const uchar czechRules[] = - { Q_MOD_100 | Q_EQ, 1, Q_NEWRULE, - Q_MOD_100 | Q_BETWEEN, 2, 4 }; static const uchar slovakRules[] = { Q_EQ, 1, Q_NEWRULE, Q_BETWEEN, 2, 4 }; @@ -115,7 +112,6 @@ static const char * const frenchStyleForms[] = { "Singular", "Plural", 0 }; static const char * const icelandicForms[] = { "Singular", "Plural", 0 }; static const char * const latvianForms[] = { "Singular", "Plural", "Nullar", 0 }; static const char * const irishStyleForms[] = { "Singular", "Dual", "Plural", 0 }; -static const char * const czechForms[] = { "Singular", "Dual", "Plural", 0 }; static const char * const slovakForms[] = { "Singular", "Dual", "Plural", 0 }; static const char * const macedonianForms[] = { "Singular", "Dual", "Plural", 0 }; static const char * const lithuanianForms[] = { "Singular", "Paucal", "Plural", 0 }; @@ -281,8 +277,7 @@ static const QLocale::Language irishStyleLanguages[] = { QLocale::Sanskrit, EOL }; -static const QLocale::Language czechLanguage[] = { QLocale::Czech, EOL }; -static const QLocale::Language slovakLanguage[] = { QLocale::Slovak, EOL }; +static const QLocale::Language slovakLanguages[] = { QLocale::Slovak, QLocale::Czech, EOL }; static const QLocale::Language macedonianLanguage[] = { QLocale::Macedonian, EOL }; static const QLocale::Language lithuanianLanguage[] = { QLocale::Lithuanian, EOL }; static const QLocale::Language russianStyleLanguages[] = { @@ -330,8 +325,7 @@ static const NumerusTableEntry numerusTable[] = { { latvianRules, sizeof(latvianRules), latvianForms, latvianLanguage, 0 }, { icelandicRules, sizeof(icelandicRules), icelandicForms, icelandicLanguage, 0 }, { irishStyleRules, sizeof(irishStyleRules), irishStyleForms, irishStyleLanguages, 0 }, - { czechRules, sizeof(czechRules), czechForms, czechLanguage, 0 }, - { slovakRules, sizeof(slovakRules), slovakForms, slovakLanguage, 0 }, + { slovakRules, sizeof(slovakRules), slovakForms, slovakLanguages, 0 }, { macedonianRules, sizeof(macedonianRules), macedonianForms, macedonianLanguage, 0 }, { lithuanianRules, sizeof(lithuanianRules), lithuanianForms, lithuanianLanguage, 0 }, { russianStyleRules, sizeof(russianStyleRules), russianStyleForms, russianStyleLanguages, 0 }, -- cgit v0.12 From 3e663dcad5e9fbfd2a5466d464747a1a87f036b3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 3 Jun 2009 11:06:14 +0200 Subject: rename some plural forms --- tools/linguist/shared/numerus.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/linguist/shared/numerus.cpp b/tools/linguist/shared/numerus.cpp index 408877f..2fe1c78 100644 --- a/tools/linguist/shared/numerus.cpp +++ b/tools/linguist/shared/numerus.cpp @@ -112,16 +112,15 @@ static const char * const frenchStyleForms[] = { "Singular", "Plural", 0 }; static const char * const icelandicForms[] = { "Singular", "Plural", 0 }; static const char * const latvianForms[] = { "Singular", "Plural", "Nullar", 0 }; static const char * const irishStyleForms[] = { "Singular", "Dual", "Plural", 0 }; -static const char * const slovakForms[] = { "Singular", "Dual", "Plural", 0 }; +static const char * const slovakForms[] = { "Singular", "Paucal", "Plural", 0 }; static const char * const macedonianForms[] = { "Singular", "Dual", "Plural", 0 }; static const char * const lithuanianForms[] = { "Singular", "Paucal", "Plural", 0 }; static const char * const russianStyleForms[] = { "Singular", "Dual", "Plural", 0 }; static const char * const polishForms[] = { "Singular", "Paucal", "Plural", 0 }; -static const char * const romanianForms[] = - { "Singular", "Plural Form for 2 to 19", "Plural", 0 }; +static const char * const romanianForms[] = { "Singular", "Paucal", "Plural", 0 }; static const char * const slovenianForms[] = { "Singular", "Dual", "Trial", "Plural", 0 }; static const char * const malteseForms[] = - { "Singular", "Plural Form for 2 to 10", "Plural Form for 11 to 19", "Plural", 0 }; + { "Singular", "Paucal", "Greater Paucal", "Plural", 0 }; static const char * const welshForms[] = { "Nullar", "Singular", "Dual", "Sexal", "Plural", 0 }; static const char * const arabicForms[] = -- cgit v0.12 From ae5b1555676cef4058157431c3af2e7ff9ead8ce Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Wed, 3 Jun 2009 12:58:08 +0200 Subject: Doc - minor fixes to beautify the sentence Reviewed-By: TrustMe --- doc/src/tutorials/addressbook.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc index 3ec883f..15fdd83 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -374,8 +374,8 @@ \snippet tutorials/addressbook/part2/addressbook.cpp submitContact part2 If the contact already exists, again, we display a QMessageBox to inform - the user about this, to prevent the user from adding duplicate contacts. - Our \c contacts object is based on key-value pairs of name and addresses, + the user about this, preventing the user from adding duplicate contacts. + Our \c contacts object is based on key-value pairs of name and address, hence, we want to ensure that \e key is unique. \o Once we have handled both cases mentioned above, we restore the push -- cgit v0.12 From 259b65c2f5d736dd7f6d81b6390f54464dd5f183 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 2 Jun 2009 18:16:37 +0200 Subject: BT: qt demo takes 100% of the cpu on X11 The tick timer is always active, even if the moving gree Qt logo is not visible. But the code that is supposed to pause it when the app loose the focus doesn't works if the moving Qt logo is not visible. Also the call to syncX makes Xorg takes lot of cpu. It doesn't fix the fact that the timer is still running while the green logo is not visible, but at least doesn't take the cpu anymore if qtdemo loose the focus. Task-number: 255020 Reviewed-by: Richard Moe Gustavsen --- demos/qtdemo/colors.cpp | 2 +- demos/qtdemo/mainwindow.cpp | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/demos/qtdemo/colors.cpp b/demos/qtdemo/colors.cpp index 41bbfb3..883b0fb 100644 --- a/demos/qtdemo/colors.cpp +++ b/demos/qtdemo/colors.cpp @@ -97,7 +97,7 @@ bool Colors::noTickerMorph = false; bool Colors::adapted = false; bool Colors::verbose = false; bool Colors::pause = true; -int Colors::fps = 100; +int Colors::fps = 60; int Colors::menuCount = 18; float Colors::animSpeed = 1.0; float Colors::animSpeedButtons = 1.0; diff --git a/demos/qtdemo/mainwindow.cpp b/demos/qtdemo/mainwindow.cpp index 8723823..16ca95f 100644 --- a/demos/qtdemo/mainwindow.cpp +++ b/demos/qtdemo/mainwindow.cpp @@ -190,7 +190,6 @@ void MainWindow::switchTimerOnOff(bool on) if (on && !Colors::noTimerUpdate){ this->useTimer = true; - this->setViewportUpdateMode(QGraphicsView::NoViewportUpdate); this->fpsTime = QTime::currentTime(); this->updateTimer.start(int(1000 / Colors::fps)); } @@ -262,10 +261,6 @@ void MainWindow::tick() if (MenuManager::instance()->ticker) MenuManager::instance()->ticker->tick(); - this->viewport()->update(); - if (Colors::softwareRendering) - QApplication::syncX(); - if (this->useTimer) this->updateTimer.start(int(1000 / Colors::fps)); } @@ -435,9 +430,7 @@ void MainWindow::focusInEvent(QFocusEvent *) if (MenuManager::instance()->ticker) MenuManager::instance()->ticker->pause(false); - int code = MenuManager::instance()->currentMenuCode; - if (code == MenuManager::ROOT || code == MenuManager::MENU1) - this->switchTimerOnOff(true); + this->switchTimerOnOff(true); this->pausedLabel->setRecursiveVisible(false); } @@ -450,9 +443,7 @@ void MainWindow::focusOutEvent(QFocusEvent *) if (MenuManager::instance()->ticker) MenuManager::instance()->ticker->pause(true); - int code = MenuManager::instance()->currentMenuCode; - if (code == MenuManager::ROOT || code == MenuManager::MENU1) - this->switchTimerOnOff(false); + this->switchTimerOnOff(false); this->pausedLabel->setRecursiveVisible(true); } -- cgit v0.12 From 34d003341c5286354e8277a4cc33182c94549ac0 Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Wed, 3 Jun 2009 13:21:21 +0200 Subject: Fix BOM for UTF-32 codec The BOM was created correctly, but half of the BOM was then overwritten by the converted data afterwards. Also made the autotest also do reverse encoding tests where possible. Task-number: 255095 Reviewed-by: lars --- src/corelib/codecs/qutfcodec.cpp | 2 +- tests/auto/qtextcodec/tst_qtextcodec.cpp | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp index 1ac592e..d9defe1 100644 --- a/src/corelib/codecs/qutfcodec.cpp +++ b/src/corelib/codecs/qutfcodec.cpp @@ -478,7 +478,7 @@ QByteArray QUtf32Codec::convertFromUnicode(const QChar *uc, int len, ConverterSt data[2] = 0; data[3] = 0; } - data += 2; + data += 4; } if (endian == BE) { for (int i = 0; i < len; ++i) { diff --git a/tests/auto/qtextcodec/tst_qtextcodec.cpp b/tests/auto/qtextcodec/tst_qtextcodec.cpp index cf4135b..566b20e 100644 --- a/tests/auto/qtextcodec/tst_qtextcodec.cpp +++ b/tests/auto/qtextcodec/tst_qtextcodec.cpp @@ -1537,7 +1537,7 @@ void tst_QTextCodec::utfHeaders_data() << QByteArray("\xef\xbb\xbfhello") << (QString(QChar(0xfeff)) + QString::fromLatin1("hello")) << true; - QTest::newRow("utf8 nobom") + QTest::newRow("utf8 nobom ignore header") << QByteArray("UTF-8") << (int)QTextCodec::IgnoreHeader << QByteArray("hello") @@ -1718,14 +1718,23 @@ void tst_QTextCodec::utfHeaders() QFETCH(bool, toUnicode); + QLatin1String ignoreReverseTestOn = (QSysInfo::ByteOrder == QSysInfo::BigEndian) ? QLatin1String(" le") : QLatin1String(" be"); + QString rowName(QTest::currentDataTag()); + for (int i = 0; i < encoded.length(); ++i) qDebug() << hex << " " << (uint)(uchar)encoded.at(i); if (toUnicode) { QString result = codec->toUnicode(encoded.constData(), encoded.length(), &state); - for (int i = 0; i < result.length(); ++i) - qDebug() << hex << " " << (uint)result.at(i).unicode(); + for (int i = 0; i < result.length(); ++i) + qDebug() << hex << " " << (uint)result.at(i).unicode(); QCOMPARE(result.length(), unicode.length()); QCOMPARE(result, unicode); + + if (!rowName.endsWith("nobom") && !rowName.contains(ignoreReverseTestOn)) { + QTextCodec::ConverterState state2(cFlags); + QByteArray reencoded = codec->fromUnicode(unicode.unicode(), unicode.length(), &state2); + QCOMPARE(reencoded, encoded); + } } else { QByteArray result = codec->fromUnicode(unicode.unicode(), unicode.length(), &state); QCOMPARE(result, encoded); -- cgit v0.12 From d16b52d5346a3b652ad7507b24373c51fc0d530c Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Wed, 3 Jun 2009 13:49:22 +0200 Subject: Doc - some sentence clean ups Reviewed-by: TrustMe --- doc/src/tutorials/addressbook.qdoc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc index 15fdd83..bf202b2 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -296,8 +296,8 @@ We also declare two private QString objects, \c oldName and \c oldAddress. These objects are needed to hold the name and address of the contact that - was last displayed, before the user clicked "Add". So, when the user clicks - "Cancel", we can revert to displaying the details of the last contact. + was last displayed, before the user clicked \gui Add. So, when the user clicks + \gui Cancel, we can revert to displaying the details of the last contact. \section1 Implementing the AddressBook Class @@ -318,7 +318,7 @@ The \c addButton is displayed by invoking the \l{QPushButton::show()} {show()} function, while the \c submitButton and \c cancelButton are hidden by invoking \l{QPushButton::hide()}{hide()}. These two push - buttons will only be displayed when the user clicks "Add" and this is + buttons will only be displayed when the user clicks \gui Add and this is handled by the \c addContact() function discussed below. \snippet tutorials/addressbook/part2/addressbook.cpp connecting signals and slots @@ -362,7 +362,7 @@ \list 1 \o We extract the contact's details from \c nameLine and \c addressText and store them in QString objects. We also validate to make sure that the - user did not click "Submit" with empty input fields; otherwise, a + user did not click \gui Submit with empty input fields; otherwise, a QMessageBox is displayed to remind the user for a name and address. \snippet tutorials/addressbook/part2/addressbook.cpp submitContact part1 @@ -396,9 +396,9 @@ \snippet tutorials/addressbook/part2/addressbook.cpp cancel - The general idea to add a contact is to give the user the flexibility to - click "Submit" or "Cancel" at any time. The flowchart below further - explains this concept: + The general idea behind adding a contact is to give the user the + flexibility to click \gui Submit or \gui Cancel at any time. The flowchart below + further explains this concept: \image addressbook-tutorial-part2-add-flowchart.png */ -- cgit v0.12 From 91f5c7314afdfd43c867266fc1bc418e0f70bac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 3 Jun 2009 14:16:39 +0200 Subject: Fixed raster bug causing fully clipped images to be partially blended. The blend functions assume the width / height of the images being blended to be greater than 0. A width of 0 caused the first iteration of a duff's device memcpy (QT_MEMCPY_USHORT) to be executed, thus blending 8 pixels instead of none. BT: yes Task-number: 255014 Reviewed-by: Trond --- src/gui/painting/qpaintengine_raster.cpp | 4 ++-- tests/auto/qpainter/tst_qpainter.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 58ffb02..1a1c204 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -1053,7 +1053,7 @@ void QRasterPaintEnginePrivate::drawImage(const QPointF &pt, int d = x + iw - cx2; iw -= d; } - if (iw < 0) + if (iw <= 0) return; // adapt the y paremeters... @@ -1070,7 +1070,7 @@ void QRasterPaintEnginePrivate::drawImage(const QPointF &pt, int d = y + ih - cy2; ih -= d; } - if (ih < 0) + if (ih <= 0) return; // call the blend function... diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index 87f9c13..8d6c9d2 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -215,6 +215,7 @@ private slots: void imageCoordinateLimit(); void imageBlending_data(); void imageBlending(); + void imageBlending_clipped(); void paintOnNullPixmap(); void checkCompositionMode(); @@ -3792,6 +3793,31 @@ void tst_QPainter::imageBlending() } } +void tst_QPainter::imageBlending_clipped() +{ + QImage src(20, 20, QImage::Format_RGB16); + QPainter p(&src); + p.fillRect(src.rect(), Qt::red); + p.end(); + + QImage dst(40, 20, QImage::Format_RGB16); + p.begin(&dst); + p.fillRect(dst.rect(), Qt::white); + p.end(); + + QImage expected = dst; + + p.begin(&dst); + p.setClipRect(QRect(23, 0, 20, 20)); + + // should be completely clipped + p.drawImage(QRectF(3, 0, 20, 20), src); + p.end(); + + // dst should be left unchanged + QCOMPARE(dst, expected); +} + void tst_QPainter::paintOnNullPixmap() { QPixmap pix(16, 16); -- cgit v0.12 From c9c8742b20c025ad893bdde48cf382267e0b646e Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Wed, 3 Jun 2009 15:03:03 +0200 Subject: Allow qmake to compile using it's .pro file. This fixes a problem where qmake would not compile when it was built from it's .pro file because this method uses the pre-compiled header. This header was causing a compile error in qlocale.cpp because qtextstream.h was included and this includes qlocale.h. The problem in qlocale.cpp was that it uses a define called QLOCALE_CPP to enable extra functions in the class declaration, but the pre-compiled header was preventing the qlocale.h from being re-processed and therefore the function was never compiled in. Reviewed-by: Marius Storm-Olsen --- qmake/qmake_pch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/qmake_pch.h b/qmake/qmake_pch.h index 1fec856..676c806 100644 --- a/qmake/qmake_pch.h +++ b/qmake/qmake_pch.h @@ -53,7 +53,7 @@ //#include "meta.h" #include //#include "winmakefile.h" -#include +//#include //#include "project.h" #include #include -- cgit v0.12 From 826b2ec2067e725561db2892dd432c01f1d36bc7 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Wed, 3 Jun 2009 15:25:46 +0200 Subject: BT: Fix a crash in the SDI example in Cocoa This was quite a bug and it showed to some issues that I hadn't taken into account when doing the initial port to Cocoa. The issue was that we weren't "merging" items into the application menu if an item had already been associated with it. Which seems OK for applications that create one window with one menubar, but breaks down horrible when you have multiple windows with each having their own menubar. The result is that items in the application menu potentially go to the wrong window (and the potential crash). Since there can only ever be one "Quit", "About", or "Preferences" menu item in Cocoa, we need to make sure that we keep these items in sync whenever we switch the menubar or remove actions that are being deleted. That's what we do here. FWIW, QActions with "ApplicationSpecificRole" for their menu role have potential to cause memory leaks or other bugs if abused. If you are a happy open source hacker who wants a thankless job, solving them would get you lots of goodwill in my book. Task-number: 255038 Reviewed-by: Richard Moe Gustavsen --- src/gui/widgets/qmenu_mac.mm | 52 +++++++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index ad848c9..2560cfa 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -871,8 +871,6 @@ static NSMenuItem *qt_mac_menu_merge_action(OSMenuRef merge, QMacMenuAction *act } } - if ([ret tag] != 0) - ret = 0; // already taken #endif return ret; } @@ -1131,15 +1129,15 @@ QMenuPrivate::QMacMenuPrivate::addAction(QMacMenuAction *action, QMacMenuAction GetMenuItemAttributes(action->menu, itemCount , &testattr); if (mergedItems.contains(action->command) && (testattr & kMenuItemAttrSeparator)) { - InsertMenuItemTextWithCFString(action->menu, 0, qMax(itemCount - 1, 0), attr, action->command); - index = itemCount; - } else { - MenuItemIndex tmpIndex; - AppendMenuItemTextWithCFString(action->menu, 0, attr, action->command, &tmpIndex); - index = tmpIndex; - if (mergedItems.contains(action->command)) - AppendMenuItemTextWithCFString(action->menu, 0, kMenuItemAttrSeparator, 0, &tmpIndex); - } + InsertMenuItemTextWithCFString(action->menu, 0, qMax(itemCount - 1, 0), attr, action->command); + index = itemCount; + } else { + MenuItemIndex tmpIndex; + AppendMenuItemTextWithCFString(action->menu, 0, attr, action->command, &tmpIndex); + index = tmpIndex; + if (mergedItems.contains(action->command)) + AppendMenuItemTextWithCFString(action->menu, 0, kMenuItemAttrSeparator, 0, &tmpIndex); + } #else [menu addItem:newItem]; #endif @@ -1477,11 +1475,18 @@ QMenuPrivate::QMacMenuPrivate::removeAction(QMacMenuAction *action) DeleteMenuItem(action->menu, qt_mac_menu_find_action(action->menu, action)); #else QMacCocoaAutoReleasePool pool; - QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader(); - if (action->menuItem == [loader quitMenuItem] || action->menuItem == [loader preferencesMenuItem]) - [action->menuItem setEnabled:false]; - else + if (action->merged) { + if (reinterpret_cast([action->menuItem tag]) == action->action) { + QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader(); + [action->menuItem setEnabled:false]; + if (action->menuItem != [loader quitMenuItem] + && action->menuItem != [loader preferencesMenuItem]) { + [[action->menuItem menu] removeItem:action->menuItem]; + } + } + } else { [[action->menuItem menu] removeItem:action->menuItem]; + } #endif actionItems.removeAll(action); } @@ -1934,6 +1939,23 @@ bool QMenuBar::macUpdateMenuBar() [loader ensureAppMenuInMenu:menu]; [NSApp setMainMenu:menu]; syncMenuBarItemsVisiblity(mb->d_func()->mac_menubar); + + if (OSMenuRef tmpMerge = QMenuPrivate::mergeMenuHash.value(menu)) { + if (QMenuMergeList *mergeList + = QMenuPrivate::mergeMenuItemsHash.value(tmpMerge)) { + const int mergeListSize = mergeList->size(); + + for (int i = 0; i < mergeListSize; ++i) { + const QMenuMergeItem &mergeItem = mergeList->at(i); + // Ideally we would call QMenuPrivate::syncAction, but that requires finding + // the original QMen and likely doing more work than we need. + // For example, enabled is handled below. + [mergeItem.menuItem setTag:reinterpret_cast( + static_cast(mergeItem.action->action))]; + [mergeItem.menuItem setHidden:!(mergeItem.action->action->isVisible())]; + } + } + } #endif QWidget *modalWidget = qApp->activeModalWidget(); if (mb != menubars()->value(modalWidget)) { -- cgit v0.12 From 11e77b1e47d527a2c4bca6c72d4597bfd8b8a1c3 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 3 Jun 2009 14:28:55 +0200 Subject: use a yes/no message box for a yes/no question in http example Using a OK/Cancel message box is weird for a yes/no question, esp. on a Windows CE device where such a message box doesn't have real push buttons but must be OK'ed / cancelled via system buttons in the title bar. Task-number: 255112 Reviewed-by: thartman --- examples/network/http/httpwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/network/http/httpwindow.cpp b/examples/network/http/httpwindow.cpp index ebde770..7aded07 100644 --- a/examples/network/http/httpwindow.cpp +++ b/examples/network/http/httpwindow.cpp @@ -116,8 +116,8 @@ void HttpWindow::downloadFile() if (QMessageBox::question(this, tr("HTTP"), tr("There already exists a file called %1 in " "the current directory. Overwrite?").arg(fileName), - QMessageBox::Ok|QMessageBox::Cancel, QMessageBox::Cancel) - == QMessageBox::Cancel) + QMessageBox::Yes|QMessageBox::No, QMessageBox::No) + == QMessageBox::No) return; QFile::remove(fileName); } -- cgit v0.12 From f1e471b561012f90938766c00aefff417593e71f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 3 Jun 2009 13:49:09 +0200 Subject: fix catalan plural rules --- src/corelib/kernel/qtranslator.cpp | 3 +++ src/corelib/kernel/qtranslator_p.h | 1 + tools/linguist/shared/numerus.cpp | 9 +++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index 3e4b467..df904a6 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -149,6 +149,9 @@ static int numerusHelper(int n, const uchar *rules, int rulesSize) leftOperand %= 10; } else if (opcode & Q_MOD_100) { leftOperand %= 100; + } else if (opcode & Q_LEAD_1000) { + while (leftOperand >= 1000) + leftOperand /= 1000; } int op = opcode & Q_OP_MASK; diff --git a/src/corelib/kernel/qtranslator_p.h b/src/corelib/kernel/qtranslator_p.h index 77ec8f5..a7d58c5 100644 --- a/src/corelib/kernel/qtranslator_p.h +++ b/src/corelib/kernel/qtranslator_p.h @@ -62,6 +62,7 @@ enum { Q_NOT = 0x08, Q_MOD_10 = 0x10, Q_MOD_100 = 0x20, + Q_LEAD_1000 = 0x40, Q_AND = 0xFD, Q_OR = 0xFE, diff --git a/tools/linguist/shared/numerus.cpp b/tools/linguist/shared/numerus.cpp index 2fe1c78..50e85cb 100644 --- a/tools/linguist/shared/numerus.cpp +++ b/tools/linguist/shared/numerus.cpp @@ -105,6 +105,9 @@ static const uchar arabicRules[] = static const uchar tagalogRules[] = { Q_LEQ, 1, Q_NEWRULE, Q_MOD_10 | Q_EQ, 4, Q_OR, Q_MOD_10 | Q_EQ, 6, Q_OR, Q_MOD_10 | Q_EQ, 9 }; +static const uchar catalanRules[] = + { Q_EQ, 1, Q_NEWRULE, + Q_LEAD_1000 | Q_EQ, 11 }; static const char * const japaneseStyleForms[] = { "Universal Form", 0 }; static const char * const englishStyleForms[] = { "Singular", "Plural", 0 }; @@ -127,6 +130,7 @@ static const char * const arabicForms[] = { "Nullar", "Singular", "Dual", "Minority Plural", "Plural", "Plural Form for 100, 200, ...", 0 }; static const char * const tagalogForms[] = { "Singular", "Plural (consonant-ended)", "Plural (vowel-ended)", 0 }; +static const char * const catalanForms[] = { "Singular", "Undecal (11)", "Plural", 0 }; #define EOL QLocale::C @@ -173,7 +177,6 @@ static const QLocale::Language englishStyleLanguages[] = { // Missing: Bokmal, QLocale::Bulgarian, QLocale::Cambodian, - QLocale::Catalan, QLocale::Cornish, QLocale::Corsican, QLocale::Danish, @@ -300,6 +303,7 @@ static const QLocale::Language malteseLanguage[] = { QLocale::Maltese, EOL }; static const QLocale::Language welshLanguage[] = { QLocale::Welsh, EOL }; static const QLocale::Language arabicLanguage[] = { QLocale::Arabic, EOL }; static const QLocale::Language tagalogLanguage[] = { QLocale::Tagalog, EOL }; +static const QLocale::Language catalanLanguage[] = { QLocale::Catalan, EOL }; static const QLocale::Country frenchStyleCountries[] = { // keep synchronized with frenchStyleLanguages @@ -334,7 +338,8 @@ static const NumerusTableEntry numerusTable[] = { { malteseRules, sizeof(malteseRules), malteseForms, malteseLanguage, 0 }, { welshRules, sizeof(welshRules), welshForms, welshLanguage, 0 }, { arabicRules, sizeof(arabicRules), arabicForms, arabicLanguage, 0 }, - { tagalogRules, sizeof(tagalogRules), tagalogForms, tagalogLanguage, 0 } + { tagalogRules, sizeof(tagalogRules), tagalogForms, tagalogLanguage, 0 }, + { catalanRules, sizeof(catalanRules), catalanForms, catalanLanguage, 0 } }; static const int NumerusTableSize = sizeof(numerusTable) / sizeof(numerusTable[0]); -- cgit v0.12 From ff8dd08c1ec66905a271c528b18c1e6738d2da77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 3 Jun 2009 20:42:42 +0200 Subject: My changes for 4.5.2 --- dist/changes-4.5.2 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 5149eba..378d565 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -127,6 +127,22 @@ Third party components * [252311] "font-family:" now handle fallback font specified with a comas separated list. +- QFile and QTemporaryFile + * [165920] QFile::copy leaves the source file open after the file has been copied + * [191467] & [252293] QFile::copy of resource files to the filesystem fails on Windows + * [197857] QFile::copy of resource files leaves temporary files on filesystem + * [248223] QTemporaryFile: Access denied error when (re-)opening through QFile interface + * [252659] QTemporaryFile::rename may leave source file behind + +- QByteArrayMatcher + * [251958] Assignment operator and copy constructor miss data + +- QCompleter + * [253125] QCompleter doesn't expand entries with UnfilteredPopupCompletion + +- QPrintDialog + * [253135] Crash in QPrintDialog when editing output filename + **************************************************************************** * Database Drivers * **************************************************************************** @@ -180,6 +196,7 @@ Qt for Windows CE **************************************************************************** - Build System + * [253053] Linker in macx-g++42 spec is gcc instead of gcc-4.2 - Assistant -- cgit v0.12 From 8021218dd5ab2d7ad9314b1c2a54168de4694065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 3 Jun 2009 21:32:55 +0200 Subject: More changes for 4.5.2 --- dist/changes-4.5.2 | 1 + 1 file changed, 1 insertion(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 378d565..6772405 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -128,6 +128,7 @@ Third party components separated list. - QFile and QTemporaryFile + * Fixed a leak of file descriptors in QTemporaryFile::rename, introduced in 4.5.1 * [165920] QFile::copy leaves the source file open after the file has been copied * [191467] & [252293] QFile::copy of resource files to the filesystem fails on Windows * [197857] QFile::copy of resource files leaves temporary files on filesystem -- cgit v0.12 From 289c098c15a359c4e5d142a997230db5df554f8d Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 4 Jun 2009 08:44:35 +0200 Subject: Silence compile warning in the test Reviewed-by: TrustMe --- tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp b/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp index 2383767..2f6180f 100644 --- a/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp +++ b/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp @@ -76,7 +76,7 @@ private slots: void oldCacheVersionFile_data(); void oldCacheVersionFile(); - + void sync(); }; @@ -486,7 +486,7 @@ public: void run() { QByteArray longString = "Hello World, this is some long string, well not really that long"; - for (int i = 0; i < 10; ++i) + for (int j = 0; j < 10; ++j) longString += longString; QByteArray longString2 = "Help, I am stuck in an autotest!"; QUrl url(EXAMPLE_URL); -- cgit v0.12 From cbe3119db5380c41d44d4e936c7da4889c02f147 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 4 Jun 2009 09:30:17 +0200 Subject: BT: Fixes Crash when deleting a QProgressBar which has been styled with QMotifStyle Same fix as in e9a7e43031d7c1ee712e43be682c4e2c183759c4 but with motif Reported by https://bugs.kde.org/show_bug.cgi?id=193911 Task-number: 255138 Reviewed-by: jbache --- dist/changes-4.5.2 | 3 +++ src/gui/styles/qmotifstyle.cpp | 5 ++++- tests/auto/qprogressbar/tst_qprogressbar.cpp | 20 ++++++++++++++++++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 6772405..a54d8ba 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -67,6 +67,9 @@ Third party components * [253339] Don't draw arrows on toolbuttons that have a menu and text only. * [252301] Ensure that small and mini spin boxes are drawn correctly. +- QMotifStyle + * Fix crash when changing style and destroying progressbar. + - QFontDialog * [252000] Ensure that QFontDialog::getFont() works on Mac OS X. diff --git a/src/gui/styles/qmotifstyle.cpp b/src/gui/styles/qmotifstyle.cpp index 7d4fab8..d19750f 100644 --- a/src/gui/styles/qmotifstyle.cpp +++ b/src/gui/styles/qmotifstyle.cpp @@ -298,8 +298,11 @@ void QMotifStyle::unpolish(QWidget* widget) { QCommonStyle::unpolish(widget); #ifndef QT_NO_PROGRESSBAR - if (qobject_cast(widget)) + if (qobject_cast(widget)) { + Q_D(QMotifStyle); widget->removeEventFilter(this); + d->bars.removeAll(static_cast(widget)); + } #endif } diff --git a/tests/auto/qprogressbar/tst_qprogressbar.cpp b/tests/auto/qprogressbar/tst_qprogressbar.cpp index d6379d3..cb037e0 100644 --- a/tests/auto/qprogressbar/tst_qprogressbar.cpp +++ b/tests/auto/qprogressbar/tst_qprogressbar.cpp @@ -63,6 +63,7 @@ private slots: void setValueRepaint(); void sizeHint(); + void task245201_testChangeStyleAndDelete_data(); void task245201_testChangeStyleAndDelete(); }; @@ -224,15 +225,30 @@ void tst_QProgressBar::sizeHint() QCOMPARE(barSize.height(), size.height()); } +void tst_QProgressBar::task245201_testChangeStyleAndDelete_data() +{ + QTest::addColumn("style1_str"); + QTest::addColumn("style2_str"); + + QTest::newRow("plastique-windows") << QString::fromLatin1("plastique") << QString::fromLatin1("windows"); + QTest::newRow("mlotif-windows") << QString::fromLatin1("motif") << QString::fromLatin1("windows"); + QTest::newRow("cleanlooks-cde") << QString::fromLatin1("cleanlooks") << QString::fromLatin1("cde"); + QTest::newRow("gtk-plastique") << QString::fromLatin1("gtk") << QString::fromLatin1("plastique"); +} + void tst_QProgressBar::task245201_testChangeStyleAndDelete() { + QFETCH(QString, style1_str); + QFETCH(QString, style2_str); + QProgressBar *bar = new QProgressBar; - QStyle *style = QStyleFactory::create("plastique"); + QStyle *style = QStyleFactory::create(style1_str); bar->setStyle(style); bar->show(); - QStyle *style2 = QStyleFactory::create("windows"); + QStyle *style2 = QStyleFactory::create(style2_str); bar->setStyle(style2); + QTest::qWait(10); delete bar; QTest::qWait(100); //should not crash -- cgit v0.12 From c755c1d3c6fe60a9018308e1ce13bae6821bc214 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Thu, 4 Jun 2009 10:10:19 +0200 Subject: Document that textVisible is optional when it comes to styles. No progress bars on the mac show text and it would be bad if we allowed it. There's nothing stopping people from connecting the valueChanged() signal to a slot and have a real label layed out correctly that actually updates with the amount of time it takes to complete, etc. This is more what they do on Mac OS X if they decide to show a label. --- src/gui/widgets/qprogressbar.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/widgets/qprogressbar.cpp b/src/gui/widgets/qprogressbar.cpp index cdb3836..1a7f878 100644 --- a/src/gui/widgets/qprogressbar.cpp +++ b/src/gui/widgets/qprogressbar.cpp @@ -349,6 +349,8 @@ void QProgressBar::setRange(int minimum, int maximum) \property QProgressBar::textVisible \brief whether the current completed percentage should be displayed + This property may be ignored by the style (e.g., QMacStyle never draws the text). + \sa textDirection */ void QProgressBar::setTextVisible(bool visible) -- cgit v0.12 From df5c557e7777c8844ac866d730346178ad33a0a6 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Thu, 4 Jun 2009 10:39:20 +0200 Subject: Document the proper signals that the ::open() convenience connects to. We were saying that it connected to accepted it all these cases, but it actually is doing some nice magic that makes sense assuming you document it. --- src/gui/dialogs/qcolordialog.cpp | 2 +- src/gui/dialogs/qfiledialog.cpp | 5 +++-- src/gui/dialogs/qfontdialog.cpp | 2 +- src/gui/dialogs/qinputdialog.cpp | 12 ++++++++++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/gui/dialogs/qcolordialog.cpp b/src/gui/dialogs/qcolordialog.cpp index 3aa04f6..4702d14 100644 --- a/src/gui/dialogs/qcolordialog.cpp +++ b/src/gui/dialogs/qcolordialog.cpp @@ -1749,7 +1749,7 @@ void QColorDialog::setVisible(bool visible) \overload \since 4.5 - Opens the dialog and connects its accepted() signal to the slot specified + Opens the dialog and connects its colorSelected() signal to the slot specified by \a receiver and \a member. The signal will be disconnected from the slot when the dialog is closed. diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 405e71e..77382a7 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -638,8 +638,9 @@ QFileDialog::Options QFileDialog::options() const \since 4.5 - Opens the dialog and connects its accepted() signal to the slot specified - by \a receiver and \a member. + This function connects one of its signals to the slot specified by \a receiver + and \a member. The specific signal depends is filesSelected() if fileMode is + ExistingFiles and fileSelected() if fileMode is anything else. The signal will be disconnected from the slot when the dialog is closed. */ diff --git a/src/gui/dialogs/qfontdialog.cpp b/src/gui/dialogs/qfontdialog.cpp index aa1c553..9ea06ac 100644 --- a/src/gui/dialogs/qfontdialog.cpp +++ b/src/gui/dialogs/qfontdialog.cpp @@ -940,7 +940,7 @@ bool QFontDialogPrivate::sharedFontPanelAvailable = true; \since 4.5 \overload - Opens the dialog and connects its accepted() signal to the slot specified + Opens the dialog and connects its fontSelected() signal to the slot specified by \a receiver and \a member. The signal will be disconnected from the slot when the dialog is closed. diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp index 78d99e3..8754324 100644 --- a/src/gui/dialogs/qinputdialog.cpp +++ b/src/gui/dialogs/qinputdialog.cpp @@ -1020,8 +1020,16 @@ QString QInputDialog::cancelButtonText() const \since 4.5 \overload - Opens the dialog and connects its accepted() signal to the slot specified - by \a receiver and \a member. + This function connects one of its signals to the slot specified by \a receiver + and \a member. The specific signal depends on the arguments that are specified + in \a member. These are: + + \list + \o textValueSelected() if \a member has a QString for its first argument. + \o intValueSelected() if \a member has an int for its first argument. + \o doubleValueSelected() if \a member has a double for its first argument. + \o accepted() if \a member has NO arguments. + \endlist The signal will be disconnected from the slot when the dialog is closed. */ -- cgit v0.12 From c4773c1b2372ac9119244c5af6d0f0dae3e8f685 Mon Sep 17 00:00:00 2001 From: Thomas Sondergaard Date: Thu, 4 Jun 2009 13:06:31 +0200 Subject: Don't use inactivatable timers to calculate time to wait for next timer. This patch prevents the eventloop from waking up needlessly. Without this patch the event loop will not sleep at all if a 0-timer is already 'inTimerEvent' Merge-request: 550 Reviewed-by: Olivier Goffart --- src/corelib/kernel/qeventdispatcher_unix.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp index 6aa3b56..f7293d4 100644 --- a/src/corelib/kernel/qeventdispatcher_unix.cpp +++ b/src/corelib/kernel/qeventdispatcher_unix.cpp @@ -420,10 +420,18 @@ bool QTimerInfoList::timerWait(timeval &tm) timeval currentTime = updateCurrentTime(); repairTimersIfNeeded(); - if (isEmpty()) - return false; + // Find first waiting timer not already active + QTimerInfo *t = 0; + for (QTimerInfoList::const_iterator it = constBegin(); it != constEnd(); ++it) { + if (!(*it)->inTimerEvent) { + t = *it; + break; + } + } + + if (!t) + return false; - QTimerInfo *t = first(); // first waiting timer if (currentTime < t->timeout) { // time to wait tm = t->timeout - currentTime; -- cgit v0.12 From 5ad68ce1cb5e80fa14e549f087e957030ef4baf0 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 4 Jun 2009 14:30:20 +0200 Subject: Add my changelog for 4.5.2 --- dist/changes-4.5.2 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index a54d8ba..4246a6b 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -46,6 +46,10 @@ Third party components Plugins (r41346, r43550, r43915, r43917, r43923) Clipboard (r41360) +- QtDBus + * [236955] Fixed an issue that would cause QtDBus to crash when + relaying a signal emitted from a class under certain conditions + - QAbstractItemView * [250754] Changing the font of the view would not update the size of the items if there is an application stylesheet. @@ -80,6 +84,10 @@ Third party components * [251467] do not allow cookies for domains like ".com" * [228974] allow cookies whose domain attribute is missing a leading dot +- QNetworkAccessManager + * [248838] Make QNetworkAccessManager reject invalid HTTP input + earlier + - QWidget * [250668] Don't send extra wheel events when using the scroll wheel in Cocoa. * [253448] Prevent a crash when using the Qt::WA_MacBrushedMetal attribute @@ -166,6 +174,7 @@ legacy freetype headers. [250326] Titlebar wasn't shown on X11 with Qt::CustomizeWindowHint for fixed-size windows. [251925] Improved showing QMessageBox on small screens. +[252042] Fixed the loading of the OpenSSL libraries on OpenBSD. Qt for Windows -------------- -- cgit v0.12 From f0f7da04358c82bb80c6670ca336ebd2154163a6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 4 Jun 2009 14:30:51 +0200 Subject: Remove a Q_ASSERT that could be triggered under some conditions. Whenever an argument failed to marshall, this assert would be triggered. It's technically an error in the application, but it's hard to track it down. So remove it and let the execution continue (the function returns false indicating failure already and there's a warning from the marshalling code itself) Reviewed-by: TrustMe --- src/dbus/qdbusmessage.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/dbus/qdbusmessage.cpp b/src/dbus/qdbusmessage.cpp index 19f0b04..96dcd3b 100644 --- a/src/dbus/qdbusmessage.cpp +++ b/src/dbus/qdbusmessage.cpp @@ -161,7 +161,6 @@ DBusMessage *QDBusMessagePrivate::toDBusMessage(const QDBusMessage &message) // not ok; q_dbus_message_unref(msg); - Q_ASSERT(false); return 0; } -- cgit v0.12 From 80b63705a64a2029800805e1fefe350543b15a70 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 4 Jun 2009 14:35:10 +0200 Subject: Autotest: add some tests for sending (or failing to) invalid D-Bus calls Reviewed-by: TrustMe --- tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp index ad1a1b8..58bfabc 100644 --- a/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp +++ b/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp @@ -84,6 +84,8 @@ private slots: void sendArgument_data(); void sendArgument(); + void sendErrors(); + private: QProcess proc; }; @@ -782,5 +784,28 @@ void tst_QDBusMarshall::sendArgument() QCOMPARE(extracted, value); } +void tst_QDBusMarshall::sendErrors() +{ + QDBusConnection con = QDBusConnection::sessionBus(); + + QVERIFY(con.isConnected()); + QDBusMessage msg = QDBusMessage::createSignal("/foo", "local.interfaceName", + "signalName"); + msg << qVariantFromValue(QDBusObjectPath()); + + QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal path \"/foo\" interface \"local.interfaceName\" member \"signalName\""); + QVERIFY(!con.send(msg)); + + msg.setArguments(QVariantList()); + QDBusObjectPath path; + + QTest::ignoreMessage(QtWarningMsg, "QDBusObjectPath: invalid path \"abc\""); + path.setPath("abc"); + msg << qVariantFromValue(path); + + QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal path \"/foo\" interface \"local.interfaceName\" member \"signalName\""); + QVERIFY(!con.send(msg)); +} + QTEST_MAIN(tst_QDBusMarshall) #include "tst_qdbusmarshall.moc" -- cgit v0.12 From 398c022e8adefc6e71a6048da40c19f6169be831 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 4 Jun 2009 15:22:13 +0200 Subject: my public task ... --- dist/changes-4.5.2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 4246a6b..04a29ba 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -77,6 +77,9 @@ Third party components - QFontDialog * [252000] Ensure that QFontDialog::getFont() works on Mac OS X. +- QLocalSocket + * [247144] correctly handle remote disconnects + - QNetworkCookie * [251959] fix parsing of multiple cookies separated by a newline -- cgit v0.12 From b70c535fb096652def0c4f6df6f9cd2827fa9c97 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Thu, 4 Jun 2009 17:19:46 +0200 Subject: regeneration of qfeatures.h --- src/corelib/global/qfeatures.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index f11c9df..9f7c7ba 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -311,6 +311,11 @@ #define QT_NO_ACCESSIBILITY #endif +// Animation +#if !defined(QT_NO_ANIMATION) && (defined(QT_NO_PROPERTIES)) +#define QT_NO_ANIMATION +#endif + // QButtonGroup #if !defined(QT_NO_BUTTONGROUP) && (defined(QT_NO_GROUPBOX)) #define QT_NO_BUTTONGROUP -- cgit v0.12 From 58c5df4109acf44982c3a2a7b2318da52606232d Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 5 Jun 2009 09:55:21 +1000 Subject: Fix compilation with gcc-4.3.3 (due to std::system) Merge-request: 594 Reviewed-by: Rohan McGovern --- src/opengl/util/generator.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/opengl/util/generator.cpp b/src/opengl/util/generator.cpp index dac5a2d..430ced1 100644 --- a/src/opengl/util/generator.cpp +++ b/src/opengl/util/generator.cpp @@ -48,6 +48,7 @@ #include #include +#include QT_BEGIN_NAMESPACE -- cgit v0.12 From ef0d1c839aed75201da10f8db7e515d9fb55bb16 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 5 Jun 2009 09:55:22 +1000 Subject: All of Qt's own code compiles with -pedantic now (but pcre and webkit don't seem fixable easily) Merge-request: 594 Reviewed-by: Rohan McGovern --- src/3rdparty/webkit/JavaScriptCore/wtf/unicode/Unicode.h | 2 +- src/dbus/qdbus_symbols_p.h | 2 +- src/dbus/qdbusthreaddebug_p.h | 2 +- src/gui/accessible/qaccessible.cpp | 2 +- src/gui/image/qpixmapdatafactory.cpp | 2 +- src/gui/kernel/qaction.cpp | 2 +- src/gui/kernel/qapplication.cpp | 2 +- src/gui/painting/qdrawhelper.cpp | 8 ++++---- src/gui/painting/qpainter_p.h | 4 ++-- src/gui/painting/qpdf_p.h | 2 +- src/gui/painting/qvectorpath_p.h | 2 +- src/gui/text/qfontdatabase_x11.cpp | 2 +- src/gui/widgets/qplaintextedit.cpp | 4 ++-- src/gui/widgets/qvalidator.cpp | 2 +- src/network/kernel/qnetworkproxy.cpp | 2 +- src/opengl/gl2paintengineex/qglengineshadermanager_p.h | 4 ++-- src/opengl/qgl.cpp | 8 ++++---- src/opengl/qgl_x11.cpp | 2 +- src/opengl/qglshaderprogram.h | 4 ++-- src/opengl/util/fragmentprograms_p.h | 8 ++++---- src/qt3support/widgets/q3action.cpp | 2 +- src/script/qscriptsyntaxchecker_p.h | 2 +- src/script/qscriptvalueimplfwd_p.h | 2 +- src/testlib/qtestcase.cpp | 6 +++--- src/testlib/qtestresult.cpp | 2 +- 25 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/unicode/Unicode.h b/src/3rdparty/webkit/JavaScriptCore/wtf/unicode/Unicode.h index e6e8f23..5b849e4 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/unicode/Unicode.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/unicode/Unicode.h @@ -32,6 +32,6 @@ #error "Unknown Unicode implementation" #endif -COMPILE_ASSERT(sizeof(UChar) == 2, UCharIsTwoBytes); +COMPILE_ASSERT(sizeof(UChar) == 2, UCharIsTwoBytes) #endif // WTF_UNICODE_H diff --git a/src/dbus/qdbus_symbols_p.h b/src/dbus/qdbus_symbols_p.h index 764d368..db5e1bb 100644 --- a/src/dbus/qdbus_symbols_p.h +++ b/src/dbus/qdbus_symbols_p.h @@ -353,7 +353,7 @@ DEFINEFUNC(dbus_bool_t , dbus_signature_validate_single, (const char * DBusError *error), (signature, error), return) DEFINEFUNC(dbus_bool_t , dbus_type_is_basic, (int typecode), - (typecode), return); + (typecode), return) DEFINEFUNC(dbus_bool_t , dbus_type_is_fixed, (int typecode), (typecode), return) diff --git a/src/dbus/qdbusthreaddebug_p.h b/src/dbus/qdbusthreaddebug_p.h index 20d819f..f2ac598 100644 --- a/src/dbus/qdbusthreaddebug_p.h +++ b/src/dbus/qdbusthreaddebug_p.h @@ -100,7 +100,7 @@ enum ThreadAction { RemoveWatchAction = 61, ToggleWatchAction = 62, SocketReadAction = 63, - SocketWriteAction = 64, + SocketWriteAction = 64 }; struct QDBusLockerBase diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp index b0878ab..bd8a9ec 100644 --- a/src/gui/accessible/qaccessible.cpp +++ b/src/gui/accessible/qaccessible.cpp @@ -394,7 +394,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QAccessibleFactoryInterface_iid, QLatin1String("/accessible"))) #endif -Q_GLOBAL_STATIC(QList, qAccessibleFactories); +Q_GLOBAL_STATIC(QList, qAccessibleFactories) QAccessible::UpdateHandler QAccessible::updateHandler = 0; QAccessible::RootObjectHandler QAccessible::rootObjectHandler = 0; diff --git a/src/gui/image/qpixmapdatafactory.cpp b/src/gui/image/qpixmapdatafactory.cpp index 699489d..bba7378 100644 --- a/src/gui/image/qpixmapdatafactory.cpp +++ b/src/gui/image/qpixmapdatafactory.cpp @@ -84,7 +84,7 @@ QPixmapData* QSimplePixmapDataFactory::create(QPixmapData::PixelType type) #endif } -Q_GLOBAL_STATIC(QSimplePixmapDataFactory, factory); +Q_GLOBAL_STATIC(QSimplePixmapDataFactory, factory) #endif // !defined(Q_WS_QWS) diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp index b2afbd0..051b6a6 100644 --- a/src/gui/kernel/qaction.cpp +++ b/src/gui/kernel/qaction.cpp @@ -76,7 +76,7 @@ static QString qt_strippedText(QString s) s.remove(i-1,1); } return s.trimmed(); -}; +} QActionPrivate::QActionPrivate() : group(0), enabled(1), forceDisabled(0), diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index f2a3498..4923d23 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -405,7 +405,7 @@ QPalette *QApplicationPrivate::set_pal = 0; // default palette set by pro QGraphicsSystem *QApplicationPrivate::graphics_system = 0; // default graphics system QString QApplicationPrivate::graphics_system_name; // graphics system id - for delayed initialization -Q_GLOBAL_STATIC(QMutex, applicationFontMutex); +Q_GLOBAL_STATIC(QMutex, applicationFontMutex) QFont *QApplicationPrivate::app_font = 0; // default application font QFont *QApplicationPrivate::sys_font = 0; // default system font QFont *QApplicationPrivate::set_font = 0; // default font set by programmer diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index bbe1a76..0d1da54 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -7225,13 +7225,13 @@ inline void qt_rectfill_template(QRasterBuffer *rasterBuffer, QT_RECTFILL(quint32) QT_RECTFILL(quint16) QT_RECTFILL(qargb8565) -QT_RECTFILL(qrgb666); -QT_RECTFILL(qargb6666); +QT_RECTFILL(qrgb666) +QT_RECTFILL(qargb6666) QT_RECTFILL(qrgb555) QT_RECTFILL(qargb8555) QT_RECTFILL(qrgb888) -QT_RECTFILL(qrgb444); -QT_RECTFILL(qargb4444); +QT_RECTFILL(qrgb444) +QT_RECTFILL(qargb4444) #undef QT_RECTFILL diff --git a/src/gui/painting/qpainter_p.h b/src/gui/painting/qpainter_p.h index 258b25a..6c8821a 100644 --- a/src/gui/painting/qpainter_p.h +++ b/src/gui/painting/qpainter_p.h @@ -92,8 +92,8 @@ inline Qt::PenJoinStyle qpen_joinStyle(const QPen &p) { return data_ptr(p)->join // QBrush inline functions... inline QBrush::DataPtr &data_ptr(const QBrush &p) { return const_cast(p).data_ptr(); } inline bool qbrush_fast_equals(const QBrush &a, const QBrush &b) { return data_ptr(a) == data_ptr(b); } -inline Qt::BrushStyle qbrush_style(const QBrush &b) { return data_ptr(b)->style; }; -inline const QColor &qbrush_color(const QBrush &b) { return data_ptr(b)->color; }; +inline Qt::BrushStyle qbrush_style(const QBrush &b) { return data_ptr(b)->style; } +inline const QColor &qbrush_color(const QBrush &b) { return data_ptr(b)->color; } inline bool qbrush_has_transform(const QBrush &b) { return data_ptr(b)->transform.type() > QTransform::TxNone; } class QPainterClipInfo diff --git a/src/gui/painting/qpdf_p.h b/src/gui/painting/qpdf_p.h index 1d45ca1..7d92c0c 100644 --- a/src/gui/painting/qpdf_p.h +++ b/src/gui/painting/qpdf_p.h @@ -158,7 +158,7 @@ namespace QPdf { QByteArray stripSpecialCharacters(const QByteArray &string); -}; +} class QPdfPage : public QPdf::ByteStream diff --git a/src/gui/painting/qvectorpath_p.h b/src/gui/painting/qvectorpath_p.h index 2713cda..2602a3d 100644 --- a/src/gui/painting/qvectorpath_p.h +++ b/src/gui/painting/qvectorpath_p.h @@ -94,7 +94,7 @@ public: // Shape rendering specifiers... OddEvenFill = 0x1000, WindingFill = 0x2000, - ImplicitClose = 0x4000, + ImplicitClose = 0x4000 }; // ### Falcon: introduca a struct XY for points so lars is not so confused... diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp index 605a7dd..8f67cec 100644 --- a/src/gui/text/qfontdatabase_x11.cpp +++ b/src/gui/text/qfontdatabase_x11.cpp @@ -392,7 +392,7 @@ int qt_mib_for_xlfd_encoding(const char *encoding) int id = qt_xlfd_encoding_id(encoding); if (id != -1) return xlfd_encoding[id].mib; return 0; -}; +} int qt_encoding_id_for_mib(int mib) { diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp index f317742..af11aa7 100644 --- a/src/gui/widgets/qplaintextedit.cpp +++ b/src/gui/widgets/qplaintextedit.cpp @@ -444,7 +444,7 @@ QPlainTextEditControl::QPlainTextEditControl(QPlainTextEdit *parent) void QPlainTextEditPrivate::_q_cursorPositionChanged() { pageUpDownLastCursorYIsValid = false; -}; +} void QPlainTextEditPrivate::_q_verticalScrollbarActionTriggered(int action) { if (action == QAbstractSlider::SliderPageStepAdd) { @@ -1756,7 +1756,7 @@ void QPlainTextEdit::paintEvent(QPaintEvent *e) QTextBlock block = firstVisibleBlock(); qreal maximumWidth = document()->documentLayout()->documentSize().width(); - + // keep right margin clean from full-width selection int maxX = offset.x() + qMax((qreal)viewportRect.width(), maximumWidth) - document()->documentMargin(); diff --git a/src/gui/widgets/qvalidator.cpp b/src/gui/widgets/qvalidator.cpp index 3aca13d..0a7c43c 100644 --- a/src/gui/widgets/qvalidator.cpp +++ b/src/gui/widgets/qvalidator.cpp @@ -370,7 +370,7 @@ static int numDigits(qlonglong n) if (n == 0) return 1; return (int)log10(double(n)) + 1; -}; +} static qlonglong pow10(int exp) { diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp index fd3a85a..a5fd60e 100644 --- a/src/network/kernel/qnetworkproxy.cpp +++ b/src/network/kernel/qnetworkproxy.cpp @@ -324,7 +324,7 @@ QList QGlobalNetworkProxy::proxyForQuery(const QNetworkProxyQuery return result; } -Q_GLOBAL_STATIC(QGlobalNetworkProxy, globalNetworkProxy); +Q_GLOBAL_STATIC(QGlobalNetworkProxy, globalNetworkProxy) namespace { template struct StaticAssertTest; diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h index 9bc81ef..afbc918 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h @@ -257,7 +257,7 @@ static const GLuint QT_TEXTURE_COORDS_ATTR = 1; class QGLEngineShaderManager : public QObject { - Q_OBJECT; + Q_OBJECT public: QGLEngineShaderManager(QGLContext* context); ~QGLEngineShaderManager(); @@ -352,7 +352,7 @@ public: */ #if defined (QT_DEBUG) - Q_ENUMS(ShaderName); + Q_ENUMS(ShaderName) #endif diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 60039eb..2e72851 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1456,7 +1456,7 @@ struct DDSFormat { #define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 #endif -Q_GLOBAL_STATIC(QGLShareRegister, _qgl_share_reg); +Q_GLOBAL_STATIC(QGLShareRegister, _qgl_share_reg) Q_OPENGL_EXPORT QGLShareRegister* qgl_share_reg() { return _qgl_share_reg(); @@ -2609,7 +2609,7 @@ const QGLContext* QGLContext::currentContext() */ /*! \fn int QGLContext::choosePixelFormat(void* dummyPfd, HDC pdc) - + \bold{Win32 only:} This virtual function chooses a pixel format that matches the OpenGL \link setFormat() format\endlink. Reimplement this function in a subclass if you need a custom @@ -2623,7 +2623,7 @@ const QGLContext* QGLContext::currentContext() */ /*! \fn void *QGLContext::chooseVisual() - + \bold{X11 only:} This virtual function tries to find a visual that matches the format, reducing the demands if the original request cannot be met. @@ -4354,7 +4354,7 @@ void QGLWidgetPrivate::initContext(QGLContext *context, const QGLWidget* shareWi } #if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS) -Q_GLOBAL_STATIC(QString, qt_gl_lib_name); +Q_GLOBAL_STATIC(QString, qt_gl_lib_name) Q_OPENGL_EXPORT void qt_set_gl_library_name(const QString& name) { diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp index 28a50bd..da61634 100644 --- a/src/opengl/qgl_x11.cpp +++ b/src/opengl/qgl_x11.cpp @@ -129,7 +129,7 @@ struct QGLCMapCleanupHandler { CMapEntryHash *cmap_hash; GLCMapHash *qglcmap_hash; }; -Q_GLOBAL_STATIC(QGLCMapCleanupHandler, cmap_handler); +Q_GLOBAL_STATIC(QGLCMapCleanupHandler, cmap_handler) static void cleanup_cmaps() { diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h index ab30c32..06bff42 100644 --- a/src/opengl/qglshaderprogram.h +++ b/src/opengl/qglshaderprogram.h @@ -103,7 +103,7 @@ private: friend class QGLShaderProgram; - Q_DISABLE_COPY(QGLShader); + Q_DISABLE_COPY(QGLShader) }; class QGLShaderProgramPrivate; @@ -279,7 +279,7 @@ public: private: QGLShaderProgramPrivate *d; - Q_DISABLE_COPY(QGLShaderProgram); + Q_DISABLE_COPY(QGLShaderProgram) bool init(); }; diff --git a/src/opengl/util/fragmentprograms_p.h b/src/opengl/util/fragmentprograms_p.h index ecf0bf8..d4b54d4 100644 --- a/src/opengl/util/fragmentprograms_p.h +++ b/src/opengl/util/fragmentprograms_p.h @@ -71,7 +71,7 @@ enum FragmentVariable { VAR_FMP2_M_RADIUS2, VAR_FMP, VAR_INV_MATRIX_M0, - VAR_ANGLE, + VAR_ANGLE }; enum FragmentBrushType { @@ -80,7 +80,7 @@ enum FragmentBrushType { FRAGMENT_PROGRAM_BRUSH_CONICAL, FRAGMENT_PROGRAM_BRUSH_LINEAR, FRAGMENT_PROGRAM_BRUSH_TEXTURE, - FRAGMENT_PROGRAM_BRUSH_PATTERN, + FRAGMENT_PROGRAM_BRUSH_PATTERN }; enum FragmentCompositionModeType { @@ -109,12 +109,12 @@ enum FragmentCompositionModeType { COMPOSITION_MODES_DIFFERENCE_NOMASK, COMPOSITION_MODES_EXCLUSION_NOMASK, COMPOSITION_MODE_BLEND_MODE_MASK, - COMPOSITION_MODE_BLEND_MODE_NOMASK, + COMPOSITION_MODE_BLEND_MODE_NOMASK }; enum FragmentMaskType { FRAGMENT_PROGRAM_MASK_TRAPEZOID_AA, - FRAGMENT_PROGRAM_MASK_ELLIPSE_AA, + FRAGMENT_PROGRAM_MASK_ELLIPSE_AA }; static const unsigned int num_fragment_variables = 19; diff --git a/src/qt3support/widgets/q3action.cpp b/src/qt3support/widgets/q3action.cpp index 311212a..caca47b 100644 --- a/src/qt3support/widgets/q3action.cpp +++ b/src/qt3support/widgets/q3action.cpp @@ -415,7 +415,7 @@ static QString qt_stripMenuText(QString s) s.remove(QLatin1String("...")); s.remove(QLatin1Char('&')); return s.trimmed(); -}; +} /*! Constructs an action called \a name with parent \a parent. diff --git a/src/script/qscriptsyntaxchecker_p.h b/src/script/qscriptsyntaxchecker_p.h index 0c02d24..18f0611 100644 --- a/src/script/qscriptsyntaxchecker_p.h +++ b/src/script/qscriptsyntaxchecker_p.h @@ -71,7 +71,7 @@ public: enum State { Error, Intermediate, - Valid, + Valid }; struct Result { diff --git a/src/script/qscriptvalueimplfwd_p.h b/src/script/qscriptvalueimplfwd_p.h index 059842e..aa0c86f 100644 --- a/src/script/qscriptvalueimplfwd_p.h +++ b/src/script/qscriptvalueimplfwd_p.h @@ -77,7 +77,7 @@ class QScriptEnginePrivate; namespace QScript { class Member; -}; +} class QScriptValueImpl { diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 041f2db..af0df3e 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1469,7 +1469,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv) #ifdef Q_OS_WIN chartLocation += QLatin1String("/../tools/qtestlib/chart/release/chart.exe"); #else - chartLocation += QLatin1String("/../tools/qtestlib/chart/chart"); + chartLocation += QLatin1String("/../tools/qtestlib/chart/chart"); #endif if (QFile::exists(chartLocation)) { QProcess p; @@ -1801,8 +1801,8 @@ COMPARE_IMPL2(quint64, %llu) #endif COMPARE_IMPL2(bool, %d) COMPARE_IMPL2(char, %c) -COMPARE_IMPL2(float, %g); -COMPARE_IMPL2(double, %lg); +COMPARE_IMPL2(float, %g) +COMPARE_IMPL2(double, %lg) /*! \internal */ diff --git a/src/testlib/qtestresult.cpp b/src/testlib/qtestresult.cpp index 39759b5..0f21378 100644 --- a/src/testlib/qtestresult.cpp +++ b/src/testlib/qtestresult.cpp @@ -68,7 +68,7 @@ namespace QTest static const char *expectFailComment = 0; static int expectFailMode = 0; -}; +} void QTestResult::reset() { -- cgit v0.12 From d0f47dfb66f10034a7b4336272f5aec63daad4fe Mon Sep 17 00:00:00 2001 From: Sarah Smith Date: Fri, 5 Jun 2009 14:35:42 +1000 Subject: Compile when -no-qt3-support is on. As checked in was compiling with QDataStream(QByteArray *, int) and that method is only available when compiling with qt3 support. Reviewed-by: Julian de Bhal --- src/network/kernel/qauthenticator.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp index b672765..cae3024 100644 --- a/src/network/kernel/qauthenticator.cpp +++ b/src/network/kernel/qauthenticator.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include -- cgit v0.12 From afaa509b0e44d3ab0235abfdda0f1ae6068bd1d6 Mon Sep 17 00:00:00 2001 From: jasplin Date: Fri, 5 Jun 2009 07:49:33 +0200 Subject: Made configure work with older versions of /bin/sh. Some older versions of the Bourne shell (/bin/sh) don't support the ! operator for negating the exit code of a pipeline. In particular, this is true on certain (all?) Solaris 9 platforms. The patch replaces all occurrences of the ! operator with equivalent (but slightly less elegant) expressions that test the $? variable instead. Reviewed-by: msorvig --- configure | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/configure b/configure index 764840e..58ab08c 100755 --- a/configure +++ b/configure @@ -4240,7 +4240,8 @@ fi # check iWMMXt support if [ "$CFG_IWMMXT" = "yes" ]; then - if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/iwmmxt "iwmmxt" $L_FLAGS $I_FLAGS $l_FLAGS "-mcpu=iwmmxt"; then + "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/iwmmxt "iwmmxt" $L_FLAGS $I_FLAGS $l_FLAGS "-mcpu=iwmmxt" + if [ $? != "0" ]; then echo "The iWMMXt functionality test failed!" echo " Please make sure your compiler supports iWMMXt intrinsics!" exit 1 @@ -4759,7 +4760,8 @@ if [ "$PLATFORM_X11" = "yes" ]; then fi # Check we actually have X11 :-) - if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xlib "XLib" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then + "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xlib "XLib" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS + if [ $? != "0" ]; then echo "Basic XLib functionality test failed!" echo " You might need to modify the include and library search paths by editing" echo " QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in ${XQMAKESPEC}." @@ -4790,7 +4792,8 @@ if [ "$PLATFORM_X11" = "yes" ]; then hpux*) # HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct. if [ "$CFG_OPENGL" = "desktop" ]; then - if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/glxfbconfig "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then + "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/glxfbconfig "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS + if [ $? != "0" ]; then QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT fi fi @@ -4800,7 +4803,8 @@ if [ "$PLATFORM_X11" = "yes" ]; then esac elif [ "$CFG_OPENGL" = "es1cl" ]; then # OpenGL ES 1.x common lite - if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1cl "OpenGL ES 1.x Lite" $L_FLAGS $I_FLAGS $l_FLAGS; then + "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1cl "OpenGL ES 1.x Lite" $L_FLAGS $I_FLAGS $l_FLAGS + if [ $? != "0" ]; then echo "The OpenGL ES 1.x Common Lite Profile functionality test failed!" echo " You might need to modify the include and library search paths by editing" echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in" @@ -4809,7 +4813,8 @@ if [ "$PLATFORM_X11" = "yes" ]; then fi elif [ "$CFG_OPENGL" = "es1" ]; then # OpenGL ES 1.x - if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS; then + "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS + if [ $? != "0" ]; then echo "The OpenGL ES 1.x functionality test failed!" echo " You might need to modify the include and library search paths by editing" echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in" @@ -4818,7 +4823,8 @@ if [ "$PLATFORM_X11" = "yes" ]; then fi elif [ "$CFG_OPENGL" = "es2" ]; then #OpenGL ES 2.x - if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS; then + "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS + if [ $? != "0" ]; then echo "The OpenGL ES 2.0 functionality test failed!" echo " You might need to modify the include and library search paths by editing" echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in" @@ -4827,7 +4833,8 @@ if [ "$PLATFORM_X11" = "yes" ]; then fi elif [ "$CFG_OPENGL" = "desktop" ]; then # Desktop OpenGL support - if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/opengl "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then + "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/opengl "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS + if [ $? != "0" ]; then echo "The OpenGL functionality test failed!" echo " You might need to modify the include and library search paths by editing" echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in" @@ -4837,7 +4844,8 @@ if [ "$PLATFORM_X11" = "yes" ]; then case "$PLATFORM" in hpux*) # HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct. - if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/glxfbconfig "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then + "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/glxfbconfig "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS + if [ $? != "0" ]; then QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT fi ;; @@ -5112,7 +5120,8 @@ if [ "$PLATFORM_QWS" = "yes" ]; then fi elif [ "$CFG_OPENGL" = "es1" ]; then # OpenGL ES 1.x - if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS; then + "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS + if [ $? != "0" ]; then echo "The OpenGL ES 1.x functionality test failed!" echo " You might need to modify the include and library search paths by editing" echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in" @@ -5121,7 +5130,8 @@ if [ "$PLATFORM_QWS" = "yes" ]; then fi elif [ "$CFG_OPENGL" = "es2" ]; then #OpenGL ES 2.x - if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS; then + "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS + if [ $? != "0" ]; then echo "The OpenGL ES 2.0 functionality test failed!" echo " You might need to modify the include and library search paths by editing" echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in" @@ -5137,7 +5147,8 @@ if [ "$PLATFORM_QWS" = "yes" ]; then # screen drivers for screen in ${CFG_GFX_ON} ${CFG_GFX_PLUGIN}; do if [ "${screen}" = "ahi" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then - if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/ahi "Ahi" $L_FLAGS $I_FLAGS $l_FLAGS; then + "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/ahi "Ahi" $L_FLAGS $I_FLAGS $l_FLAGS + if [ $? != "0" ]; then echo "The Ahi screen driver functionality test failed!" echo " You might need to modify the include and library search paths by editing" echo " QMAKE_INCDIR and QMAKE_LIBDIR in" @@ -5147,7 +5158,8 @@ if [ "$PLATFORM_QWS" = "yes" ]; then fi if [ "${screen}" = "svgalib" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then - if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/svgalib "SVGAlib" $L_FLAGS $I_FLAGS $l_FLAGS; then + "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/svgalib "SVGAlib" $L_FLAGS $I_FLAGS $l_FLAGS + if [ $? != "0" ]; then echo "The SVGAlib screen driver functionality test failed!" echo " You might need to modify the include and library search paths by editing" echo " QMAKE_INCDIR and QMAKE_LIBDIR in" @@ -5176,7 +5188,8 @@ if [ "$PLATFORM_QWS" = "yes" ]; then QMakeVar set QT_DEFINES_DIRECTFB "QT3_SUPPORT" fi - if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/directfb "DirectFB" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_DIRECTFB $QT_LIBS_DIRECTFB; then + "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/directfb "DirectFB" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_DIRECTFB $QT_LIBS_DIRECTFB + if [ $? != "0" ]; then echo "The DirectFB screen driver functionality test failed!" echo " You might need to modify the include and library search paths by editing" echo " QT_CFLAGS_DIRECTFB and QT_LIBS_DIRECTFB in" @@ -5190,7 +5203,8 @@ if [ "$PLATFORM_QWS" = "yes" ]; then # mouse drivers for mouse in ${CFG_MOUSE_ON} ${CFG_MOUSE_PLUGIN}; do if [ "${mouse}" = "tslib" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then - if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/tslib "tslib" $L_FLAGS $I_FLAGS $l_FLAGS; then + "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/tslib "tslib" $L_FLAGS $I_FLAGS $l_FLAGS + if [ $? != "0" ]; then echo "The tslib functionality test failed!" echo " You might need to modify the include and library search paths by editing" echo " QMAKE_INCDIR and QMAKE_LIBDIR in" @@ -5203,7 +5217,8 @@ if [ "$PLATFORM_QWS" = "yes" ]; then CFG_QGTKSTYLE=no # sound - if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/sound "sound" $L_FLAGS $I_FLAGS $l_FLAGS; then + "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/sound "sound" $L_FLAGS $I_FLAGS $l_FLAGS + if [ $? != "0" ]; then QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SOUND" fi -- cgit v0.12 From 555018baf3115cb2587d2217bf1a5b8f49564ad2 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 5 Jun 2009 09:06:54 +0200 Subject: qdoc: Put ... around names in each summary section. --- tools/qdoc3/htmlgenerator.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index ab26d08..0c4aab3 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1744,8 +1744,9 @@ QString HtmlGenerator::generateLowStatusMemberFile(const InnerNode *inner, CodeM return fileName; } -void HtmlGenerator::generateClassHierarchy(const Node *relative, CodeMarker *marker, - const QMap &classMap) +void HtmlGenerator::generateClassHierarchy(const Node *relative, + CodeMarker *marker, + const QMap &classMap) { if (classMap.isEmpty()) return; @@ -1950,7 +1951,8 @@ void HtmlGenerator::generateCompactList(const Node *relative, CodeMarker *marker if (currentOffset[i] >= firstOffset[i + 1]) { // this column is finished out() << "\n\n"; - } else { + } + else { while (currentOffsetInParagraph[i] == paragraph[currentParagraphNo[i]].count()) { ++currentParagraphNo[i]; currentOffsetInParagraph[i] = 0; @@ -1959,7 +1961,9 @@ void HtmlGenerator::generateCompactList(const Node *relative, CodeMarker *marker out() << ""; if (currentOffsetInParagraph[i] == 0) { // start a new paragraph - out() << "" << paragraphName[currentParagraphNo[i]] << " "; + out() << "" + << paragraphName[currentParagraphNo[i]] + << " "; } out() << "\n"; @@ -1972,7 +1976,9 @@ void HtmlGenerator::generateCompactList(const Node *relative, CodeMarker *marker out() << ""; // Previously, we used generateFullName() for this, but we // require some special formatting. - out() << ""; + out() << ""; QStringList pieces = fullName(it.value(), relative, marker).split("::"); out() << protect(pieces.last()); out() << ""; @@ -1992,7 +1998,8 @@ void HtmlGenerator::generateCompactList(const Node *relative, CodeMarker *marker out() << "

\n"; } -void HtmlGenerator::generateFunctionIndex(const Node *relative, CodeMarker *marker) +void HtmlGenerator::generateFunctionIndex(const Node *relative, + CodeMarker *marker) { out() << "

"; for (int i = 0; i < 26; i++) { @@ -2337,13 +2344,11 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, } i += 2; if (parseArg(src, linkTag, &i, n, &arg, &par1)) { - if (style == CodeMarker::Accessors) - html += ""; + html += ""; QString link = linkForNode( CodeMarker::nodeForString(par1.toString()), relative); addLink(link, arg, &html); - if (style == CodeMarker::Accessors) - html += ""; + html += ""; } else { html += charLangle; -- cgit v0.12 From e50916796adc0dee112505ed617f9b83e99526fb Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 5 Jun 2009 10:32:25 +0200 Subject: qdoc: Changed to use h2 for section headers instead of h3. --- tools/qdoc3/htmlgenerator.cpp | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 0c4aab3..90d3b04 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1048,12 +1048,16 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, out() << "

  • " << "List of all members, including inherited members
  • \n"; - QString obsoleteLink = generateLowStatusMemberFile(inner, marker, CodeMarker::Obsolete); + QString obsoleteLink = generateLowStatusMemberFile(inner, + marker, + CodeMarker::Obsolete); if (!obsoleteLink.isEmpty()) out() << "
  • " << "Obsolete members
  • \n"; - QString compatLink = generateLowStatusMemberFile(inner, marker, CodeMarker::Compat); + QString compatLink = generateLowStatusMemberFile(inner, + marker, + CodeMarker::Compat); if (!compatLink.isEmpty()) out() << "
  • " << "Qt 3 support members
  • \n"; @@ -1069,9 +1073,10 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, if (!s->inherited.isEmpty()) needOtherSection = true; } else { - out() << "\n"; - out() << "

    " << protect((*s).name) << "

    \n"; - + out() << "\n"; + out() << "

    " << protect((*s).name) << "

    \n"; generateSectionList(*s, inner, marker, CodeMarker::Summary); } ++s; @@ -1224,12 +1229,16 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) out() << "
  • " << "List of all members, including inherited members
  • \n"; - QString obsoleteLink = generateLowStatusMemberFile(fake, marker, CodeMarker::Obsolete); + QString obsoleteLink = generateLowStatusMemberFile(fake, + marker, + CodeMarker::Obsolete); if (!obsoleteLink.isEmpty()) out() << "
  • " << "Obsolete members
  • \n"; - QString compatLink = generateLowStatusMemberFile(fake, marker, CodeMarker::Compat); + QString compatLink = generateLowStatusMemberFile(fake, + marker, + CodeMarker::Compat); if (!compatLink.isEmpty()) out() << "
  • " << "Qt 3 support members
  • \n"; @@ -1260,7 +1269,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) s = sections.begin(); while (s != sections.end()) { out() << "\n"; - out() << "

    " << protect((*s).name) << "

    \n"; + out() << "

    " << protect((*s).name) << "

    \n"; generateSectionList(*s, fake, marker, CodeMarker::Summary); ++s; } @@ -1656,7 +1665,9 @@ QString HtmlGenerator::generateListOfAllMemberFile(const InnerNode *inner, CodeM QList
    sections; QList
    ::ConstIterator s; - sections = marker->sections(inner, CodeMarker::SeparateList, CodeMarker::Okay); + sections = marker->sections(inner, + CodeMarker::SeparateList, + CodeMarker::Okay); if (sections.isEmpty()) return QString(); @@ -1677,10 +1688,13 @@ QString HtmlGenerator::generateListOfAllMemberFile(const InnerNode *inner, CodeM return fileName; } -QString HtmlGenerator::generateLowStatusMemberFile(const InnerNode *inner, CodeMarker *marker, +QString HtmlGenerator::generateLowStatusMemberFile(const InnerNode *inner, + CodeMarker *marker, CodeMarker::Status status) { - QList
    sections = marker->sections(inner, CodeMarker::Summary, status); + QList
    sections = marker->sections(inner, + CodeMarker::Summary, + status); QMutableListIterator
    j(sections); while (j.hasNext()) { if (j.next().members.size() == 0) @@ -1717,12 +1731,13 @@ QString HtmlGenerator::generateLowStatusMemberFile(const InnerNode *inner, CodeM "code.

    \n"; } - out() << "

    • " << protect(inner->name()) + out() << "

      \n"; for (i = 0; i < sections.size(); ++i) { - out() << "

      " << protect(sections.at(i).name) << "

      \n"; - + out() << "

      " << protect(sections.at(i).name) << "

      \n"; generateSectionList(sections.at(i), inner, marker, CodeMarker::Summary); } -- cgit v0.12 From 754f8968332e712d590a6ee984118536c0447348 Mon Sep 17 00:00:00 2001 From: jasplin Date: Fri, 5 Jun 2009 12:06:46 +0200 Subject: Compile with Sun CC 5.5. An alternative solution is to swap the order of -I../../include and -I../../include/QtOpenGL when compiling the opengl module. Reviewed-by: TrustMe --- src/opengl/gl2paintengineex/qglgradientcache_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/gl2paintengineex/qglgradientcache_p.h b/src/opengl/gl2paintengineex/qglgradientcache_p.h index 9bf58c7..f088359 100644 --- a/src/opengl/gl2paintengineex/qglgradientcache_p.h +++ b/src/opengl/gl2paintengineex/qglgradientcache_p.h @@ -52,7 +52,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE -- cgit v0.12 From f04af57ba71e8a4cd3c19f6e1a283290cc5280d4 Mon Sep 17 00:00:00 2001 From: miniak Date: Fri, 5 Jun 2009 12:50:31 +0200 Subject: Fix for Qt issue #218037 - Add support for the WM_MOUSEHWHEEL message on Windows Merge-request: 384 Reviewed-by: Marius Storm-Olsen --- src/corelib/global/qt_windows.h | 3 +++ src/corelib/kernel/qcoreapplication_win.cpp | 4 ++++ src/corelib/kernel/qeventdispatcher_win.cpp | 3 ++- src/gui/kernel/qapplication_win.cpp | 14 ++++++++++++-- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/corelib/global/qt_windows.h b/src/corelib/global/qt_windows.h index 2ce4059..7fc7f47 100644 --- a/src/corelib/global/qt_windows.h +++ b/src/corelib/global/qt_windows.h @@ -106,6 +106,9 @@ #ifndef WM_MOUSEWHEEL #define WM_MOUSEWHEEL 0x020A #endif +#ifndef WM_MOUSEHWHEEL +#define WM_MOUSEHWHEEL 0x020E +#endif #ifndef ETO_PDY #define ETO_PDY 0x2000 #endif diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp index 815a558..9c1c235 100644 --- a/src/corelib/kernel/qcoreapplication_win.cpp +++ b/src/corelib/kernel/qcoreapplication_win.cpp @@ -409,6 +409,7 @@ struct { { 0x020B, "WM_XBUTTONDOWN" }, { 0x020C, "WM_XBUTTONUP" }, { 0x020D, "WM_XBUTTONDBLCLK" }, + { 0x020E, "WM_MOUSEHWHEEL" }, { 0x0210, "WM_PARENTNOTIFY" }, { 0x0211, "WM_ENTERMENULOOP" }, { 0x0212, "WM_EXITMENULOOP" }, @@ -898,6 +899,9 @@ QString decodeMSG(const MSG& msg) #ifdef WM_MOUSEWHEEL case WM_MOUSEWHEEL: #endif +#ifdef WM_MOUSEHWHEEL + case WM_MOUSEHWHEEL: +#endif #ifdef WM_LBUTTONDBLCLK case WM_LBUTTONDBLCLK: #endif diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index 2dd5534..7d3a13a 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -696,7 +696,8 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags) && msg.message <= WM_KEYLAST) || (msg.message >= WM_MOUSEFIRST && msg.message <= WM_MOUSELAST) - || msg.message == WM_MOUSEWHEEL)) { + || msg.message == WM_MOUSEWHEEL + || msg.message == WM_MOUSEHWHEEL)) { // queue user input events for later processing haveMessage = false; d->queuedUserInputEvents.append(msg); diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 7e97784..60f3edf 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -1408,6 +1408,7 @@ static bool qt_is_translatable_mouse_event(UINT message) return (message >= WM_MOUSEFIRST && message <= WM_MOUSELAST || message >= WM_XBUTTONDOWN && message <= WM_XBUTTONDBLCLK) && message != WM_MOUSEWHEEL + && message != WM_MOUSEHWHEEL #ifndef Q_WS_WINCE || message >= WM_NCMOUSEMOVE && message <= WM_NCMBUTTONDBLCLK @@ -1758,6 +1759,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam break; case WM_MOUSEWHEEL: + case WM_MOUSEHWHEEL: result = widget->translateWheelEvent(msg); break; @@ -2657,6 +2659,7 @@ bool qt_try_modal(QWidget *widget, MSG *msg, int& ret) #endif if ((type >= WM_MOUSEFIRST && type <= WM_MOUSELAST) || type == WM_MOUSEWHEEL || type == (int)WM95_MOUSEWHEEL || + type == WM_MOUSEHWHEEL || type == WM_MOUSELEAVE || (type >= WM_KEYFIRST && type <= WM_KEYLAST) #ifndef Q_WS_WINCE @@ -3268,12 +3271,12 @@ bool QETWidget::translateWheelEvent(const MSG &msg) state = translateButtonState(GET_KEYSTATE_WPARAM(msg.wParam), 0, 0); int delta; - if (msg.message == WM_MOUSEWHEEL) + if (msg.message == WM_MOUSEWHEEL || msg.message == WM_MOUSEHWHEEL) delta = (short) HIWORD (msg.wParam); else delta = (int) msg.wParam; - Qt::Orientation orient = (state&Qt::AltModifier + Qt::Orientation orient = (msg.message == WM_MOUSEHWHEEL || state&Qt::AltModifier #if 0 // disabled for now - Trenton's one-wheel mouse makes trouble... // "delta" for usual wheels is +-120. +-240 seems to indicate @@ -3287,6 +3290,13 @@ bool QETWidget::translateWheelEvent(const MSG &msg) #endif ) ? Qt::Horizontal : Qt::Vertical; + // according to the MSDN documentation on WM_MOUSEHWHEEL: + // a positive value indicates that the wheel was rotated to the right; + // a negative value indicates that the wheel was rotated to the left. + // Qt defines this value as the exact opposite, so we have to flip the value! + if (msg.message == WM_MOUSEHWHEEL) + delta = -delta; + QPoint globalPos; globalPos.rx() = (short)LOWORD (msg.lParam); -- cgit v0.12 From 84f381b98a9a100007a9d40a26e30f0bf705037b Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 5 Jun 2009 13:06:06 +0200 Subject: Made qmake handle "no_default" config for sub targets Merge-request: 395 Reviewed-by: Marius Storm-Olsen --- qmake/generators/makefile.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 67e5bfb..2d4658e 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2463,7 +2463,12 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListtarget + "-" + suffix; + SubTarget *subTarget = targets.at(target); + if((suffix == "make_first" || suffix == "make_default") + && project->values(subTarget->name + ".CONFIG").indexOf("no_default_target") != -1) { + continue; + } + QString targetRule = subTarget->target + "-" + suffix; if(flags & SubTargetOrdered) targetRule += "-ordered"; t << " " << targetRule; -- cgit v0.12 From e6b3c48159f479d82740988a6104b9f5aee16a59 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 5 Jun 2009 11:39:54 +0200 Subject: Make QStringBuilder work out-of-the-box if QT_NO_CAST_FROM_ASCII is defined So far, only operator% was working for concatenation in those circumnstances. Now, defining QT_USE_FAST_OPERATOR_PLUS and QT_USE_FAST_CONCATENATION is enough, so user code will work without any source changes. Reviewed-by: joao --- src/corelib/tools/qstringbuilder.h | 24 ++++++++++++++++ tests/auto/qstringbuilder/tst_qstringbuilder.cpp | 35 ------------------------ 2 files changed, 24 insertions(+), 35 deletions(-) diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h index 1e67b7d..7b16197 100644 --- a/src/corelib/tools/qstringbuilder.h +++ b/src/corelib/tools/qstringbuilder.h @@ -169,6 +169,30 @@ template <> struct QConcatenable } }; +#ifndef QT_NO_CAST_FROM_ASCII +template struct QConcatenable +{ + typedef char type[N]; + static int size(const char *) { return N - 1; } + static inline void appendTo(const char *a, QChar *&out) + { + for (int i = 0; i < N - 1; ++i) + *out++ = QLatin1Char(a[i]); + } +}; + +template <> struct QConcatenable +{ + typedef char const *type; + static int size(const char *a) { return qstrlen(a); } + static inline void appendTo(const char *a, QChar *&out) + { + while (*a) + *out++ = QLatin1Char(*a++); + } +}; +#endif + template struct QConcatenable< QStringBuilder > { diff --git a/tests/auto/qstringbuilder/tst_qstringbuilder.cpp b/tests/auto/qstringbuilder/tst_qstringbuilder.cpp index f5df79e..5501204 100644 --- a/tests/auto/qstringbuilder/tst_qstringbuilder.cpp +++ b/tests/auto/qstringbuilder/tst_qstringbuilder.cpp @@ -95,41 +95,6 @@ #define LITERAL "some literal" -#ifndef QT_NO_CAST_FROM_ASCII - -// Plan is to move the QConcatenable specialications below -// to qstringbuilder.h as soon as the QByteArray builder is -// implemented. - -QT_BEGIN_NAMESPACE - -template struct QConcatenable -{ - typedef char type[N]; - static int size(const char *) { return N - 1; } - static inline void appendTo(const type &a, QChar *&out) - { - memcpy(out, a, N - 1); - out += N - 1; - } -}; - -template struct QConcatenable -{ - typedef char type[N]; - static int size(const char *) { return N - 1; } - static inline void appendTo(const type &a, QChar *&out) - { - memcpy(out, a, N - 1); - out += N - 1; - } -}; - -QT_END_NAMESPACE - -#endif - - class tst_QStringBuilder : public QObject { Q_OBJECT -- cgit v0.12 From a8738d7a11f8eea0164977c4c478d04a1a337f3a Mon Sep 17 00:00:00 2001 From: jasplin Date: Fri, 5 Jun 2009 13:28:46 +0200 Subject: Fixed build issue with Sun CC 5.5. Reviewed-by: TrustMe --- tools/linguist/lupdate/cpp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp index 42aa2f0..9f28d1d 100644 --- a/tools/linguist/lupdate/cpp.cpp +++ b/tools/linguist/lupdate/cpp.cpp @@ -145,7 +145,6 @@ public: const ParseResults *getResults() const { return results; } void deleteResults() { delete results; } -private: struct SavedState { QStringList namespaces; QStack namespaceDepths; @@ -154,6 +153,7 @@ private: QString pendingContext; }; +private: struct IfdefState { IfdefState() {} IfdefState(int _braceDepth, int _parenDepth) : -- cgit v0.12 From f101435831bb06f342bb0e2241e3011073341617 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Fri, 5 Jun 2009 13:35:49 +0200 Subject: Fix wrong sizing of toolbars when they have anough space What could happen starting with 4.4 is that you could move a toolbar. If you then added actions, the toolbar would grom and make the other toolbars move to the right although it had enough space already to show the newly created actions. Autotest will follow shortly. Task-number: 226060 --- src/gui/widgets/qmainwindowlayout_p.h | 30 ------------ src/gui/widgets/qtoolbararealayout.cpp | 86 ++++++++++++++++++++-------------- src/gui/widgets/qtoolbararealayout_p.h | 57 ++++++++++++++++++++-- 3 files changed, 104 insertions(+), 69 deletions(-) diff --git a/src/gui/widgets/qmainwindowlayout_p.h b/src/gui/widgets/qmainwindowlayout_p.h index 1159aac..24a58a6 100644 --- a/src/gui/widgets/qmainwindowlayout_p.h +++ b/src/gui/widgets/qmainwindowlayout_p.h @@ -341,34 +341,4 @@ QT_END_NAMESPACE #endif // QT_NO_MAINWINDOW -QT_BEGIN_NAMESPACE -static inline int pick(Qt::Orientation o, const QPoint &pos) -{ return o == Qt::Horizontal ? pos.x() : pos.y(); } - -static inline int pick(Qt::Orientation o, const QSize &size) -{ return o == Qt::Horizontal ? size.width() : size.height(); } - -static inline int &rpick(Qt::Orientation o, QPoint &pos) -{ return o == Qt::Horizontal ? pos.rx() : pos.ry(); } - -static inline int &rpick(Qt::Orientation o, QSize &size) -{ return o == Qt::Horizontal ? size.rwidth() : size.rheight(); } - -static inline QSizePolicy::Policy pick(Qt::Orientation o, const QSizePolicy &policy) -{ return o == Qt::Horizontal ? policy.horizontalPolicy() : policy.verticalPolicy(); } - -static inline int perp(Qt::Orientation o, const QPoint &pos) -{ return o == Qt::Vertical ? pos.x() : pos.y(); } - -static inline int perp(Qt::Orientation o, const QSize &size) -{ return o == Qt::Vertical ? size.width() : size.height(); } - -static inline int &rperp(Qt::Orientation o, QPoint &pos) -{ return o == Qt::Vertical ? pos.rx() : pos.ry(); } - -static inline int &rperp(Qt::Orientation o, QSize &size) -{ return o == Qt::Vertical ? size.rwidth() : size.rheight(); } - -QT_END_NAMESPACE - #endif // QDYNAMICMAINWINDOWLAYOUT_P_H diff --git a/src/gui/widgets/qtoolbararealayout.cpp b/src/gui/widgets/qtoolbararealayout.cpp index 49f4a9e..240d059 100644 --- a/src/gui/widgets/qtoolbararealayout.cpp +++ b/src/gui/widgets/qtoolbararealayout.cpp @@ -113,7 +113,7 @@ QSize QToolBarAreaLayoutLine::sizeHint() const continue; QSize sh = item.sizeHint(); - a += pick(o, sh) + item.extraSpace; + a += item.preferredSize > 0 ? item.preferredSize : pick(o, sh); b = qMax(b, perp(o, sh)); } @@ -163,12 +163,17 @@ void QToolBarAreaLayoutLine::fitLayout() int itemMin = pick(o, item.minimumSize()); int itemHint = pick(o, item.sizeHint()); //we ensure the extraspace is not too low - item.extraSpace = qMax(itemMin - itemHint, item.extraSpace); - itemHint += item.extraSpace; - int itemExtra = qMin(itemHint - itemMin, extra); + item.size = qMax(item.size, itemHint); + if (item.preferredSize > 0) { + //preferredSize would be the default size + item.size = item.preferredSize; + } + + //the extraspace is the space above the item minimum sizehint + int extraSpace = qMin(item.size - itemMin, extra); + item.size = itemMin + extraSpace; //that is the real size - item.size = itemMin + itemExtra; - extra -= itemExtra; + extra -= extraSpace; last = i; } @@ -395,17 +400,15 @@ void QToolBarAreaLayoutInfo::removeToolBarBreak(QToolBar *before) void QToolBarAreaLayoutInfo::moveToolBar(QToolBar *toolbar, int pos) { - if (dirty) { + if (dirty) fitLayout(); - } dirty = true; - if (o == Qt::Vertical) { + if (o == Qt::Vertical) pos -= rect.top(); - } - //here we actually update the extraSpace for the line containing the toolbar so that we move it + //here we actually update the preferredSize for the line containing the toolbar so that we move it for (int j = 0; j < lines.count(); ++j) { QToolBarAreaLayoutLine &line = lines[j]; @@ -432,22 +435,21 @@ void QToolBarAreaLayoutInfo::moveToolBar(QToolBar *toolbar, int pos) newPos = qMin(pos, maxPos); } - //let's update the previous extra space + //extra is the number of pixels to add to the previous toolbar int extra = newPos - current.pos; - if (qAbs(previous.extraSpace + extra) < QApplication::startDragDistance()) { + //we check if the previous is near its size hint + //in which case we try to stick to it + if (qAbs(pick(o, previous.sizeHint()) - (previous.size + extra)) < QApplication::startDragDistance()) { //we stick to the default space extra = 0; } //update for the current item - current.extraSpace -= extra; - //this ensures the toolbars to be pushed to the right when necessary - current.extraSpace = qMax(pick(o,current.minimumSize())- pick(o,current.sizeHint()), current.extraSpace); - - if (extra >= 0) { - previous.extraSpace += extra; + current.extendSize(line.o, -extra); + if (extra >= 0) { + previous.extendSize(line.o, extra); } else { //we need to push the toolbars on the left starting with previous extra = -extra; // we just need to know the number of pixels @@ -455,13 +457,13 @@ void QToolBarAreaLayoutInfo::moveToolBar(QToolBar *toolbar, int pos) for(int l = previousIndex; l >=0; --l) { QToolBarAreaLayoutItem &item = line.toolBarItems[l]; if (!item.skip()) { - const int minExtraSpace = pick(o, item.minimumSize()) - pick(o, item.sizeHint()); - const int margin = item.extraSpace - minExtraSpace; + const int minPreferredSize = pick(o, item.minimumSize()); + const int margin = item.size - minPreferredSize; if (margin < extra) { - item.extraSpace = minExtraSpace; + item.resize(line.o, minPreferredSize); extra -= margin; } else { - item.extraSpace -= extra; + item.extendSize(line.o, -extra); extra = 0; } } @@ -536,13 +538,22 @@ bool QToolBarAreaLayoutInfo::insertGap(QList path, QLayoutItem *item) gap_item.gap = true; gap_item.widgetItem = item; - //update the previous item's extra space + //update the previous item's preferred size for(int p = k - 1 ; p >= 0; --p) { QToolBarAreaLayoutItem &previous = line.toolBarItems[p]; if (!previous.skip()) { //we found the previous one - gap_item.extraSpace = qMax(0, previous.extraSpace - pick(o, gap_item.sizeHint())); - previous.extraSpace = qMin(previous.extraSpace, 0); + int previousSizeHint = pick(line.o, previous.sizeHint()); + int previousExtraSpace = previous.size - previousSizeHint; + + if (previousExtraSpace > 0) { + //in this case we reset the space + previous.preferredSize = -1; + previous.size = previousSizeHint; + + gap_item.resize(o, previousExtraSpace); + } + break; } } @@ -1132,15 +1143,22 @@ QLayoutItem *QToolBarAreaLayout::unplug(QList path, QToolBarAreaLayout *oth //update the leading space here QToolBarAreaLayoutInfo &info = docks[path.at(0)]; QToolBarAreaLayoutLine &line = info.lines[path.at(1)]; - if (item.extraSpace != 0) { + if (item.size != pick(line.o, item.realSizeHint())) { + //the item doesn't have its default size + //so we'll give this to the next item int newExtraSpace = 0; + //let's iterate over the siblings of the current item that pare placed before it + //we need to find just the one before for (int i = path.at(2) - 1; i >= 0; --i) { QToolBarAreaLayoutItem &previous = line.toolBarItems[i]; if (!previous.skip()) { + //we need to check if it has a previous element and a next one + //the previous will get its size changed for (int j = path.at(2) + 1; j < line.toolBarItems.count(); ++j) { const QToolBarAreaLayoutItem &next = line.toolBarItems.at(j); if (!next.skip()) { - newExtraSpace = previous.extraSpace = next.pos - previous.pos - pick(line.o, previous.sizeHint()); + newExtraSpace = next.pos - previous.pos - pick(line.o, previous.sizeHint()); + previous.resize(line.o, next.pos - previous.pos); } break; } @@ -1154,7 +1172,7 @@ QLayoutItem *QToolBarAreaLayout::unplug(QList path, QToolBarAreaLayout *oth for (int i = path.at(2) - 1; i >= 0; --i) { QToolBarAreaLayoutItem &previous = line.toolBarItems[i]; if (!previous.skip()) { - previous.extraSpace = newExtraSpace; + previous.resize(line.o, pick(line.o, previous.sizeHint()) + newExtraSpace); break; } } @@ -1162,7 +1180,6 @@ QLayoutItem *QToolBarAreaLayout::unplug(QList path, QToolBarAreaLayout *oth } } - Q_ASSERT(!item.gap); item.gap = true; return item.widgetItem; @@ -1253,8 +1270,8 @@ void QToolBarAreaLayout::saveState(QDataStream &stream) const } stream << shownOrientation; stream << item.pos; - //if extraSpace is 0 the item has its "normal" size, so no need to store the size (we store -1) - stream << (item.extraSpace == 0 ? -1 : (pick(line.o, item.realSizeHint()) + item.extraSpace)); + //we store the preferred size. If the use rdidn't resize the toolbars it will be -1 + stream << item.preferredSize; uint geom0, geom1; packRect(&geom0, &geom1, widget->geometry(), widget->isWindow()); @@ -1339,10 +1356,7 @@ bool QToolBarAreaLayout::restoreState(QDataStream &stream, const QListsetVisible(shown & 1); toolBar->d_func()->setWindowState(floating, true, rect); - //if it is -1, it means we should use the default size - item.extraSpace = (item.size == -1) ? 0 : item.size - pick(line.o, item.realSizeHint()); - - + item.preferredSize = item.size; line.toolBarItems.append(item); } } diff --git a/src/gui/widgets/qtoolbararealayout_p.h b/src/gui/widgets/qtoolbararealayout_p.h index 574e366..5662ffc 100644 --- a/src/gui/widgets/qtoolbararealayout_p.h +++ b/src/gui/widgets/qtoolbararealayout_p.h @@ -59,6 +59,33 @@ QT_BEGIN_NAMESPACE +static inline int pick(Qt::Orientation o, const QPoint &pos) +{ return o == Qt::Horizontal ? pos.x() : pos.y(); } + +static inline int pick(Qt::Orientation o, const QSize &size) +{ return o == Qt::Horizontal ? size.width() : size.height(); } + +static inline int &rpick(Qt::Orientation o, QPoint &pos) +{ return o == Qt::Horizontal ? pos.rx() : pos.ry(); } + +static inline int &rpick(Qt::Orientation o, QSize &size) +{ return o == Qt::Horizontal ? size.rwidth() : size.rheight(); } + +static inline QSizePolicy::Policy pick(Qt::Orientation o, const QSizePolicy &policy) +{ return o == Qt::Horizontal ? policy.horizontalPolicy() : policy.verticalPolicy(); } + +static inline int perp(Qt::Orientation o, const QPoint &pos) +{ return o == Qt::Vertical ? pos.x() : pos.y(); } + +static inline int perp(Qt::Orientation o, const QSize &size) +{ return o == Qt::Vertical ? size.width() : size.height(); } + +static inline int &rperp(Qt::Orientation o, QPoint &pos) +{ return o == Qt::Vertical ? pos.rx() : pos.ry(); } + +static inline int &rperp(Qt::Orientation o, QSize &size) +{ return o == Qt::Vertical ? size.rwidth() : size.rheight(); } + #ifndef QT_NO_TOOLBAR class QToolBar; @@ -70,17 +97,41 @@ class QToolBarAreaLayoutItem { public: QToolBarAreaLayoutItem(QLayoutItem *item = 0) - : widgetItem(item), pos(0), size(-1), extraSpace(0), gap(false) {} + : widgetItem(item), pos(0), size(-1), preferredSize(-1), gap(false) {} bool skip() const; QSize minimumSize() const; QSize sizeHint() const; - QSize realSizeHint() const; + QSize realSizeHint() const; + + void resize(Qt::Orientation o, int newSize) + { + newSize = qMax(pick(o, minimumSize()), newSize); + int sizeh = pick(o, sizeHint()); + if (newSize == sizeh) { + preferredSize = -1; + size = sizeh; + } else { + preferredSize = newSize; + } + } + + void extendSize(Qt::Orientation o, int extent) + { + int newSize = qMax(pick(o, minimumSize()), (preferredSize > 0 ? preferredSize : size) + extent); + int sizeh = pick(o, sizeHint()); + if (newSize == sizeh) { + preferredSize = -1; + size = sizeh; + } else { + preferredSize = newSize; + } + } QLayoutItem *widgetItem; int pos; int size; - int extraSpace; + int preferredSize; bool gap; }; -- cgit v0.12 From 4acabb3abd0ff109b9abeedb6832f5b1c3e0cc4e Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Fri, 5 Jun 2009 13:05:24 +0200 Subject: handle qreal properties correctly in the meta-object system When cross-compiling, it's possible that the size of qreal for moc itself (host platform) is different from the size of qreal on the target platform. Thus, we should not encode the metatype-id of qreal at moc time. Instead, use QMetaType::QReal in the generated code so that the the property flags are only derived at compile time. We also need to support the pesky QT_COORD_TYPE. In this case, qreal can be _any_ type (not just float or double), so we encode the property type as 0 and have a special check in QMetaProperty::type() that resolves the correct type at runtime. Reviewed-by: Simon Hausmann --- src/corelib/global/qglobal.h | 1 + src/corelib/kernel/qmetaobject.cpp | 5 +++++ src/corelib/kernel/qmetatype.cpp | 1 + src/corelib/kernel/qmetatype.h | 9 +++++++++ src/corelib/kernel/qobjectdefs.h | 2 +- src/tools/moc/generator.cpp | 20 +++++++++++++++----- src/tools/moc/outputrevision.h | 2 +- tests/auto/qobject/tst_qobject.cpp | 27 +++++++++++++++++++++++++++ 8 files changed, 60 insertions(+), 7 deletions(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 3990c7d..a10b6d6 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1004,6 +1004,7 @@ typedef int QNoImplicitBoolCast; #define QT_NO_FPU #endif +// This logic must match the one in qmetatype.h #if defined(QT_COORD_TYPE) typedef QT_COORD_TYPE qreal; #elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index b65f956..6f3316c 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -2003,6 +2003,11 @@ QVariant::Type QMetaProperty::type() const if (enumMetaTypeId == 0) return QVariant::Int; } +#ifdef QT_COORD_TYPE + // qreal metatype must be resolved at runtime. + if (strcmp(typeName(), "qreal") == 0) + return QVariant::Type(qMetaTypeId()); +#endif return QVariant::UserType; } diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index ce10bae..a0b954f 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -179,6 +179,7 @@ QT_BEGIN_NAMESPACE \omitvalue LastCoreExtType \omitvalue LastCoreType \omitvalue LastGuiType + \omitvalue QReal Additional types can be registered using Q_DECLARE_METATYPE(). diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 648f933..be8a667 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -86,6 +86,15 @@ public: UShort = 133, UChar = 134, Float = 135, QObjectStar = 136, QWidgetStar = 137, LastCoreExtType = 137 /* QWidgetStar */, +// This logic must match the one in qglobal.h +#if defined(QT_COORD_TYPE) + QReal = 0, +#elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) + QReal = Float, +#else + QReal = Double, +#endif + User = 256 }; diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h index 3a22323..f5d08ce 100644 --- a/src/corelib/kernel/qobjectdefs.h +++ b/src/corelib/kernel/qobjectdefs.h @@ -55,7 +55,7 @@ class QByteArray; class QString; #ifndef Q_MOC_OUTPUT_REVISION -#define Q_MOC_OUTPUT_REVISION 61 +#define Q_MOC_OUTPUT_REVISION 62 #endif // The following macros are our "extensions" to C++ diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index e94bb77..e4ad068 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -109,6 +109,14 @@ bool isVariantType(const char* type) return qvariant_nameToType(type) != 0; } +/*! + Returns true if the type is qreal. +*/ +static bool isQRealType(const char *type) +{ + return strcmp(type, "qreal") == 0; +} + Generator::Generator(ClassDef *classDef, const QList &metaTypes, FILE *outfile) : out(outfile), cdef(classDef), metaTypes(metaTypes) { @@ -545,7 +553,7 @@ void Generator::generateProperties() uint flags = Invalid; if (!isVariantType(p.type)) { flags |= EnumOrFlag; - } else { + } else if (!isQRealType(p.type)) { flags |= qvariant_nameToType(p.type) << 24; } if (!p.read.isEmpty()) @@ -589,10 +597,12 @@ void Generator::generateProperties() if (p.notifyId != -1) flags |= Notify; - fprintf(out, " %4d, %4d, 0x%.8x,\n", - strreg(p.name), - strreg(p.type), - flags); + fprintf(out, " %4d, %4d, ", + strreg(p.name), + strreg(p.type)); + if (!(flags >> 24) && isQRealType(p.type)) + fprintf(out, "(QMetaType::QReal << 24) | "); + fprintf(out, "0x%.8x,\n", flags); } if(cdef->notifyableProperties) { diff --git a/src/tools/moc/outputrevision.h b/src/tools/moc/outputrevision.h index 1e1d640..f577f6c 100644 --- a/src/tools/moc/outputrevision.h +++ b/src/tools/moc/outputrevision.h @@ -43,6 +43,6 @@ #define OUTPUTREVISION_H // if the output revision changes, you MUST change it in qobjectdefs.h too -enum { mocOutputRevision = 61 }; // moc format output revision +enum { mocOutputRevision = 62 }; // moc format output revision #endif // OUTPUTREVISION_H diff --git a/tests/auto/qobject/tst_qobject.cpp b/tests/auto/qobject/tst_qobject.cpp index 399d021..d76c7d4 100644 --- a/tests/auto/qobject/tst_qobject.cpp +++ b/tests/auto/qobject/tst_qobject.cpp @@ -106,6 +106,7 @@ private slots: void childDeletesItsSibling(); void dynamicProperties(); void floatProperty(); + void qrealProperty(); void property(); void recursiveSignalEmission(); void blockingQueuedConnection(); @@ -1113,6 +1114,7 @@ class PropertyObject : public QObject Q_PROPERTY(QVariant variant READ variant WRITE setVariant) Q_PROPERTY(CustomType* custom READ custom WRITE setCustom) Q_PROPERTY(float myFloat READ myFloat WRITE setMyFloat) + Q_PROPERTY(qreal myQReal READ myQReal WRITE setMyQReal) public: enum Alpha { @@ -1148,6 +1150,9 @@ public: void setMyFloat(float value) { m_float = value; } inline float myFloat() const { return m_float; } + void setMyQReal(qreal value) { m_qreal = value; } + qreal myQReal() const { return m_qreal; } + private: Alpha m_alpha; Priority m_priority; @@ -1156,6 +1161,7 @@ private: QVariant m_variant; CustomType *m_custom; float m_float; + qreal m_qreal; }; Q_DECLARE_METATYPE(PropertyObject::Priority) @@ -2348,6 +2354,27 @@ void tst_QObject::floatProperty() QVERIFY(qVariantValue(v) == 128.0f); } +void tst_QObject::qrealProperty() +{ + PropertyObject obj; + const int idx = obj.metaObject()->indexOfProperty("myQReal"); + QVERIFY(idx > 0); + QMetaProperty prop = obj.metaObject()->property(idx); + QVERIFY(prop.isValid()); + QVERIFY(prop.type() == uint(QMetaType::type("qreal"))); + QVERIFY(!prop.write(&obj, QVariant("Hello"))); + + QVERIFY(prop.write(&obj, qVariantFromValue(128.0f))); + QVariant v = prop.read(&obj); + QCOMPARE(v.userType(), qMetaTypeId()); + QVERIFY(qVariantValue(v) == 128.0); + + QVERIFY(prop.write(&obj, qVariantFromValue(double(127)))); + v = prop.read(&obj); + QCOMPARE(v.userType(), qMetaTypeId()); + QVERIFY(qVariantValue(v) == 127.0); +} + class DynamicPropertyObject : public PropertyObject { public: -- cgit v0.12 From a468e2f12536600abff582e8770ec42e1782bdab Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Fri, 5 Jun 2009 10:13:16 +0200 Subject: Add a callback so Qt updates its color stuff when the profile changes. We've had a problem with a stale cache for color profiles this should make things work well. We get the callback for each display whether it needs it or not, but honesly I would rather that we update this a few times too many when people change their display profile than not at all. FWIW, this code is inspired from Apple's Tech Note TN2035. --- src/gui/kernel/qapplication_mac.mm | 28 ++++++++++++++++++++++++++++ src/gui/painting/qpaintengine_mac_p.h | 2 ++ 2 files changed, 30 insertions(+) diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm index d5fa9ea..6a592e4 100644 --- a/src/gui/kernel/qapplication_mac.mm +++ b/src/gui/kernel/qapplication_mac.mm @@ -154,6 +154,10 @@ #define kThemeBrushAlternatePrimaryHighlightColor -5 #endif +#define kCMDeviceUnregisteredNotification CFSTR("CMDeviceUnregisteredNotification") +#define kCMDefaultDeviceNotification CFSTR("CMDefaultDeviceNotification") +#define kCMDeviceProfilesNotification CFSTR("CMDeviceProfilesNotification") +#define kCMDefaultDeviceProfileNotification CFSTR("CMDefaultDeviceProfileNotification") QT_BEGIN_NAMESPACE @@ -1040,11 +1044,29 @@ void qt_release_app_proc_handler() #endif } +void qt_color_profile_changed(CFNotificationCenterRef, void *, CFStringRef, const void *, + CFDictionaryRef) +{ + QCoreGraphicsPaintEngine::cleanUpMacColorSpaces(); +} /* platform specific implementations */ void qt_init(QApplicationPrivate *priv, int) { if (qt_is_gui_used) { CGDisplayRegisterReconfigurationCallback(qt_mac_display_change_callbk, 0); + CFNotificationCenterRef center = CFNotificationCenterGetDistributedCenter(); + CFNotificationCenterAddObserver(center, qApp, qt_color_profile_changed, + kCMDeviceUnregisteredNotification, 0, + CFNotificationSuspensionBehaviorDeliverImmediately); + CFNotificationCenterAddObserver(center, qApp, qt_color_profile_changed, + kCMDefaultDeviceNotification, 0, + CFNotificationSuspensionBehaviorDeliverImmediately); + CFNotificationCenterAddObserver(center, qApp, qt_color_profile_changed, + kCMDeviceProfilesNotification, 0, + CFNotificationSuspensionBehaviorDeliverImmediately); + CFNotificationCenterAddObserver(center, qApp, qt_color_profile_changed, + kCMDefaultDeviceProfileNotification, 0, + CFNotificationSuspensionBehaviorDeliverImmediately); ProcessSerialNumber psn; if (GetCurrentProcess(&psn) == noErr) { // Jambi needs to transform itself since most people aren't "used" @@ -1224,6 +1246,12 @@ void qt_release_apple_event_handler() void qt_cleanup() { CGDisplayRemoveReconfigurationCallback(qt_mac_display_change_callbk, 0); + CFNotificationCenterRef center = CFNotificationCenterGetDistributedCenter(); + CFNotificationCenterRemoveObserver(center, qApp, kCMDeviceUnregisteredNotification, 0); + CFNotificationCenterRemoveObserver(center, qApp, kCMDefaultDeviceNotification, 0); + CFNotificationCenterRemoveObserver(center, qApp, kCMDeviceProfilesNotification, 0); + CFNotificationCenterRemoveObserver(center, qApp, kCMDefaultDeviceProfileNotification, 0); + #ifndef QT_MAC_USE_COCOA qt_release_app_proc_handler(); if (app_proc_handlerUPP) { diff --git a/src/gui/painting/qpaintengine_mac_p.h b/src/gui/painting/qpaintengine_mac_p.h index 298c145..9b85800 100644 --- a/src/gui/painting/qpaintengine_mac_p.h +++ b/src/gui/painting/qpaintengine_mac_p.h @@ -233,6 +233,8 @@ protected: friend class QMacPrintEngine; friend class QMacPrintEnginePrivate; friend void qt_mac_display_change_callbk(CGDirectDisplayID, CGDisplayChangeSummaryFlags, void *); + friend void qt_color_profile_changed(CFNotificationCenterRef center, void *, + CFStringRef , const void *, CFDictionaryRef); QCoreGraphicsPaintEngine(QPaintEnginePrivate &dptr); private: -- cgit v0.12 From 2ddf5be9627b7c93729838522bb37f47f41a6435 Mon Sep 17 00:00:00 2001 From: jasplin Date: Fri, 5 Jun 2009 14:31:39 +0200 Subject: Fixed compile error with Sun CC 5.5. Reviewed-by: TrustMe --- examples/animation/stickman/node.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/animation/stickman/node.h b/examples/animation/stickman/node.h index 72eae87..8654144 100644 --- a/examples/animation/stickman/node.h +++ b/examples/animation/stickman/node.h @@ -47,7 +47,7 @@ class Node: public QObject, public QGraphicsItem { Q_OBJECT - Q_PROPERTY(QPointF position READ pos WRITE setPos); + Q_PROPERTY(QPointF position READ pos WRITE setPos) public: Node(const QPointF &pos, QGraphicsItem *parent = 0); ~Node(); -- cgit v0.12 From 65f6422401f7dfeb5f3a7fcc3791528b4cf2cee4 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Fri, 5 Jun 2009 15:34:32 +0200 Subject: kill dead code --- src/script/qscriptextqobject.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/script/qscriptextqobject.cpp b/src/script/qscriptextqobject.cpp index 4522807..0a346f0 100644 --- a/src/script/qscriptextqobject.cpp +++ b/src/script/qscriptextqobject.cpp @@ -1883,8 +1883,6 @@ void QScript::QtFunction::execute(QScriptContextPrivate *context) return; } - QScriptValueImpl result = eng_p->undefinedValue(); - const QMetaObject *meta = qobj->metaObject(); QObject *thisQObject = context->thisObject().toQObject(); -- cgit v0.12 From 407a77cb2660cf122b08a388216f3a2da8cfd1c3 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 5 Jun 2009 15:40:17 +0200 Subject: Fixes anti-aliased text rendering on smartphones (Windows Mobile) The check for cleartype in qt_win_read_cleartype_settings() was not correct for Windows Mobile For anti-aliased text rendering we also have to use another pixel format for the native image. Task-number: 249642 Reviewed-by: mauricek --- src/gui/kernel/qapplication_win.cpp | 8 ++++++++ src/gui/text/qfontengine_win.cpp | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 60f3edf..b21eb36 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -625,6 +625,13 @@ static void qt_set_windows_font_resources() static void qt_win_read_cleartype_settings() { +#ifdef Q_OS_WINCE + UINT result; + BOOL ok; + ok = SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &result, 0); + if (ok) + qt_cleartype_enabled = result; +#else QT_WA({ UINT result; BOOL ok; @@ -638,6 +645,7 @@ static void qt_win_read_cleartype_settings() if (ok) qt_cleartype_enabled = (result == FE_FONTSMOOTHINGCLEARTYPE); }); +#endif } diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp index 002e670..d172a81 100644 --- a/src/gui/text/qfontengine_win.cpp +++ b/src/gui/text/qfontengine_win.cpp @@ -1333,6 +1333,7 @@ bool QFontEngineWin::getSfntTableData(uint tag, uchar *buffer, uint *length) con # define CLEARTYPE_QUALITY 5 #endif +extern bool qt_cleartype_enabled; QNativeImage *QFontEngineWin::drawGDIGlyph(HFONT font, glyph_t glyph, int margin, const QTransform &t) @@ -1408,7 +1409,11 @@ QNativeImage *QFontEngineWin::drawGDIGlyph(HFONT font, glyph_t glyph, int margin QNativeImage *ni = new QNativeImage(iw + 2 * margin + 4, ih + 2 * margin + 4, - QNativeImage::systemFormat(), true); + QNativeImage::systemFormat(), !qt_cleartype_enabled); + + /*If cleartype is enabled we use the standard system format even on Windows CE + and not the special textbuffer format we have to use if cleartype is disabled*/ + ni->image.fill(0xffffffff); HDC hdc = ni->hdc; @@ -1437,7 +1442,6 @@ QNativeImage *QFontEngineWin::drawGDIGlyph(HFONT font, glyph_t glyph, int margin } -extern bool qt_cleartype_enabled; extern uint qt_pow_gamma[256]; QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform) -- cgit v0.12 From 1ad2cba32bc34786cdfd92ad16e3212b8830be3d Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 5 Jun 2009 15:43:31 +0200 Subject: Compilefix for QT_NO_CURSOR in qgraphicsscene.cpp Reviewed-by: Joerg --- src/gui/graphicsview/qgraphicsscene.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 1fc4567..49c2329 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -2924,11 +2924,13 @@ void QGraphicsScene::addItem(QGraphicsItem *item) d->allItemsIgnoreHoverEvents = false; d->enableMouseTrackingOnViews(); } +#ifndef QT_NO_CURSOR if (d->allItemsUseDefaultCursor && item->hasCursor()) { d->allItemsUseDefaultCursor = false; if (d->allItemsIgnoreHoverEvents) // already enabled otherwise d->enableMouseTrackingOnViews(); } +#endif //QT_NO_CURSOR // Update selection lists if (item->isSelected()) -- cgit v0.12 From 100b55e4ddc9e4846ab877ea670473e2a9ed641e Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Tue, 10 Mar 2009 17:35:17 +0100 Subject: add HTTP DELETE support to Network Access API added new method QNetworkAccessManager::deleteResource (naming the method "delete" was not possible since it is a reserverd word in C++) and adjusted all the internals necessary. Task-number: 242916 Reviewed-by: Thiago --- src/network/access/qnetworkaccesshttpbackend.cpp | 10 +++ src/network/access/qnetworkaccessmanager.cpp | 19 ++++- src/network/access/qnetworkaccessmanager.h | 2 + tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 99 ++++++++++++++++++++++++ 4 files changed, 128 insertions(+), 2 deletions(-) diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index bd364cb..7517000 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -212,6 +212,7 @@ QNetworkAccessHttpBackendFactory::create(QNetworkAccessManager::Operation op, case QNetworkAccessManager::PostOperation: case QNetworkAccessManager::HeadOperation: case QNetworkAccessManager::PutOperation: + case QNetworkAccessManager::DeleteOperation: break; default: @@ -244,6 +245,10 @@ static QNetworkReply::NetworkError statusCodeFromHttp(int httpStatusCode, const code = QNetworkReply::ContentNotFoundError; break; + case 405: // Method Not Allowed + code = QNetworkReply::ContentOperationNotPermittedError; + break; + case 407: code = QNetworkReply::ProxyAuthenticationRequiredError; break; @@ -485,6 +490,11 @@ void QNetworkAccessHttpBackend::postRequest() httpRequest.setUploadByteDevice(createUploadByteDevice()); break; + case QNetworkAccessManager::DeleteOperation: + invalidateCache(); + httpRequest.setOperation(QHttpNetworkRequest::Delete); + break; + default: break; // can't happen } diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index bf06ede..7ca5f78 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -148,6 +148,9 @@ static void ensureInitialized() \value PostOperation send the contents of an HTML form for processing via HTTP POST (created with post()) + \value DeleteOperation delete contents operation (created with + deleteResource()) + \omitvalue UnknownOperation \sa QNetworkReply::operation() @@ -555,7 +558,7 @@ QNetworkReply *QNetworkAccessManager::head(const QNetworkRequest &request) a new QNetworkReply object opened for reading which emits its QIODevice::readyRead() signal whenever new data arrives. - \sa post(), put() + \sa post(), put(), deleteResource() */ QNetworkReply *QNetworkAccessManager::get(const QNetworkRequest &request) { @@ -577,7 +580,7 @@ QNetworkReply *QNetworkAccessManager::get(const QNetworkRequest &request) Note: sending a POST request on protocols other than HTTP and HTTPS is undefined and will probably fail. - \sa get(), put() + \sa get(), put(), deleteResource() */ QNetworkReply *QNetworkAccessManager::post(const QNetworkRequest &request, QIODevice *data) { @@ -642,6 +645,18 @@ QNetworkReply *QNetworkAccessManager::put(const QNetworkRequest &request, const } /*! + This function is used to send a request to delete the resource + identified by the URL of \a request. + This feature is currently available for HTTP only, performing an HTTP DELETE request. + + \sa get(), post(), put() +*/ +QNetworkReply *QNetworkAccessManager::deleteResource(const QNetworkRequest &request) +{ + return d_func()->postProcess(createRequest(QNetworkAccessManager::DeleteOperation, request)); +} + +/*! Returns a new QNetworkReply object to handle the operation \a op and request \a req. The device \a outgoingData is always 0 for Get and Head requests, but is the value passed to post() and put() in diff --git a/src/network/access/qnetworkaccessmanager.h b/src/network/access/qnetworkaccessmanager.h index 4fe218e..79f512c 100644 --- a/src/network/access/qnetworkaccessmanager.h +++ b/src/network/access/qnetworkaccessmanager.h @@ -74,6 +74,7 @@ public: GetOperation, PutOperation, PostOperation, + DeleteOperation, UnknownOperation = 0 }; @@ -100,6 +101,7 @@ public: QNetworkReply *post(const QNetworkRequest &request, const QByteArray &data); QNetworkReply *put(const QNetworkRequest &request, QIODevice *data); QNetworkReply *put(const QNetworkRequest &request, const QByteArray &data); + QNetworkReply *deleteResource(const QNetworkRequest &request); Q_SIGNALS: #ifndef QT_NO_NETWORKPROXY diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index b76a4e6..43b4ea9 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -161,6 +161,10 @@ private Q_SLOTS: void putToHttp(); void postToHttp_data(); void postToHttp(); + void deleteFromHttp_data(); + void deleteFromHttp(); + void putGetDeleteGetFromHttp_data(); + void putGetDeleteGetFromHttp(); void ioGetFromData_data(); void ioGetFromData(); @@ -903,6 +907,10 @@ QString tst_QNetworkReply::runSimpleRequest(QNetworkAccessManager::Operation op, reply = manager.post(request, data); break; + case QNetworkAccessManager::DeleteOperation: + reply = manager.deleteResource(request); + break; + default: Q_ASSERT_X(false, "tst_QNetworkReply", "Invalid/unknown operation requested"); } @@ -1478,6 +1486,97 @@ void tst_QNetworkReply::postToHttp() QCOMPARE(uploadedData, md5sum.toHex()); } +void tst_QNetworkReply::deleteFromHttp_data() +{ + QTest::addColumn("url"); + QTest::addColumn("resultCode"); + QTest::addColumn("error"); + + // for status codes to expect, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html + + QTest::newRow("405-method-not-allowed") << QUrl("http://" + QtNetworkSettings::serverName() + "/index.html") << 405 << QNetworkReply::ContentOperationNotPermittedError; + QTest::newRow("200-ok") << QUrl("http://" + QtNetworkSettings::serverName() + "/cgi-bin/http-delete.cgi?200-ok") << 200 << QNetworkReply::NoError; + QTest::newRow("202-accepted") << QUrl("http://" + QtNetworkSettings::serverName() + "/cgi-bin/http-delete.cgi?202-accepted") << 202 << QNetworkReply::NoError; + QTest::newRow("204-no-content") << QUrl("http://" + QtNetworkSettings::serverName() + "/cgi-bin/http-delete.cgi?204-no-content") << 204 << QNetworkReply::NoError; + QTest::newRow("404-not-found") << QUrl("http://" + QtNetworkSettings::serverName() + "/cgi-bin/http-delete.cgi?404-not-found") << 404 << QNetworkReply::ContentNotFoundError; +} + +void tst_QNetworkReply::deleteFromHttp() +{ + QFETCH(QUrl, url); + QFETCH(int, resultCode); + QFETCH(QNetworkReply::NetworkError, error); + QNetworkRequest request(url); + QNetworkReplyPtr reply; + runSimpleRequest(QNetworkAccessManager::DeleteOperation, request, reply, 0); + QCOMPARE(reply->url(), url); + QCOMPARE(reply->error(), error); + QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), resultCode); +} + +void tst_QNetworkReply::putGetDeleteGetFromHttp_data() +{ + QTest::addColumn("putUrl"); + QTest::addColumn("putResultCode"); + QTest::addColumn("putError"); + QTest::addColumn("deleteUrl"); + QTest::addColumn("deleteResultCode"); + QTest::addColumn("deleteError"); + QTest::addColumn("get2Url"); + QTest::addColumn("get2ResultCode"); + QTest::addColumn("get2Error"); + + QUrl url("http://" + QtNetworkSettings::serverName()); + url.setPath(QString("/dav/qnetworkaccess-putToHttp-%1-%2") + .arg(QTest::currentDataTag()) + .arg(uniqueExtension)); + + // first use case: put, get (to check it is there), delete, get (to check it is not there anymore) + QTest::newRow("success") << url << 201 << QNetworkReply::NoError << url << 204 << QNetworkReply::NoError << url << 404 << QNetworkReply::ContentNotFoundError; + + QUrl wrongUrl("http://" + QtNetworkSettings::serverName()); + wrongUrl.setPath(QString("/dav/qnetworkaccess-thisURLisNotAvailable")); + + // second use case: put, get (to check it is there), delete wrong URL, get (to check it is still there) + QTest::newRow("delete-error") << url << 201 << QNetworkReply::NoError << wrongUrl << 404 << QNetworkReply::ContentNotFoundError << url << 200 << QNetworkReply::NoError; + +} + +void tst_QNetworkReply::putGetDeleteGetFromHttp() +{ + QFETCH(QUrl, putUrl); + QFETCH(int, putResultCode); + QFETCH(QNetworkReply::NetworkError, putError); + QFETCH(QUrl, deleteUrl); + QFETCH(int, deleteResultCode); + QFETCH(QNetworkReply::NetworkError, deleteError); + QFETCH(QUrl, get2Url); + QFETCH(int, get2ResultCode); + QFETCH(QNetworkReply::NetworkError, get2Error); + + QNetworkRequest putRequest(putUrl); + QNetworkRequest deleteRequest(deleteUrl); + QNetworkRequest get2Request(get2Url); + QNetworkReplyPtr reply; + + RUN_REQUEST(runSimpleRequest(QNetworkAccessManager::PutOperation, putRequest, reply, 0)); + QCOMPARE(reply->error(), putError); + QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), putResultCode); + + runSimpleRequest(QNetworkAccessManager::GetOperation, putRequest, reply, 0); + QCOMPARE(reply->error(), QNetworkReply::NoError); + QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200); + + runSimpleRequest(QNetworkAccessManager::DeleteOperation, deleteRequest, reply, 0); + QCOMPARE(reply->error(), deleteError); + QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), deleteResultCode); + + runSimpleRequest(QNetworkAccessManager::GetOperation, get2Request, reply, 0); + QCOMPARE(reply->error(), get2Error); + QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), get2ResultCode); + +} + void tst_QNetworkReply::ioGetFromData_data() { QTest::addColumn("urlStr"); -- cgit v0.12 From 0302c0103da731b7af8d749b1643c50e39d81c00 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Fri, 5 Jun 2009 16:35:37 +0200 Subject: QNetworkAccessManager: forgot the "since" tag in my previous commit Reviewed-by: trustMe --- src/network/access/qnetworkaccessmanager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 7ca5f78..024f191 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -645,6 +645,8 @@ QNetworkReply *QNetworkAccessManager::put(const QNetworkRequest &request, const } /*! + \since 4.6 + This function is used to send a request to delete the resource identified by the URL of \a request. This feature is currently available for HTTP only, performing an HTTP DELETE request. -- cgit v0.12 From ff9497f82d605688453e2f027bab7c719048f0d2 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Fri, 5 Jun 2009 15:38:44 +0200 Subject: Revert two of my commits, restoring the original fix for focus handling. The fix that was introduced adds regressions, and I don't see a way we can fix it without breaking someone elses code. So restoring the original fix that just avoid a crash (autotest by Thierry is included). Revert "Revert Avoid a crash when setting a focus in a widget hierarchy containing" Revert "Setting a focus on a widget hierarchy which contains both visible and invisible widgets could cause a crash." This reverts commit be833a4f25a8ec8c3dd7a8ac4fa4b0507c93e7ee. This partially reverts commit 1a7da7096bbda17197738061902f4489af234bc0 Reviewed-by: Thierry Bastian Reviewed-by: Prasanth Ullattil --- src/gui/kernel/qwidget.cpp | 16 ++++------------ tests/auto/qwidget/tst_qwidget.cpp | 18 ------------------ 2 files changed, 4 insertions(+), 30 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index d436ffb..6026821 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -5674,15 +5674,10 @@ void QWidget::setFocus(Qt::FocusReason reason) w = w->isWindow() ? 0 : w->parentWidget(); } } else { - while (w && w->isVisible()) { + while (w) { w->d_func()->focus_child = f; w = w->isWindow() ? 0 : w->parentWidget(); } - // a special case, if there is an invisible parent, notify him - // about the focus_child widget, so that if it becomes - // visible, the focus widget will be respected. - if (w) - w->d_func()->focus_child = f; } #ifndef QT_NO_GRAPHICSVIEW @@ -5757,8 +5752,9 @@ void QWidget::setFocus(Qt::FocusReason reason) void QWidget::clearFocus() { QWidget *w = this; - while (w && w->d_func()->focus_child == this) { - w->d_func()->focus_child = 0; + while (w) { + if (w->d_func()->focus_child == this) + w->d_func()->focus_child = 0; w = w->parentWidget(); } #ifndef QT_NO_GRAPHICSVIEW @@ -6734,10 +6730,6 @@ void QWidgetPrivate::show_helper() if (QApplicationPrivate::hidden_focus_widget == q) { QApplicationPrivate::hidden_focus_widget = 0; q->setFocus(Qt::OtherFocusReason); - } else if (focus_child) { - // if we are shown and there is an explicit focus child widget - // set, respect it by giving him focus. - focus_child->setFocus(Qt::OtherFocusReason); } // Process events when showing a Qt::SplashScreen widget before the event loop diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 3fad366..041aa7a 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -351,7 +351,6 @@ private slots: void toplevelLineEditFocus(); void focusWidget_task254563(); - void focusWidget_mixed_widget_hierarchy(); private: bool ensureScreenSize(int width, int height); @@ -8995,22 +8994,5 @@ void tst_QWidget::focusWidget_task254563() QVERIFY(top.focusWidget() != widget); //dangling pointer } -void tst_QWidget::focusWidget_mixed_widget_hierarchy() -{ - QWidget top; - top.show(); - QWidget notvisible(&top); - QWidget *visible = new QWidget(¬visible); - visible->show(); - - visible->setFocus(); - notvisible.setFocus(); - notvisible.show(); - QCOMPARE(top.focusWidget(), visible); - QCOMPARE(notvisible.focusWidget(), visible); - QCOMPARE(visible->focusWidget(), visible); -} - - QTEST_MAIN(tst_QWidget) #include "tst_qwidget.moc" -- cgit v0.12 From 9691523b796c6acc6a837a5f5a34fef16aa74c48 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Fri, 5 Jun 2009 16:48:52 +0200 Subject: have QScriptValue::toVariant() convert Array objects to QVariantLists Converting the array to its string representation is not very useful. Now round-trip conversion will work as well. Reviewed-by: Ariya Hidayat --- src/script/qscriptvalue.cpp | 1 + src/script/qscriptvalueimpl.cpp | 2 ++ tests/auto/qscriptvalue/tst_qscriptvalue.cpp | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+) diff --git a/src/script/qscriptvalue.cpp b/src/script/qscriptvalue.cpp index a253985..f72d1db 100644 --- a/src/script/qscriptvalue.cpp +++ b/src/script/qscriptvalue.cpp @@ -904,6 +904,7 @@ qsreal QScriptValue::toInteger() const \row \o QObject Object \o A QVariant containing a pointer to the QObject. \row \o Date Object \o A QVariant containing the date value (toDateTime()). \row \o RegExp Object \o A QVariant containing the regular expression value (toRegExp()). + \row \o Array Object \o The array is converted to a QVariantList. \row \o Object \o If the value is primitive, then the result is converted to a QVariant according to the above rules; otherwise, an invalid QVariant is returned. \endtable diff --git a/src/script/qscriptvalueimpl.cpp b/src/script/qscriptvalueimpl.cpp index a890839..7c7b711 100644 --- a/src/script/qscriptvalueimpl.cpp +++ b/src/script/qscriptvalueimpl.cpp @@ -339,6 +339,8 @@ QVariant QScriptValueImpl::toVariant() const if (isQObject()) return qVariantFromValue(toQObject()); #endif + if (isArray()) + return QScriptEnginePrivate::variantListFromArray(*this); QScriptValueImpl v = engine()->toPrimitive(*this); if (!v.isObject()) diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp index bf91001..ad1080a 100644 --- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp +++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp @@ -1301,6 +1301,27 @@ void tst_QScriptValue::toVariant() QCOMPARE(str.toVariant(), QVariant(QString("ciao"))); QCOMPARE(qscriptvalue_cast(str), QVariant(QString("ciao"))); } + + // array + { + QVariantList listIn; + listIn << 123 << "hello"; + QScriptValue array = qScriptValueFromValue(&eng, listIn); + QVERIFY(array.isArray()); + QCOMPARE(array.property("length").toInt32(), 2); + QVariant ret = array.toVariant(); + QCOMPARE(ret.type(), QVariant::List); + QVariantList listOut = ret.toList(); + QCOMPARE(listOut.size(), listIn.size()); + for (int i = 0; i < listIn.size(); ++i) + QVERIFY(listOut.at(i) == listIn.at(i)); + // round-trip conversion + QScriptValue array2 = qScriptValueFromValue(&eng, ret); + QVERIFY(array2.isArray()); + QCOMPARE(array2.property("length").toInt32(), array.property("length").toInt32()); + for (int i = 0; i < array.property("length").toInt32(); ++i) + QVERIFY(array2.property(i).strictlyEquals(array.property(i))); + } } // unfortunately, this is necessary in order to do qscriptvalue_cast(...) -- cgit v0.12