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 85d6409aa650272e1956a7e8f2064d453a6203ad Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 4 Jun 2009 08:57:43 +0200 Subject: qdoc: Reset the memItemLeft width property to 200. --- tools/qdoc3/htmlgenerator.cpp | 2 +- tools/qdoc3/test/classic.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 422e956..a2a7184 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2323,7 +2323,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, for (int i = 0, n = src.size(); i < n;) { if (src.at(i) == charLangle && src.at(i + 1).unicode() == '@') { if (nameAlignment) // && (i != 0)) Why was this here? - html += " "; + html += ""; i += 2; if (parseArg(src, linkTag, &i, n, &arg, &par1)) { QString link = linkForNode( diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css index 5239856..fa0167b 100644 --- a/tools/qdoc3/test/classic.css +++ b/tools/qdoc3/test/classic.css @@ -66,7 +66,7 @@ body } table td.memItemLeft { - width: 100px; + width: 200px; padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; -- 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 d227b12495bb88a78b98436eac38f240429dfa98 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 2 Jun 2009 11:25:21 +0200 Subject: Add some comparisons with std::string to the QStringBuilder benchmarks. --- tests/benchmarks/qstringbuilder/main.cpp | 86 +++++++++++++++++++++++++------- 1 file changed, 68 insertions(+), 18 deletions(-) diff --git a/tests/benchmarks/qstringbuilder/main.cpp b/tests/benchmarks/qstringbuilder/main.cpp index d4e2fa0..8b769a6 100644 --- a/tests/benchmarks/qstringbuilder/main.cpp +++ b/tests/benchmarks/qstringbuilder/main.cpp @@ -1,6 +1,6 @@ // Select one of the scenarios below -#define SCENARIO 3 +#define SCENARIO 1 #if SCENARIO == 1 // this is the "no harm done" version. Only operator% is active, @@ -17,7 +17,7 @@ // this is the "full" version. Operator+ is replaced by a QStringBuilder // based version // with NO_CAST * defined -#define P % +#define P + #define QT_USE_FAST_OPERATOR_PLUS #define QT_USE_FAST_CONCATENATION #define QT_NO_CAST_FROM_ASCII @@ -38,7 +38,7 @@ // this is the "full" version. Operator+ is replaced by a QStringBuilder // based version // with NO_CAST * _not_ defined -#define P % +#define P + #define QT_USE_FAST_OPERATOR_PLUS #define QT_USE_FAST_CONCATENATION #undef QT_NO_CAST_FROM_ASCII @@ -53,6 +53,8 @@ #include +#include + #define COMPARE(a, b) QCOMPARE(a, b) //#define COMPARE(a, b) @@ -70,6 +72,7 @@ public: l1string(LITERAL), ba(LITERAL), string(l1string), + stdstring(LITERAL), stringref(&string, 2, 10), achar('c'), r2(QLatin1String(LITERAL LITERAL)), @@ -115,8 +118,9 @@ public: private slots: void separator_0() { - qDebug() << "\nIn each block the QStringBuilder based result appear first, " - "QStringBased second.\n"; + qDebug() << "\nIn each block the QStringBuilder based result appear first " + "(with a 'b_' prefix), QStringBased second ('q_' prefix), std::string " + "last ('s_' prefix)\n"; } void separator_1() { SEP("literal + literal (builder first)"); } @@ -131,7 +135,7 @@ private slots: COMPARE(r, r2); } #endif - void s_2_l1string() { + void q_2_l1string() { QBENCHMARK { r = l1string + l1string; } COMPARE(r, r2); } @@ -143,10 +147,14 @@ private slots: QBENCHMARK { r = string P string; } COMPARE(r, r2); } - void s_2_string() { + void q_2_string() { QBENCHMARK { r = string + string; } COMPARE(r, r2); } + void s_2_string() { + QBENCHMARK { stdr = stdstring + stdstring; } + COMPARE(stdr, stdstring + stdstring); + } void separator_2c() { SEP("2 string refs"); } @@ -155,7 +163,7 @@ private slots: QBENCHMARK { r = stringref % stringref; } COMPARE(r, QString(stringref.toString() + stringref.toString())); } - void s_2_stringref() { + void q_2_stringref() { QBENCHMARK { r = stringref.toString() + stringref.toString(); } COMPARE(r, QString(stringref % stringref)); } @@ -167,10 +175,30 @@ private slots: QBENCHMARK { r = string P string P string; } COMPARE(r, r3); } - void s_3_string() { + void q_3_string() { QBENCHMARK { r = string + string + string; } COMPARE(r, r3); } + void s_3_string() { + QBENCHMARK { stdr = stdstring + stdstring + stdstring; } + COMPARE(stdr, stdstring + stdstring + stdstring); + } + + void separator_2e() { SEP("4 strings"); } + + void b_4_string() { + QBENCHMARK { r = string P string P string P string; } + COMPARE(r, r4); + } + void q_4_string() { + QBENCHMARK { r = string + string + string + string; } + COMPARE(r, r4); + } + void s_4_string() { + QBENCHMARK { stdr = stdstring + stdstring + stdstring + stdstring; } + COMPARE(stdr, stdstring + stdstring + stdstring + stdstring); + } + void separator_2a() { SEP("string + literal (builder first)"); } @@ -193,14 +221,18 @@ private slots: QBENCHMARK { r = string P l1string; } COMPARE(r, r2); } - void s_string_l1literal() { + void q_string_l1literal() { QBENCHMARK { r = string + l1string; } COMPARE(r, r2); } - void s_string_l1string() { + void q_string_l1string() { QBENCHMARK { r = string + l1string; } COMPARE(r, r2); } + void s_LITERAL_string() { + QBENCHMARK { stdr = LITERAL + stdstring; } + COMPARE(stdr, stdstring + stdstring); + } void separator_3() { SEP("3 literals"); } @@ -209,10 +241,14 @@ private slots: QBENCHMARK { r = l1literal P l1literal P l1literal; } COMPARE(r, r3); } - void s_3_l1string() { + void q_3_l1string() { QBENCHMARK { r = l1string + l1string + l1string; } COMPARE(r, r3); } + void s_3_l1string() { + QBENCHMARK { stdr = stdstring + LITERAL + LITERAL; } + COMPARE(stdr, stdstring + stdstring + stdstring); + } void separator_4() { SEP("4 literals"); } @@ -221,7 +257,7 @@ private slots: QBENCHMARK { r = l1literal P l1literal P l1literal P l1literal; } COMPARE(r, r4); } - void s_4_l1string() { + void q_4_l1string() { QBENCHMARK { r = l1string + l1string + l1string + l1string; } COMPARE(r, r4); } @@ -234,7 +270,7 @@ private slots: COMPARE(r, r5); } - void s_5_l1string() { + void q_5_l1string() { QBENCHMARK { r = l1string + l1string + l1string + l1string + l1string; } COMPARE(r, r5); } @@ -247,11 +283,16 @@ private slots: COMPARE(r, QString(string P achar P achar P achar P achar)); } - void s_string_4_char() { + void q_string_4_char() { QBENCHMARK { r = string + achar + achar + achar + achar; } COMPARE(r, QString(string P achar P achar P achar P achar)); } + void s_string_4_char() { + QBENCHMARK { stdr = stdstring + 'c' + 'c' + 'c' + 'c'; } + COMPARE(stdr, stdstring + 'c' + 'c' + 'c' + 'c'); + } + void separator_7() { SEP("char + string + char"); } @@ -260,11 +301,17 @@ private slots: COMPARE(r, QString(achar P string P achar)); } - void s_char_string_char() { + void q_char_string_char() { QBENCHMARK { r = achar + string + achar; } COMPARE(r, QString(achar P string P achar)); } + void s_char_string_char() { + QBENCHMARK { stdr = 'c' + stdstring + 'c'; } + COMPARE(stdr, 'c' + stdstring + 'c'); + } + + void separator_8() { SEP("string.arg"); } void b_string_arg() { @@ -273,13 +320,13 @@ private slots: COMPARE(r, r3); } - void s_string_arg() { + void q_string_arg() { const QString pattern = l1string + QLatin1String("%1") + l1string; QBENCHMARK { r = pattern.arg(string); } COMPARE(r, r3); } - void s_bytearray_arg() { + void q_bytearray_arg() { QByteArray result; QBENCHMARK { result = ba + ba + ba; } } @@ -331,11 +378,14 @@ private: const QLatin1String l1string; const QByteArray ba; const QString string; + const std::string stdstring; const QStringRef stringref; const QLatin1Char achar; const QString r2, r3, r4, r5; + // short cuts for results QString r; + std::string stdr; }; -- cgit v0.12 From d167d50234a977eae5c03cca20a78850437d5b87 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 4 Jun 2009 10:22:10 +0200 Subject: compile fix with namespaces --- demos/boxes/glbuffers.h | 2 ++ demos/boxes/scene.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/demos/boxes/glbuffers.h b/demos/boxes/glbuffers.h index 392924e..9e05fad 100644 --- a/demos/boxes/glbuffers.h +++ b/demos/boxes/glbuffers.h @@ -58,7 +58,9 @@ if (m_failed || !(assertion)) { returnStatement; \ } +QT_BEGIN_NAMESPACE class QMatrix4x4; +QT_END_NAMESPACE class GLTexture { diff --git a/demos/boxes/scene.h b/demos/boxes/scene.h index 48ecaba..9f8d2af 100644 --- a/demos/boxes/scene.h +++ b/demos/boxes/scene.h @@ -56,7 +56,10 @@ #define PI 3.14159265358979 +QT_BEGIN_NAMESPACE class QMatrix4x4; +QT_END_NAMESPACE + class ParameterEdit : public QWidget { public: -- cgit v0.12 From 397c3bb494e220af5ef1cf6e47cfdfc84b61540b Mon Sep 17 00:00:00 2001 From: jasplin Date: Thu, 4 Jun 2009 10:39:29 +0200 Subject: Fixed build error with Sun CC 5.5. Reviewed-by: TrustMe --- src/corelib/tools/qvector.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 7bdcba0..38254cd 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -94,7 +94,14 @@ template class QVector { typedef QVectorTypedData Data; - union { QVectorData *d; Data *p; }; + union { + QVectorData *d; +#if defined(Q_CC_SUN) && (__SUNPRO_CC <= 0x550) + QVectorTypedData *p; +#else + Data *p; +#endif + }; public: inline QVector() : d(&QVectorData::shared_null) { d->ref.ref(); } -- 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 c116ffaa7abb26373475921db7410503a79b4207 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Thu, 4 Jun 2009 10:45:17 +0200 Subject: Fixed the frame that would sometimes not be painted around widgets in a QStatusBar Task-number: 253717 Reviewed-by: ogoffart --- src/gui/widgets/qstatusbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qstatusbar.cpp b/src/gui/widgets/qstatusbar.cpp index 3829bcb..a248346 100644 --- a/src/gui/widgets/qstatusbar.cpp +++ b/src/gui/widgets/qstatusbar.cpp @@ -728,7 +728,7 @@ void QStatusBar::paintEvent(QPaintEvent *event) QStatusBarPrivate::SBItem* item = d->items.at(i); if (item && item->w->isVisible() && (!haveMessage || item->p)) { QRect ir = item->w->geometry().adjusted(-2, -1, 2, 1); - if (event->rect().contains(ir)) { + if (event->rect().intersects(ir)) { QStyleOption opt(0); opt.rect = ir; opt.palette = palette(); -- cgit v0.12 From 470716d0d0e06e4032f469f7c4c629a3d2a3b133 Mon Sep 17 00:00:00 2001 From: jasplin Date: Thu, 4 Jun 2009 10:44:06 +0200 Subject: Fixed build error with Sun CC 5.5.. Note that the fix is simply to swap the order of the two v_construct() overloads. Sun CC 5.5 requires the version with the default argument to occur first. Reviewed-by: TrustMe --- src/corelib/kernel/qvariant_p.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h index 033b760..02b507e 100644 --- a/src/corelib/kernel/qvariant_p.h +++ b/src/corelib/kernel/qvariant_p.h @@ -105,28 +105,28 @@ private: // constructs a new variant if copy is 0, otherwise copy-constructs template -inline void v_construct(QVariant::Private *x, const T &t) +inline void v_construct(QVariant::Private *x, const void *copy, T * = 0) { if (sizeof(T) > sizeof(QVariant::Private::Data)) { - x->data.shared = new QVariantPrivateSharedEx(t); + x->data.shared = copy ? new QVariantPrivateSharedEx(*static_cast(copy)) + : new QVariantPrivateSharedEx; x->is_shared = true; } else { - new (&x->data.ptr) T(t); + if (copy) + new (&x->data.ptr) T(*static_cast(copy)); + else + new (&x->data.ptr) T; } } template -inline void v_construct(QVariant::Private *x, const void *copy, T * = 0) +inline void v_construct(QVariant::Private *x, const T &t) { if (sizeof(T) > sizeof(QVariant::Private::Data)) { - x->data.shared = copy ? new QVariantPrivateSharedEx(*static_cast(copy)) - : new QVariantPrivateSharedEx; + x->data.shared = new QVariantPrivateSharedEx(t); x->is_shared = true; } else { - if (copy) - new (&x->data.ptr) T(*static_cast(copy)); - else - new (&x->data.ptr) T; + new (&x->data.ptr) T(t); } } -- cgit v0.12 From d5231e0593dcbf226e0ca3d679c2547e8e1c9697 Mon Sep 17 00:00:00 2001 From: jasplin Date: Thu, 4 Jun 2009 10:54:26 +0200 Subject: Fixed build error with Sun CC 5.5. Reviewed-by: tbastian --- src/gui/animation/qguivariantanimation.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/animation/qguivariantanimation.cpp b/src/gui/animation/qguivariantanimation.cpp index 37ca6a1..75532f6 100644 --- a/src/gui/animation/qguivariantanimation.cpp +++ b/src/gui/animation/qguivariantanimation.cpp @@ -66,6 +66,9 @@ Q_CONSTRUCTOR_FUNCTION(qRegisterGuiGetInterpolator) static int qUnregisterGuiGetInterpolator() { qRegisterAnimationInterpolator(0); + qRegisterAnimationInterpolator( + (QVariant (*)(const QColor &, const QColor &, qreal))0); // cast required by Sun CC 5.5 + return 1; } Q_DESTRUCTOR_FUNCTION(qUnregisterGuiGetInterpolator) -- cgit v0.12 From 0a37c9bbf9dc95e0ad422007718a7af11b046deb Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Thu, 4 Jun 2009 11:11:15 +0200 Subject: Make the bench a bit faster. Reviewed-by:TrustMe --- tests/benchmarks/qpixmapcache/tst_qpixmapcache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/benchmarks/qpixmapcache/tst_qpixmapcache.cpp b/tests/benchmarks/qpixmapcache/tst_qpixmapcache.cpp index f3c1134..9dafff5 100644 --- a/tests/benchmarks/qpixmapcache/tst_qpixmapcache.cpp +++ b/tests/benchmarks/qpixmapcache/tst_qpixmapcache.cpp @@ -156,9 +156,9 @@ struct styleStruct { int height; bool operator==(const styleStruct &str) const { - return str.key == key && str.state == state && str.direction == direction + return str.state == state && str.direction == direction && str.complex == complex && str.palette == palette && str.width == width - && str.height == height; + && str.height == height && str.key == key; } }; -- cgit v0.12 From 59653437cbc37f9644aa540c46701c2142939198 Mon Sep 17 00:00:00 2001 From: jasplin Date: Thu, 4 Jun 2009 11:37:08 +0200 Subject: Removed the internal UsePixmapCache flag in the style code. In the style code, the internal UsePixmapCache flag made no sense in practice, so it was removed. A fortunate side-effect of the patch is that the code is now accepted by Sun CC 5.5. Reviewed-by: jbache --- src/gui/styles/qcleanlooksstyle.cpp | 30 ++++++++----------- src/gui/styles/qgtkstyle.cpp | 1 - src/gui/styles/qplastiquestyle.cpp | 57 ++++++++++++++----------------------- src/gui/styles/qstyle_p.h | 2 +- src/gui/styles/qstylehelper.cpp | 1 - src/gui/styles/qstylehelper_p.h | 1 - 6 files changed, 35 insertions(+), 57 deletions(-) diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp index 5c37794..b33dfc1 100644 --- a/src/gui/styles/qcleanlooksstyle.cpp +++ b/src/gui/styles/qcleanlooksstyle.cpp @@ -1664,7 +1664,7 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o } painter->fillRect(r, gradient); - if (!UsePixmapCache || !QPixmapCache::find(pixmapName, cache)) { + if (!QPixmapCache::find(pixmapName, cache)) { cache = QPixmap(r.size()); cache.fill(Qt::transparent); QRect pixmapRect(0, 0, r.width(), r.height()); @@ -1683,8 +1683,7 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o cachePainter.drawLine(pixmapRect.topRight() + QPoint(-1, 3), pixmapRect.bottomRight() + QPoint(-1, -3)); cachePainter.setPen(QPen(option->palette.light().color())); cachePainter.drawLine(pixmapRect.topRight() + QPoint(0, 3), pixmapRect.bottomRight() + QPoint(0, -3)); } cachePainter.end(); - if (UsePixmapCache) - QPixmapCache::insert(pixmapName, cache); + QPixmapCache::insert(pixmapName, cache); } painter->drawPixmap(r.topLeft(), cache); } @@ -2438,7 +2437,7 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast(option)) { QPixmap cache; QString pixmapName = QStyleHelper::uniqueName(QLatin1String("spinbox"), spinBox, spinBox->rect.size()); - if (!UsePixmapCache || !QPixmapCache::find(pixmapName, cache)) { + if (!QPixmapCache::find(pixmapName, cache)) { cache = QPixmap(spinBox->rect.size()); cache.fill(Qt::transparent); QRect pixmapRect(0, 0, spinBox->rect.width(), spinBox->rect.height()); @@ -2655,8 +2654,7 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp cachePainter.fillRect(downRect.adjusted(1, 0, 0, 0), disabledColor); } cachePainter.end(); - if (UsePixmapCache) - QPixmapCache::insert(pixmapName, cache); + QPixmapCache::insert(pixmapName, cache); } painter->drawPixmap(spinBox->rect.topLeft(), cache); } @@ -3187,7 +3185,7 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp if (isEnabled) pixmapName += QLatin1String("-enabled"); - if (!UsePixmapCache || !QPixmapCache::find(pixmapName, cache)) { + if (!QPixmapCache::find(pixmapName, cache)) { cache = QPixmap(comboBox->rect.size()); cache.fill(Qt::transparent); QPainter cachePainter(&cache); @@ -3314,8 +3312,7 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp drawPrimitive(PE_FrameFocusRect, &focus, &cachePainter, widget); } cachePainter.end(); - if (UsePixmapCache) - QPixmapCache::insert(pixmapName, cache); + QPixmapCache::insert(pixmapName, cache); } painter->drawPixmap(comboBox->rect.topLeft(), cache); } @@ -3406,7 +3403,7 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp QRect pixmapRect(0, 0, groove.width(), groove.height()); // draw background groove - if (!UsePixmapCache || !QPixmapCache::find(groovePixmapName, cache)) { + if (!QPixmapCache::find(groovePixmapName, cache)) { cache = QPixmap(pixmapRect.size()); cache.fill(Qt::transparent); QPainter groovePainter(&cache); @@ -3433,15 +3430,14 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp groovePainter.setBrush(gradient); groovePainter.drawRect(pixmapRect.adjusted(1, 1, -2, -2)); groovePainter.end(); - if (UsePixmapCache) - QPixmapCache::insert(groovePixmapName, cache); + QPixmapCache::insert(groovePixmapName, cache); } painter->drawPixmap(groove.topLeft(), cache); // draw blue groove highlight QRect clipRect; groovePixmapName += QLatin1String("_blue"); - if (!UsePixmapCache || !QPixmapCache::find(groovePixmapName, cache)) { + if (!QPixmapCache::find(groovePixmapName, cache)) { cache = QPixmap(pixmapRect.size()); cache.fill(Qt::transparent); QPainter groovePainter(&cache); @@ -3460,8 +3456,7 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp groovePainter.setBrush(gradient); groovePainter.drawRect(pixmapRect.adjusted(1, 1, -2, -2)); groovePainter.end(); - if (UsePixmapCache) - QPixmapCache::insert(groovePixmapName, cache); + QPixmapCache::insert(groovePixmapName, cache); } if (horizontal) { if (slider->upsideDown) @@ -3483,7 +3478,7 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp // draw handle if ((option->subControls & SC_SliderHandle) ) { QString handlePixmapName = QStyleHelper::uniqueName(QLatin1String("slider_handle"), option, handle.size()); - if (!UsePixmapCache || !QPixmapCache::find(handlePixmapName, cache)) { + if (!QPixmapCache::find(handlePixmapName, cache)) { cache = QPixmap(handle.size()); cache.fill(Qt::transparent); QRect pixmapRect(0, 0, handle.width(), handle.height()); @@ -3564,8 +3559,7 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp } } handlePainter.end(); - if (UsePixmapCache) - QPixmapCache::insert(handlePixmapName, cache); + QPixmapCache::insert(handlePixmapName, cache); } painter->drawPixmap(handle.topLeft(), cache); diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index 151dab0..1fe4627 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -176,7 +176,6 @@ public: static const int groupBoxBottomMargin = 2; // space below the groupbox static const int groupBoxTitleMargin = 6; // space between contents and title static const int groupBoxTopMargin = 2; -static bool UsePixmapCache = true; // Get size of the arrow controls in a GtkSpinButton static int spinboxArrowSize() diff --git a/src/gui/styles/qplastiquestyle.cpp b/src/gui/styles/qplastiquestyle.cpp index 91ad64e..01c0e44 100644 --- a/src/gui/styles/qplastiquestyle.cpp +++ b/src/gui/styles/qplastiquestyle.cpp @@ -43,7 +43,6 @@ #if !defined(QT_NO_STYLE_PLASTIQUE) || defined(QT_PLUGIN) -static bool UsePixmapCache = true; static const bool AnimateBusyProgressBar = true; static const bool AnimateProgressBar = false; // #define QPlastique_MaskButtons @@ -491,7 +490,7 @@ static void qBrushSetAlphaF(QBrush *brush, qreal alpha) QPixmap texture = brush->texture(); QPixmap pixmap; QString name = QString::fromLatin1("qbrushtexture-alpha-%1-%2").arg(alpha).arg(texture.cacheKey()); - if (UsePixmapCache && !QPixmapCache::find(name, pixmap)) { + if (!QPixmapCache::find(name, pixmap)) { QImage image = texture.toImage(); QRgb *rgb = reinterpret_cast(image.bits()); int pixels = image.width() * image.height(); @@ -552,7 +551,7 @@ static QBrush qBrushLight(QBrush brush, int light) QPixmap texture = brush.texture(); QPixmap pixmap; QString name = QString::fromLatin1("qbrushtexture-light-%1-%2").arg(light).arg(texture.cacheKey()); - if (UsePixmapCache && !QPixmapCache::find(name, pixmap)) { + if (!QPixmapCache::find(name, pixmap)) { QImage image = texture.toImage(); QRgb *rgb = reinterpret_cast(image.bits()); int pixels = image.width() * image.height(); @@ -611,7 +610,7 @@ static QBrush qBrushDark(QBrush brush, int dark) QPixmap texture = brush.texture(); QPixmap pixmap; QString name = QString::fromLatin1("qbrushtexture-dark-%1-%2").arg(dark).arg(brush.texture().cacheKey()); - if (UsePixmapCache && !QPixmapCache::find(name, pixmap)) { + if (!QPixmapCache::find(name, pixmap)) { QImage image = texture.toImage(); QRgb *rgb = reinterpret_cast(image.bits()); int pixels = image.width() * image.height(); @@ -750,8 +749,7 @@ static void qt_plastique_draw_gradient(QPainter *painter, const QRect &rect, con QPainter *p = painter; QRect r = rect; - bool doPixmapCache = UsePixmapCache - && painter->deviceTransform().isIdentity() + bool doPixmapCache = painter->deviceTransform().isIdentity() && painter->worldMatrix().isIdentity(); if (doPixmapCache && QPixmapCache::find(gradientName, cache)) { painter->drawPixmap(rect, cache); @@ -1006,8 +1004,6 @@ QPlastiqueStylePrivate::QPlastiqueStylePrivate() : , progressBarAnimateTimer(0) #endif { - if (!qgetenv("QT_STYLE_NO_PIXMAPCACHE").isNull()) - UsePixmapCache = false; } /*! @@ -1517,7 +1513,7 @@ void QPlastiqueStyle::drawPrimitive(PrimitiveElement element, const QStyleOption } #endif QString pixmapName = uniqueName(QLatin1String("toolbarhandle"), option, rect.size()); - if (!UsePixmapCache || !QPixmapCache::find(pixmapName, cache)) { + if (!QPixmapCache::find(pixmapName, cache)) { cache = QPixmap(rect.size()); cache.fill(Qt::transparent); QPainter cachePainter(&cache); @@ -1547,8 +1543,7 @@ void QPlastiqueStyle::drawPrimitive(PrimitiveElement element, const QStyleOption handle); } cachePainter.end(); - if (UsePixmapCache) - QPixmapCache::insert(pixmapName, cache); + QPixmapCache::insert(pixmapName, cache); } painter->drawPixmap(rect.topLeft(), cache); break; @@ -2786,7 +2781,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op QString progressBarName = uniqueName(QLatin1String("progressBarContents"), option, rect.size()); QPixmap cache; - if ((!UsePixmapCache || !QPixmapCache::find(progressBarName, cache)) && rect.height() > 7) { + if (!QPixmapCache::find(progressBarName, cache) && rect.height() > 7) { QSize size = rect.size(); cache = QPixmap(QSize(size.width() - 6 + 30, size.height() - 6)); cache.fill(Qt::white); @@ -2819,8 +2814,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op leftEdge += 10; } - if (UsePixmapCache) - QPixmapCache::insert(progressBarName, cache); + QPixmapCache::insert(progressBarName, cache); } painter->setClipRect(progressBar.adjusted(1, 0, -1, -1)); @@ -2848,7 +2842,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op pixmapName += QString::number(- int(header->position)); pixmapName += QString::number(- int(header->orientation)); - if (!UsePixmapCache || !QPixmapCache::find(pixmapName, cache)) { + if (!QPixmapCache::find(pixmapName, cache)) { cache = QPixmap(option->rect.size()); cache.fill(Qt::white); QRect pixmapRect(0, 0, option->rect.width(), option->rect.height()); @@ -2892,8 +2886,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op cachePainter.drawLines(lines, 2); cachePainter.end(); - if (UsePixmapCache) - QPixmapCache::insert(pixmapName, cache); + QPixmapCache::insert(pixmapName, cache); } painter->drawPixmap(option->rect.topLeft(), cache); @@ -3093,7 +3086,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op if ((option->state & State_Selected)) { QPixmap cache; QString pixmapName = uniqueName(QLatin1String("menubaritem"), option, option->rect.size()); - if (!UsePixmapCache || !QPixmapCache::find(pixmapName, cache)) { + if (!QPixmapCache::find(pixmapName, cache)) { cache = QPixmap(option->rect.size()); cache.fill(Qt::white); QRect pixmapRect(0, 0, option->rect.width(), option->rect.height()); @@ -3143,8 +3136,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op lines[1] = QLine(rect.right() - 1, rect.top() + 1, rect.right() - 1, rect.bottom() - 2); cachePainter.drawLines(lines, 2); cachePainter.end(); - if (UsePixmapCache) - QPixmapCache::insert(pixmapName, cache); + QPixmapCache::insert(pixmapName, cache); } painter->drawPixmap(option->rect.topLeft(), cache); } else { @@ -3458,7 +3450,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op QString addLinePixmapName = uniqueName(QLatin1String("scrollbar_addline"), option, option->rect.size()); QPixmap cache; - if (!UsePixmapCache || !QPixmapCache::find(addLinePixmapName, cache)) { + if (!QPixmapCache::find(addLinePixmapName, cache)) { cache = QPixmap(option->rect.size()); cache.fill(Qt::white); QRect pixmapRect(0, 0, cache.width(), cache.height()); @@ -3517,8 +3509,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op addLinePainter.drawImage(QPoint(pixmapRect.center().x() - 3, pixmapRect.center().y() - 2), arrow); } addLinePainter.end(); - if (UsePixmapCache) - QPixmapCache::insert(addLinePixmapName, cache); + QPixmapCache::insert(addLinePixmapName, cache); } painter->drawPixmap(option->rect.topLeft(), cache); } @@ -3536,7 +3527,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op groovePixmapName += QLatin1String("-addpage"); QPixmap cache; - if (!UsePixmapCache || !QPixmapCache::find(groovePixmapName, cache)) { + if (!QPixmapCache::find(groovePixmapName, cache)) { cache = QPixmap(option->rect.size()); cache.fill(option->palette.background().color()); QPainter groovePainter(&cache); @@ -3562,8 +3553,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op } groovePainter.end(); - if (UsePixmapCache) - QPixmapCache::insert(groovePixmapName, cache); + QPixmapCache::insert(groovePixmapName, cache); } painter->drawPixmap(option->rect.topLeft(), cache); } @@ -3591,7 +3581,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op QString subLinePixmapName = uniqueName(QLatin1String("scrollbar_subline"), option, button1.size()); QPixmap cache; - if (!UsePixmapCache || !QPixmapCache::find(subLinePixmapName, cache)) { + if (!QPixmapCache::find(subLinePixmapName, cache)) { cache = QPixmap(button1.size()); cache.fill(Qt::white); QRect pixmapRect(0, 0, cache.width(), cache.height()); @@ -3651,8 +3641,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op subLinePainter.drawImage(QPoint(pixmapRect.center().x() - 3, pixmapRect.center().y() - 2), arrow); } subLinePainter.end(); - if (UsePixmapCache) - QPixmapCache::insert(subLinePixmapName, cache); + QPixmapCache::insert(subLinePixmapName, cache); } painter->drawPixmap(button1.topLeft(), cache); painter->drawPixmap(button2.topLeft(), cache); @@ -3670,7 +3659,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op sliderPixmapName += QLatin1String("-horizontal"); QPixmap cache; - if (!UsePixmapCache || !QPixmapCache::find(sliderPixmapName, cache)) { + if (!QPixmapCache::find(sliderPixmapName, cache)) { cache = QPixmap(option->rect.size()); cache.fill(Qt::white); QRect pixmapRect(0, 0, cache.width(), cache.height()); @@ -3741,8 +3730,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op } sliderPainter.end(); // insert the slider into the cache - if (UsePixmapCache) - QPixmapCache::insert(sliderPixmapName, cache); + QPixmapCache::insert(sliderPixmapName, cache); } painter->drawPixmap(option->rect.topLeft(), cache); } @@ -3892,7 +3880,7 @@ void QPlastiqueStyle::drawComplexControl(ComplexControl control, const QStyleOpt if ((option->activeSubControls & SC_SliderHandle) && (option->state & State_Sunken)) handlePixmapName += QLatin1String("-sunken"); - if (!UsePixmapCache || !QPixmapCache::find(handlePixmapName, cache)) { + if (!QPixmapCache::find(handlePixmapName, cache)) { cache = QPixmap(handle.size()); cache.fill(Qt::white); QRect pixmapRect(0, 0, handle.width(), handle.height()); @@ -3975,8 +3963,7 @@ void QPlastiqueStyle::drawComplexControl(ComplexControl control, const QStyleOpt } handlePainter.drawImage(pixmapRect, image); handlePainter.end(); - if (UsePixmapCache) - QPixmapCache::insert(handlePixmapName, cache); + QPixmapCache::insert(handlePixmapName, cache); } painter->drawPixmap(handle.topLeft(), cache); diff --git a/src/gui/styles/qstyle_p.h b/src/gui/styles/qstyle_p.h index 848bad6..154321a 100644 --- a/src/gui/styles/qstyle_p.h +++ b/src/gui/styles/qstyle_p.h @@ -77,7 +77,7 @@ public: QPainter *p = painter; \ QString unique = uniqueName((a), option, option->rect.size()); \ int txType = painter->deviceTransform().type() | painter->worldTransform().type(); \ - bool doPixmapCache = UsePixmapCache && txType <= QTransform::TxTranslate; \ + bool doPixmapCache = txType <= QTransform::TxTranslate; \ if (doPixmapCache && QPixmapCache::find(unique, internalPixmapCache)) { \ painter->drawPixmap(option->rect.topLeft(), internalPixmapCache); \ } else { \ diff --git a/src/gui/styles/qstylehelper.cpp b/src/gui/styles/qstylehelper.cpp index 69f8cd2..20de892 100644 --- a/src/gui/styles/qstylehelper.cpp +++ b/src/gui/styles/qstylehelper.cpp @@ -51,7 +51,6 @@ QT_BEGIN_NAMESPACE namespace QStyleHelper { -const bool UsePixmapCache = true; QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size) { diff --git a/src/gui/styles/qstylehelper_p.h b/src/gui/styles/qstylehelper_p.h index 5385d9f..ef6e66c 100644 --- a/src/gui/styles/qstylehelper_p.h +++ b/src/gui/styles/qstylehelper_p.h @@ -66,7 +66,6 @@ class QStyleOption; namespace QStyleHelper { - extern const bool UsePixmapCache; QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size); #ifndef QT_NO_DIAL qreal angle(const QPointF &p1, const QPointF &p2); -- cgit v0.12 From 57ba2d64ba2f261e869ec5242350fc41906e5f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Thu, 4 Jun 2009 12:16:36 +0200 Subject: Enable valgrind on Mac OS X as well. --- src/testlib/qbenchmark_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testlib/qbenchmark_p.h b/src/testlib/qbenchmark_p.h index b6340f8..f3cd094 100644 --- a/src/testlib/qbenchmark_p.h +++ b/src/testlib/qbenchmark_p.h @@ -55,7 +55,7 @@ #include -#if defined(Q_OS_LINUX) && !defined(QT_NO_PROCESS) +#if (defined(Q_OS_LINUX) || defined Q_OS_MAC) && !defined(QT_NO_PROCESS) #define QTESTLIB_USE_VALGRIND #else #undef QTESTLIB_USE_VALGRIND -- cgit v0.12 From ba4d556e7c9f0f6f2c02893326eec76c21f46fc7 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 4 Jun 2009 12:34:31 +0200 Subject: qdoc: Put ... around accessor names. --- tools/qdoc3/htmlgenerator.cpp | 45 ++++++++++++++++++++++++++++--------------- tools/qdoc3/htmlgenerator.h | 1 + 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index a2a7184..ab26d08 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -447,21 +447,24 @@ int HtmlGenerator::generateAtom(const Atom *atom, out() << formattingRightMap()[ATOM_FORMATTING_TELETYPE]; break; case Atom::Code: - out() << "
" << trimmedTrailing(highlightedCode(indent(codeIndent, atom->string()),
-                                                            marker, relative))
+	out() << "
"
+              << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
+                                                 marker,relative))
               << "
\n"; break; #ifdef QDOC_QML case Atom::Qml: - out() << "
" << trimmedTrailing(highlightedCode(indent(codeIndent, atom->string()),
-                                                            marker, relative))
+	out() << "
"
+              << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
+                                                 marker,relative))
               << "
\n"; break; #endif case Atom::CodeNew: out() << "

you can rewrite it as

\n" - << "
" << trimmedTrailing(highlightedCode(indent(codeIndent, atom->string()),
-                                                            marker, relative))
+              << "
"
+              << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
+                                                 marker,relative))
               << "
\n"; break; case Atom::CodeOld: @@ -469,7 +472,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, // fallthrough case Atom::CodeBad: out() << "
"
-              << trimmedTrailing(protect(plainCode(indent(codeIndent, atom->string()))))
+              << trimmedTrailing(protect(plainCode(indent(codeIndent,atom->string()))))
               << "
\n"; break; case Atom::FootnoteLeft: @@ -1533,17 +1536,19 @@ void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker, void HtmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker) { if (!inner->includes().isEmpty()) { - out() << "
" << trimmedTrailing(highlightedCode(indent(codeIndent,
-                                                                   marker->markedUpIncludes(
-                                                                        inner->includes())),
-                                                                        marker, inner))
+        out() << "
"
+              << trimmedTrailing(highlightedCode(indent(codeIndent,
+                                                        marker->markedUpIncludes(inner->includes())),
+                                                 marker,inner))
               << "
"; } } -void HtmlGenerator::generateTableOfContents(const Node *node, CodeMarker *marker, +void HtmlGenerator::generateTableOfContents(const Node *node, + CodeMarker *marker, Doc::SectioningUnit sectioningUnit, - int numColumns, const Node *relative) + int numColumns, + const Node *relative) { if (!node->doc().hasTableOfContents()) @@ -2302,12 +2307,13 @@ void HtmlGenerator::generateSynopsis(const Node *node, marked.replace("<@type>", ""); marked.replace("", ""); } - out() << highlightedCode(marked, marker, relative, nameAlignment); + out() << highlightedCode(marked, marker, relative, style, nameAlignment); } QString HtmlGenerator::highlightedCode(const QString& markedCode, CodeMarker *marker, const Node *relative, + CodeMarker::SynopsisStyle style, bool nameAlignment) { QString src = markedCode; @@ -2320,15 +2326,24 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, // replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*()" static const QString linkTag("link"); + if (src.contains("setAcceptDrops")) + qDebug() << "SRC:" << src; + bool done = false; for (int i = 0, n = src.size(); i < n;) { if (src.at(i) == charLangle && src.at(i + 1).unicode() == '@') { - if (nameAlignment) // && (i != 0)) Why was this here? + if (nameAlignment && !done) {// && (i != 0)) Why was this here? html += ""; + done = true; + } i += 2; if (parseArg(src, linkTag, &i, n, &arg, &par1)) { + if (style == CodeMarker::Accessors) + html += ""; QString link = linkForNode( CodeMarker::nodeForString(par1.toString()), relative); addLink(link, arg, &html); + if (style == CodeMarker::Accessors) + html += ""; } else { html += charLangle; diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index ec9532f..36a2e30 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -158,6 +158,7 @@ class HtmlGenerator : public PageGenerator QString highlightedCode(const QString& markedCode, CodeMarker *marker, const Node *relative, + CodeMarker::SynopsisStyle style = CodeMarker::Accessors, bool nameAlignment = false); #else void generateSynopsis(const Node *node, -- cgit v0.12 From c2bad7dba5eccd5450eaf7eddaebc75b8410fa95 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Thu, 4 Jun 2009 12:36:16 +0200 Subject: Add an extra explanation for the API extension. Reviewed-by:David Boddie --- src/gui/image/qpixmapcache.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp index 82b42b4..bdcddfd 100644 --- a/src/gui/image/qpixmapcache.cpp +++ b/src/gui/image/qpixmapcache.cpp @@ -65,7 +65,10 @@ QT_BEGIN_NAMESPACE object for caching the pixmaps. The cache associates a pixmap with a string as a key or with a QPixmapCache::Key. - The QPixmapCache::Key is faster than using strings as key. + The QPixmapCache::Key is faster than using strings as key. The string API is + very convenient for complex keys but the QPixmapCache::Key API will be very efficient + and convenient for a 1 object <-> 1 pixmap mapping (then you can store the key as + a member). If two pixmaps are inserted into the cache using equal keys, then the last pixmap will hide the first pixmap. The QHash and QCache classes do exactly the same. -- cgit v0.12 From e3a562e8d2e5767eef0070dacc01859c0acc142f Mon Sep 17 00:00:00 2001 From: jasplin Date: Thu, 4 Jun 2009 13:07:20 +0200 Subject: Forgot to remove old code in d5231e0593dcbf226e0ca3d679c2547e8e1c9697. Reviewed-by: TrustMe --- src/gui/animation/qguivariantanimation.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/animation/qguivariantanimation.cpp b/src/gui/animation/qguivariantanimation.cpp index 75532f6..bcffb85 100644 --- a/src/gui/animation/qguivariantanimation.cpp +++ b/src/gui/animation/qguivariantanimation.cpp @@ -65,7 +65,6 @@ Q_CONSTRUCTOR_FUNCTION(qRegisterGuiGetInterpolator) static int qUnregisterGuiGetInterpolator() { - qRegisterAnimationInterpolator(0); qRegisterAnimationInterpolator( (QVariant (*)(const QColor &, const QColor &, qreal))0); // cast required by Sun CC 5.5 -- 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 84e2c537c48122ec6ada0becca701b3b4b6715b1 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Thu, 4 Jun 2009 13:45:00 +0200 Subject: Make inverted appearance work for progressbar in QMacStyle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HITheme doesn't seem to support the reverse thing. I filled a bug about it, but this is easy to emulate in the horizontal case and the "Inverted" orientation works great for vertical. Task-number: 217594 Reviewed-by: Morten Sørvig --- src/gui/styles/qmacstyle_mac.mm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 43efedf..99894ad 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -4339,7 +4339,19 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter tdi.enableState = kThemeTrackDisabled; else tdi.enableState = kThemeTrackActive; - HIThemeDrawTrack(&tdi, 0, cg, kHIThemeOrientationNormal); + HIThemeOrientation drawOrientation = kHIThemeOrientationNormal; + if (reverse) { + if (vertical) { + drawOrientation = kHIThemeOrientationInverted; + } else { + CGContextSaveGState(cg); + CGContextTranslateCTM(cg, pb->rect.width(), 0); + CGContextScaleCTM(cg, -1, 1); + } + } + HIThemeDrawTrack(&tdi, 0, cg, drawOrientation); + if (reverse && !vertical) + CGContextRestoreGState(cg); } break; case CE_ProgressBarLabel: -- cgit v0.12 From 788a05859a2e6b4533c7b5727952818c95c49568 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 4 Jun 2009 13:23:21 +0200 Subject: Add some compile tests for QStringBuilder. --- tests/auto/qstringbuilder/qstringbuilder.pro | 5 + tests/auto/qstringbuilder/scenario1.cpp | 1 + tests/auto/qstringbuilder/scenario1.pro | 8 + tests/auto/qstringbuilder/scenario2.cpp | 1 + tests/auto/qstringbuilder/scenario2.pro | 7 + tests/auto/qstringbuilder/scenario3.cpp | 1 + tests/auto/qstringbuilder/scenario3.pro | 7 + tests/auto/qstringbuilder/scenario4.cpp | 1 + tests/auto/qstringbuilder/scenario4.pro | 7 + tests/auto/qstringbuilder/tst_qstringbuilder.cpp | 182 +++++++++++++++++++++++ 10 files changed, 220 insertions(+) create mode 100644 tests/auto/qstringbuilder/qstringbuilder.pro create mode 100644 tests/auto/qstringbuilder/scenario1.cpp create mode 100644 tests/auto/qstringbuilder/scenario1.pro create mode 100644 tests/auto/qstringbuilder/scenario2.cpp create mode 100644 tests/auto/qstringbuilder/scenario2.pro create mode 100644 tests/auto/qstringbuilder/scenario3.cpp create mode 100644 tests/auto/qstringbuilder/scenario3.pro create mode 100644 tests/auto/qstringbuilder/scenario4.cpp create mode 100644 tests/auto/qstringbuilder/scenario4.pro create mode 100644 tests/auto/qstringbuilder/tst_qstringbuilder.cpp diff --git a/tests/auto/qstringbuilder/qstringbuilder.pro b/tests/auto/qstringbuilder/qstringbuilder.pro new file mode 100644 index 0000000..c5a26d3 --- /dev/null +++ b/tests/auto/qstringbuilder/qstringbuilder.pro @@ -0,0 +1,5 @@ + +TEMPLATE = subdirs +SUBDIRS = scenario1.pro scenario2.pro scenario3.pro scenario4.pro + + diff --git a/tests/auto/qstringbuilder/scenario1.cpp b/tests/auto/qstringbuilder/scenario1.cpp new file mode 100644 index 0000000..26b4ed3 --- /dev/null +++ b/tests/auto/qstringbuilder/scenario1.cpp @@ -0,0 +1 @@ +#include "tst_qstringbuilder.cpp" diff --git a/tests/auto/qstringbuilder/scenario1.pro b/tests/auto/qstringbuilder/scenario1.pro new file mode 100644 index 0000000..4ce7156 --- /dev/null +++ b/tests/auto/qstringbuilder/scenario1.pro @@ -0,0 +1,8 @@ +load(qttest_p4) + +QT = core + +SOURCES += scenario1.cpp + +DEFINES += SCENARIO=1 + diff --git a/tests/auto/qstringbuilder/scenario2.cpp b/tests/auto/qstringbuilder/scenario2.cpp new file mode 100644 index 0000000..26b4ed3 --- /dev/null +++ b/tests/auto/qstringbuilder/scenario2.cpp @@ -0,0 +1 @@ +#include "tst_qstringbuilder.cpp" diff --git a/tests/auto/qstringbuilder/scenario2.pro b/tests/auto/qstringbuilder/scenario2.pro new file mode 100644 index 0000000..64c46e2 --- /dev/null +++ b/tests/auto/qstringbuilder/scenario2.pro @@ -0,0 +1,7 @@ +load(qttest_p4) + +QT = core + +SOURCES += scenario2.cpp + +DEFINES += SCENARIO=2 diff --git a/tests/auto/qstringbuilder/scenario3.cpp b/tests/auto/qstringbuilder/scenario3.cpp new file mode 100644 index 0000000..26b4ed3 --- /dev/null +++ b/tests/auto/qstringbuilder/scenario3.cpp @@ -0,0 +1 @@ +#include "tst_qstringbuilder.cpp" diff --git a/tests/auto/qstringbuilder/scenario3.pro b/tests/auto/qstringbuilder/scenario3.pro new file mode 100644 index 0000000..beedffd --- /dev/null +++ b/tests/auto/qstringbuilder/scenario3.pro @@ -0,0 +1,7 @@ +load(qttest_p4) + +QT = core + +SOURCES += scenario3.cpp + +DEFINES += SCENARIO=3 diff --git a/tests/auto/qstringbuilder/scenario4.cpp b/tests/auto/qstringbuilder/scenario4.cpp new file mode 100644 index 0000000..26b4ed3 --- /dev/null +++ b/tests/auto/qstringbuilder/scenario4.cpp @@ -0,0 +1 @@ +#include "tst_qstringbuilder.cpp" diff --git a/tests/auto/qstringbuilder/scenario4.pro b/tests/auto/qstringbuilder/scenario4.pro new file mode 100644 index 0000000..1c45a70 --- /dev/null +++ b/tests/auto/qstringbuilder/scenario4.pro @@ -0,0 +1,7 @@ +load(qttest_p4) + +QT = core + +SOURCES += scenario4.cpp + +DEFINES += SCENARIO=4 diff --git a/tests/auto/qstringbuilder/tst_qstringbuilder.cpp b/tests/auto/qstringbuilder/tst_qstringbuilder.cpp new file mode 100644 index 0000000..f5df79e --- /dev/null +++ b/tests/auto/qstringbuilder/tst_qstringbuilder.cpp @@ -0,0 +1,182 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// This is included in various .cpp files as a compile test for various scenarios +// depending on NO_CAST_* and QT_USE_FAST_OPERATOR_PLUS and QT_USE_FAST_CONCATENATION + +#if SCENARIO == 1 +// this is the "no harm done" version. Only operator% is active, +// with NO_CAST * defined +#define P % +#undef QT_USE_FAST_OPERATOR_PLUS +#undef QT_USE_FAST_CONCATENATION +#define QT_NO_CAST_FROM_ASCII +#define QT_NO_CAST_TO_ASCII +#endif + + +#if SCENARIO == 2 +// this is the "full" version. Operator+ is replaced by a QStringBuilder +// based version +// with NO_CAST * defined +#define P + +#define QT_USE_FAST_OPERATOR_PLUS +#define QT_USE_FAST_CONCATENATION +#define QT_NO_CAST_FROM_ASCII +#define QT_NO_CAST_TO_ASCII +#endif + +#if SCENARIO == 3 +// this is the "no harm done" version. Only operator% is active, +// with NO_CAST * _not_ defined +#define P % +#undef QT_USE_FAST_OPERATOR_PLUS +#undef QT_USE_FAST_CONCATENATION +#undef QT_NO_CAST_FROM_ASCII +#undef QT_NO_CAST_TO_ASCII +#endif + +#if SCENARIO == 4 +// this is the "full" version. Operator+ is replaced by a QStringBuilder +// based version +// with NO_CAST * _not_ defined +#define P + +#define QT_USE_FAST_OPERATOR_PLUS +#define QT_USE_FAST_CONCATENATION +#undef QT_NO_CAST_FROM_ASCII +#undef QT_NO_CAST_TO_ASCII +#endif + + +#include + +//TESTED_CLASS=QStringBuilder +//TESTED_FILES=qstringbuilder.cpp + +#include + +#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 + +public: + tst_QStringBuilder() {} + ~tst_QStringBuilder() {} + +public slots: + void init() {} + void cleanup() {} + + void scenario(); +}; + +void tst_QStringBuilder::scenario() +{ + QLatin1Literal l1literal(LITERAL); + QLatin1String l1string(LITERAL); + QString string(l1string); + QStringRef stringref(&string, 2, 10); + QLatin1Char achar('c'); + QString r2(QLatin1String(LITERAL LITERAL)); + QString r; + + r = l1literal P l1literal; + QCOMPARE(r, r2); + r = string P string; + QCOMPARE(r, r2); + r = stringref P stringref; + QCOMPARE(r, QString(stringref.toString() + stringref.toString())); + r = string P l1literal; + QCOMPARE(r, r2); + r = string P l1string; + QCOMPARE(r, r2); + r = string + achar; + QCOMPARE(r, QString(string P achar)); + r = achar + string; + QCOMPARE(r, QString(achar P string)); +#ifndef QT_NO_CAST_FROM_ASCII + r = string P LITERAL; + QCOMPARE(r, r2); + r = LITERAL P string; + QCOMPARE(r, r2); +#endif +} + +QTEST_APPLESS_MAIN(tst_QStringBuilder) + +#include "tst_qstringbuilder.moc" -- cgit v0.12 From 58900297b27f063b1b838a0c542218dd6d7246dd Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 4 Jun 2009 13:48:43 +0200 Subject: qdoc3: define QT_NO_CAST_TO_ASCII for safety, no code changes needed. --- tools/qdoc3/qdoc3.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro index 2bba8fb..ead7b88 100644 --- a/tools/qdoc3/qdoc3.pro +++ b/tools/qdoc3/qdoc3.pro @@ -1,5 +1,5 @@ DEFINES += QDOC2_COMPAT -#DEFINES += QT_NO_CAST_TO_ASCII +DEFINES += QT_NO_CAST_TO_ASCII #DEFINES += QT_NO_CAST_FROM_ASCII QT = core xml -- cgit v0.12 From 7e6b33b29057556903c37aadd0f48650641591fa Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 4 Jun 2009 14:11:01 +0200 Subject: kill usage of QT_STATEMACHINE_SOLUTION The define no longer exists. --- examples/statemachine/eventtransitions/main.cpp | 5 ----- examples/statemachine/factorial/main.cpp | 6 ------ examples/statemachine/pingpong/main.cpp | 5 ----- examples/statemachine/trafficlight/main.cpp | 5 ----- examples/statemachine/twowaybutton/main.cpp | 4 ---- 5 files changed, 25 deletions(-) diff --git a/examples/statemachine/eventtransitions/main.cpp b/examples/statemachine/eventtransitions/main.cpp index aba0c73..5959016 100644 --- a/examples/statemachine/eventtransitions/main.cpp +++ b/examples/statemachine/eventtransitions/main.cpp @@ -40,11 +40,6 @@ ****************************************************************************/ #include -#ifdef QT_STATEMACHINE_SOLUTION -#include -#include -#include -#endif //! [0] class Window : public QWidget diff --git a/examples/statemachine/factorial/main.cpp b/examples/statemachine/factorial/main.cpp index 1065eb8..bf3f80e 100644 --- a/examples/statemachine/factorial/main.cpp +++ b/examples/statemachine/factorial/main.cpp @@ -41,12 +41,6 @@ #include #include -#ifdef QT_STATEMACHINE_SOLUTION -#include -#include -#include -#include -#endif //! [0] class Factorial : public QObject diff --git a/examples/statemachine/pingpong/main.cpp b/examples/statemachine/pingpong/main.cpp index 331627e..586b422 100644 --- a/examples/statemachine/pingpong/main.cpp +++ b/examples/statemachine/pingpong/main.cpp @@ -41,11 +41,6 @@ #include #include -#ifdef QT_STATEMACHINE_SOLUTION -#include -#include -#include -#endif //! [0] class PingEvent : public QEvent diff --git a/examples/statemachine/trafficlight/main.cpp b/examples/statemachine/trafficlight/main.cpp index 8a46fff..23f4bed 100644 --- a/examples/statemachine/trafficlight/main.cpp +++ b/examples/statemachine/trafficlight/main.cpp @@ -40,11 +40,6 @@ ****************************************************************************/ #include -#ifdef QT_STATEMACHINE_SOLUTION -#include -#include -#include -#endif //! [0] class LightWidget : public QWidget diff --git a/examples/statemachine/twowaybutton/main.cpp b/examples/statemachine/twowaybutton/main.cpp index a2c6e45..f5afeca 100644 --- a/examples/statemachine/twowaybutton/main.cpp +++ b/examples/statemachine/twowaybutton/main.cpp @@ -40,10 +40,6 @@ ****************************************************************************/ #include -#ifdef QT_STATEMACHINE_SOLUTION -#include -#include -#endif //! [0] int main(int argc, char **argv) -- 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 e2382d731249dc57e7c538ec60b3f1f714741cfd Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Thu, 4 Jun 2009 14:32:33 +0200 Subject: move the QT_NO_ANIMATION macro to the right place (ie after other includes) --- src/corelib/animation/qabstractanimation.cpp | 4 ++-- src/corelib/animation/qanimationgroup.cpp | 4 ++-- src/corelib/animation/qparallelanimationgroup.cpp | 4 +++- src/corelib/animation/qpauseanimation.cpp | 4 ++-- src/corelib/animation/qpropertyanimation.cpp | 4 ++-- src/corelib/animation/qsequentialanimationgroup.cpp | 6 ++---- src/corelib/animation/qvariantanimation.cpp | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 61d61df..fcc63a4 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -142,8 +142,6 @@ \sa direction */ -#ifndef QT_NO_ANIMATION - #include "qabstractanimation.h" #include "qanimationgroup.h" #include @@ -155,6 +153,8 @@ #include #include +#ifndef QT_NO_ANIMATION + #define DEFAULT_TIMER_INTERVAL 16 QT_BEGIN_NAMESPACE diff --git a/src/corelib/animation/qanimationgroup.cpp b/src/corelib/animation/qanimationgroup.cpp index 839b522..e192a6c 100644 --- a/src/corelib/animation/qanimationgroup.cpp +++ b/src/corelib/animation/qanimationgroup.cpp @@ -89,13 +89,13 @@ \sa QAbstractAnimation, QVariantAnimation, {The Animation Framework} */ -#ifndef QT_NO_ANIMATION - #include "qanimationgroup.h" #include #include #include "qanimationgroup_p.h" +#ifndef QT_NO_ANIMATION + QT_BEGIN_NAMESPACE diff --git a/src/corelib/animation/qparallelanimationgroup.cpp b/src/corelib/animation/qparallelanimationgroup.cpp index 13f6073..c148cb5d 100644 --- a/src/corelib/animation/qparallelanimationgroup.cpp +++ b/src/corelib/animation/qparallelanimationgroup.cpp @@ -68,11 +68,13 @@ \sa QAnimationGroup, QPropertyAnimation, {The Animation Framework} */ -#ifndef QT_NO_ANIMATION #include "qparallelanimationgroup.h" #include "qparallelanimationgroup_p.h" //#define QANIMATION_DEBUG + +#ifndef QT_NO_ANIMATION + QT_BEGIN_NAMESPACE /*! diff --git a/src/corelib/animation/qpauseanimation.cpp b/src/corelib/animation/qpauseanimation.cpp index b175f0c..93043c2 100644 --- a/src/corelib/animation/qpauseanimation.cpp +++ b/src/corelib/animation/qpauseanimation.cpp @@ -62,12 +62,12 @@ \sa QSequentialAnimationGroup */ -#ifndef QT_NO_ANIMATION - #include "qpauseanimation.h" #include "qabstractanimation_p.h" +#ifndef QT_NO_ANIMATION + QT_BEGIN_NAMESPACE class QPauseAnimationPrivate : public QAbstractAnimationPrivate diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp index 357a6ac..65f1361 100644 --- a/src/corelib/animation/qpropertyanimation.cpp +++ b/src/corelib/animation/qpropertyanimation.cpp @@ -87,8 +87,6 @@ \sa QVariantAnimation, QAnimationGroup, {The Animation Framework} */ -#ifndef QT_NO_ANIMATION - #include "qpropertyanimation.h" #include "qanimationgroup.h" #include "qpropertyanimation_p.h" @@ -97,6 +95,8 @@ #include #include +#ifndef QT_NO_ANIMATION + QT_BEGIN_NAMESPACE typedef QPair QPropertyAnimationPair; diff --git a/src/corelib/animation/qsequentialanimationgroup.cpp b/src/corelib/animation/qsequentialanimationgroup.cpp index 14814a7..25db52f 100644 --- a/src/corelib/animation/qsequentialanimationgroup.cpp +++ b/src/corelib/animation/qsequentialanimationgroup.cpp @@ -77,8 +77,6 @@ \sa QAnimationGroup, QAbstractAnimation, {The Animation Framework} */ -#ifndef QT_NO_ANIMATION - #include "qsequentialanimationgroup.h" #include "qsequentialanimationgroup_p.h" @@ -86,9 +84,9 @@ #include -QT_BEGIN_NAMESPACE - +#ifndef QT_NO_ANIMATION +QT_BEGIN_NAMESPACE bool QSequentialAnimationGroupPrivate::atEnd() const { diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp index a3fa93a..ab73373 100644 --- a/src/corelib/animation/qvariantanimation.cpp +++ b/src/corelib/animation/qvariantanimation.cpp @@ -39,8 +39,6 @@ ** ****************************************************************************/ -#ifndef QT_NO_ANIMATION - #include "qvariantanimation.h" #include "qvariantanimation_p.h" @@ -49,6 +47,8 @@ #include #include +#ifndef QT_NO_ANIMATION + QT_BEGIN_NAMESPACE /*! -- 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 7eb85cdd2a507b6fa1f8023b26f8b34e2fe6f2c4 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 4 Jun 2009 15:12:00 +0200 Subject: Autotest: fix detection of generated files and strip the first line Reviewed-by: TrustMe --- tests/auto/headers/tst_headers.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/headers/tst_headers.cpp b/tests/auto/headers/tst_headers.cpp index 607d655..7e32deb 100644 --- a/tests/auto/headers/tst_headers.cpp +++ b/tests/auto/headers/tst_headers.cpp @@ -135,6 +135,9 @@ void tst_Headers::licenseCheck() QByteArray data = f.readAll(); QStringList content = QString::fromLocal8Bit(data.replace('\r',"")).split("\n"); + if (content.first().contains("generated")) + content.takeFirst(); + QVERIFY(licensePattern.exactMatch(content.at(7)) || licensePattern.exactMatch(content.at(4))); QString licenseType = licensePattern.cap(1); -- cgit v0.12 From 0d47438a75bef93ac15aba011d7bf931791e32f9 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 4 Jun 2009 15:27:17 +0200 Subject: Fix headers in the XUnit feature. All Qt headers must have QT_BEGIN_HEADER, QT_END_HEADER and QT_MODULE. These headers didn't have this. Reviewed-by: TrustMe --- src/testlib/qtestbasicstreamer.h | 6 ++++++ src/testlib/qtestcoreelement.h | 10 ++++++++-- src/testlib/qtestcorelist.h | 6 ++++++ src/testlib/qtestelement.h | 8 +++++++- src/testlib/qtestelementattribute.h | 8 +++++++- src/testlib/qtestfilelogger.h | 6 ++++++ src/testlib/qtestlightxmlstreamer.h | 8 +++++++- src/testlib/qtestxmlstreamer.h | 8 +++++++- src/testlib/qtestxunitstreamer.h | 8 +++++++- 9 files changed, 61 insertions(+), 7 deletions(-) diff --git a/src/testlib/qtestbasicstreamer.h b/src/testlib/qtestbasicstreamer.h index 527b1d4..61cdfd5 100644 --- a/src/testlib/qtestbasicstreamer.h +++ b/src/testlib/qtestbasicstreamer.h @@ -44,8 +44,12 @@ #include +QT_BEGIN_HEADER + QT_BEGIN_NAMESPACE +QT_MODULE(Test) + class QTestElement; class QTestElementAttribute; class QTestLogger; @@ -81,4 +85,6 @@ class QTestBasicStreamer QT_END_NAMESPACE +QT_END_HEADER + #endif diff --git a/src/testlib/qtestcoreelement.h b/src/testlib/qtestcoreelement.h index 4cf8fcb..907041f 100644 --- a/src/testlib/qtestcoreelement.h +++ b/src/testlib/qtestcoreelement.h @@ -42,11 +42,15 @@ #ifndef QTESTCOREELEMENT_H #define QTESTCOREELEMENT_H -#include "qtestcorelist.h" -#include "qtestelementattribute.h" +#include +#include + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE +QT_MODULE(Test) + template class QTestCoreElement: public QTestCoreList { @@ -163,4 +167,6 @@ const QTestElementAttribute *QTestCoreElement::attribute(QTest::Att QT_END_NAMESPACE +QT_END_HEADER + #endif diff --git a/src/testlib/qtestcorelist.h b/src/testlib/qtestcorelist.h index 686e157..9983b27 100644 --- a/src/testlib/qtestcorelist.h +++ b/src/testlib/qtestcorelist.h @@ -44,8 +44,12 @@ #include +QT_BEGIN_HEADER + QT_BEGIN_NAMESPACE +QT_MODULE(Test) + template class QTestCoreList { @@ -127,4 +131,6 @@ int QTestCoreList::count() QT_END_NAMESPACE +QT_END_HEADER + #endif diff --git a/src/testlib/qtestelement.h b/src/testlib/qtestelement.h index c1932da..e75689a 100644 --- a/src/testlib/qtestelement.h +++ b/src/testlib/qtestelement.h @@ -42,10 +42,14 @@ #ifndef QTESTELEMENT_H #define QTESTELEMENT_H -#include "qtestcoreelement.h" +#include + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE +QT_MODULE(Test) + class QTestElement: public QTestCoreElement { public: @@ -66,4 +70,6 @@ class QTestElement: public QTestCoreElement QT_END_NAMESPACE +QT_END_HEADER + #endif diff --git a/src/testlib/qtestelementattribute.h b/src/testlib/qtestelementattribute.h index 261f3f7..944d9c0 100644 --- a/src/testlib/qtestelementattribute.h +++ b/src/testlib/qtestelementattribute.h @@ -42,10 +42,14 @@ #ifndef QTESTELEMENTATTRIBUTE_H #define QTESTELEMENTATTRIBUTE_H -#include "qtestcorelist.h" +#include + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE +QT_MODULE(Test) + namespace QTest { enum AttributeIndex @@ -102,4 +106,6 @@ class QTestElementAttribute: public QTestCoreList QT_END_NAMESPACE +QT_END_HEADER + #endif diff --git a/src/testlib/qtestfilelogger.h b/src/testlib/qtestfilelogger.h index 892657d..f6a993d 100644 --- a/src/testlib/qtestfilelogger.h +++ b/src/testlib/qtestfilelogger.h @@ -44,8 +44,12 @@ #include +QT_BEGIN_HEADER + QT_BEGIN_NAMESPACE +QT_MODULE(Test) + class QTestFileLogger { public: @@ -58,4 +62,6 @@ class QTestFileLogger QT_END_NAMESPACE +QT_END_HEADER + #endif // QTESTFILELOGGER_H diff --git a/src/testlib/qtestlightxmlstreamer.h b/src/testlib/qtestlightxmlstreamer.h index 382a14a..3f564a8 100644 --- a/src/testlib/qtestlightxmlstreamer.h +++ b/src/testlib/qtestlightxmlstreamer.h @@ -42,10 +42,14 @@ #ifndef QTESTLIGHTXMLSTREAMER_H #define QTESTLIGHTXMLSTREAMER_H -#include "qtestbasicstreamer.h" +#include + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE +QT_MODULE(Test) + class QTestElement; class QTestElementAttribute; @@ -63,4 +67,6 @@ class QTestLightXmlStreamer: public QTestBasicStreamer QT_END_NAMESPACE +QT_END_HEADER + #endif diff --git a/src/testlib/qtestxmlstreamer.h b/src/testlib/qtestxmlstreamer.h index 58544a4..814bffc 100644 --- a/src/testlib/qtestxmlstreamer.h +++ b/src/testlib/qtestxmlstreamer.h @@ -42,10 +42,14 @@ #ifndef QTESTXMLSTREAMER_H #define QTESXMLSTREAMER_H -#include "qtestbasicstreamer.h" +#include + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE +QT_MODULE(Test) + class QTestElement; class QTestElementAttribute; @@ -63,4 +67,6 @@ class QTestXmlStreamer: public QTestBasicStreamer QT_END_NAMESPACE +QT_END_HEADER + #endif diff --git a/src/testlib/qtestxunitstreamer.h b/src/testlib/qtestxunitstreamer.h index b4b82f0..0e48b2c 100644 --- a/src/testlib/qtestxunitstreamer.h +++ b/src/testlib/qtestxunitstreamer.h @@ -42,10 +42,14 @@ #ifndef QTESTXUNITSTREAMER_H #define QTESTXUNITSTREAMER_H -#include "qtestbasicstreamer.h" +#include + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE +QT_MODULE(Test) + class QTestLogger; class QTestXunitStreamer: public QTestBasicStreamer @@ -68,4 +72,6 @@ class QTestXunitStreamer: public QTestBasicStreamer QT_END_NAMESPACE +QT_END_HEADER + #endif -- cgit v0.12 From fcd1059f05be695b78f42c02446b17ab143ce9c0 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 4 Jun 2009 15:35:19 +0200 Subject: kill bad QT_END_HEADER There should be no QT_{BEGIN,END}_HEADER here; this is a private header. --- src/gui/statemachine/qbasicmouseeventtransition_p.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/statemachine/qbasicmouseeventtransition_p.h b/src/gui/statemachine/qbasicmouseeventtransition_p.h index 6c0afe4..3161844 100644 --- a/src/gui/statemachine/qbasicmouseeventtransition_p.h +++ b/src/gui/statemachine/qbasicmouseeventtransition_p.h @@ -93,6 +93,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif -- cgit v0.12 From 5c23548a0a60ca25631cff2fa7f296fdbd15b78a Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 4 Jun 2009 16:05:19 +0200 Subject: add QT_NO_STATEMACHINE define so state machine can be compiled out Reviewed-by: Thierry Bastian --- src/corelib/global/qfeatures.txt | 7 +++++++ src/corelib/statemachine/qabstractstate.cpp | 5 +++++ src/corelib/statemachine/qabstractstate.h | 4 ++++ src/corelib/statemachine/qabstracttransition.cpp | 5 +++++ src/corelib/statemachine/qabstracttransition.h | 4 ++++ src/corelib/statemachine/qeventtransition.cpp | 5 +++++ src/corelib/statemachine/qeventtransition.h | 4 ++++ src/corelib/statemachine/qfinalstate.cpp | 5 +++++ src/corelib/statemachine/qfinalstate.h | 4 ++++ src/corelib/statemachine/qhistorystate.cpp | 5 +++++ src/corelib/statemachine/qhistorystate.h | 4 ++++ src/corelib/statemachine/qsignalevent.h | 4 ++++ src/corelib/statemachine/qsignaltransition.cpp | 5 +++++ src/corelib/statemachine/qsignaltransition.h | 4 ++++ src/corelib/statemachine/qstate.cpp | 5 +++++ src/corelib/statemachine/qstate.h | 4 ++++ src/corelib/statemachine/qstatemachine.cpp | 5 +++++ src/corelib/statemachine/qstatemachine.h | 4 ++++ src/corelib/statemachine/qwrappedevent.h | 4 ++++ src/gui/kernel/qapplication.cpp | 4 ++++ src/gui/statemachine/qbasickeyeventtransition.cpp | 5 +++++ src/gui/statemachine/qbasickeyeventtransition_p.h | 5 +++++ src/gui/statemachine/qbasicmouseeventtransition.cpp | 5 +++++ src/gui/statemachine/qbasicmouseeventtransition_p.h | 5 +++++ src/gui/statemachine/qguistatemachine.cpp | 5 +++++ src/gui/statemachine/qkeyeventtransition.cpp | 5 +++++ src/gui/statemachine/qkeyeventtransition.h | 4 ++++ src/gui/statemachine/qmouseeventtransition.cpp | 5 +++++ src/gui/statemachine/qmouseeventtransition.h | 4 ++++ 29 files changed, 134 insertions(+) diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index 23ec7b0..9408a5b 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -1164,6 +1164,13 @@ Requires: PROPERTIES Name: Animation SeeAlso: ??? +Feature: STATEMACHINE +Description: Provides hierarchical finite state machines. +Section: Utilities +Requires: PROPERTIES +Name: State machine +SeeAlso: ??? + # SVG diff --git a/src/corelib/statemachine/qabstractstate.cpp b/src/corelib/statemachine/qabstractstate.cpp index 942722f..b9a50a2 100644 --- a/src/corelib/statemachine/qabstractstate.cpp +++ b/src/corelib/statemachine/qabstractstate.cpp @@ -40,6 +40,9 @@ ****************************************************************************/ #include "qabstractstate.h" + +#ifndef QT_NO_STATEMACHINE + #include "qabstractstate_p.h" #include "qstate.h" #include "qstate_p.h" @@ -200,3 +203,5 @@ bool QAbstractState::event(QEvent *e) } QT_END_NAMESPACE + +#endif //QT_NO_STATEMACHINE diff --git a/src/corelib/statemachine/qabstractstate.h b/src/corelib/statemachine/qabstractstate.h index d0ebb52..ee55541 100644 --- a/src/corelib/statemachine/qabstractstate.h +++ b/src/corelib/statemachine/qabstractstate.h @@ -50,6 +50,8 @@ QT_BEGIN_NAMESPACE QT_MODULE(Core) +#ifndef QT_NO_STATEMACHINE + class QState; class QStateMachine; @@ -83,6 +85,8 @@ private: Q_DECLARE_PRIVATE(QAbstractState) }; +#endif //QT_NO_STATEMACHINE + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/corelib/statemachine/qabstracttransition.cpp b/src/corelib/statemachine/qabstracttransition.cpp index dfcafeb..f582b8c 100644 --- a/src/corelib/statemachine/qabstracttransition.cpp +++ b/src/corelib/statemachine/qabstracttransition.cpp @@ -40,6 +40,9 @@ ****************************************************************************/ #include "qabstracttransition.h" + +#ifndef QT_NO_STATEMACHINE + #include "qabstracttransition_p.h" #include "qabstractstate.h" #include "qstate.h" @@ -340,3 +343,5 @@ bool QAbstractTransition::event(QEvent *e) } QT_END_NAMESPACE + +#endif //QT_NO_STATEMACHINE diff --git a/src/corelib/statemachine/qabstracttransition.h b/src/corelib/statemachine/qabstracttransition.h index c63d55a..a1a62c9 100644 --- a/src/corelib/statemachine/qabstracttransition.h +++ b/src/corelib/statemachine/qabstracttransition.h @@ -52,6 +52,8 @@ QT_BEGIN_NAMESPACE QT_MODULE(Core) +#ifndef QT_NO_STATEMACHINE + class QEvent; class QAbstractState; class QState; @@ -104,6 +106,8 @@ private: Q_DECLARE_PRIVATE(QAbstractTransition) }; +#endif //QT_NO_STATEMACHINE + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/corelib/statemachine/qeventtransition.cpp b/src/corelib/statemachine/qeventtransition.cpp index f25d821..4c40256 100644 --- a/src/corelib/statemachine/qeventtransition.cpp +++ b/src/corelib/statemachine/qeventtransition.cpp @@ -40,6 +40,9 @@ ****************************************************************************/ #include "qeventtransition.h" + +#ifndef QT_NO_STATEMACHINE + #include "qeventtransition_p.h" #include "qwrappedevent.h" #include "qstate.h" @@ -283,3 +286,5 @@ bool QEventTransition::event(QEvent *e) } QT_END_NAMESPACE + +#endif //QT_NO_STATEMACHINE diff --git a/src/corelib/statemachine/qeventtransition.h b/src/corelib/statemachine/qeventtransition.h index 3530bdd..40ffecf 100644 --- a/src/corelib/statemachine/qeventtransition.h +++ b/src/corelib/statemachine/qeventtransition.h @@ -51,6 +51,8 @@ QT_BEGIN_NAMESPACE QT_MODULE(Core) +#ifndef QT_NO_STATEMACHINE + class QEventTransitionPrivate; class Q_CORE_EXPORT QEventTransition : public QAbstractTransition { @@ -89,6 +91,8 @@ private: Q_DECLARE_PRIVATE(QEventTransition) }; +#endif //QT_NO_STATEMACHINE + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/corelib/statemachine/qfinalstate.cpp b/src/corelib/statemachine/qfinalstate.cpp index 0980336..0eb531f 100644 --- a/src/corelib/statemachine/qfinalstate.cpp +++ b/src/corelib/statemachine/qfinalstate.cpp @@ -40,6 +40,9 @@ ****************************************************************************/ #include "qfinalstate.h" + +#ifndef QT_NO_STATEMACHINE + #include "qabstractstate_p.h" QT_BEGIN_NAMESPACE @@ -132,3 +135,5 @@ bool QFinalState::event(QEvent *e) } QT_END_NAMESPACE + +#endif //QT_NO_STATEMACHINE diff --git a/src/corelib/statemachine/qfinalstate.h b/src/corelib/statemachine/qfinalstate.h index fa68394..865f333 100644 --- a/src/corelib/statemachine/qfinalstate.h +++ b/src/corelib/statemachine/qfinalstate.h @@ -50,6 +50,8 @@ QT_BEGIN_NAMESPACE QT_MODULE(Core) +#ifndef QT_NO_STATEMACHINE + class QFinalStatePrivate; class Q_CORE_EXPORT QFinalState : public QAbstractState { @@ -69,6 +71,8 @@ private: Q_DECLARE_PRIVATE(QFinalState) }; +#endif //QT_NO_STATEMACHINE + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/corelib/statemachine/qhistorystate.cpp b/src/corelib/statemachine/qhistorystate.cpp index 517faa8..4304da3 100644 --- a/src/corelib/statemachine/qhistorystate.cpp +++ b/src/corelib/statemachine/qhistorystate.cpp @@ -40,6 +40,9 @@ ****************************************************************************/ #include "qhistorystate.h" + +#ifndef QT_NO_STATEMACHINE + #include "qhistorystate_p.h" QT_BEGIN_NAMESPACE @@ -221,3 +224,5 @@ bool QHistoryState::event(QEvent *e) } QT_END_NAMESPACE + +#endif //QT_NO_STATEMACHINE diff --git a/src/corelib/statemachine/qhistorystate.h b/src/corelib/statemachine/qhistorystate.h index a0682bd..eee43d1 100644 --- a/src/corelib/statemachine/qhistorystate.h +++ b/src/corelib/statemachine/qhistorystate.h @@ -50,6 +50,8 @@ QT_BEGIN_NAMESPACE QT_MODULE(Core) +#ifndef QT_NO_STATEMACHINE + class QHistoryStatePrivate; class Q_CORE_EXPORT QHistoryState : public QAbstractState { @@ -84,6 +86,8 @@ private: Q_DECLARE_PRIVATE(QHistoryState) }; +#endif //QT_NO_STATEMACHINE + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/corelib/statemachine/qsignalevent.h b/src/corelib/statemachine/qsignalevent.h index 8221f68..79d1053 100644 --- a/src/corelib/statemachine/qsignalevent.h +++ b/src/corelib/statemachine/qsignalevent.h @@ -53,6 +53,8 @@ QT_BEGIN_NAMESPACE QT_MODULE(Core) +#ifndef QT_NO_STATEMACHINE + class Q_CORE_EXPORT QSignalEvent : public QEvent { public: @@ -70,6 +72,8 @@ private: QList m_arguments; }; +#endif //QT_NO_STATEMACHINE + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/corelib/statemachine/qsignaltransition.cpp b/src/corelib/statemachine/qsignaltransition.cpp index 9ffcb9c..2e150a7 100644 --- a/src/corelib/statemachine/qsignaltransition.cpp +++ b/src/corelib/statemachine/qsignaltransition.cpp @@ -40,6 +40,9 @@ ****************************************************************************/ #include "qsignaltransition.h" + +#ifndef QT_NO_STATEMACHINE + #include "qsignaltransition_p.h" #include "qsignalevent.h" #include "qstate.h" @@ -258,3 +261,5 @@ bool QSignalTransition::event(QEvent *e) } QT_END_NAMESPACE + +#endif //QT_NO_STATEMACHINE diff --git a/src/corelib/statemachine/qsignaltransition.h b/src/corelib/statemachine/qsignaltransition.h index b485785..02b1de9 100644 --- a/src/corelib/statemachine/qsignaltransition.h +++ b/src/corelib/statemachine/qsignaltransition.h @@ -50,6 +50,8 @@ QT_BEGIN_NAMESPACE QT_MODULE(Core) +#ifndef QT_NO_STATEMACHINE + class QSignalTransitionPrivate; class Q_CORE_EXPORT QSignalTransition : public QAbstractTransition { @@ -82,6 +84,8 @@ private: Q_DECLARE_PRIVATE(QSignalTransition) }; +#endif //QT_NO_STATEMACHINE + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp index ebb0b47..5dd56c0 100644 --- a/src/corelib/statemachine/qstate.cpp +++ b/src/corelib/statemachine/qstate.cpp @@ -40,6 +40,9 @@ ****************************************************************************/ #include "qstate.h" + +#ifndef QT_NO_STATEMACHINE + #include "qstate_p.h" #include "qhistorystate.h" #include "qhistorystate_p.h" @@ -482,3 +485,5 @@ bool QState::event(QEvent *e) */ QT_END_NAMESPACE + +#endif //QT_NO_STATEMACHINE diff --git a/src/corelib/statemachine/qstate.h b/src/corelib/statemachine/qstate.h index 6729c69..c98bb64 100644 --- a/src/corelib/statemachine/qstate.h +++ b/src/corelib/statemachine/qstate.h @@ -50,6 +50,8 @@ QT_BEGIN_NAMESPACE QT_MODULE(Core) +#ifndef QT_NO_STATEMACHINE + class QAbstractTransition; class QSignalTransition; @@ -106,6 +108,8 @@ private: Q_DECLARE_PRIVATE(QState) }; +#endif //QT_NO_STATEMACHINE + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index d5f6b76..64b33ac 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -40,6 +40,9 @@ ****************************************************************************/ #include "qstatemachine.h" + +#ifndef QT_NO_STATEMACHINE + #include "qstate.h" #include "qstate_p.h" #include "qstatemachine_p.h" @@ -2207,3 +2210,5 @@ QWrappedEvent::~QWrappedEvent() QT_END_NAMESPACE #include "moc_qstatemachine.cpp" + +#endif //QT_NO_STATEMACHINE diff --git a/src/corelib/statemachine/qstatemachine.h b/src/corelib/statemachine/qstatemachine.h index 2a98a9a..0b3c728 100644 --- a/src/corelib/statemachine/qstatemachine.h +++ b/src/corelib/statemachine/qstatemachine.h @@ -54,6 +54,8 @@ QT_BEGIN_NAMESPACE QT_MODULE(Core) +#ifndef QT_NO_STATEMACHINE + class QEvent; class QAbstractState; class QState; @@ -159,6 +161,8 @@ private: #endif }; +#endif //QT_NO_STATEMACHINE + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/corelib/statemachine/qwrappedevent.h b/src/corelib/statemachine/qwrappedevent.h index b01c608..cb4261b 100644 --- a/src/corelib/statemachine/qwrappedevent.h +++ b/src/corelib/statemachine/qwrappedevent.h @@ -50,6 +50,8 @@ QT_BEGIN_NAMESPACE QT_MODULE(Core) +#ifndef QT_NO_STATEMACHINE + class QObject; class Q_CORE_EXPORT QWrappedEvent : public QEvent @@ -69,6 +71,8 @@ private: Q_DISABLE_COPY(QWrappedEvent) }; +#endif //QT_NO_STATEMACHINE + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index a9424db..f2a3498 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -838,9 +838,11 @@ void QApplicationPrivate::initialize() // trigger registering of QVariant's GUI types extern int qRegisterGuiVariant(); qRegisterGuiVariant(); +#ifndef QT_NO_STATEMACHINE // trigger registering of QStateMachine's GUI types extern int qRegisterGuiStateMachine(); qRegisterGuiStateMachine(); +#endif is_app_running = true; // no longer starting up @@ -1062,9 +1064,11 @@ QApplication::~QApplication() QApplicationPrivate::fade_tooltip = false; QApplicationPrivate::widgetCount = false; +#ifndef QT_NO_STATEMACHINE // trigger unregistering of QStateMachine's GUI types extern int qUnregisterGuiStateMachine(); qUnregisterGuiStateMachine(); +#endif // trigger unregistering of QVariant's GUI types extern int qUnregisterGuiVariant(); qUnregisterGuiVariant(); diff --git a/src/gui/statemachine/qbasickeyeventtransition.cpp b/src/gui/statemachine/qbasickeyeventtransition.cpp index f7f1eb6..61362b2 100644 --- a/src/gui/statemachine/qbasickeyeventtransition.cpp +++ b/src/gui/statemachine/qbasickeyeventtransition.cpp @@ -40,6 +40,9 @@ ****************************************************************************/ #include "qbasickeyeventtransition_p.h" + +#ifndef QT_NO_STATEMACHINE + #include #include #include @@ -201,3 +204,5 @@ void QBasicKeyEventTransition::onTransition(QEvent *) } QT_END_NAMESPACE + +#endif //QT_NO_STATEMACHINE diff --git a/src/gui/statemachine/qbasickeyeventtransition_p.h b/src/gui/statemachine/qbasickeyeventtransition_p.h index 39fa6ad..aef1f99 100644 --- a/src/gui/statemachine/qbasickeyeventtransition_p.h +++ b/src/gui/statemachine/qbasickeyeventtransition_p.h @@ -54,6 +54,9 @@ // #include + +#ifndef QT_NO_STATEMACHINE + #include QT_BEGIN_NAMESPACE @@ -90,4 +93,6 @@ private: QT_END_NAMESPACE +#endif //QT_NO_STATEMACHINE + #endif diff --git a/src/gui/statemachine/qbasicmouseeventtransition.cpp b/src/gui/statemachine/qbasicmouseeventtransition.cpp index 20dd792..0304e28 100644 --- a/src/gui/statemachine/qbasicmouseeventtransition.cpp +++ b/src/gui/statemachine/qbasicmouseeventtransition.cpp @@ -40,6 +40,9 @@ ****************************************************************************/ #include "qbasicmouseeventtransition_p.h" + +#ifndef QT_NO_STATEMACHINE + #include #include #include @@ -206,3 +209,5 @@ void QBasicMouseEventTransition::onTransition(QEvent *) } QT_END_NAMESPACE + +#endif //QT_NO_STATEMACHINE diff --git a/src/gui/statemachine/qbasicmouseeventtransition_p.h b/src/gui/statemachine/qbasicmouseeventtransition_p.h index 3161844..ed0022a 100644 --- a/src/gui/statemachine/qbasicmouseeventtransition_p.h +++ b/src/gui/statemachine/qbasicmouseeventtransition_p.h @@ -54,6 +54,9 @@ // #include + +#ifndef QT_NO_STATEMACHINE + #include QT_BEGIN_NAMESPACE @@ -93,4 +96,6 @@ private: QT_END_NAMESPACE +#endif //QT_NO_STATEMACHINE + #endif diff --git a/src/gui/statemachine/qguistatemachine.cpp b/src/gui/statemachine/qguistatemachine.cpp index 612e43e..69155a9 100644 --- a/src/gui/statemachine/qguistatemachine.cpp +++ b/src/gui/statemachine/qguistatemachine.cpp @@ -40,6 +40,9 @@ ****************************************************************************/ #include + +#ifndef QT_NO_STATEMACHINE + #include #include #include @@ -557,3 +560,5 @@ int qUnregisterGuiStateMachine() Q_DESTRUCTOR_FUNCTION(qUnregisterGuiStateMachine) QT_END_NAMESPACE + +#endif //QT_NO_STATEMACHINE diff --git a/src/gui/statemachine/qkeyeventtransition.cpp b/src/gui/statemachine/qkeyeventtransition.cpp index f803711..fee9f81 100644 --- a/src/gui/statemachine/qkeyeventtransition.cpp +++ b/src/gui/statemachine/qkeyeventtransition.cpp @@ -40,6 +40,9 @@ ****************************************************************************/ #include "qkeyeventtransition.h" + +#ifndef QT_NO_STATEMACHINE + #include "qbasickeyeventtransition_p.h" #include #include @@ -184,3 +187,5 @@ void QKeyEventTransition::onTransition(QEvent *event) } QT_END_NAMESPACE + +#endif //QT_NO_STATEMACHINE diff --git a/src/gui/statemachine/qkeyeventtransition.h b/src/gui/statemachine/qkeyeventtransition.h index d9c7760..c9e06f5 100644 --- a/src/gui/statemachine/qkeyeventtransition.h +++ b/src/gui/statemachine/qkeyeventtransition.h @@ -50,6 +50,8 @@ QT_BEGIN_NAMESPACE QT_MODULE(Gui) +#ifndef QT_NO_STATEMACHINE + class QKeyEventTransitionPrivate; class Q_GUI_EXPORT QKeyEventTransition : public QEventTransition { @@ -80,6 +82,8 @@ private: Q_DECLARE_PRIVATE(QKeyEventTransition) }; +#endif //QT_NO_STATEMACHINE + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/gui/statemachine/qmouseeventtransition.cpp b/src/gui/statemachine/qmouseeventtransition.cpp index e4e18eb..6ae3d36 100644 --- a/src/gui/statemachine/qmouseeventtransition.cpp +++ b/src/gui/statemachine/qmouseeventtransition.cpp @@ -40,6 +40,9 @@ ****************************************************************************/ #include "qmouseeventtransition.h" + +#ifndef QT_NO_STATEMACHINE + #include "qbasicmouseeventtransition_p.h" #include #include @@ -214,3 +217,5 @@ void QMouseEventTransition::onTransition(QEvent *event) } QT_END_NAMESPACE + +#endif //QT_NO_STATEMACHINE diff --git a/src/gui/statemachine/qmouseeventtransition.h b/src/gui/statemachine/qmouseeventtransition.h index 9c7af5b..557b2c3 100644 --- a/src/gui/statemachine/qmouseeventtransition.h +++ b/src/gui/statemachine/qmouseeventtransition.h @@ -50,6 +50,8 @@ QT_BEGIN_NAMESPACE QT_MODULE(Gui) +#ifndef QT_NO_STATEMACHINE + class QMouseEventTransitionPrivate; class QPainterPath; class Q_GUI_EXPORT QMouseEventTransition : public QEventTransition @@ -85,6 +87,8 @@ private: Q_DECLARE_PRIVATE(QMouseEventTransition) }; +#endif //QT_NO_STATEMACHINE + QT_END_NAMESPACE QT_END_HEADER -- 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 f7338759ef86deba18b27ee72b3afcf40f3a5aaf Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Thu, 4 Jun 2009 09:07:38 -0700 Subject: Make sure to retain alpha information in copy We need to set alpha to the right value when copying pixmaps. Reviewed-by: Donald --- src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index dba1b51..18754f5 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -202,11 +202,12 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect) } IDirectFBSurface *src = static_cast(data)->directFBSurface(); - const bool hasAlpha = data->hasAlphaChannel(); - format = (hasAlpha + alpha = data->hasAlphaChannel(); + format = (alpha ? QDirectFBScreen::instance()->alphaPixmapFormat() : QDirectFBScreen::instance()->pixelFormat()); + dfbSurface = screen->createDFBSurface(rect.size(), format, QDirectFBScreen::TrackSurface); if (!dfbSurface) { @@ -215,7 +216,7 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect) return; } - if (hasAlpha) { + if (alpha) { dfbSurface->Clear(dfbSurface, 0, 0, 0, 0); dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_BLEND_ALPHACHANNEL); } else { -- 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 cdb0222129a139dfe1b7e4fb4b401556989901b4 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Fri, 5 Jun 2009 10:45:26 +0200 Subject: My changelog for 4.5.2 --- dist/changes-4.5.2 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 04a29ba..5de0dbe 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -67,6 +67,17 @@ Third party components - QDir * Fix reentrency (listing directories in different threads) +- QFileSystemModel + * [254701] QFileSystemModel doesn't sort subfolders when using it in a QTreeView + * [251295] Windows path names incorrectly constructed in calls to updateIcon() + +- QFileDialog + * [251341] It is not possible to remove a directory of the sidebar if the directory does not exist + * [251321] Hidden path in QFileDialog's sidebar cannot be opened + * [226483] setSidebarUrls() handles the urls case sensitive so that adding the same directory twice is possible - Windows + * [252068] QFileDialog with QSortFilterProxyModel crashes + * [254490] QFileDialog selectFile doesn't clear the selection if we call it several times. + - 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. -- cgit v0.12 From 3e1bbbda44258005b20862effe495cfb664627ca Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 5 Jun 2009 10:52:01 +0200 Subject: link qmake without /DEBUG on Windows Reviewed-by: mariusSO --- qmake/Makefile.win32 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index 39bac81..53130aa 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -41,7 +41,7 @@ CFLAGS = -c -Fo$@ \ CXXFLAGS = $(CFLAGS) LFLAGS = LIBS = ole32.lib advapi32.lib -LINKQMAKE = $(LINK) $(LFLAGS) -DEBUG -OUT:qmake.exe $(OBJS) $(QTOBJS) $(LIBS) +LINKQMAKE = $(LINK) $(LFLAGS) -OUT:qmake.exe $(OBJS) $(QTOBJS) $(LIBS) ADDCLEAN = vc60.pdb vc70.pdb qmake.pdb qmake.ilk !ELSE -- cgit v0.12 From 6fff92a31c4acd270d0ecb4cda336ba098801ffb Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Fri, 5 Jun 2009 12:12:21 +0200 Subject: Doc - cleaned up a sentence to improve clarity 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 bf202b2..5a49901 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -454,7 +454,7 @@ \snippet tutorials/addressbook/part3/addressbook.cpp connecting navigation signals The image below is our expected graphical user interface. Notice that it - is getting closer to our expected final output. + is getting closer to our final application. \image addressbook-tutorial-part3-screenshot.png -- cgit v0.12 From 95ceabf52d79b922a87f7c023c9606e633ab1ea2 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 4 Jun 2009 15:03:31 +0200 Subject: Autotest: Fixed a race condition in the network self test. Some of the tests (including the httpsServer one) requested that the server close the connection (Connection: close). It could happen that, well, the server did close the connection and we noticed it while doing the waitForBytesWritten in the doSocketFlush function. Then we'd create an error in the next step because the socket wasn't connected. Reviewed-by: TrustMe --- tests/auto/_networkselftest/tst_networkselftest.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/auto/_networkselftest/tst_networkselftest.cpp b/tests/auto/_networkselftest/tst_networkselftest.cpp index 0fa001a..eac603f 100644 --- a/tests/auto/_networkselftest/tst_networkselftest.cpp +++ b/tests/auto/_networkselftest/tst_networkselftest.cpp @@ -190,12 +190,6 @@ static void netChat(int port, const QList &chat) // now start the chat QList::ConstIterator it = chat.constBegin(); for (int i = 1; it != chat.constEnd(); ++it, ++i) { - if (it->type != Chat::Reconnect - && socket.state() != QAbstractSocket::ConnectedState - && socket.state() != QAbstractSocket::ClosingState) - QFAIL(QString("Internal error: socket is in invalid state %1 in step %2") - .arg(socket.state()).arg(i).toLocal8Bit()); - switch (it->type) { case Chat::Expect: { qDebug() << i << "Expecting" << prettyByteArray(it->data); -- 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 799a9ddf0a53ecdd6e097b2efd7418fd6ab9b655 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Fri, 5 Jun 2009 12:29:27 +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 5a49901..4ab549a 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -510,7 +510,7 @@ \list \o If the iterator is at the end of \c contacts, we clear the display and return. - \o If the iterator is the beginning of \c contacts, we move it to + \o If the iterator is at the beginning of \c contacts, we move it to the end. \o We then decrement the iterator by one. \endlist -- cgit v0.12 From 35bdd8942716c716113e5b795186ca76199e8d96 Mon Sep 17 00:00:00 2001 From: Trond Kjernaasen Date: Fri, 5 Jun 2009 12:32:51 +0200 Subject: Fixed text drawing on Windows in 16 bit mode. There were several problems with antialiased text in 16 bit mode under Windows. No gamma correction was done, yet we prepared the cached glyphs for gamma correction. The mask format we rendered the glyphs into was also set to the desktop depth, which implied that information was lost and the text looked rather odd. Reviewed-by: Samuel BT: yes --- src/gui/text/qfontengine_win.cpp | 26 ++++++++++++++------------ src/gui/text/qfontengine_win_p.h | 3 ++- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp index 7341665..dc2e1ff 100644 --- a/src/gui/text/qfontengine_win.cpp +++ b/src/gui/text/qfontengine_win.cpp @@ -1335,7 +1335,7 @@ bool QFontEngineWin::getSfntTableData(uint tag, uchar *buffer, uint *length) con QNativeImage *QFontEngineWin::drawGDIGlyph(HFONT font, glyph_t glyph, int margin, - const QTransform &t) + const QTransform &t, QImage::Format mask_format) { glyph_metrics_t gm = boundingBox(glyph); @@ -1408,7 +1408,7 @@ 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); + mask_format, true); ni->image.fill(0xffffffff); HDC hdc = ni->hdc; @@ -1448,8 +1448,12 @@ QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform) lf.lfQuality = ANTIALIASED_QUALITY; font = CreateFontIndirectW(&lf); } + QImage::Format mask_format = QNativeImage::systemFormat(); +#ifndef Q_OS_WINCE + mask_format = QImage::Format_RGB32; +#endif - QNativeImage *mask = drawGDIGlyph(font, glyph, 0, xform); + QNativeImage *mask = drawGDIGlyph(font, glyph, 0, xform, mask_format); if (mask == 0) return QImage(); @@ -1466,22 +1470,20 @@ QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform) // Alpha channel of the ni.image pixels... for (int y=0; yheight(); ++y) { uchar *dest = indexed.scanLine(y); - if (mask->systemFormat() == QImage::Format_RGB16) { + if (mask->image.format() == QImage::Format_RGB16) { const qint16 *src = (qint16 *) ((const QImage &) mask->image).scanLine(y); - for (int x=0; xwidth(); ++x) { -#ifdef Q_OS_WINCE + for (int x=0; xwidth(); ++x) dest[x] = 255 - qGray(src[x]); -#else - dest[x] = 255 - (qt_pow_gamma[qGray(src[x])] * 255. / 2047.); -#endif - } } else { const uint *src = (uint *) ((const QImage &) mask->image).scanLine(y); for (int x=0; xwidth(); ++x) { #ifdef Q_OS_WINCE dest[x] = 255 - qGray(src[x]); #else - dest[x] = 255 - (qt_pow_gamma[qGray(src[x])] * 255. / 2047.); + if (QNativeImage::systemFormat() == QImage::Format_RGB16) + dest[x] = 255 - qGray(src[x]); + else + dest[x] = 255 - (qt_pow_gamma[qGray(src[x])] * 255. / 2047.); #endif } } @@ -1507,7 +1509,7 @@ QImage QFontEngineWin::alphaRGBMapForGlyph(glyph_t glyph, int margin, const QTra SystemParametersInfo(SPI_GETFONTSMOOTHINGCONTRAST, 0, &contrast, 0); SystemParametersInfo(SPI_SETFONTSMOOTHINGCONTRAST, 0, (void *) 1000, 0); - QNativeImage *mask = drawGDIGlyph(font, glyph, margin, t); + QNativeImage *mask = drawGDIGlyph(font, glyph, margin, t, QImage::Format_RGB32); SystemParametersInfo(SPI_SETFONTSMOOTHINGCONTRAST, 0, (void *) contrast, 0); if (mask == 0) diff --git a/src/gui/text/qfontengine_win_p.h b/src/gui/text/qfontengine_win_p.h index 6f37e91..f78bc6a 100644 --- a/src/gui/text/qfontengine_win_p.h +++ b/src/gui/text/qfontengine_win_p.h @@ -138,7 +138,8 @@ public: mutable int designAdvancesSize; private: - QNativeImage *drawGDIGlyph(HFONT font, glyph_t, int margin, const QTransform &xform); + QNativeImage *drawGDIGlyph(HFONT font, glyph_t, int margin, const QTransform &xform, + QImage::Format mask_format); }; -- 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 5740b034811794e0c33496cf0eeb81ba471cc018 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Fri, 5 Jun 2009 13:30:03 +0200 Subject: Example MDI: keybord focus not working correctly! The reason is that cocoa looses the first responder when we raise the fake window inside the MDA area. So we need to re-set the first responder again Task-number: 255040 Reviewed-by: Trenton Schulz --- src/gui/kernel/qwidget_mac.mm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index c82b87d..68eaf6f 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3603,11 +3603,15 @@ void QWidgetPrivate::raise_sys() } } else { // Cocoa doesn't really have an idea of Z-ordering, but you can - // fake it by changing the order of it. + // fake it by changing the order of it. But beware, removing an + // NSView will also remove it as the first responder. So we re-set + // the first responder just in case: NSView *view = qt_mac_nativeview_for(q); NSView *parentView = [view superview]; + NSResponder *firstResponder = [[view window] firstResponder]; [view removeFromSuperview]; [parentView addSubview:view]; + [[view window] makeFirstResponder:firstResponder]; } #else if(q->isWindow()) { @@ -3645,6 +3649,7 @@ void QWidgetPrivate::lower_sys() NSArray *tmpViews = [parentView subviews]; NSMutableArray *subviews = [[NSMutableArray alloc] initWithCapacity:[tmpViews count]]; [subviews addObjectsFromArray:tmpViews]; + NSResponder *firstResponder = [[myview window] firstResponder]; // Implicit assumption that myViewIndex is included in subviews, that's why I'm not checking // myViewIndex. NSUInteger index = 0; @@ -3664,6 +3669,7 @@ void QWidgetPrivate::lower_sys() for (NSView *subview in subviews) [parentView addSubview:subview]; [subviews release]; + [[myview window] makeFirstResponder:firstResponder]; } #else if(q->isWindow()) { -- cgit v0.12 From a45ba34ead80d7e19e62eff571d094c9417fd876 Mon Sep 17 00:00:00 2001 From: jasplin Date: Fri, 5 Jun 2009 13:46:14 +0200 Subject: Revert "BT: Fixed crash on Mac caused by erroneous handling of native focus events." This reverts commit 7314c07a3e443b1d5349b419a03db8d41ca43f7e. As reported by Eike, this patch caused several problems for Qt Creator. Potentially it may cause problems for other (external) applications as well. An alternative fix (scheduled for 4.5.x) needs to be found for tasks 254456 and 254460. Reviewed-by: Richard Moe Gustavsen --- src/gui/kernel/qwidget_mac.mm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 68eaf6f..b2256cd 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -1296,11 +1296,8 @@ OSStatus QWidgetPrivate::qt_widget_event(EventHandlerCallRef er, EventRef event, if(part == kControlFocusNoPart){ if (widget->hasFocus()) QApplicationPrivate::setFocusWidget(0, Qt::OtherFocusReason); - } else if (widget->focusPolicy() != Qt::NoFocus) { + } else widget->setFocus(); - } else { - handled_event = false; - } } if(!HIObjectIsOfClass((HIObjectRef)hiview, kObjectQWidget)) CallNextEventHandler(er, event); -- 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 5455f9c7a3ec8ed591666a2f4384c10de31f6a60 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 5 Jun 2009 14:06:03 +0200 Subject: My changes for 4.5.2 --- dist/changes-4.5.2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 5de0dbe..84460e3 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -210,7 +210,9 @@ Qt for Embedded Linux Qt for Windows CE ----------------- -[248846] handle the back soft key on Windows mobile. +[248846] Handle the back soft key on Windows mobile. +[252319] Fix regression in native menu integration. +[242484] Fixed crash if Qt::WindowCancelButtonHint is used for a QDialog **************************************************************************** -- 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 2734d8fa8c26c8498091348305b2616ecacfad85 Mon Sep 17 00:00:00 2001 From: jasplin Date: Fri, 5 Jun 2009 15:01:16 +0200 Subject: My changes for 4.5.2. --- dist/changes-4.5.2 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 84460e3..1984881 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -59,6 +59,10 @@ Third party components - QAbstractNetworkCache * Only cache responses to HTTP GET by default, not HTTP PUT or POST +- QApplication + * [249589] Fixed bug that prevented any part of the application to receive + focus when Graphics View was disabled using QT_NO_GRAPHICSVIEW. + - QComboBox * [253944] Changing the style doesn't reset custom item delegate anymore. * [254589] Fixed the frame appearing if setting a stylesheet with a border @@ -88,6 +92,9 @@ Third party components - QFontDialog * [252000] Ensure that QFontDialog::getFont() works on Mac OS X. +- QGraphicsWidget + * Fixed a bug with Qt::WidgetWithChildren shortcut context. + - QLocalSocket * [247144] correctly handle remote disconnects @@ -107,6 +114,10 @@ Third party components * [253448] Prevent a crash when using the Qt::WA_MacBrushedMetal attribute in conjunction with style sheets. +- QWizard + * [252662] Fixed crash that could happen when compiling on Windows XP and + running on older Windows versions like 98 and 2000. + - QObject * Fixed possible race condition if two QObject connected together with signals and slot are destroyed in different threads @@ -121,6 +132,9 @@ Third party components * [251534] Fixed issue where text with non-opaque color from widget palette would be blitted instead of blended. +- QProgressBar + * [252283] Fixed busy indicator for a QProgressBar with a style sheet applied to it. + - QSelectionModel * [252069] fix QSelectionModel::rowIntersectsSelection or QSelectionModel::columnsIntersectsSelection not reporting right result if some items are disabled. @@ -135,6 +149,10 @@ Third party components - QString * Fixed reentrency of QString::squeeze() +- QTabBar + * [252472] Fixed problem with the current tab not being visible after calling + setTabButton() on a scrolled tab bar. + - QTransform * Fixed issue in QTransform::type() causing a projective transform to be treated as a scaling transform. -- 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 f6fc34ea5b247d1b56e113663958176b095a58a6 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Fri, 5 Jun 2009 15:44:24 +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 4ab549a..e5657e7 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -529,7 +529,7 @@ \example tutorials/addressbook/part4 \title Address Book 4 - Editing and Removing Addresses - In this chapter, we look at ways to modify the contents of contact stored + In this chapter, we look at ways to modify the contents of contacts stored in the address book application. \image addressbook-tutorial-screenshot.png -- 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 4515b690829a639283a9b660893ff3f0f7ff598b Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Fri, 5 Jun 2009 15:59:59 +0200 Subject: Doc - fixed another 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 e5657e7..4de334d 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -539,7 +539,7 @@ edit and remove functions so that a contact's details can be changed when needed. However, this requires a little improvement, in the form of enums. In our previous chapters, we had two modes: \c{AddingMode} and - \c{NavigationMode} - but they weren't defined as enums. Instead, we + \c{NavigationMode} - but they were not defined as enums. Instead, we enabled and disabled the corresponding buttons manually, resulting in multiple lines of repeated code. -- cgit v0.12 From b59d84fe67caedeb8c11d2530ddee2017a376920 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Fri, 5 Jun 2009 16:31:24 +0200 Subject: Doc - fixed a typo Reviewed-By: TrustMe --- doc/src/tutorials/addressbook.qdoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc index 4de334d..9a1af85 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -573,8 +573,7 @@ \dots \snippet tutorials/addressbook/part4/addressbook.h mode declaration - Lastly, we declare \c currentMode to keep track of the current mode of the - enum. + Lastly, we declare \c currentMode to keep track of the enum's current mode. \section1 Implementing the AddressBook Class -- 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 d29da4699a2887cdf0836ff39652524d015431c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 5 Jun 2009 16:41:23 +0200 Subject: Fixed an issue with graphicssystem raster on 8 and 16 bit X servers. We didn't actually check the depth of the target window before calling the qt_x11_drawImage() fu, that will only work with depths >= 24. Task-number: 255311 Reviewed-by: Samuel BT: yes --- src/gui/painting/qwindowsurface_raster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp index 110ba2f..0a6a04e 100644 --- a/src/gui/painting/qwindowsurface_raster.cpp +++ b/src/gui/painting/qwindowsurface_raster.cpp @@ -229,7 +229,7 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi { const QImage &src = d->image->image; br = br.intersected(src.rect()); - if (src.format() != QImage::Format_RGB32) { + if (src.format() != QImage::Format_RGB32 || widget->x11Info().depth() < 24) { QX11PixmapData *data = new QX11PixmapData(QPixmapData::PixmapType); data->xinfo = widget->x11Info(); data->fromImage(src, Qt::AutoColor); -- 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 From 7f21512826689df38678c4cb954e9c347c01df8b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 5 Jun 2009 17:13:17 +0200 Subject: explicitly handle windows and mac9 line endings in practice, this matters only for backslashed line continuations Task-number: 255336 --- tools/linguist/shared/cpp.cpp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/tools/linguist/shared/cpp.cpp b/tools/linguist/shared/cpp.cpp index 2e137cf..0aab661 100644 --- a/tools/linguist/shared/cpp.cpp +++ b/tools/linguist/shared/cpp.cpp @@ -134,13 +134,28 @@ static uint getChar() if (yyInPos >= yyInStr.size()) return EOF; uint c = yyInStr[yyInPos++].unicode(); - if (c == '\\' && yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n') { - ++yyCurLineNo; - ++yyInPos; - continue; + if (c == '\\' && yyInPos < yyInStr.size()) { + if (yyInStr[yyInPos].unicode() == '\n') { + ++yyCurLineNo; + ++yyInPos; + continue; + } + if (yyInStr[yyInPos].unicode() == '\r') { + ++yyCurLineNo; + ++yyInPos; + if (yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n') + ++yyInPos; + continue; + } } - if (c == '\n') + if (c == '\r') { + if (yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n') + ++yyInPos; + c = '\n'; ++yyCurLineNo; + } else if (c == '\n') { + ++yyCurLineNo; + } return c; } } -- cgit v0.12 From 508c9cd681244a5ad566c12733aa70f5bd522b57 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Fri, 5 Jun 2009 17:38:39 +0200 Subject: make signal handlers understand QVariant again Also, issue a warning if a type is not known to the meta-type system. Task-number: 248129 --- src/script/qscriptextqobject.cpp | 21 ++++++++++++++--- tests/auto/qscriptqobject/tst_qscriptqobject.cpp | 29 ++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/src/script/qscriptextqobject.cpp b/src/script/qscriptextqobject.cpp index 0a346f0..47c04d4 100644 --- a/src/script/qscriptextqobject.cpp +++ b/src/script/qscriptextqobject.cpp @@ -1667,12 +1667,27 @@ void QScript::QObjectConnectionManager::execute(int slotIndex, void **argv) activation_data->m_members[i].object(nameId, i, QScriptValue::Undeletable | QScriptValue::SkipInEnumeration); + QScriptValueImpl actual; if (i < argc) { - int argType = QMetaType::type(parameterTypes.at(i)); - activation_data->m_values[i] = eng->create(argType, argv[i + 1]); + void *arg = argv[i + 1]; + QByteArray typeName = parameterTypes.at(i); + int argType = QMetaType::type(typeName); + if (!argType) { + if (typeName == "QVariant") { + actual = eng->valueFromVariant(*reinterpret_cast(arg)); + } else { + qWarning("QScriptEngine: Unable to handle unregistered datatype '%s' " + "when invoking handler of signal %s::%s", + typeName.constData(), meta->className(), method.signature()); + actual = eng->undefinedValue(); + } + } else { + actual = eng->create(argType, arg); + } } else { - activation_data->m_values[i] = eng->undefinedValue(); + actual = eng->undefinedValue(); } + activation_data->m_values[i] = actual; } QScriptValueImpl senderObject; diff --git a/tests/auto/qscriptqobject/tst_qscriptqobject.cpp b/tests/auto/qscriptqobject/tst_qscriptqobject.cpp index 1025d2a..2c47c49 100644 --- a/tests/auto/qscriptqobject/tst_qscriptqobject.cpp +++ b/tests/auto/qscriptqobject/tst_qscriptqobject.cpp @@ -333,6 +333,10 @@ public: { emit mySignalWithDefaultArg(arg); } void emitMySignalWithDefaultArg() { emit mySignalWithDefaultArg(); } + void emitMySignalWithVariantArg(const QVariant &arg) + { emit mySignalWithVariantArg(arg); } + void emitMySignalWithScriptEngineArg(QScriptEngine *arg) + { emit mySignalWithScriptEngineArg(arg); } public Q_SLOTS: void mySlot() @@ -395,6 +399,8 @@ Q_SIGNALS: void myOtherOverloadedSignal(const QString &arg); void myOtherOverloadedSignal(int arg); void mySignalWithDefaultArg(int arg = 123); + void mySignalWithVariantArg(const QVariant &arg); + void mySignalWithScriptEngineArg(QScriptEngine *arg); protected: void connectNotify(const char *signal) { @@ -1553,6 +1559,29 @@ void tst_QScriptExtQObject::connectAndDisconnect() m_myObject->emitMyOtherOverloadedSignal(123); QVERIFY(!m_engine->evaluate("gotSignal").toBoolean()); + // signal with QVariant arg: argument conversion should work + m_myObject->clearConnectedSignal(); + QVERIFY(m_engine->evaluate("myObject.mySignalWithVariantArg.connect(myHandler)").isUndefined()); + QCOMPARE(m_myObject->connectedSignal().constData(), SIGNAL(mySignalWithVariantArg(QVariant))); + m_engine->evaluate("gotSignal = false"); + m_myObject->emitMySignalWithVariantArg(123); + QCOMPARE(m_engine->evaluate("gotSignal").toBoolean(), true); + QCOMPARE(m_engine->evaluate("signalArgs.length").toNumber(), 1.0); + QCOMPARE(m_engine->evaluate("signalArgs[0]").toNumber(), 123.0); + QVERIFY(m_engine->evaluate("myObject.mySignalWithVariantArg.disconnect(myHandler)").isUndefined()); + + // signal with argument type that's unknown to the meta-type system + m_myObject->clearConnectedSignal(); + QVERIFY(m_engine->evaluate("myObject.mySignalWithScriptEngineArg.connect(myHandler)").isUndefined()); + QCOMPARE(m_myObject->connectedSignal().constData(), SIGNAL(mySignalWithScriptEngineArg(QScriptEngine*))); + m_engine->evaluate("gotSignal = false"); + QTest::ignoreMessage(QtWarningMsg, "QScriptEngine: Unable to handle unregistered datatype 'QScriptEngine*' when invoking handler of signal MyQObject::mySignalWithScriptEngineArg(QScriptEngine*)"); + m_myObject->emitMySignalWithScriptEngineArg(m_engine); + QCOMPARE(m_engine->evaluate("gotSignal").toBoolean(), true); + QCOMPARE(m_engine->evaluate("signalArgs.length").toNumber(), 1.0); + QVERIFY(m_engine->evaluate("signalArgs[0]").isUndefined()); + QVERIFY(m_engine->evaluate("myObject.mySignalWithScriptEngineArg.disconnect(myHandler)").isUndefined()); + // connect(object, function) m_engine->evaluate("otherObject = { name:'foo' }"); QVERIFY(m_engine->evaluate("myObject.mySignal.connect(otherObject, myHandler)").isUndefined()); -- cgit v0.12 From dabeec5e1d3f43b54a58b2f8667ac552a7c24685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 5 Jun 2009 17:46:48 +0200 Subject: My 4.5.2 changes. --- dist/changes-4.5.2 | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 1984881..810c022 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -131,6 +131,8 @@ Third party components * Fixed crash when drawing on a null pixmap. * [251534] Fixed issue where text with non-opaque color from widget palette would be blitted instead of blended. + * [253663] Fixed an issue with implicitly closed poly lines when using + perspective transforms. - QProgressBar * [252283] Fixed busy indicator for a QProgressBar with a style sheet applied to it. @@ -165,6 +167,8 @@ Third party components engine. * [251485] Fixed crash that could occur with projective transforms and high quality antialiasing. + * [253468] Fixed a crash in the GL 2 paint engine that could occur + when drawing text. - QCssParser * [252311] "font-family:" now handle fallback font specified with a comas @@ -186,6 +190,28 @@ Third party components - QPrintDialog * [253135] Crash in QPrintDialog when editing output filename + * [252873] Fixed an issue that could cause QPrintDialog to invalidate + a valid QPrinter object. + * [224728] Fixed an issue under X11 where QPrintDialog didn't update + the print-to-file state, if it was passed a QPrinter set up to + print PDF or PostScript. + +- QPrinter + * [252873] Fixed an issue with QPrinter::NativeFormat printers not + being valid. + * [248881] Fixed an issue under Windows where QPrinter::pageRect() returned + the wrong rect when QPrinter::fullPage() was set. + * [199271] Fixed an issue with QPrinter::setPrinterName()/printerName() + on Mac. + +- QSvg + * [253614] Fixed an issue with parsing the 'stroke-dasharray' SVG attribute. + +- QSvgIconEngine + * [251106] Fixed an issue that would cause QIcon::actualSize() to reparse + the SVG file for each acutalSize() call, until QIcon::pixmap() was called. + * [248848] Fixed an issue that would cause QIcon::pixmap() to reparse the + SVG file, even though there was a cached pixmap for that size available. **************************************************************************** * Database Drivers * @@ -202,17 +228,30 @@ Qt for Linux/X11 legacy freetype headers. [241361] Prevented asynchronous access to non-thread safe libfontconfig API. [244362] Worked around X server crash when calling XFillPolygon with more than -200000 points by falling back to raster paint engine. + 200000 points by falling back to raster paint engine. [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. +[255311] Fixed an issue with '-graphicssystem raster' on 8 and 16 bit X servers. +[252328] Fixed an issue when rendering old XLFD fonts on X11 with Xrender and + fontconfig enabled. +[248720] Fixed and issue with using '-graphicssystem raster' on X servers with + BGR color layout. +[196152] Fixed a problem with QPixmap::toImage() on big endian systems that + would cause the R and B channels to be swapped for 32 bit pixmaps. Qt for Windows -------------- +Fixed and issue with text rendering in 16 bit mode. + +[246196] Fixed an issue with clipped glyphs when rendering text with + certain fonts. [251259] Switching to another app left text cursor in line edits with QtMfc framework. +[253367] Fixed a memory leak when loading system icons on Windows. + Qt for Mac OS X --------------- @@ -220,6 +259,9 @@ Qt for Mac OS X [252176] Fix regression in drawing parts of pixmaps on Panther. [253402] Fix a crash when a Cocoa window that used to be a QWidget would get events after the QWidget was destroyed. +[249178] Fixed an issue with drawing text to QImages on Mac/Cocoa. +[250066] Fixed an issue that caused reparenting of QGLWidgets to output warnings + on Mac/Cocoa. Qt for Embedded Linux -- cgit v0.12 From f2b307342a0effed58436dd199a0d80c5e651755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 5 Jun 2009 17:48:37 +0200 Subject: Fixed typos. --- dist/changes-4.5.2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 810c022..39082f6 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -236,7 +236,7 @@ legacy freetype headers. [255311] Fixed an issue with '-graphicssystem raster' on 8 and 16 bit X servers. [252328] Fixed an issue when rendering old XLFD fonts on X11 with Xrender and fontconfig enabled. -[248720] Fixed and issue with using '-graphicssystem raster' on X servers with +[248720] Fixed an issue with using '-graphicssystem raster' on X servers with BGR color layout. [196152] Fixed a problem with QPixmap::toImage() on big endian systems that would cause the R and B channels to be swapped for 32 bit pixmaps. @@ -244,7 +244,7 @@ legacy freetype headers. Qt for Windows -------------- -Fixed and issue with text rendering in 16 bit mode. +Fixed an issue with text rendering in 16 bit mode. [246196] Fixed an issue with clipped glyphs when rendering text with certain fonts. -- cgit v0.12 From 8411fe233021f8609250b7cf47353e3128521406 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Sat, 6 Jun 2009 23:17:29 +0200 Subject: Add a comment for the translator so the placeholders are described Reviewed-by: TrustMe --- tools/assistant/lib/qhelpdbreader.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/assistant/lib/qhelpdbreader.cpp b/tools/assistant/lib/qhelpdbreader.cpp index 76994a7..27bc4d7 100644 --- a/tools/assistant/lib/qhelpdbreader.cpp +++ b/tools/assistant/lib/qhelpdbreader.cpp @@ -92,6 +92,9 @@ bool QHelpDBReader::init() QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), m_uniqueId); db.setDatabaseName(m_dbName); if (!db.open()) { + /*: The placeholders are: %1 - The name of the database which cannot be opened + %2 - The unique id for the connection + %3 - The actual error string */ m_error = tr("Cannot open database '%1' '%2': %3").arg(m_dbName, m_uniqueId, db.lastError().text()); QSqlDatabase::removeDatabase(m_uniqueId); return false; -- cgit v0.12 From 0fafad31feb518453c7c25b2e29a8b26d7018978 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 8 Jun 2009 07:53:58 +0200 Subject: Ensure that the manifest files are placed correctly If OBJECTS_DIR was empty then it would create a directory for the manifest files in the root directory. This is not desired as it should create a directory in the build directory instead. Reviewed-by: Marius Storm-Olsen --- mkspecs/features/win32/embed_manifest_dll.prf | 8 +++++--- mkspecs/features/win32/embed_manifest_exe.prf | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/mkspecs/features/win32/embed_manifest_dll.prf b/mkspecs/features/win32/embed_manifest_dll.prf index 90d9a2b..76a8ed1 100644 --- a/mkspecs/features/win32/embed_manifest_dll.prf +++ b/mkspecs/features/win32/embed_manifest_dll.prf @@ -1,11 +1,13 @@ +MANIFEST_DIR = $$OBJECTS_DIR +isEmpty(MANIFEST_DIR):MANIFEST_DIR = . !if(plugin:no_plugin_manifest):if(win32-msvc2005|win32-msvc2008):!static:!equals(TEMPLATE_PREFIX, "vc"):equals(TEMPLATE, "lib") { NOPATH_TARGET = $$TARGET NOPATH_TARGET ~= s,\\ , ,q # Remove space escaping (NOPATH_TARGET is quoted) NOPATH_TARGET ~= s,\\,/,g # Change to single type separators NOPATH_TARGET ~= s,^(.*/)+,, # Remove all paths - QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${OBJECTS_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\") + QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${MANIFEST_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\") QMAKE_PREV_POST_LINK = $$QMAKE_POST_LINK - QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(OBJECTS_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);2$$escape_expand(\n\t)) + QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);2$$escape_expand(\n\t)) QMAKE_POST_LINK += $$QMAKE_PREV_POST_LINK - QMAKE_CLEAN += \"$$replace(OBJECTS_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" + QMAKE_CLEAN += \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" } diff --git a/mkspecs/features/win32/embed_manifest_exe.prf b/mkspecs/features/win32/embed_manifest_exe.prf index e1747f1..d2800a1 100644 --- a/mkspecs/features/win32/embed_manifest_exe.prf +++ b/mkspecs/features/win32/embed_manifest_exe.prf @@ -1,11 +1,13 @@ +MANIFEST_DIR = $$OBJECTS_DIR +isEmpty(MANIFEST_DIR):MANIFEST_DIR = . if(win32-msvc2005|win32-msvc2008):!equals(TEMPLATE_PREFIX, "vc"):equals(TEMPLATE, "app") { NOPATH_TARGET = $$TARGET NOPATH_TARGET ~= s,\\ , ,q # Remove space escaping (NOPATH_TARGET is quoted) NOPATH_TARGET ~= s,\\,/,g # Change to single type separators NOPATH_TARGET ~= s,^(.*/)+,, # Remove all paths - QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${OBJECTS_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\") + QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${MANIFEST_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\") QMAKE_PREV_POST_LINK = $$QMAKE_POST_LINK - QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(OBJECTS_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);1$$escape_expand(\n\t)) + QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);1$$escape_expand(\n\t)) QMAKE_POST_LINK += $$QMAKE_PREV_POST_LINK - QMAKE_CLEAN += \"$$replace(OBJECTS_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" + QMAKE_CLEAN += \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" } -- cgit v0.12 From 3b2b9d727f0fadf607968c73003e7550c8bd0296 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 8 Jun 2009 08:03:17 +0200 Subject: Set the error to be HostUnreacheable if WSAEHOSTUNREACH is recieved This was a contribution sent via the public bugs channel. Task-number: 255161 Reviewed-by: Marius Storm-Olsen --- src/network/socket/qnativesocketengine_win.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp index b08d7b0..8c6cd31 100644 --- a/src/network/socket/qnativesocketengine_win.cpp +++ b/src/network/socket/qnativesocketengine_win.cpp @@ -570,6 +570,11 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &address, quin socketState = QAbstractSocket::UnconnectedState; break; } + if (value == WSAEHOSTUNREACH) { + setError(QAbstractSocket::NetworkError, HostUnreachableErrorString); + socketState = QAbstractSocket::UnconnectedState; + break; + } } // fall through } -- cgit v0.12 From 779bd72aaad2cd8cd5af23214cd812bf2e5528a7 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Mon, 8 Jun 2009 08:47:22 +0200 Subject: make moc-generated code compile again Needed due to commit 4acabb3abd0ff109b9abeedb6832f5b1c3e0cc4e --- src/tools/moc/moc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index 8ca2823..4629ac5 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -767,6 +767,8 @@ void Moc::generate(FILE *out) if (classList.size() && classList.first().classname == "Qt") fprintf(out, "#include \n"); + fprintf(out, "#include \n"); + fprintf(out, "#if !defined(Q_MOC_OUTPUT_REVISION)\n" "#error \"The header file '%s' doesn't include .\"\n", (const char *)fn); fprintf(out, "#elif Q_MOC_OUTPUT_REVISION != %d\n", mocOutputRevision); -- cgit v0.12 From 38a5b31a8ae87f5e833d7f4383af9dc4592bf122 Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Mon, 8 Jun 2009 09:12:10 +0200 Subject: New binary Fixes the no qconfig.h output issue in main Reviewed by: trustme --- configure.exe | Bin 856064 -> 847872 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/configure.exe b/configure.exe index 9da5c60..cfad2dd 100644 Binary files a/configure.exe and b/configure.exe differ -- cgit v0.12 From d3bda146c4076dce3e260b4ef47f6bbc2d191b25 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 8 Jun 2009 08:46:32 +0200 Subject: Use QT_USE_FAST_OPERATOR_PLUS and QT_USE_FAST_CONCATENATION in qdoc3. Reduces the number of qmalloc calls by 9% and reduces the instruction count as reported by valgrind by 2% in a release build. --- tools/qdoc3/qdoc3.pro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro index ead7b88..5438e5f 100644 --- a/tools/qdoc3/qdoc3.pro +++ b/tools/qdoc3/qdoc3.pro @@ -1,6 +1,8 @@ DEFINES += QDOC2_COMPAT DEFINES += QT_NO_CAST_TO_ASCII #DEFINES += QT_NO_CAST_FROM_ASCII +DEFINES += QT_USE_FAST_OPERATOR_PLUS +DEFINES += QT_USE_FAST_CONCATENATION QT = core xml CONFIG += console -- cgit v0.12 From ac30cbdceac428fa206a939e5d820b2bd77227fc Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 8 Jun 2009 09:14:19 +0200 Subject: Make QCharRef known to QStringBuilder. --- src/corelib/tools/qstringbuilder.cpp | 4 ++-- src/corelib/tools/qstringbuilder.h | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/corelib/tools/qstringbuilder.cpp b/src/corelib/tools/qstringbuilder.cpp index 4f24f76..03d8160 100644 --- a/src/corelib/tools/qstringbuilder.cpp +++ b/src/corelib/tools/qstringbuilder.cpp @@ -111,7 +111,7 @@ The QStringBuilder class is not to be used explicitly in user code. Instances of the class are created as return values of the operator%() function, acting on objects of type \c QString, \c QLatin1String, - \c QLatin1Literal, \c \QStringRef, \c QChar, + \c QLatin1Literal, \c \QStringRef, \c QChar, \c QCharRef, \c QLatin1Char, and \c char. Concatenating strings with operator%() generally yields better @@ -130,6 +130,6 @@ This function is usable with arguments of type \c QString, \c QLatin1String, \c QLatin1Literal, \c QStringRef, - \c QChar, \c QLatin1Char, and \c char. + \c QChar, \c QCharRef, \c QLatin1Char, and \c char. */ diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h index 7b16197..2c31476 100644 --- a/src/corelib/tools/qstringbuilder.h +++ b/src/corelib/tools/qstringbuilder.h @@ -122,6 +122,16 @@ template <> struct QConcatenable } }; +template <> struct QConcatenable +{ + typedef QCharRef type; + static int size(const QCharRef &) { return 1; } + static inline void appendTo(const QCharRef &c, QChar *&out) + { + *out++ = QChar(c); + } +}; + template <> struct QConcatenable { typedef QLatin1String type; @@ -173,8 +183,8 @@ template <> struct QConcatenable template struct QConcatenable { typedef char type[N]; - static int size(const char *) { return N - 1; } - static inline void appendTo(const char *a, QChar *&out) + static int size(const char[N]) { return N - 1; } + static inline void appendTo(const char a[N], QChar *&out) { for (int i = 0; i < N - 1; ++i) *out++ = QLatin1Char(a[i]); -- cgit v0.12 From eb8789ba06949974eb4108b115a30f96e1500a81 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Mon, 8 Jun 2009 10:42:42 +0200 Subject: Fix QT_NO_DATASTREAM macro checks and improve readability Some checks where in the wrong locations, and some endifs where hard to read. Merge-request: 611 Reviewed-by: Marius Storm-Olsen --- src/corelib/io/qdatastream.h | 3 +-- src/corelib/kernel/qmetatype.cpp | 4 ++-- src/corelib/kernel/qmetatype.h | 2 +- src/corelib/plugin/quuid.cpp | 2 +- src/corelib/tools/qbitarray.cpp | 5 +++-- src/corelib/tools/qbytearray.cpp | 5 +++-- src/corelib/tools/qchar.cpp | 2 +- src/corelib/tools/qlocale.cpp | 2 +- src/corelib/tools/qregexp.cpp | 2 +- src/corelib/tools/qsize.h | 4 ++++ src/gui/embedded/qkbd_qws_p.h | 3 ++- src/gui/image/qimage.cpp | 2 +- src/gui/image/qpicture.cpp | 2 ++ src/gui/image/qpicture.h | 2 ++ src/gui/image/qpixmap.cpp | 2 +- src/gui/itemviews/qheaderview.cpp | 10 ++++++---- src/gui/itemviews/qlistwidget.cpp | 3 +++ src/gui/itemviews/qstandarditemmodel.cpp | 2 +- src/gui/itemviews/qtreewidget.cpp | 3 +-- src/gui/kernel/qlayout.cpp | 4 +--- src/gui/kernel/qpalette.cpp | 4 ++-- src/gui/kernel/qsizepolicy.h | 2 ++ src/gui/painting/qcolor.cpp | 4 +--- src/gui/painting/qfixed_p.h | 2 ++ src/gui/painting/qmatrix.h | 2 ++ src/gui/painting/qpainterpath.cpp | 2 +- src/gui/painting/qpolygon.cpp | 2 +- src/gui/painting/qtransform.h | 2 ++ src/gui/text/qtextformat.cpp | 4 ++++ src/gui/text/qtextformat.h | 4 ++++ 30 files changed, 59 insertions(+), 33 deletions(-) diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h index ec5780c..077e720 100644 --- a/src/corelib/io/qdatastream.h +++ b/src/corelib/io/qdatastream.h @@ -65,9 +65,8 @@ template class QSet; template class QHash; template class QMap; -class QDataStreamPrivate; - #ifndef QT_NO_DATASTREAM +class QDataStreamPrivate; class Q_CORE_EXPORT QDataStream { public: diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index a0b954f..6b40f46 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -360,7 +360,7 @@ void QMetaType::registerStreamOperators(const char *typeName, SaveOperator saveO inf.saveOp = saveOp; inf.loadOp = loadOp; } -#endif +#endif // QT_NO_DATASTREAM /*! Returns the type name associated with the given \a type, or 0 if no @@ -885,7 +885,7 @@ bool QMetaType::load(QDataStream &stream, int type, void *data) } return true; } -#endif +#endif // QT_NO_DATASTREAM /*! Returns a copy of \a copy, assuming it is of type \a type. If \a diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index be8a667..22214a4 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -183,7 +183,7 @@ void qRegisterMetaTypeStreamOperators(const char *typeName QMetaType::registerStreamOperators(typeName, reinterpret_cast(sptr), reinterpret_cast(lptr)); } -#endif +#endif // QT_NO_DATASTREAM template struct QMetaTypeId diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp index 3e05d28..cee8bf7 100644 --- a/src/corelib/plugin/quuid.cpp +++ b/src/corelib/plugin/quuid.cpp @@ -405,7 +405,7 @@ QDataStream &operator>>(QDataStream &s, QUuid &id) } return s; } -#endif +#endif // QT_NO_DATASTREAM /*! Returns true if this is the null UUID diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp index a947ab5..591cfa9 100644 --- a/src/corelib/tools/qbitarray.cpp +++ b/src/corelib/tools/qbitarray.cpp @@ -653,6 +653,7 @@ QBitArray operator^(const QBitArray &a1, const QBitArray &a2) QBitArray stream functions *****************************************************************************/ +#ifndef QT_NO_DATASTREAM /*! \relates QBitArray @@ -660,7 +661,7 @@ QBitArray operator^(const QBitArray &a1, const QBitArray &a2) \sa \link datastreamformat.html Format of the QDataStream operators \endlink */ -#ifndef QT_NO_DATASTREAM + QDataStream &operator<<(QDataStream &out, const QBitArray &ba) { quint32 len = ba.size(); @@ -713,7 +714,7 @@ QDataStream &operator>>(QDataStream &in, QBitArray &ba) *ba.d.data() = ba.d.size() * 8 - len; return in; } -#endif +#endif // QT_NO_DATASTREAM /*! \fn DataPtr &QBitArray::data_ptr() diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 49dd52d..cbd9d4e 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -2591,6 +2591,8 @@ void QByteArray::clear() d->ref.ref(); } +#ifndef QT_NO_DATASTREAM + /*! \relates QByteArray Writes byte array \a ba to the stream \a out and returns a reference @@ -2598,7 +2600,6 @@ void QByteArray::clear() \sa {Format of the QDataStream operators} */ -#ifndef QT_NO_DATASTREAM QDataStream &operator<<(QDataStream &out, const QByteArray &ba) { @@ -2641,7 +2642,7 @@ QDataStream &operator>>(QDataStream &in, QByteArray &ba) return in; } -#endif //QT_NO_DATASTREAM +#endif // QT_NO_DATASTREAM /*! \fn bool QByteArray::operator==(const QString &str) const diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp index a940cda..250dad0 100644 --- a/src/corelib/tools/qchar.cpp +++ b/src/corelib/tools/qchar.cpp @@ -1321,7 +1321,7 @@ QDataStream &operator>>(QDataStream &in, QChar &chr) chr.unicode() = ushort(u); return in; } -#endif +#endif // QT_NO_DATASTREAM /*! \fn ushort & QChar::unicode() diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 8c740bd..00132d7 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -1533,7 +1533,7 @@ QDataStream &operator>>(QDataStream &ds, QLocale &l) l = QLocale(s); return ds; } -#endif +#endif // QT_NO_DATASTREAM /*! diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp index e1c3921..9c62c7a 100644 --- a/src/corelib/tools/qregexp.cpp +++ b/src/corelib/tools/qregexp.cpp @@ -4065,6 +4065,6 @@ QDataStream &operator>>(QDataStream &in, QRegExp ®Exp) regExp = newRegExp; return in; } -#endif +#endif // QT_NO_DATASTREAM QT_END_NAMESPACE diff --git a/src/corelib/tools/qsize.h b/src/corelib/tools/qsize.h index 34a6c99..237625e 100644 --- a/src/corelib/tools/qsize.h +++ b/src/corelib/tools/qsize.h @@ -98,8 +98,10 @@ Q_DECLARE_TYPEINFO(QSize, Q_MOVABLE_TYPE); QSize stream functions *****************************************************************************/ +#ifndef QT_NO_DATASTREAM Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QSize &); Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QSize &); +#endif /***************************************************************************** @@ -249,8 +251,10 @@ Q_DECLARE_TYPEINFO(QSizeF, Q_MOVABLE_TYPE); QSizeF stream functions *****************************************************************************/ +#ifndef QT_NO_DATASTREAM Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QSizeF &); Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QSizeF &); +#endif /***************************************************************************** diff --git a/src/gui/embedded/qkbd_qws_p.h b/src/gui/embedded/qkbd_qws_p.h index 3224da2..2ef1d0c 100644 --- a/src/gui/embedded/qkbd_qws_p.h +++ b/src/gui/embedded/qkbd_qws_p.h @@ -105,6 +105,7 @@ namespace QWSKeyboard { }; }; +#ifndef QT_NO_DATASTREAM inline QDataStream &operator>>(QDataStream &ds, QWSKeyboard::Mapping &m) { return ds >> m.keycode >> m.unicode >> m.qtcode >> m.modifiers >> m.flags >> m.special; @@ -124,6 +125,6 @@ inline QDataStream &operator<<(QDataStream &ds, const QWSKeyboard::Composing &c) { return ds << c.first << c.second << c.result; } - +#endif // QT_NO_DATASTREAM #endif // QWSKEYBOARD_H diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index c1c5631..0377ca7 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4763,7 +4763,7 @@ QDataStream &operator>>(QDataStream &s, QImage &image) image = QImageReader(s.device(), 0).read(); return s; } -#endif +#endif // QT_NO_DATASTREAM #ifdef QT3_SUPPORT diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp index 92023e0..23baa96 100644 --- a/src/gui/image/qpicture.cpp +++ b/src/gui/image/qpicture.cpp @@ -1143,6 +1143,7 @@ QPaintEngine *QPicture::paintEngine() const QPicture stream functions *****************************************************************************/ +#ifndef QT_NO_DATASTREAM /*! \relates QPicture @@ -1188,6 +1189,7 @@ QDataStream &operator>>(QDataStream &s, QPicture &r) r.d_func()->resetFormat(); return s; } +#endif // QT_NO_DATASTREAM #ifndef QT_NO_PICTUREIO diff --git a/src/gui/image/qpicture.h b/src/gui/image/qpicture.h index fe86e8d..edfac71 100644 --- a/src/gui/image/qpicture.h +++ b/src/gui/image/qpicture.h @@ -184,8 +184,10 @@ private: QPicture stream functions *****************************************************************************/ +#ifndef QT_NO_DATASTREAM Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPicture &); Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPicture &); +#endif #endif // QT_NO_PICTURE diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 8ed9e93..f6b5de2 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1317,7 +1317,7 @@ QDataStream &operator>>(QDataStream &stream, QPixmap &pixmap) return stream; } -#endif //QT_NO_DATASTREAM +#endif // QT_NO_DATASTREAM #ifdef QT3_SUPPORT Q_GUI_EXPORT void copyBlt(QPixmap *dst, int dx, int dy, diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index ad93922..d28c08a 100644 --- a/src/gui/itemviews/qheaderview.cpp +++ b/src/gui/itemviews/qheaderview.cpp @@ -62,9 +62,11 @@ #ifndef QT_NO_DATASTREAM #include +#endif QT_BEGIN_NAMESPACE +#ifndef QT_NO_DATASTREAM QDataStream &operator<<(QDataStream &out, const QHeaderViewPrivate::SectionSpan &span) { span.write(out); @@ -76,7 +78,7 @@ QDataStream &operator>>(QDataStream &in, QHeaderViewPrivate::SectionSpan &span) span.read(in); return in; } -#endif +#endif // QT_NO_DATASTREAM /*! @@ -1535,7 +1537,7 @@ bool QHeaderView::restoreState(const QByteArray &state) } return false; } -#endif +#endif // QT_NO_DATASTREAM /*! \reimp @@ -3571,9 +3573,9 @@ bool QHeaderViewPrivate::read(QDataStream &in) return true; } -QT_END_NAMESPACE +#endif // QT_NO_DATASTREAM -#endif // QT_NO_DATASTREAEM +QT_END_NAMESPACE #endif // QT_NO_ITEMVIEWS diff --git a/src/gui/itemviews/qlistwidget.cpp b/src/gui/itemviews/qlistwidget.cpp index bf3b43c..e1e509d 100644 --- a/src/gui/itemviews/qlistwidget.cpp +++ b/src/gui/itemviews/qlistwidget.cpp @@ -711,6 +711,7 @@ void QListWidgetItem::write(QDataStream &out) const { out << d->values; } +#endif // QT_NO_DATASTREAM /*! \since 4.1 @@ -745,6 +746,8 @@ QListWidgetItem &QListWidgetItem::operator=(const QListWidgetItem &other) return *this; } +#ifndef QT_NO_DATASTREAM + /*! \relates QListWidgetItem diff --git a/src/gui/itemviews/qstandarditemmodel.cpp b/src/gui/itemviews/qstandarditemmodel.cpp index 10aac9a..d8adbd2 100644 --- a/src/gui/itemviews/qstandarditemmodel.cpp +++ b/src/gui/itemviews/qstandarditemmodel.cpp @@ -1938,7 +1938,7 @@ QDataStream &operator<<(QDataStream &out, const QStandardItem &item) return out; } -#endif // !QT_NO_DATASTREAM +#endif // QT_NO_DATASTREAM /*! \class QStandardItemModel diff --git a/src/gui/itemviews/qtreewidget.cpp b/src/gui/itemviews/qtreewidget.cpp index 6103225..a2bfe45 100644 --- a/src/gui/itemviews/qtreewidget.cpp +++ b/src/gui/itemviews/qtreewidget.cpp @@ -1827,6 +1827,7 @@ void QTreeWidgetItem::write(QDataStream &out) const { out << values << d->display; } +#endif // QT_NO_DATASTREAM /*! \since 4.1 @@ -1863,8 +1864,6 @@ QTreeWidgetItem &QTreeWidgetItem::operator=(const QTreeWidgetItem &other) return *this; } -#endif // QT_NO_DATASTREAM - /*! Appends the \a child item to the list of children. diff --git a/src/gui/kernel/qlayout.cpp b/src/gui/kernel/qlayout.cpp index 4463aab..0a233d5 100644 --- a/src/gui/kernel/qlayout.cpp +++ b/src/gui/kernel/qlayout.cpp @@ -1583,8 +1583,6 @@ QDataStream &operator>>(QDataStream &stream, QSizePolicy &policy) { return stream >> policy.data; } - -#endif - +#endif // QT_NO_DATASTREAM QT_END_NAMESPACE diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp index 6541510..18a2142 100644 --- a/src/gui/kernel/qpalette.cpp +++ b/src/gui/kernel/qpalette.cpp @@ -125,7 +125,7 @@ QDataStream &operator>>(QDataStream &s, QColorGroup &g) { return qt_stream_in_qcolorgroup(s, g); } -#endif +#endif // QT_NO_DATASTREAM /*! Constructs a palette with the specified \a active, \a disabled and @@ -158,7 +158,7 @@ void QPalette::setColorGroup(ColorGroup cg, const QColorGroup &g) g.brush(LinkVisited), g.brush(ToolTipBase), g.brush(ToolTipText)); } -#endif +#endif // QT3_SUPPORT /*! \fn const QColor &QPalette::color(ColorRole role) const diff --git a/src/gui/kernel/qsizepolicy.h b/src/gui/kernel/qsizepolicy.h index 652fda1..32b3b4f 100644 --- a/src/gui/kernel/qsizepolicy.h +++ b/src/gui/kernel/qsizepolicy.h @@ -203,9 +203,11 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(QSizePolicy::ControlTypes) +#ifndef QT_NO_DATASTREAM // implemented in qlayout.cpp Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QSizePolicy &); Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QSizePolicy &); +#endif inline void QSizePolicy::transpose() { Policy hData = horizontalPolicy(); diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index b1fe3aa..fa833db 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -2116,9 +2116,7 @@ QDataStream &operator>>(QDataStream &stream, QColor &color) return stream; } -#endif - - +#endif // QT_NO_DATASTREAM /***************************************************************************** diff --git a/src/gui/painting/qfixed_p.h b/src/gui/painting/qfixed_p.h index 2e49615..c89d97a 100644 --- a/src/gui/painting/qfixed_p.h +++ b/src/gui/painting/qfixed_p.h @@ -181,8 +181,10 @@ inline bool operator<(int i, const QFixed &f) { return (i<<6) < f.value(); } inline bool operator>(const QFixed &f, int i) { return f.value() > (i<<6); } inline bool operator>(int i, const QFixed &f) { return (i<<6) > f.value(); } +#ifndef QT_NO_DEBUG_STREAM inline QDebug &operator<<(QDebug &dbg, const QFixed &f) { return dbg << f.toReal(); } +#endif struct QFixedPoint { QFixed x; diff --git a/src/gui/painting/qmatrix.h b/src/gui/painting/qmatrix.h index 1e5fbb4..1df2395 100644 --- a/src/gui/painting/qmatrix.h +++ b/src/gui/painting/qmatrix.h @@ -169,8 +169,10 @@ inline bool QMatrix::isIdentity() const QMatrix stream functions *****************************************************************************/ +#ifndef QT_NO_DATASTREAM Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QMatrix &); Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QMatrix &); +#endif #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QMatrix &); diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index bd91dfc..e1bb317 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -2366,7 +2366,7 @@ QDataStream &operator>>(QDataStream &s, QPainterPath &p) p.d_func()->dirtyControlBounds = true; return s; } -#endif +#endif // QT_NO_DATASTREAM /******************************************************************************* diff --git a/src/gui/painting/qpolygon.cpp b/src/gui/painting/qpolygon.cpp index 769c095..b79c288 100644 --- a/src/gui/painting/qpolygon.cpp +++ b/src/gui/painting/qpolygon.cpp @@ -742,7 +742,7 @@ QDataStream &operator>>(QDataStream &s, QPolygon &a) QVector &v = a; return s >> v; } -#endif +#endif // QT_NO_DATASTREAM /***************************************************************************** QPolygonF stream functions diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h index aac7c31..a5002ca 100644 --- a/src/gui/painting/qtransform.h +++ b/src/gui/painting/qtransform.h @@ -332,8 +332,10 @@ inline QTransform &QTransform::operator-=(qreal num) } /****** stream functions *******************/ +#ifndef QT_NO_DATASTREAM Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTransform &); Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTransform &); +#endif #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QTransform &); diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index 38ac4ca..d93f084 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -142,6 +142,7 @@ QTextLength::operator QVariant() const return QVariant(QVariant::TextLength, this); } +#ifndef QT_NO_DATASTREAM QDataStream &operator<<(QDataStream &stream, const QTextLength &length) { return stream << qint32(length.lengthType) << double(length.fixedValueOrPercentage); @@ -156,6 +157,7 @@ QDataStream &operator>>(QDataStream &stream, QTextLength &length) length.lengthType = QTextLength::Type(type); return stream; } +#endif // QT_NO_DATASTREAM class QTextFormatPrivate : public QSharedData { @@ -374,6 +376,7 @@ void QTextFormatPrivate::recalcFont() const fontDirty = false; } +#ifndef QT_NO_DATASTREAM Q_GUI_EXPORT QDataStream &operator<<(QDataStream &stream, const QTextFormat &fmt) { stream << fmt.format_type << fmt.properties(); @@ -396,6 +399,7 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &stream, QTextFormat &fmt) return stream; } +#endif // QT_NO_DATASTREAM /*! \class QTextFormat diff --git a/src/gui/text/qtextformat.h b/src/gui/text/qtextformat.h index 8eaeeb1..96c0739 100644 --- a/src/gui/text/qtextformat.h +++ b/src/gui/text/qtextformat.h @@ -76,8 +76,10 @@ class QTextCursor; class QTextDocument; class QTextLength; +#ifndef QT_NO_DATASTREAM Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextLength &); Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextLength &); +#endif class Q_GUI_EXPORT QTextLength { @@ -119,8 +121,10 @@ private: inline QTextLength::QTextLength(Type atype, qreal avalue) : lengthType(atype), fixedValueOrPercentage(avalue) {} +#ifndef QT_NO_DATASTREAM Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextFormat &); Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextFormat &); +#endif class Q_GUI_EXPORT QTextFormat { -- cgit v0.12 From ec110c41175daae436d49b1e2369f80587ba5b65 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 8 Jun 2009 10:55:45 +0200 Subject: My changes for 4.5.2 --- dist/changes-4.5.2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 39082f6..6049a4d 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -304,6 +304,10 @@ Qt for Windows CE QDesignerFormWindowCursor::setProperty(). * [253539] Prevent crash in Designer with the Cocoa port when when using a scroll wheel to change a property. + * [252333] Fixed a regression crash in uic triggered when icon was set with different modes + than normal off. + * [252414, 252416, 252502] Fixed a crash in case of setting invalid point size + of font property in property editor - Linguist - Linguist GUI -- cgit v0.12 From 6a2202b544e3d7809312f74b0cf0b2b392bd78b7 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 8 Jun 2009 10:53:05 +0200 Subject: Doc typo fix in QSslSocket Reviewed-by: TrustMe --- src/network/ssl/qsslsocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index ea64042..cf2512e 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -450,7 +450,7 @@ QSslSocket::SslMode QSslSocket::mode() const Returns true if the socket is encrypted; otherwise, false is returned. An encrypted socket encrypts all data that is written by calling write() - or putChar() before the data is written to the network, and descrypts all + or putChar() before the data is written to the network, and decrypts all incoming data as the data is received from the network, before you call read(), readLine() or getChar(). -- cgit v0.12 From 61d1dcea0efa6b0809639b781bb49baf252b3aad Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 8 Jun 2009 09:09:29 +0200 Subject: Mac: play music from CD does not work in Phonon ...because it was never implemented. This patch does that. Task-number: 255377 --- src/3rdparty/phonon/qt7/mediaobject.h | 18 ++- src/3rdparty/phonon/qt7/mediaobject.mm | 147 +++++++++++++-------- src/3rdparty/phonon/qt7/quicktimemetadata.h | 8 +- src/3rdparty/phonon/qt7/quicktimemetadata.mm | 41 ++++-- src/3rdparty/phonon/qt7/quicktimevideoplayer.h | 19 ++- src/3rdparty/phonon/qt7/quicktimevideoplayer.mm | 163 ++++++++++++++++++++++-- 6 files changed, 313 insertions(+), 83 deletions(-) diff --git a/src/3rdparty/phonon/qt7/mediaobject.h b/src/3rdparty/phonon/qt7/mediaobject.h index 27949ec..d59ee77 100644 --- a/src/3rdparty/phonon/qt7/mediaobject.h +++ b/src/3rdparty/phonon/qt7/mediaobject.h @@ -38,7 +38,10 @@ namespace QT7 class MediaObjectAudioNode; class MediaObject : public MediaNode, - public Phonon::MediaObjectInterface, public Phonon::AddonInterface + public Phonon::MediaObjectInterface +#ifndef QT_NO_PHONON_MEDIACONTROLLER + , public Phonon::AddonInterface +#endif { Q_OBJECT Q_INTERFACES(Phonon::MediaObjectInterface Phonon::AddonInterface) @@ -105,6 +108,16 @@ namespace QT7 void metaDataChanged(QMultiMap); void currentSourceChanged(const MediaSource &newSource); + // Add-on interface: + void availableSubtitlesChanged(); + void availableAudioChannelsChanged(); + void titleChanged(int); + void availableTitlesChanged(int); + void chapterChanged(int); + void availableChaptersChanged(int); + void angleChanged(int); + void availableAnglesChanged(int); + protected: void mediaNodeEvent(const MediaNodeEvent *event); bool event(QEvent *event); @@ -118,7 +131,6 @@ namespace QT7 QuickTimeVideoPlayer *m_nextVideoPlayer; QuickTimeAudioPlayer *m_nextAudioPlayer; MediaObjectAudioNode *m_mediaObjectAudioNode; - QuickTimeMetaData *m_metaData; qint32 m_tickInterval; qint32 m_transitionTime; @@ -133,6 +145,7 @@ namespace QT7 bool m_waitNextSwap; int m_swapTimeLeft; QTime m_swapTime; + bool m_autoplayTitles; void synchAudioVideo(); void updateCurrentTime(); @@ -154,6 +167,7 @@ namespace QT7 void inspectVideoGraphRecursive(MediaNode *node, int &effectCount, int &outputCount); void inspectGraph(); bool isCrossFading(); + void setCurrentTrack(int track); QString m_errorString; Phonon::ErrorType m_errorType; diff --git a/src/3rdparty/phonon/qt7/mediaobject.mm b/src/3rdparty/phonon/qt7/mediaobject.mm index 002c337..95859ef 100644 --- a/src/3rdparty/phonon/qt7/mediaobject.mm +++ b/src/3rdparty/phonon/qt7/mediaobject.mm @@ -46,7 +46,6 @@ MediaObject::MediaObject(QObject *parent) : MediaNode(AudioSource | VideoSource, m_mediaObjectAudioNode = new MediaObjectAudioNode(m_audioPlayer, m_nextAudioPlayer); setAudioNode(m_mediaObjectAudioNode); - m_metaData = new QuickTimeMetaData(); m_audioGraph = new AudioGraph(this); m_tickInterval = 0; @@ -55,6 +54,7 @@ MediaObject::MediaObject(QObject *parent) : MediaNode(AudioSource | VideoSource, m_transitionTime = 0; m_percentageLoaded = 0; m_waitNextSwap = false; + m_autoplayTitles = true; m_audioEffectCount = 0; m_audioOutputCount = 0; m_videoEffectCount = 0; @@ -70,13 +70,12 @@ MediaObject::MediaObject(QObject *parent) : MediaNode(AudioSource | VideoSource, } MediaObject::~MediaObject() -{ +{ // m_mediaObjectAudioNode is owned by super class. m_audioPlayer->unsetVideoPlayer(); m_nextAudioPlayer->unsetVideoPlayer(); delete m_videoPlayer; delete m_nextVideoPlayer; - delete m_metaData; checkForError(); } @@ -122,7 +121,7 @@ void MediaObject::inspectGraph() // Inspect the graph to check wether there are any // effects or outputs connected. This will have // influence on the audio system and video system that ends up beeing used: - int prevVideoOutputCount = m_videoOutputCount; + int prevVideoOutputCount = m_videoOutputCount; m_audioEffectCount = 0; m_audioOutputCount = 0; m_videoEffectCount = 0; @@ -134,7 +133,7 @@ void MediaObject::inspectGraph() if (m_videoOutputCount != prevVideoOutputCount){ MediaNodeEvent e1(MediaNodeEvent::VideoOutputCountChanged, &m_videoOutputCount); notify(&e1); - } + } } void MediaObject::setupAudioSystem() @@ -167,14 +166,14 @@ void MediaObject::setupAudioSystem() if (newAudioSystem == m_audioSystem) return; - + // Enable selected audio system: - m_audioSystem = newAudioSystem; + m_audioSystem = newAudioSystem; switch (newAudioSystem){ case AS_Silent: m_audioGraph->stop(); m_videoPlayer->enableAudio(false); - m_nextVideoPlayer->enableAudio(false); + m_nextVideoPlayer->enableAudio(false); m_audioPlayer->enableAudio(false); m_nextAudioPlayer->enableAudio(false); break; @@ -214,28 +213,28 @@ void MediaObject::setSource(const MediaSource &source) IMPLEMENTED; PhononAutoReleasePool pool; setState(Phonon::LoadingState); - + // Save current state for event/signal handling below: bool prevHasVideo = m_videoPlayer->hasVideo(); qint64 prevTotalTime = totalTime(); + int prevTrackCount = m_videoPlayer->trackCount(); m_waitNextSwap = false; - + // Cancel cross-fade if any: m_nextVideoPlayer->pause(); m_nextAudioPlayer->pause(); m_mediaObjectAudioNode->cancelCrossFade(); - + // Set new source: m_audioPlayer->unsetVideoPlayer(); m_videoPlayer->setMediaSource(source); m_audioPlayer->setVideoPlayer(m_videoPlayer); - m_metaData->setVideo(m_videoPlayer); - m_audioGraph->updateStreamSpecifications(); + m_audioGraph->updateStreamSpecifications(); m_nextAudioPlayer->unsetVideoPlayer(); - m_nextVideoPlayer->unsetVideo(); + m_nextVideoPlayer->unsetCurrentMediaSource(); m_currentTime = 0; - + // Emit/notify information about the new source: QRect videoRect = m_videoPlayer->videoRect(); MediaNodeEvent e1(MediaNodeEvent::VideoFrameSizeChanged, &videoRect); @@ -246,12 +245,14 @@ void MediaObject::setSource(const MediaSource &source) updateVideo(emptyFrame); emit currentSourceChanged(source); - emit metaDataChanged(m_metaData->metaData()); + emit metaDataChanged(m_videoPlayer->metaData()); if (prevHasVideo != m_videoPlayer->hasVideo()) - emit hasVideoChanged(m_videoPlayer->hasVideo()); + emit hasVideoChanged(m_videoPlayer->hasVideo()); if (prevTotalTime != totalTime()) - emit totalTimeChanged(totalTime()); + emit totalTimeChanged(totalTime()); + if (prevTrackCount != m_videoPlayer->trackCount()) + emit availableTitlesChanged(m_videoPlayer->trackCount()); if (checkForError()) return; if (!m_videoPlayer->isDrmAuthorized()) @@ -260,7 +261,7 @@ void MediaObject::setSource(const MediaSource &source) return; if (!m_videoPlayer->canPlayMedia()) SET_ERROR("Cannot play media.", FATAL_ERROR) - + // The state might have changed from LoadingState // as a response to an error state change. So we // need to check it before stopping: @@ -287,28 +288,30 @@ void MediaObject::swapCurrentWithNext(qint32 transitionTime) // Save current state for event/signal handling below: bool prevHasVideo = m_videoPlayer->hasVideo(); qint64 prevTotalTime = totalTime(); + int prevTrackCount = m_videoPlayer->trackCount(); qSwap(m_audioPlayer, m_nextAudioPlayer); qSwap(m_videoPlayer, m_nextVideoPlayer); m_mediaObjectAudioNode->startCrossFade(transitionTime); m_audioGraph->updateStreamSpecifications(); - m_metaData->setVideo(m_videoPlayer); m_waitNextSwap = false; m_currentTime = 0; - + // Emit/notify information about the new source: QRect videoRect = m_videoPlayer->videoRect(); MediaNodeEvent e1(MediaNodeEvent::VideoFrameSizeChanged, &videoRect); notify(&e1); emit currentSourceChanged(m_videoPlayer->mediaSource()); - emit metaDataChanged(m_metaData->metaData()); + emit metaDataChanged(m_videoPlayer->metaData()); if (prevHasVideo != m_videoPlayer->hasVideo()) - emit hasVideoChanged(m_videoPlayer->hasVideo()); + emit hasVideoChanged(m_videoPlayer->hasVideo()); if (prevTotalTime != totalTime()) emit totalTimeChanged(totalTime()); + if (prevTrackCount != m_videoPlayer->trackCount()) + emit availableTitlesChanged(m_videoPlayer->trackCount()); if (checkForError()) return; if (!m_videoPlayer->isDrmAuthorized()) @@ -332,15 +335,15 @@ void MediaObject::updateTimer(int &timer, int interval) if (timer) killTimer(timer); timer = 0; - if (interval >= 0) - timer = startTimer(interval); + if (interval >= 0) + timer = startTimer(interval); } void MediaObject::play_internal() { // Play main audio/video: m_videoPlayer->play(); - m_audioPlayer->play(); + m_audioPlayer->play(); updateLipSynch(0); // Play old audio/video to finish cross-fade: if (m_nextVideoPlayer->currentTime() > 0){ @@ -382,7 +385,7 @@ void MediaObject::play() if (!m_videoPlayer->canPlayMedia()) return; if (!setState(Phonon::PlayingState)) - return; + return; if (m_audioSystem == AS_Graph){ m_audioGraph->start(); m_mediaObjectAudioNode->setMute(true); @@ -423,7 +426,7 @@ void MediaObject::stop() if (!setState(Phonon::StoppedState)) return; m_waitNextSwap = false; - m_nextVideoPlayer->unsetVideo(); + m_nextVideoPlayer->unsetCurrentMediaSource(); m_nextAudioPlayer->unsetVideoPlayer(); pause_internal(); seek(0); @@ -435,9 +438,9 @@ void MediaObject::seek(qint64 milliseconds) IMPLEMENTED; if (m_state == Phonon::ErrorState) return; - + // Stop cross-fade if any: - m_nextVideoPlayer->unsetVideo(); + m_nextVideoPlayer->unsetCurrentMediaSource(); m_nextAudioPlayer->unsetVideoPlayer(); m_mediaObjectAudioNode->cancelCrossFade(); @@ -446,7 +449,7 @@ void MediaObject::seek(qint64 milliseconds) m_videoPlayer->seek(milliseconds); m_audioPlayer->seek(m_videoPlayer->currentTime()); m_mediaObjectAudioNode->setMute(false); - + // Update time and cancel pending swap: if (m_currentTime < m_videoPlayer->duration()) m_waitNextSwap = false; @@ -557,7 +560,7 @@ bool MediaObject::isSeekable() const qint64 MediaObject::currentTime() const { IMPLEMENTED_SILENT; - const_cast(this)->updateCurrentTime(); + const_cast(this)->updateCurrentTime(); return m_currentTime; } @@ -567,19 +570,24 @@ void MediaObject::updateCurrentTime() m_currentTime = (m_audioSystem == AS_Graph) ? m_audioPlayer->currentTime() : m_videoPlayer->currentTime(); quint64 total = m_videoPlayer->duration(); - // Check if it's time to emit aboutToFinish: - quint32 mark = qMax(quint64(0), qMin(total, total + m_transitionTime - 2000)); - if (lastUpdateTime < mark && mark <= m_currentTime) - emit aboutToFinish(); - - // Check if it's time to emit prefinishMarkReached: - mark = qMax(quint64(0), total - m_prefinishMark); - if (lastUpdateTime < mark && mark <= m_currentTime) - emit prefinishMarkReached(total - m_currentTime); + if (m_videoPlayer->currentTrack() < m_videoPlayer->trackCount() - 1){ + // There are still more tracks to play after the current track. + if (m_autoplayTitles) { + if (lastUpdateTime < m_currentTime && m_currentTime == total) + setCurrentTrack(m_videoPlayer->currentTrack() + 1); + } + } else if (m_nextVideoPlayer->state() == QuickTimeVideoPlayer::NoMedia){ + // There is no more sources or tracks to play after the current source. + // Check if it's time to emit aboutToFinish: + quint32 mark = qMax(quint64(0), qMin(total, total + m_transitionTime - 2000)); + if (lastUpdateTime < mark && mark <= m_currentTime) + emit aboutToFinish(); + + // Check if it's time to emit prefinishMarkReached: + mark = qMax(quint64(0), total - m_prefinishMark); + if (lastUpdateTime < mark && mark <= m_currentTime) + emit prefinishMarkReached(total - m_currentTime); - if (m_nextVideoPlayer->state() == QuickTimeVideoPlayer::NoMedia){ - // There is no next source in que. - // Check if it's time to emit finished: if (lastUpdateTime < m_currentTime && m_currentTime == total){ emit finished(); m_currentTime = (m_audioSystem == AS_Graph) ? m_audioPlayer->currentTime() : m_videoPlayer->currentTime(); @@ -589,7 +597,7 @@ void MediaObject::updateCurrentTime() } else { // We have a next source. // Check if it's time to swap to next source: - mark = qMax(quint64(0), total + m_transitionTime); + quint32 mark = qMax(quint64(0), total + m_transitionTime); if (m_waitNextSwap && m_state == Phonon::PlayingState && m_transitionTime < m_swapTime.msecsTo(QTime::currentTime())){ swapCurrentWithNext(0); @@ -692,14 +700,14 @@ bool MediaObject::setAudioDeviceOnMovie(int id) void MediaObject::updateCrossFade() { - m_mediaObjectAudioNode->updateCrossFade(m_currentTime); + m_mediaObjectAudioNode->updateCrossFade(m_currentTime); // Clean-up previous movie if done fading: if (m_mediaObjectAudioNode->m_fadeDuration == 0){ if (m_nextVideoPlayer->isPlaying() || m_nextAudioPlayer->isPlaying()){ - m_nextVideoPlayer->unsetVideo(); + m_nextVideoPlayer->unsetCurrentMediaSource(); m_nextAudioPlayer->unsetVideoPlayer(); } - } + } } void MediaObject::updateBufferStatus() @@ -728,7 +736,7 @@ void MediaObject::updateVideoFrames() // Draw next frame if awailable: if (m_videoPlayer->videoFrameChanged()){ updateLipSynch(50); - VideoFrame frame(m_videoPlayer); + VideoFrame frame(m_videoPlayer); if (m_nextVideoPlayer->isPlaying() && m_nextVideoPlayer->hasVideo() && isCrossFading()){ @@ -736,9 +744,9 @@ void MediaObject::updateVideoFrames() frame.setBackgroundFrame(bgFrame); frame.setBaseOpacity(m_mediaObjectAudioNode->m_volume1); } - + // Send the frame through the graph: - updateVideo(frame); + updateVideo(frame); checkForError(); } } @@ -749,7 +757,7 @@ void MediaObject::updateLipSynch(int allowedOffset) return; if (m_videoSinkList.isEmpty() || m_audioSinkList.isEmpty()) return; - + if (m_videoPlayer->hasVideo()){ qint64 diff = m_audioPlayer->currentTime() - m_videoPlayer->currentTime(); if (-allowedOffset > diff || diff > allowedOffset) @@ -834,13 +842,42 @@ bool MediaObject::event(QEvent *event) return QObject::event(event); } -bool MediaObject::hasInterface(Interface /*interface*/) const +void MediaObject::setCurrentTrack(int track) +{ + if (track == m_videoPlayer->currentTrack() || track < 0 || track >= m_videoPlayer->trackCount()) + return; + + m_videoPlayer->setCurrentTrack(track); + emit titleChanged(track); + emit metaDataChanged(m_videoPlayer->metaData()); +} + +bool MediaObject::hasInterface(Interface iface) const { - return false; + return iface == AddonInterface::TitleInterface; } -QVariant MediaObject::interfaceCall(Interface /*interface*/, int /*command*/, const QList &/*arguments*/) +QVariant MediaObject::interfaceCall(Interface iface, int command, const QList ¶ms) { + switch (iface) { + case TitleInterface: + switch (command) { + case availableTitles: + return m_videoPlayer->trackCount(); + case title: + return m_videoPlayer->currentTrack(); + case setTitle: + setCurrentTrack(params.first().toInt()); + break; + case autoplayTitles: + return m_autoplayTitles; + case setAutoplayTitles: + m_autoplayTitles = params.first().toBool(); + break; + } + default: + break; + } return QVariant(); } diff --git a/src/3rdparty/phonon/qt7/quicktimemetadata.h b/src/3rdparty/phonon/qt7/quicktimemetadata.h index d524183..c589535 100644 --- a/src/3rdparty/phonon/qt7/quicktimemetadata.h +++ b/src/3rdparty/phonon/qt7/quicktimemetadata.h @@ -38,10 +38,8 @@ namespace QT7 class QuickTimeMetaData { public: - QuickTimeMetaData(); - virtual ~QuickTimeMetaData(); - - void setVideo(QuickTimeVideoPlayer *videoPlayer); + QuickTimeMetaData(QuickTimeVideoPlayer *videoPlayer); + void update(); QMultiMap metaData(); private: @@ -49,6 +47,8 @@ namespace QT7 bool m_movieChanged; QuickTimeVideoPlayer *m_videoPlayer; void readMetaData(); + void guessMetaDataForCD(); + void readMetaDataFromMovie(); #ifdef QUICKTIME_C_API_AVAILABLE QString stripCopyRightSymbol(const QString &key); diff --git a/src/3rdparty/phonon/qt7/quicktimemetadata.mm b/src/3rdparty/phonon/qt7/quicktimemetadata.mm index 851e707..2dcc152 100644 --- a/src/3rdparty/phonon/qt7/quicktimemetadata.mm +++ b/src/3rdparty/phonon/qt7/quicktimemetadata.mm @@ -15,6 +15,7 @@ along with this library. If not, see . */ +#include #include "quicktimemetadata.h" #include "quicktimevideoplayer.h" @@ -25,19 +26,14 @@ namespace Phonon namespace QT7 { -QuickTimeMetaData::QuickTimeMetaData() +QuickTimeMetaData::QuickTimeMetaData(QuickTimeVideoPlayer *videoPlayer) { - m_videoPlayer = 0; + m_videoPlayer = videoPlayer; m_movieChanged = false; } -QuickTimeMetaData::~QuickTimeMetaData() +void QuickTimeMetaData::update() { -} - -void QuickTimeMetaData::setVideo(QuickTimeVideoPlayer *videoPlayer) -{ - m_videoPlayer = videoPlayer; m_movieChanged = true; m_metaData.clear(); } @@ -145,14 +141,22 @@ void QuickTimeMetaData::readFormattedData(QTMetaDataRef metaDataRef, OSType form #endif // QUICKTIME_C_API_AVAILABLE -void QuickTimeMetaData::readMetaData() +void QuickTimeMetaData::guessMetaDataForCD() +{ + QString album = QFileInfo(m_videoPlayer->movieCompactDiscPath()).fileName(); + QString title = QFileInfo(m_videoPlayer->currentTrackPath()).fileName(); + title = title.left(title.lastIndexOf('.')); + m_metaData.insert(QLatin1String("ALBUM"), album); + m_metaData.insert(QLatin1String("TITLE"), title); + m_metaData.insert(QLatin1String("TRACKNUMBER"), QString::number(m_videoPlayer->currentTrack())); +} + +void QuickTimeMetaData::readMetaDataFromMovie() { - if (!m_videoPlayer) - return; QMultiMap metaMap; - + #ifdef QUICKTIME_C_API_AVAILABLE - QTMetaDataRef metaDataRef; + QTMetaDataRef metaDataRef; OSStatus err = QTCopyMovieMetaData([m_videoPlayer->qtMovie() quickTimeMovie], &metaDataRef); BACKEND_ASSERT2(err == noErr, "Could not read QuickTime meta data", NORMAL_ERROR) @@ -173,6 +177,17 @@ void QuickTimeMetaData::readMetaData() m_metaData.insert(QLatin1String("DESCRIPTION"), metaMap.value(QLatin1String("des"))); } +void QuickTimeMetaData::readMetaData() +{ + if (!m_videoPlayer) + return; + + if (m_videoPlayer->mediaSource().type() == Phonon::MediaSource::Disc) + guessMetaDataForCD(); + else + readMetaDataFromMovie(); +} + QMultiMap QuickTimeMetaData::metaData() { if (m_videoPlayer && m_videoPlayer->hasMovie() && m_movieChanged) diff --git a/src/3rdparty/phonon/qt7/quicktimevideoplayer.h b/src/3rdparty/phonon/qt7/quicktimevideoplayer.h index b80570a..8495e18 100644 --- a/src/3rdparty/phonon/qt7/quicktimevideoplayer.h +++ b/src/3rdparty/phonon/qt7/quicktimevideoplayer.h @@ -39,6 +39,7 @@ namespace Phonon namespace QT7 { class QuickTimeStreamReader; + class QuickTimeMetaData; class VideoRenderWidgetQTMovieView; class QuickTimeVideoPlayer : QObject @@ -56,7 +57,7 @@ namespace QT7 void setMediaSource(const MediaSource &source); MediaSource mediaSource() const; - void unsetVideo(); + void unsetCurrentMediaSource(); void play(); void pause(); @@ -84,6 +85,7 @@ namespace QT7 bool setAudioDevice(int id); void setPlaybackRate(float rate); QTMovie *qtMovie() const; + QMultiMap metaData(); float playbackRate() const; float prefferedPlaybackRate() const; @@ -103,6 +105,12 @@ namespace QT7 float percentageLoaded(); quint64 timeLoaded(); + int trackCount() const; + int currentTrack() const; + void setCurrentTrack(int track); + QString movieCompactDiscPath() const; + QString currentTrackPath() const; + static QString timeToString(quint64 ms); // Help functions when drawing to more that one widget in cocoa 64: @@ -116,6 +124,7 @@ namespace QT7 QTMovie *m_QTMovie; State m_state; QGLPixelBuffer *m_QImagePixelBuffer; + QuickTimeMetaData *m_metaData; bool m_playbackRateSat; bool m_isDrmProtected; @@ -133,6 +142,9 @@ namespace QT7 qreal m_contrast; qreal m_hue; qreal m_saturation; + NSArray *m_folderTracks; + int m_currentTrack; + QString m_movieCompactDiscPath; #ifdef QUICKTIME_C_API_AVAILABLE QTVisualContextRef m_visualContext; @@ -140,16 +152,21 @@ namespace QT7 VideoFrame m_currentFrame; QuickTimeStreamReader *m_streamReader; + void prepareCurrentMovieForPlayback(); void createVisualContext(); void openMovieFromCurrentMediaSource(); void openMovieFromDataRef(QTDataReference *dataRef); void openMovieFromFile(); void openMovieFromUrl(); void openMovieFromStream(); + void openMovieFromCompactDisc(); void openMovieFromData(QByteArray *data, char *fileType); void openMovieFromDataGuessType(QByteArray *data); QString mediaSourcePath(); bool codecExistsAccordingToSuffix(const QString &fileName); + NSString* pathToCompactDisc(); + bool isCompactDisc(NSString *path); + NSArray* scanFolder(NSString *path); void setError(NSError *error); bool errorOccured(); diff --git a/src/3rdparty/phonon/qt7/quicktimevideoplayer.mm b/src/3rdparty/phonon/qt7/quicktimevideoplayer.mm index 3f76132..93867e2 100644 --- a/src/3rdparty/phonon/qt7/quicktimevideoplayer.mm +++ b/src/3rdparty/phonon/qt7/quicktimevideoplayer.mm @@ -20,6 +20,7 @@ #include "videowidget.h" #include "audiodevice.h" #include "quicktimestreamreader.h" +#include "quicktimemetadata.h" #include #include @@ -52,6 +53,7 @@ QuickTimeVideoPlayer::QuickTimeVideoPlayer() : QObject(0) { m_state = NoMedia; m_mediaSource = MediaSource(); + m_metaData = new QuickTimeMetaData(this); m_QTMovie = 0; m_streamReader = 0; m_playbackRate = 1.0f; @@ -67,6 +69,8 @@ QuickTimeVideoPlayer::QuickTimeVideoPlayer() : QObject(0) m_primaryRenderingTarget = 0; m_primaryRenderingCIImage = 0; m_QImagePixelBuffer = 0; + m_folderTracks = 0; + m_currentTrack = 0; #ifdef QUICKTIME_C_API_AVAILABLE OSStatus err = EnterMovies(); @@ -77,7 +81,8 @@ QuickTimeVideoPlayer::QuickTimeVideoPlayer() : QObject(0) QuickTimeVideoPlayer::~QuickTimeVideoPlayer() { - unsetVideo(); + unsetCurrentMediaSource(); + delete m_metaData; [(NSObject*)m_primaryRenderingTarget release]; m_primaryRenderingTarget = 0; #ifdef QUICKTIME_C_API_AVAILABLE @@ -397,7 +402,7 @@ QRect QuickTimeVideoPlayer::videoRect() const return QRect(0, 0, size.width, size.height); } -void QuickTimeVideoPlayer::unsetVideo() +void QuickTimeVideoPlayer::unsetCurrentMediaSource() { if (!m_QTMovie) return; @@ -411,10 +416,13 @@ void QuickTimeVideoPlayer::unsetVideo() m_isDrmProtected = false; m_isDrmAuthorized = true; m_mediaSource = MediaSource(); + m_movieCompactDiscPath.clear(); [(CIImage *)m_primaryRenderingCIImage release]; m_primaryRenderingCIImage = 0; delete m_QImagePixelBuffer; m_QImagePixelBuffer = 0; + [m_folderTracks release]; + m_folderTracks = 0; } QuickTimeVideoPlayer::State QuickTimeVideoPlayer::state() const @@ -524,18 +532,25 @@ bool QuickTimeVideoPlayer::codecExistsAccordingToSuffix(const QString &fileName) void QuickTimeVideoPlayer::setMediaSource(const MediaSource &mediaSource) { PhononAutoReleasePool pool; - unsetVideo(); + unsetCurrentMediaSource(); + m_mediaSource = mediaSource; if (mediaSource.type() == MediaSource::Empty || mediaSource.type() == MediaSource::Invalid){ m_state = NoMedia; return; } + openMovieFromCurrentMediaSource(); if (errorOccured()){ - unsetVideo(); + unsetCurrentMediaSource(); return; } + prepareCurrentMovieForPlayback(); +} + +void QuickTimeVideoPlayer::prepareCurrentMovieForPlayback() +{ #ifdef QUICKTIME_C_API_AVAILABLE if (m_visualContext) SetMovieVisualContext([m_QTMovie quickTimeMovie], m_visualContext); @@ -543,14 +558,14 @@ void QuickTimeVideoPlayer::setMediaSource(const MediaSource &mediaSource) waitStatePlayable(); if (errorOccured()){ - unsetVideo(); + unsetCurrentMediaSource(); return; } readProtection(); preRollMovie(); if (errorOccured()){ - unsetVideo(); + unsetCurrentMediaSource(); return; } @@ -560,6 +575,7 @@ void QuickTimeVideoPlayer::setMediaSource(const MediaSource &mediaSource) enableAudio(m_audioEnabled); setMute(m_mute); setVolume(m_masterVolume, m_relativeVolume); + m_metaData->update(); pause(); } @@ -573,7 +589,7 @@ void QuickTimeVideoPlayer::openMovieFromCurrentMediaSource() openMovieFromUrl(); break; case MediaSource::Disc: - CASE_UNSUPPORTED("Could not open media source.", FATAL_ERROR) + openMovieFromCompactDisc(); break; case MediaSource::Stream: openMovieFromStream(); @@ -635,7 +651,7 @@ void QuickTimeVideoPlayer::openMovieFromDataGuessType(QByteArray *data) // than using e.g [QTMovie movieFileTypes:QTIncludeCommonTypes]. Some // codecs *think* they can decode the stream, and crash... #define TryOpenMovieWithCodec(type) gClearError(); \ - openMovieFromData(data, "."type); \ + openMovieFromData(data, (char *)"."type); \ if (m_QTMovie) return; TryOpenMovieWithCodec("avi"); @@ -675,6 +691,50 @@ void QuickTimeVideoPlayer::openMovieFromStream() openMovieFromDataGuessType(m_streamReader->pointerToData()); } +typedef void (*qt_sighandler_t)(int); +static void sigtest(int) { + qApp->exit(0); +} + +void QuickTimeVideoPlayer::openMovieFromCompactDisc() +{ + // Interrupting the application while the device is open + // causes the application to hang. So we need to handle + // this in a more graceful way: + qt_sighandler_t hndl = signal(SIGINT, sigtest); + if (hndl) + signal(SIGINT, hndl); + + PhononAutoReleasePool pool; + NSString *cd = 0; + QString devName = m_mediaSource.deviceName(); + if (devName.isEmpty()) { + cd = pathToCompactDisc(); + if (!cd) { + SET_ERROR("Could not open media source.", NORMAL_ERROR) + return; + } + m_movieCompactDiscPath = PhononCFString::toQString(reinterpret_cast(cd)); + } else { + if (!QFileInfo(devName).isAbsolute()) + devName = QLatin1String("/Volumes/") + devName; + cd = [reinterpret_cast(PhononCFString::toCFStringRef(devName)) autorelease]; + if (!isCompactDisc(cd)) { + SET_ERROR("Could not open media source.", NORMAL_ERROR) + return; + } + m_movieCompactDiscPath = devName; + } + + m_folderTracks = [scanFolder(cd) retain]; + setCurrentTrack(0); +} + +QString QuickTimeVideoPlayer::movieCompactDiscPath() const +{ + return m_movieCompactDiscPath; +} + MediaSource QuickTimeVideoPlayer::mediaSource() const { return m_mediaSource; @@ -950,6 +1010,93 @@ void QuickTimeVideoPlayer::readProtection() } } +QMultiMap QuickTimeVideoPlayer::metaData() +{ + return m_metaData->metaData(); +} + +int QuickTimeVideoPlayer::trackCount() const +{ + if (!m_folderTracks) + return 0; + return [m_folderTracks count]; +} + +int QuickTimeVideoPlayer::currentTrack() const +{ + return m_currentTrack; +} + +QString QuickTimeVideoPlayer::currentTrackPath() const +{ + if (!m_folderTracks) + return QString(); + + PhononAutoReleasePool pool; + NSString *trackPath = [m_folderTracks objectAtIndex:m_currentTrack]; + return PhononCFString::toQString(reinterpret_cast(trackPath)); +} + +NSString* QuickTimeVideoPlayer::pathToCompactDisc() +{ + PhononAutoReleasePool pool; + NSArray *devices = [[NSWorkspace sharedWorkspace] mountedRemovableMedia]; + for (NSString *dev in devices) { + if (isCompactDisc(dev)) + return [dev retain]; + } + return 0; +} + +bool QuickTimeVideoPlayer::isCompactDisc(NSString *path) +{ + PhononAutoReleasePool pool; + NSString *type = [NSString string]; + [[NSWorkspace sharedWorkspace] getFileSystemInfoForPath:path + isRemovable:0 + isWritable:0 + isUnmountable:0 + description:0 + type:&type]; + return [type hasPrefix:@"cdd"]; +} + +NSArray* QuickTimeVideoPlayer::scanFolder(NSString *path) +{ + NSMutableArray *tracks = [NSMutableArray arrayWithCapacity:20]; + if (!path) + return tracks; + + NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] enumeratorAtPath:path]; + while (NSString *track = [enumerator nextObject]) { + if (![track hasPrefix:@"."]) + [tracks addObject:[path stringByAppendingPathComponent:track]]; + } + return tracks; +} + +void QuickTimeVideoPlayer::setCurrentTrack(int track) +{ + PhononAutoReleasePool pool; + [m_QTMovie release]; + m_QTMovie = 0; + m_currentTime = 0; + m_currentTrack = track; + + if (!m_folderTracks) + return; + if (track < 0 || track >= (int)[m_folderTracks count]) + return; + + NSString *trackPath = [m_folderTracks objectAtIndex:track]; + QTDataReference *dataRef = [QTDataReference dataReferenceWithReferenceToFile:trackPath]; + State currentState = m_state; + openMovieFromDataRef(dataRef); + prepareCurrentMovieForPlayback(); + if (currentState == Playing) + play(); +} + }} QT_END_NAMESPACE -- cgit v0.12 From b5579e01a023800a6fd81193209db00e000a3620 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 8 Jun 2009 11:05:35 +0200 Subject: Made QTreeWidgetItem::operator<() check if the data is numerical when comparing. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit More information in task 166873. Merge-request: 514 Reviewed-by: Jan-Arve Sæther --- src/gui/itemviews/qtreewidget.cpp | 33 +++++++++++++++++++++++++++--- src/gui/itemviews/qtreewidget_p.h | 1 + tests/auto/qtreewidget/tst_qtreewidget.cpp | 4 ++++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/gui/itemviews/qtreewidget.cpp b/src/gui/itemviews/qtreewidget.cpp index a2bfe45..1c87580 100644 --- a/src/gui/itemviews/qtreewidget.cpp +++ b/src/gui/itemviews/qtreewidget.cpp @@ -577,7 +577,7 @@ void QTreeModel::sort(int column, Qt::SortOrder order) if (column < 0 || column >= columnCount()) return; - //layoutAboutToBeChanged and layoutChanged will be called by sortChildren + //layoutAboutToBeChanged and layoutChanged will be called by sortChildren rootItem->sortChildren(column, order, true); } @@ -695,6 +695,29 @@ bool QTreeModel::itemGreaterThan(const QPair &left, } /*! + \internal + + Returns true if the type of the variant \a value + can be casted as double. +*/ +bool QTreeModel::canConvertToDouble(const QVariant &value) +{ + switch (value.type()) { + case QVariant::Bool: + case QVariant::Int: + case QVariant::UInt: + case QVariant::LongLong: + case QVariant::ULongLong: + case QVariant::Double: + case QVariant::Char: + return true; + default: + return false; + } + return false; +} + +/*! \internal */ QList::iterator QTreeModel::sortedInsertionIterator( @@ -1787,7 +1810,11 @@ QVariant QTreeWidgetItem::data(int column, int role) const bool QTreeWidgetItem::operator<(const QTreeWidgetItem &other) const { int column = view ? view->sortColumn() : 0; - return text(column) < other.text(column); + const QVariant v1 = data(column, Qt::DisplayRole); + const QVariant v2 = other.data(column, Qt::DisplayRole); + if (QTreeModel::canConvertToDouble(v1) && QTreeModel::canConvertToDouble(v2)) + return v1.toDouble() < v2.toDouble(); + return v1.toString() < v2.toString(); } #ifndef QT_NO_DATASTREAM @@ -2074,7 +2101,7 @@ void QTreeWidgetItemPrivate::sortChildren(int column, Qt::SortOrder order, bool if (climb) { QList::iterator it = q->children.begin(); for (; it != q->children.end(); ++it) { - //here we call the private object's method to avoid emitting + //here we call the private object's method to avoid emitting //the layoutAboutToBeChanged and layoutChanged signals (*it)->d->sortChildren(column, order, climb); } diff --git a/src/gui/itemviews/qtreewidget_p.h b/src/gui/itemviews/qtreewidget_p.h index a089cf5..96f734d 100644 --- a/src/gui/itemviews/qtreewidget_p.h +++ b/src/gui/itemviews/qtreewidget_p.h @@ -116,6 +116,7 @@ public: const QPair &right); static bool itemGreaterThan(const QPair &left, const QPair &right); + static bool canConvertToDouble(const QVariant &value); static QList::iterator sortedInsertionIterator( const QList::iterator &begin, const QList::iterator &end, diff --git a/tests/auto/qtreewidget/tst_qtreewidget.cpp b/tests/auto/qtreewidget/tst_qtreewidget.cpp index 906332c..32a2c40 100644 --- a/tests/auto/qtreewidget/tst_qtreewidget.cpp +++ b/tests/auto/qtreewidget/tst_qtreewidget.cpp @@ -2434,6 +2434,10 @@ void tst_QTreeWidget::itemOperatorLessThan() item1.setText(0, "b"); item2.setText(0, "a"); QCOMPARE(item1 < item2, true); + tw.sortItems(0, Qt::AscendingOrder); + item1.setData(0, Qt::DisplayRole, 11); + item2.setData(0, Qt::DisplayRole, 2); + QCOMPARE(item1 < item2, false); } } -- cgit v0.12 From fded22680a728ecba93feb87733785537c234b02 Mon Sep 17 00:00:00 2001 From: mae Date: Mon, 8 Jun 2009 12:35:20 +0200 Subject: Extend auto test to cover the emission order of the contentChange() and cursorPositionChanged() singals of QTextDocument. The contentChange() signal is used for the syntax highlighter. --- tests/auto/qtextdocument/tst_qtextdocument.cpp | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/auto/qtextdocument/tst_qtextdocument.cpp b/tests/auto/qtextdocument/tst_qtextdocument.cpp index 63a172b..27be372 100644 --- a/tests/auto/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/qtextdocument/tst_qtextdocument.cpp @@ -163,6 +163,8 @@ private slots: void testUndoBlocks(); + void receiveCursorPositionChangedAfterContentsChange(); + private: void backgroundImage_checkExpectedHtml(const QTextDocument &doc); @@ -2453,5 +2455,35 @@ void tst_QTextDocument::testUndoBlocks() QCOMPARE(doc->toPlainText(), QString("")); } +class Receiver : public QObject +{ + Q_OBJECT + public: + QString first; + public slots: + void cursorPositionChanged() { + if (first.isEmpty()) + first = QLatin1String("cursorPositionChanged"); + } + + void contentsChange() { + if (first.isEmpty()) + first = QLatin1String("contentsChanged"); + } +}; + +void tst_QTextDocument::receiveCursorPositionChangedAfterContentsChange() +{ + QVERIFY(doc); + doc->setDocumentLayout(new MyAbstractTextDocumentLayout(doc)); + Receiver rec; + connect(doc, SIGNAL(cursorPositionChanged(QTextCursor)), + &rec, SLOT(cursorPositionChanged())); + connect(doc, SIGNAL(contentsChange(int,int,int)), + &rec, SLOT(contentsChange())); + cursor.insertText("Hello World"); + QCOMPARE(rec.first, QString("contentsChanged")); +} + QTEST_MAIN(tst_QTextDocument) #include "tst_qtextdocument.moc" -- cgit v0.12 From 11303c676166cda3aae33e7e97939e9d2942271f Mon Sep 17 00:00:00 2001 From: mae Date: Mon, 8 Jun 2009 12:43:13 +0200 Subject: Revert signal emission order in QTextDocument to 4.5 behaviour This is covered by the autotest tst_QTextDocument::receiveCursorPositionChangedAfterContentsChange() Reviewed-by: con --- src/gui/text/qtextdocument_p.cpp | 8 +++++++- src/gui/text/qtextdocument_p.h | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp index e1da4be..7700c14 100644 --- a/src/gui/text/qtextdocument_p.cpp +++ b/src/gui/text/qtextdocument_p.cpp @@ -193,6 +193,8 @@ QTextDocumentPrivate::QTextDocumentPrivate() undoEnabled = true; inContentsChange = false; + inEdit = false; + defaultTextOption.setTabStop(80); // same as in qtextengine.cpp defaultTextOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); @@ -439,6 +441,7 @@ void QTextDocumentPrivate::insert(int pos, int strPos, int strLength, int format Q_ASSERT(pos >= 0 && pos < fragments.length()); Q_ASSERT(formats.format(format).isCharFormat()); + beginEdit(); insert_string(pos, strPos, strLength, format, QTextUndoCommand::MoveCursor); if (undoEnabled) { int b = blocks.findNode(pos); @@ -564,6 +567,7 @@ void QTextDocumentPrivate::move(int pos, int to, int length, QTextUndoCommand::O if (pos == to) return; + beginEdit(); const bool needsInsert = to != -1; #if !defined(QT_NO_DEBUG) @@ -1106,6 +1110,8 @@ void QTextDocumentPrivate::finishEdit() if (editBlock) return; + inEdit = false; + if (framesDirty) scan_frames(docChangeFrom, docChangeOldLength, docChangeLength); @@ -1175,7 +1181,7 @@ void QTextDocumentPrivate::adjustDocumentChangesAndCursors(int from, int addedOr for (int i = 0; i < cursors.size(); ++i) { QTextCursorPrivate *curs = cursors.at(i); if (curs->adjustPosition(from, addedOrRemoved, op) == QTextCursorPrivate::CursorMoved) { - if (editBlock) { + if (editBlock || inEdit) { if (!changedCursors.contains(curs)) changedCursors.append(curs); } else { diff --git a/src/gui/text/qtextdocument_p.h b/src/gui/text/qtextdocument_p.h index d754ff0..e10e7ae 100644 --- a/src/gui/text/qtextdocument_p.h +++ b/src/gui/text/qtextdocument_p.h @@ -202,6 +202,7 @@ public: inline void beginEditBlock() { editBlock++; } void joinPreviousEditBlock(); void endEditBlock(); + inline void beginEdit() { inEdit = true; } void finishEdit(); inline bool isInEditBlock() const { return editBlock; } void enableUndoRedo(bool enable); @@ -335,8 +336,9 @@ public: QCss::StyleSheet parsedDefaultStyleSheet; #endif int maximumBlockCount; - bool needsEnsureMaximumBlockCount; - bool inContentsChange; + uint needsEnsureMaximumBlockCount : 1; + uint inContentsChange : 1; + uint inEdit : 1; // between beginEdit() and finishEdit() QSizeF pageSize; QString title; QString url; -- cgit v0.12 From f38c81bfbae39c6f58d87b874d0abdee0d3ac8af Mon Sep 17 00:00:00 2001 From: Bruno Abinader Date: Mon, 8 Jun 2009 13:06:21 +0200 Subject: Reflected the state machine framework API changes on documentation. Signed-off-by: Bruno Abinader Merge-request: 602 Reviewed-by: David Boddie --- doc/src/animation.qdoc | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/doc/src/animation.qdoc b/doc/src/animation.qdoc index b4e603c..c16d6a2 100644 --- a/doc/src/animation.qdoc +++ b/doc/src/animation.qdoc @@ -327,14 +327,14 @@ \section1 Animations and States When using a \l{The State Machine Framework}{state machine}, we - have a special state, QAnimationState, that will play one or more - animations. - - The QState::addAnimatedTransition() convenience function lets you - associate an animation to a state transition. The function will - create the QAnimationState for you, and insert it into the state - machine. We also have the possibility to associate properties with - the states rather than setting the start and end values ourselves. + can associate an animation to a transition between states using a + QSignalTransition or QEventTransition class. These classes are both + derived from QAbstractClass, which defines the convenience function + addAnimation() that enables the appending of one or more animations + triggered when the transition occurs. + + We also have the possibility to associate properties with the + states rather than setting the start and end values ourselves. Below is a complete code example that animates the geometry of a QPushButton. @@ -345,18 +345,19 @@ QStateMachine *machine = new QStateMachine; QState *state1 = new QState(machine->rootState()); - state1->setPropertyOnEntry(button, "geometry", - QRect(0, 0, 100, 30)); + state1->assignProperty(button, "geometry", QRect(0, 0, 100, 30)); machine->setInitialState(state1); QState *state2 = new QState(machine->rootState()); - state2->setPropertyOnEntry(button, "geometry", - QRect(250, 250, 100, 30)); + state2->assignProperty(button, "geometry", QRect(250, 250, 100, 30)); - state1->addAnimatedTransition(button, SIGNAL(clicked()), state2, - new QPropertyAnimation(button, "geometry")); - state2->addAnimatedTransition(button, SIGNAL(clicked()), state1, - new QPropertyAnimation(button, "geometry")); + QSignalTransition *transition1 = state1->addTransition(button, + SIGNAL(clicked()), state2); + transition1->addAnimation(new QPropertyAnimation(button, "geometry")); + + QSignalTransition *transition2 = state2->addTransition(button, + SIGNAL(clicked()), state1); + transition2->addAnimation(new QPropertyAnimation(button, "geometry")); machine->start(); \endcode -- cgit v0.12 From fd6b00fcbc049ba3d7f8f0e6b9913b376130d88f Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 8 Jun 2009 13:25:19 +0200 Subject: qdoc: Updated the code to create references to documents and files. Task-number: 251995 Reviewed-by: Martin Smith --- tools/qdoc3/tree.cpp | 80 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 32 deletions(-) diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp index 0fbd438..370bd5a 100644 --- a/tools/qdoc3/tree.cpp +++ b/tools/qdoc3/tree.cpp @@ -1884,23 +1884,25 @@ QString Tree::fullDocumentLocation(const Node *node) const if (!node->url().isEmpty()) return node->url(); + QString parentName; + QString anchorRef; + if (node->type() == Node::Namespace) { // The root namespace has no name - check for this before creating // an attribute containing the location of any documentation. if (!node->fileBase().isEmpty()) - return node->fileBase() + ".html"; + parentName = node->fileBase() + ".html"; else return ""; } else if (node->type() == Node::Fake) { - return node->fileBase() + ".html"; + parentName = node->fileBase() + ".html"; } else if (node->fileBase().isEmpty()) return ""; - QString parentName; Node *parentNode = 0; if ((parentNode = node->relates())) @@ -1912,10 +1914,11 @@ QString Tree::fullDocumentLocation(const Node *node) const case Node::Class: case Node::Namespace: if (parentNode && !parentNode->name().isEmpty()) - return parentName.replace(".html", "") + "-" - + node->fileBase().toLower() + ".html"; + parentName = parentName.replace(".html", "") + "-" + + node->fileBase().toLower() + ".html"; else - return node->fileBase() + ".html"; + parentName = node->fileBase() + ".html"; + break; case Node::Function: { /* @@ -1925,29 +1928,17 @@ QString Tree::fullDocumentLocation(const Node *node) const const FunctionNode *functionNode = static_cast(node); - // Functions can be compatibility functions or be obsolete. - switch (node->status()) { - case Node::Compat: - parentName.replace(".html", "-qt3.html"); - break; - case Node::Obsolete: - parentName.replace(".html", "-obsolete.html"); - break; - default: - ; - } - if (functionNode->metaness() == FunctionNode::Dtor) - return parentName + "#dtor." + functionNode->name().mid(1); + anchorRef = "#dtor." + functionNode->name().mid(1); - if (functionNode->associatedProperty()) + else if (functionNode->associatedProperty()) return fullDocumentLocation(functionNode->associatedProperty()); - if (functionNode->overloadNumber() > 1) - return parentName + "#" + functionNode->name() - + "-" + QString::number(functionNode->overloadNumber()); + else if (functionNode->overloadNumber() > 1) + anchorRef = "#" + functionNode->name() + + "-" + QString::number(functionNode->overloadNumber()); else - return parentName + "#" + functionNode->name(); + anchorRef = "#" + functionNode->name(); } /* @@ -1955,27 +1946,52 @@ QString Tree::fullDocumentLocation(const Node *node) const the latter returns the name in lower-case. For HTML anchors, we need to preserve the case. */ + break; case Node::Enum: - return parentName + "#" + node->name() + "-enum"; + anchorRef = "#" + node->name() + "-enum"; + break; case Node::Typedef: - return parentName + "#" + node->name() + "-typedef"; + anchorRef = "#" + node->name() + "-typedef"; + break; case Node::Property: - return parentName + "#" + node->name() + "-prop"; + anchorRef = "#" + node->name() + "-prop"; + break; case Node::Variable: - return parentName + "#" + node->name() + "-var"; + anchorRef = "#" + node->name() + "-var"; + break; case Node::Target: - return parentName + "#" + Doc::canonicalTitle(node->name()); + anchorRef = "#" + Doc::canonicalTitle(node->name()); + break; case Node::Fake: { - QString pageName = node->name(); - return pageName.replace("/", "-").replace(".", "-") + ".html"; + /* + Use node->fileBase() for fake nodes because they are represented + by pages whose file names are lower-case. + */ + parentName = node->fileBase(); + parentName.replace("/", "-").replace(".", "-"); + parentName += ".html"; } break; default: break; } - return ""; + // Various objects can be compat (deprecated) or obsolete. + if (node->type() != Node::Class && node->type() != Node::Namespace) { + switch (node->status()) { + case Node::Compat: + parentName.replace(".html", "-qt3.html"); + break; + case Node::Obsolete: + parentName.replace(".html", "-obsolete.html"); + break; + default: + ; + } + } + + return parentName.toLower() + anchorRef; } /*! -- cgit v0.12 From 2dbd8c48c11deb7732920d88f8b6c20bf162bd6b Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 8 Jun 2009 13:29:00 +0200 Subject: Doc: Added information about the Fontconfig and FreeType dependencies. Task-number: 250349 Reviewed-by: Trust Me --- doc/src/diagrams/dependencies.lout | 59 +- doc/src/diagrams/x11_dependencies.sk | 1542 +++++++++++++++++++--------------- doc/src/images/x11_dependencies.png | Bin 93480 -> 68043 bytes 3 files changed, 908 insertions(+), 693 deletions(-) diff --git a/doc/src/diagrams/dependencies.lout b/doc/src/diagrams/dependencies.lout index d20f4f1..256f7de 100644 --- a/doc/src/diagrams/dependencies.lout +++ b/doc/src/diagrams/dependencies.lout @@ -1,7 +1,13 @@ +# This file is used to create x11_dependencies.sk, which is then converted to a PNG image. +# +# lout -EPS -o dependencies.eps dependencies.lout +# pstoedit -f sk dependencies.eps x11_dependencies.sk +# makeimage.py x11_dependencies.sk x11_dependencies.png 0.25 --anti-alias + @SysInclude { picture } @SysInclude { tbl } @SysInclude { diag } -# lout -EPS dependencies.lout > dependencies.eps + macro @TTGreenColour { {cmyk 0.40 0.00 1.00 0.01} } macro @TTPurpleColour { {cmyk 0.39 0.39 0.00 0.00} } macro @DefaultColour { rgb { 0.961 0.961 0.863 } } @@ -41,31 +47,33 @@ macro @GlibColour { rgb { 0.7 0.7 0.7 } } div { top } # fmarginbelow { 0c } - aformat { @Cell A | @Cell B | @Cell marginbelow { 0c } font { +2p } C | @Cell D | @Cell E } - bformat { @Cell A | @Cell B | @Cell C | @Cell D | @Cell E | @Cell F } - cformat { @Cell A | @Cell B | @Cell C | @Cell D | @Cell marginleft { 1.5c } E | @Cell F } - dformat { @Cell A | @Cell B | @Cell C | @Cell D | @Cell E | @Cell F } - eformat { @Cell A | @Cell B | @Cell C | @Cell D | @Cell E | @Cell F } - fformat { @Cell A | @Cell B | @Cell C | @Cell D | @Cell E | @Cell F } - gformat { @Cell A | @Cell B | @Cell C | @Cell D | @StartHSpan @Cell E | @HSpan } + aformat { @Cell A | @Cell B | @StartHSpan @Cell marginbelow { 0c } font { +2p } C | @HSpan | @HSpan | @Cell F | @Cell G} + bformat { @Cell A | @Cell B | @Cell C | @Cell D | @Cell E | @Cell F | @Cell G } + cformat { @Cell A | @Cell B | @Cell C | @Cell D | @Cell E | @Cell marginleft { 1.5c } F | @Cell G } + dformat { @Cell A | @Cell B | @Cell C | @Cell D | @Cell E | @Cell F | @Cell G } + eformat { @Cell A | @Cell B | @Cell C | @Cell D | @Cell E | @Cell F | @Cell G } + fformat { @Cell A | @Cell B | @Cell C | @Cell D | @Cell E | @Cell F | @Cell G } + gformat { @Cell A | @Cell B | @Cell C | @Cell D | @Cell E | @StartHSpan @Cell F | @HSpan } { @Rowa C { Qt"/"X11 library dependencies } - @Rowb C { QTGUI:: @Node paint { @TTGreenColour } QtGui } - @Rowc B { XCURSOR:: @Node paint { @OptionalColour } Xcursor } - C { XRANDR:: @Node paint { @OptionalColour } Xrandr } - D { XINERAMA:: @Node paint { @OptionalColour } Xinerama } - E { Xi:: @Node paint { @OptionalColour } Xi } - @Rowd C { XRENDER:: @Node paint { @OptionalColour } XRender } - F { Xt:: @Node paint { @DefaultColour } Xt* } - @Rowe A { QTCORE:: @Node paint { @TTPurpleColour } QtCore } - C { XFIXES:: @Node paint { @OptionalColour } Xfixes } - D { XEXT:: @Node paint { @DefaultColour } Xext } - F { SM:: @Node paint { @SMColour } SM } - @Rowf A { PTHREAD:: @Node paint { @PthreadColour } pthread } - B { GLIB:: @Node paint { @GlibColour } Glib } - D { X:: @Node paint { @DefaultColour } X11 } - F { ICE:: @Node paint { @SMColour } ICE } - @Rowg E { + @Rowb D { QTGUI:: @Node paint { @TTGreenColour } QtGui } + @Rowc C { XCURSOR:: @Node paint { @OptionalColour } Xcursor } + D { XRANDR:: @Node paint { @OptionalColour } Xrandr } + E { XINERAMA:: @Node paint { @OptionalColour } Xinerama } + F { Xi:: @Node paint { @OptionalColour } Xi } + @Rowd A { FONTCONFIG:: @Node paint { @OptionalColour } Fontconfig } + D { XRENDER:: @Node paint { @OptionalColour } XRender } + G { Xt:: @Node paint { @DefaultColour } Xt* } + @Rowe A { FREETYPE:: @Node paint { @OptionalColour } FreeType } + B { QTCORE:: @Node paint { @TTPurpleColour } QtCore } + D { XFIXES:: @Node paint { @OptionalColour } Xfixes } + E { XEXT:: @Node paint { @DefaultColour } Xext } + G { SM:: @Node paint { @SMColour } SM } + @Rowf B { PTHREAD:: @Node paint { @PthreadColour } pthread } + C { GLIB:: @Node paint { @GlibColour } Glib } + E { X:: @Node paint { @DefaultColour } X11 } + G { ICE:: @Node paint { @SMColour } ICE } + @Rowg F { @Tbl font { -2p } margin { 0.15f } @@ -101,6 +109,9 @@ macro @GlibColour { rgb { 0.7 0.7 0.7 } } @Arrow from { XEXT } to { X } @VHCurveArrow from { XCURSOR } to { XFIXES } @VHVCurveArrow from { XFIXES } to { X } +@HVCurveArrow from { QTGUI } to { FONTCONFIG } pathstyle { dotted } +@Arrow from { FONTCONFIG } to { FREETYPE } pathstyle { dotted } +@VHVCurveArrow from { FREETYPE } to { PTHREAD } @Link from { C@W } to { D@E } pathstyle { dotted } } } diff --git a/doc/src/diagrams/x11_dependencies.sk b/doc/src/diagrams/x11_dependencies.sk index 5f6b304..a9eb3e3 100644 --- a/doc/src/diagrams/x11_dependencies.sk +++ b/doc/src/diagrams/x11_dependencies.sk @@ -2,1415 +2,1619 @@ document() layout('A4',0) layer('Layer 1',1,1,0,0,(0,0,0)) -G() +fp((0,0,0)) +Fn('Helvetica') +Fs(16) +txt('Qt/X11',(254.1,398.35)) +fp((0,0,0)) +Fn('Helvetica') +Fs(16) +txt('libr',(304.9,398.35)) +fp((0,0,0)) +Fn('Helvetica') +Fs(16) +txt('ar',(326.07,398.35)) +fp((0,0,0)) +Fn('Helvetica') +Fs(16) +txt('y',(340.739,398.35)) +fp((0,0,0)) +Fn('Helvetica') +Fs(16) +txt('dependencies',(352.85,398.35)) fp((0,0,0)) le() b() -bs(268.8,339.25,0) -bs(268.8,337.15,0) -bs(352.8,337.15,0) -bs(352.8,362.2,0) -bs(350.7,362.2,0) -bs(350.7,339.25,0) -bs(268.8,339.25,0) +bs(312.898,344.199,0) +bs(312.898,342.102,0) +bs(396.898,342.102,0) +bs(396.898,367.148,0) +bs(394.801,367.148,0) +bs(394.801,344.199,0) +bs(312.898,344.199,0) bC() -fp((0.59,0.99,0)) +fp((0.594,0.99,0)) le() b() -bs(266.7,339.25,0) -bs(350.7,339.25,0) -bs(350.7,364.3,0) -bs(266.7,364.3,0) -bs(266.7,339.25,0) +bs(310.801,344.199,0) +bs(394.801,344.199,0) +bs(394.801,369.25,0) +bs(310.801,369.25,0) +bs(310.801,344.199,0) lw(1.12) lc(2) b() -bs(266.7,339.25,0) -bs(350.7,339.25,0) +bs(310.801,344.199,0) +bs(394.801,344.199,0) lw(1.12) lc(2) b() -bs(350.7,339.25,0) -bs(350.7,364.3,0) +bs(394.801,344.199,0) +bs(394.801,369.25,0) lw(1.12) lc(2) b() -bs(350.7,364.3,0) -bs(266.7,364.3,0) +bs(394.801,369.25,0) +bs(310.801,369.25,0) lw(1.12) lc(2) b() -bs(266.7,364.3,0) -bs(266.7,339.25,0) +bs(310.801,369.25,0) +bs(310.801,344.199,0) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('QtGui',(290.95,347)) +txt('QtGui',(335.05,351.95)) fp((0,0,0)) le() b() -bs(111.3,280.05,0) -bs(111.3,277.95,0) -bs(195.3,277.95,0) -bs(195.3,302.15,0) -bs(193.2,302.15,0) -bs(193.2,280.05,0) -bs(111.3,280.05,0) +bs(212.102,285,0) +bs(212.102,282.898,0) +bs(296.102,282.898,0) +bs(296.102,307.102,0) +bs(294,307.102,0) +bs(294,285,0) +bs(212.102,285,0) bC() fp((0.792,0.882,1)) le() b() -bs(109.2,280.05,0) -bs(193.2,280.05,0) -bs(193.2,304.25,0) -bs(109.2,304.25,0) -bs(109.2,280.05,0) +bs(210,285,0) +bs(294,285,0) +bs(294,309.199,0) +bs(210,309.199,0) +bs(210,285,0) lw(1.12) lc(2) b() -bs(109.2,280.05,0) -bs(193.2,280.05,0) +bs(210,285,0) +bs(294,285,0) lw(1.12) lc(2) b() -bs(193.2,280.05,0) -bs(193.2,304.25,0) +bs(294,285,0) +bs(294,309.199,0) lw(1.12) lc(2) b() -bs(193.2,304.25,0) -bs(109.2,304.25,0) +bs(294,309.199,0) +bs(210,309.199,0) lw(1.12) lc(2) b() -bs(109.2,304.25,0) -bs(109.2,280.05,0) +bs(210,309.199,0) +bs(210,285,0) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('Xcursor',(127.15,287.25)) +txt('Xcursor',(227.95,292.2)) fp((0,0,0)) le() b() -bs(268.8,280.05,0) -bs(268.8,277.95,0) -bs(352.8,277.95,0) -bs(352.8,302.15,0) -bs(350.7,302.15,0) -bs(350.7,280.05,0) -bs(268.8,280.05,0) +bs(312.898,285,0) +bs(312.898,282.898,0) +bs(396.898,282.898,0) +bs(396.898,307.102,0) +bs(394.801,307.102,0) +bs(394.801,285,0) +bs(312.898,285,0) bC() fp((0.792,0.882,1)) le() b() -bs(266.7,280.05,0) -bs(350.7,280.05,0) -bs(350.7,304.25,0) -bs(266.7,304.25,0) -bs(266.7,280.05,0) +bs(310.801,285,0) +bs(394.801,285,0) +bs(394.801,309.199,0) +bs(310.801,309.199,0) +bs(310.801,285,0) lw(1.12) lc(2) b() -bs(266.7,280.05,0) -bs(350.7,280.05,0) +bs(310.801,285,0) +bs(394.801,285,0) lw(1.12) lc(2) b() -bs(350.7,280.05,0) -bs(350.7,304.25,0) +bs(394.801,285,0) +bs(394.801,309.199,0) lw(1.12) lc(2) b() -bs(350.7,304.25,0) -bs(266.7,304.25,0) +bs(394.801,309.199,0) +bs(310.801,309.199,0) lw(1.12) lc(2) b() -bs(266.7,304.25,0) -bs(266.7,280.05,0) +bs(310.801,309.199,0) +bs(310.801,285,0) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('Xr',(287.8,287.25)) +txt('Xr',(331.9,292.2)) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('andr',(301.7,287.25)) +txt('andr',(345.796,292.2)) fp((0,0,0)) le() b() -bs(426.3,280.05,0) -bs(426.3,277.95,0) -bs(510.3,277.95,0) -bs(510.3,302.15,0) -bs(508.2,302.15,0) -bs(508.2,280.05,0) -bs(426.3,280.05,0) +bs(413.699,285,0) +bs(413.699,282.898,0) +bs(497.699,282.898,0) +bs(497.699,307.102,0) +bs(495.602,307.102,0) +bs(495.602,285,0) +bs(413.699,285,0) bC() fp((0.792,0.882,1)) le() b() -bs(424.2,280.05,0) -bs(508.2,280.05,0) -bs(508.2,304.25,0) -bs(424.2,304.25,0) -bs(424.2,280.05,0) +bs(411.602,285,0) +bs(495.602,285,0) +bs(495.602,309.199,0) +bs(411.602,309.199,0) +bs(411.602,285,0) lw(1.12) lc(2) b() -bs(424.2,280.05,0) -bs(508.2,280.05,0) +bs(411.602,285,0) +bs(495.602,285,0) lw(1.12) lc(2) b() -bs(508.2,280.05,0) -bs(508.2,304.25,0) +bs(495.602,285,0) +bs(495.602,309.199,0) lw(1.12) lc(2) b() -bs(508.2,304.25,0) -bs(424.2,304.25,0) +bs(495.602,309.199,0) +bs(411.602,309.199,0) lw(1.12) lc(2) b() -bs(424.2,304.25,0) -bs(424.2,280.05,0) +bs(411.602,309.199,0) +bs(411.602,285,0) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('Xiner',(436.55,287.25)) +txt('Xiner',(423.95,292.2)) +fp((0,0,0)) +Fn('Helvetica') +Fs(14) +txt('ama',(456.514,292.2)) +fp((0,0,0)) +le() +b() +bs(548.602,285.102,0) +bs(548.602,283,0) +bs(632.602,283,0) +bs(632.602,307,0) +bs(630.5,307,0) +bs(630.5,285.102,0) +bs(548.602,285.102,0) +bC() +fp((0.792,0.882,1)) +le() +b() +bs(546.5,285.102,0) +bs(630.5,285.102,0) +bs(630.5,309.102,0) +bs(546.5,309.102,0) +bs(546.5,285.102,0) +lw(1.12) +lc(2) +b() +bs(546.5,285.102,0) +bs(630.5,285.102,0) +lw(1.12) +lc(2) +b() +bs(630.5,285.102,0) +bs(630.5,309.102,0) +lw(1.12) +lc(2) +b() +bs(630.5,309.102,0) +bs(546.5,309.102,0) +lw(1.12) +lc(2) +b() +bs(546.5,309.102,0) +bs(546.5,285.102,0) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('ama',(469.125,287.25)) +txt('Xi',(582.75,292.1)) fp((0,0,0)) le() b() -bs(561.2,280.15,0) -bs(561.2,278.05,0) -bs(645.2,278.05,0) -bs(645.2,302.05,0) -bs(643.1,302.05,0) -bs(643.1,280.15,0) -bs(561.2,280.15,0) +bs(10.5,222.801,0) +bs(10.5,220.699,0) +bs(94.5,220.699,0) +bs(94.5,247.898,0) +bs(92.3984,247.898,0) +bs(92.3984,222.801,0) +bs(10.5,222.801,0) bC() fp((0.792,0.882,1)) le() b() -bs(559.1,280.15,0) -bs(643.1,280.15,0) -bs(643.1,304.15,0) -bs(559.1,304.15,0) -bs(559.1,280.15,0) +bs(8.39844,222.801,0) +bs(92.3984,222.801,0) +bs(92.3984,250,0) +bs(8.39844,250,0) +bs(8.39844,222.801,0) lw(1.12) lc(2) b() -bs(559.1,280.15,0) -bs(643.1,280.15,0) +bs(8.39844,222.801,0) +bs(92.3984,222.801,0) lw(1.12) lc(2) b() -bs(643.1,280.15,0) -bs(643.1,304.15,0) +bs(92.3984,222.801,0) +bs(92.3984,250,0) lw(1.12) lc(2) b() -bs(643.1,304.15,0) -bs(559.1,304.15,0) +bs(92.3984,250,0) +bs(8.39844,250,0) lw(1.12) lc(2) b() -bs(559.1,304.15,0) -bs(559.1,280.15,0) +bs(8.39844,250,0) +bs(8.39844,222.801,0) +fp((0,0,0)) +Fn('Helvetica') +Fs(14) +txt('F',(18.4,232.85)) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('Xi',(595.35,287.15)) +txt('ontconfig',(26.5508,232.85)) fp((0,0,0)) le() b() -bs(268.8,220.85,0) -bs(268.8,218.75,0) -bs(352.8,218.75,0) -bs(352.8,242.95,0) -bs(350.7,242.95,0) -bs(350.7,220.85,0) -bs(268.8,220.85,0) +bs(312.898,225.801,0) +bs(312.898,223.699,0) +bs(396.898,223.699,0) +bs(396.898,247.898,0) +bs(394.801,247.898,0) +bs(394.801,225.801,0) +bs(312.898,225.801,0) bC() fp((0.792,0.882,1)) le() b() -bs(266.7,220.85,0) -bs(350.7,220.85,0) -bs(350.7,245.05,0) -bs(266.7,245.05,0) -bs(266.7,220.85,0) +bs(310.801,225.801,0) +bs(394.801,225.801,0) +bs(394.801,250,0) +bs(310.801,250,0) +bs(310.801,225.801,0) lw(1.12) lc(2) b() -bs(266.7,220.85,0) -bs(350.7,220.85,0) +bs(310.801,225.801,0) +bs(394.801,225.801,0) lw(1.12) lc(2) b() -bs(350.7,220.85,0) -bs(350.7,245.05,0) +bs(394.801,225.801,0) +bs(394.801,250,0) lw(1.12) lc(2) b() -bs(350.7,245.05,0) -bs(266.7,245.05,0) +bs(394.801,250,0) +bs(310.801,250,0) lw(1.12) lc(2) b() -bs(266.7,245.05,0) -bs(266.7,220.85,0) +bs(310.801,250,0) +bs(310.801,225.801,0) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('XRender',(281.15,228.05)) +txt('XRender',(325.25,233)) fp((0,0,0)) le() b() -bs(662,220.95,0) -bs(662,218.85,0) -bs(746,218.85,0) -bs(746,242.95,0) -bs(743.9,242.95,0) -bs(743.9,220.95,0) -bs(662,220.95,0) +bs(649.398,225.898,0) +bs(649.398,223.801,0) +bs(733.398,223.801,0) +bs(733.398,247.898,0) +bs(731.301,247.898,0) +bs(731.301,225.898,0) +bs(649.398,225.898,0) bC() fp((0.961,0.961,0.863)) le() b() -bs(659.9,220.95,0) -bs(743.9,220.95,0) -bs(743.9,245.05,0) -bs(659.9,245.05,0) -bs(659.9,220.95,0) +bs(647.301,225.898,0) +bs(731.301,225.898,0) +bs(731.301,250,0) +bs(647.301,250,0) +bs(647.301,225.898,0) lw(1.12) lc(2) b() -bs(659.9,220.95,0) -bs(743.9,220.95,0) +bs(647.301,225.898,0) +bs(731.301,225.898,0) lw(1.12) lc(2) b() -bs(743.9,220.95,0) -bs(743.9,245.05,0) +bs(731.301,225.898,0) +bs(731.301,250,0) lw(1.12) lc(2) b() -bs(743.9,245.05,0) -bs(659.9,245.05,0) +bs(731.301,250,0) +bs(647.301,250,0) lw(1.12) lc(2) b() -bs(659.9,245.05,0) -bs(659.9,220.95,0) +bs(647.301,250,0) +bs(647.301,225.898,0) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('Xt*',(692.9,228.05)) +txt('Xt*',(680.3,233)) fp((0,0,0)) le() b() -bs(10.4998,160.8,0) -bs(10.4998,158.7,0) -bs(94.4998,158.7,0) -bs(94.4998,183.75,0) -bs(92.3999,183.75,0) -bs(92.3999,160.8,0) -bs(10.4998,160.8,0) +bs(10.5,160.801,0) +bs(10.5,158.699,0) +bs(94.5,158.699,0) +bs(94.5,185.699,0) +bs(92.3984,185.699,0) +bs(92.3984,160.801,0) +bs(10.5,160.801,0) +bC() +fp((0.792,0.882,1)) +le() +b() +bs(8.39844,160.801,0) +bs(92.3984,160.801,0) +bs(92.3984,187.801,0) +bs(8.39844,187.801,0) +bs(8.39844,160.801,0) +lw(1.12) +lc(2) +b() +bs(8.39844,160.801,0) +bs(92.3984,160.801,0) +lw(1.12) +lc(2) +b() +bs(92.3984,160.801,0) +bs(92.3984,187.801,0) +lw(1.12) +lc(2) +b() +bs(92.3984,187.801,0) +bs(8.39844,187.801,0) +lw(1.12) +lc(2) +b() +bs(8.39844,187.801,0) +bs(8.39844,160.801,0) +fp((0,0,0)) +Fn('Helvetica') +Fs(14) +txt('F',(21.9,170.8)) +fp((0,0,0)) +Fn('Helvetica') +Fs(14) +txt('reeT',(29.8508,170.8)) +fp((0,0,0)) +Fn('Helvetica') +Fs(14) +txt('ype',(56.9742,170.8)) +fp((0,0,0)) +le() +b() +bs(111.301,161.801,0) +bs(111.301,159.699,0) +bs(195.301,159.699,0) +bs(195.301,184.75,0) +bs(193.199,184.75,0) +bs(193.199,161.801,0) +bs(111.301,161.801,0) bC() fp((0.61,0.61,1)) le() b() -bs(8.3999,160.8,0) -bs(92.3999,160.8,0) -bs(92.3999,185.85,0) -bs(8.3999,185.85,0) -bs(8.3999,160.8,0) +bs(109.199,161.801,0) +bs(193.199,161.801,0) +bs(193.199,186.852,0) +bs(109.199,186.852,0) +bs(109.199,161.801,0) lw(1.12) lc(2) b() -bs(8.3999,160.8,0) -bs(92.3999,160.8,0) +bs(109.199,161.801,0) +bs(193.199,161.801,0) lw(1.12) lc(2) b() -bs(92.3999,160.8,0) -bs(92.3999,185.85,0) +bs(193.199,161.801,0) +bs(193.199,186.852,0) lw(1.12) lc(2) b() -bs(92.3999,185.85,0) -bs(8.3999,185.85,0) +bs(193.199,186.852,0) +bs(109.199,186.852,0) lw(1.12) lc(2) b() -bs(8.3999,185.85,0) -bs(8.3999,160.8,0) +bs(109.199,186.852,0) +bs(109.199,161.801,0) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('QtCore',(28.1997,168.55)) +txt('QtCore',(129,169.55)) fp((0,0,0)) le() b() -bs(268.8,161.15,0) -bs(268.8,159.05,0) -bs(352.8,159.05,0) -bs(352.8,183.4,0) -bs(350.7,183.4,0) -bs(350.7,161.15,0) -bs(268.8,161.15,0) +bs(312.898,162.148,0) +bs(312.898,160.051,0) +bs(396.898,160.051,0) +bs(396.898,184.398,0) +bs(394.801,184.398,0) +bs(394.801,162.148,0) +bs(312.898,162.148,0) bC() fp((0.792,0.882,1)) le() b() -bs(266.7,161.15,0) -bs(350.7,161.15,0) -bs(350.7,185.5,0) -bs(266.7,185.5,0) -bs(266.7,161.15,0) +bs(310.801,162.148,0) +bs(394.801,162.148,0) +bs(394.801,186.5,0) +bs(310.801,186.5,0) +bs(310.801,162.148,0) lw(1.12) lc(2) b() -bs(266.7,161.15,0) -bs(350.7,161.15,0) +bs(310.801,162.148,0) +bs(394.801,162.148,0) lw(1.12) lc(2) b() -bs(350.7,161.15,0) -bs(350.7,185.5,0) +bs(394.801,162.148,0) +bs(394.801,186.5,0) lw(1.12) lc(2) b() -bs(350.7,185.5,0) -bs(266.7,185.5,0) +bs(394.801,186.5,0) +bs(310.801,186.5,0) lw(1.12) lc(2) b() -bs(266.7,185.5,0) -bs(266.7,161.15,0) +bs(310.801,186.5,0) +bs(310.801,162.148,0) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('Xfix',(290.1,168.35)) +txt('Xfix',(334.2,169.35)) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('es',(313.038,168.35)) +txt('es',(357.136,169.35)) fp((0,0,0)) le() b() -bs(426.3,161.25,0) -bs(426.3,159.15,0) -bs(510.3,159.15,0) -bs(510.3,183.35,0) -bs(508.2,183.35,0) -bs(508.2,161.25,0) -bs(426.3,161.25,0) +bs(413.699,162.199,0) +bs(413.699,160.102,0) +bs(497.699,160.102,0) +bs(497.699,184.301,0) +bs(495.602,184.301,0) +bs(495.602,162.199,0) +bs(413.699,162.199,0) bC() fp((0.961,0.961,0.863)) le() b() -bs(424.2,161.25,0) -bs(508.2,161.25,0) -bs(508.2,185.45,0) -bs(424.2,185.45,0) -bs(424.2,161.25,0) +bs(411.602,162.199,0) +bs(495.602,162.199,0) +bs(495.602,186.398,0) +bs(411.602,186.398,0) +bs(411.602,162.199,0) lw(1.12) lc(2) b() -bs(424.2,161.25,0) -bs(508.2,161.25,0) +bs(411.602,162.199,0) +bs(495.602,162.199,0) lw(1.12) lc(2) b() -bs(508.2,161.25,0) -bs(508.2,185.45,0) +bs(495.602,162.199,0) +bs(495.602,186.398,0) lw(1.12) lc(2) b() -bs(508.2,185.45,0) -bs(424.2,185.45,0) +bs(495.602,186.398,0) +bs(411.602,186.398,0) lw(1.12) lc(2) b() -bs(424.2,185.45,0) -bs(424.2,161.25,0) +bs(411.602,186.398,0) +bs(411.602,162.199,0) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('Xe',(452.55,168.45)) +txt('Xe',(439.95,169.4)) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('xt',(469.272,168.45)) +txt('xt',(456.667,169.4)) fp((0,0,0)) le() b() -bs(662,161.05,0) -bs(662,158.95,0) -bs(746,158.95,0) -bs(746,183.5,0) -bs(743.9,183.5,0) -bs(743.9,161.05,0) -bs(662,161.05,0) +bs(649.398,162.051,0) +bs(649.398,159.949,0) +bs(733.398,159.949,0) +bs(733.398,184.5,0) +bs(731.301,184.5,0) +bs(731.301,162.051,0) +bs(649.398,162.051,0) bC() fp((0.761,0.98,0.98)) le() b() -bs(659.9,161.05,0) -bs(743.9,161.05,0) -bs(743.9,185.6,0) -bs(659.9,185.6,0) -bs(659.9,161.05,0) +bs(647.301,162.051,0) +bs(731.301,162.051,0) +bs(731.301,186.602,0) +bs(647.301,186.602,0) +bs(647.301,162.051,0) lw(1.12) lc(2) b() -bs(659.9,161.05,0) -bs(743.9,161.05,0) +bs(647.301,162.051,0) +bs(731.301,162.051,0) lw(1.12) lc(2) b() -bs(743.9,161.05,0) -bs(743.9,185.6,0) +bs(731.301,162.051,0) +bs(731.301,186.602,0) lw(1.12) lc(2) b() -bs(743.9,185.6,0) -bs(659.9,185.6,0) +bs(731.301,186.602,0) +bs(647.301,186.602,0) lw(1.12) lc(2) b() -bs(659.9,185.6,0) -bs(659.9,161.05,0) +bs(647.301,186.602,0) +bs(647.301,162.051,0) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('SM',(691.9,168.3)) +txt('SM',(679.3,169.3)) fp((0,0,0)) le() b() -bs(10.4998,98.9001,0) -bs(10.4998,96.8003,0) -bs(94.4998,96.8003,0) -bs(94.4998,123.7,0) -bs(92.3999,123.7,0) -bs(92.3999,98.9001,0) -bs(10.4998,98.9001,0) +bs(111.301,98.8984,0) +bs(111.301,96.8008,0) +bs(195.301,96.8008,0) +bs(195.301,123.699,0) +bs(193.199,123.699,0) +bs(193.199,98.8984,0) +bs(111.301,98.8984,0) bC() fp((0.741,0.718,0.42)) le() b() -bs(8.3999,98.9001,0) -bs(92.3999,98.9001,0) -bs(92.3999,125.8,0) -bs(8.3999,125.8,0) -bs(8.3999,98.9001,0) +bs(109.199,98.8984,0) +bs(193.199,98.8984,0) +bs(193.199,125.801,0) +bs(109.199,125.801,0) +bs(109.199,98.8984,0) lw(1.12) lc(2) b() -bs(8.3999,98.9001,0) -bs(92.3999,98.9001,0) +bs(109.199,98.8984,0) +bs(193.199,98.8984,0) lw(1.12) lc(2) b() -bs(92.3999,98.9001,0) -bs(92.3999,125.8,0) +bs(193.199,98.8984,0) +bs(193.199,125.801,0) lw(1.12) lc(2) b() -bs(92.3999,125.8,0) -bs(8.3999,125.8,0) +bs(193.199,125.801,0) +bs(109.199,125.801,0) lw(1.12) lc(2) b() -bs(8.3999,125.8,0) -bs(8.3999,98.9001,0) +bs(109.199,125.801,0) +bs(109.199,98.8984,0) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('pthread',(27.1499,108.8)) +txt('pthread',(127.95,108.8)) fp((0,0,0)) le() b() -bs(111.3,100.1,0) -bs(111.3,98.0002,0) -bs(195.3,98.0002,0) -bs(195.3,122.55,0) -bs(193.2,122.55,0) -bs(193.2,100.1,0) -bs(111.3,100.1,0) +bs(212.102,100.102,0) +bs(212.102,98,0) +bs(296.102,98,0) +bs(296.102,122.551,0) +bs(294,122.551,0) +bs(294,100.102,0) +bs(212.102,100.102,0) bC() fp((0.7,0.7,0.7)) le() b() -bs(109.2,100.1,0) -bs(193.2,100.1,0) -bs(193.2,124.65,0) -bs(109.2,124.65,0) -bs(109.2,100.1,0) +bs(210,100.102,0) +bs(294,100.102,0) +bs(294,124.648,0) +bs(210,124.648,0) +bs(210,100.102,0) lw(1.12) lc(2) b() -bs(109.2,100.1,0) -bs(193.2,100.1,0) +bs(210,100.102,0) +bs(294,100.102,0) lw(1.12) lc(2) b() -bs(193.2,100.1,0) -bs(193.2,124.65,0) +bs(294,100.102,0) +bs(294,124.648,0) lw(1.12) lc(2) b() -bs(193.2,124.65,0) -bs(109.2,124.65,0) +bs(294,124.648,0) +bs(210,124.648,0) lw(1.12) lc(2) b() -bs(109.2,124.65,0) -bs(109.2,100.1,0) +bs(210,124.648,0) +bs(210,100.102,0) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('Glib',(139.05,107.35)) +txt('Glib',(239.85,107.35)) fp((0,0,0)) le() b() -bs(426.3,100.35,0) -bs(426.3,98.2502,0) -bs(510.3,98.2502,0) -bs(510.3,122.25,0) -bs(508.2,122.25,0) -bs(508.2,100.35,0) -bs(426.3,100.35,0) +bs(413.699,100.352,0) +bs(413.699,98.25,0) +bs(497.699,98.25,0) +bs(497.699,122.25,0) +bs(495.602,122.25,0) +bs(495.602,100.352,0) +bs(413.699,100.352,0) bC() fp((0.961,0.961,0.863)) le() b() -bs(424.2,100.35,0) -bs(508.2,100.35,0) -bs(508.2,124.35,0) -bs(424.2,124.35,0) -bs(424.2,100.35,0) +bs(411.602,100.352,0) +bs(495.602,100.352,0) +bs(495.602,124.352,0) +bs(411.602,124.352,0) +bs(411.602,100.352,0) lw(1.12) lc(2) b() -bs(424.2,100.35,0) -bs(508.2,100.35,0) +bs(411.602,100.352,0) +bs(495.602,100.352,0) lw(1.12) lc(2) b() -bs(508.2,100.35,0) -bs(508.2,124.35,0) +bs(495.602,100.352,0) +bs(495.602,124.352,0) lw(1.12) lc(2) b() -bs(508.2,124.35,0) -bs(424.2,124.35,0) +bs(495.602,124.352,0) +bs(411.602,124.352,0) lw(1.12) lc(2) b() -bs(424.2,124.35,0) -bs(424.2,100.35,0) +bs(411.602,124.352,0) +bs(411.602,100.352,0) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('X11',(455.15,107.35)) +txt('X11',(442.55,107.35)) fp((0,0,0)) le() b() -bs(662,100.1,0) -bs(662,98.0002,0) -bs(746,98.0002,0) -bs(746,122.55,0) -bs(743.9,122.55,0) -bs(743.9,100.1,0) -bs(662,100.1,0) +bs(649.398,100.102,0) +bs(649.398,98,0) +bs(733.398,98,0) +bs(733.398,122.551,0) +bs(731.301,122.551,0) +bs(731.301,100.102,0) +bs(649.398,100.102,0) bC() fp((0.761,0.98,0.98)) le() b() -bs(659.9,100.1,0) -bs(743.9,100.1,0) -bs(743.9,124.65,0) -bs(659.9,124.65,0) -bs(659.9,100.1,0) +bs(647.301,100.102,0) +bs(731.301,100.102,0) +bs(731.301,124.648,0) +bs(647.301,124.648,0) +bs(647.301,100.102,0) lw(1.12) lc(2) b() -bs(659.9,100.1,0) -bs(743.9,100.1,0) +bs(647.301,100.102,0) +bs(731.301,100.102,0) lw(1.12) lc(2) b() -bs(743.9,100.1,0) -bs(743.9,124.65,0) +bs(731.301,100.102,0) +bs(731.301,124.648,0) lw(1.12) lc(2) b() -bs(743.9,124.65,0) -bs(659.9,124.65,0) +bs(731.301,124.648,0) +bs(647.301,124.648,0) lw(1.12) lc(2) b() -bs(659.9,124.65,0) -bs(659.9,100.1,0) +bs(647.301,124.648,0) +bs(647.301,100.102,0) fp((0,0,0)) Fn('Helvetica') Fs(14) -txt('ICE',(690.6,107.35)) +txt('ICE',(678,107.35)) fp((0,0,0)) Fn('Helvetica') -txt('some',(585.05,38.7002)) +txt('some',(572.45,38.7)) fp((0,0,0)) Fn('Helvetica') -txt('configur',(617.15,38.7002)) +txt('configur',(604.55,38.7)) fp((0,0,0)) Fn('Helvetica') -txt('ations',(659.733,38.7002)) +txt('ations',(647.13,38.7)) fp((0,0,0)) Fn('Helvetica') -txt('only',(694.4,38.7002)) +txt('only',(681.8,38.7)) fp((0,0,0)) Fn('Helvetica') -txt('*',(568.85,22.5002)) +txt('*',(556.25,22.5)) fp((0,0,0)) Fn('Helvetica') -txt('Xt',(585.05,22.5002)) +txt('Xt',(572.45,22.5)) fp((0,0,0)) Fn('Helvetica') -txt('intr',(599.4,22.5002)) +txt('intr',(586.8,22.5)) fp((0,0,0)) Fn('Helvetica') -txt('insics',(616.217,22.5002)) +txt('insics',(603.61,22.5)) fp((0,0,0)) Fn('Helvetica') -txt('only',(648.95,22.5002)) +txt('only',(636.35,22.5)) lw(1.12) lc(2) -ld((0, 2.4999899999999999)) +ld((0, 2.5)) b() -bs(308.7,339.25,0) -bs(308.7,328.05,0) +bs(352.801,344.199,0) +bs(352.801,333,0) lw(1.12) lc(2) -ld((0, 2.0312000000000001)) +ld((0, 2.03125)) b() -bs(308.7,328.05,0) -bs(308.7,332.6,0) +bs(352.801,333,0) +bs(352.801,337.551,0) lw(1.12) lc(2) ld((0, 2.45438)) b() -bs(308.7,332.6,0) -bs(308.7,332.6,0) -bc(308.7,330.744,309.438,328.963,310.75,327.651,0) +bs(352.801,337.551,0) +bs(352.801,337.551,0) +bc(352.801,335.695,353.539,333.914,354.852,332.602,0) lw(1.12) lc(2) -ld((0, 2.4543599999999999)) +ld((0, 2.45438)) b() -bs(310.75,327.65,0) -bs(310.75,327.651,0) -bc(312.063,326.338,313.844,325.6,315.7,325.6,0) +bs(354.852,332.602,0) +bs(354.852,332.602,0) +bc(356.164,331.289,357.945,330.551,359.801,330.551,0) lw(1.12) lc(2) -ld((0, 2.4639500000000001)) +ld((0, 2.4218799999999998)) b() -bs(315.7,325.6,0) -bs(387.45,325.6,0) +bs(359.801,330.551,0) +bs(403.199,330.551,0) lw(1.12) lc(2) -ld((0, 2.4639500000000001)) +ld((0, 2.4218799999999998)) b() -bs(387.45,325.6,0) -bs(459.2,325.6,0) +bs(403.199,330.551,0) +bs(446.602,330.551,0) lw(1.12) lc(2) ld((0, 2.45438)) b() -bs(459.2,325.6,0) -bs(459.2,325.6,0) -bc(461.056,325.6,462.837,324.863,464.15,323.55,0) +bs(446.602,330.551,0) +bs(446.602,330.551,0) +bc(448.457,330.551,450.238,329.812,451.551,328.5,0) lw(1.12) lc(2) ld((0, 2.45438)) b() -bs(464.15,323.55,0) -bs(464.15,323.55,0) -bc(465.462,322.237,466.2,320.457,466.2,318.6,0) +bs(451.551,328.5,0) +bs(451.551,328.5,0) +bc(452.863,327.188,453.602,325.406,453.602,323.551,0) lw(1.12) lc(2) -ld((0, 2.3437899999999998)) +ld((0, 2.3437399999999999)) b() -bs(466.2,318.6,0) -bs(466.2,313.35,0) +bs(453.602,323.551,0) +bs(453.602,318.301,0) lw(1.12) lc(2) ld((0, 2.5)) b() -bs(466.2,313.35,0) -bs(466.2,311.95,0) +bs(453.602,318.301,0) +bs(453.602,316.898,0) fp((0,0,0)) le() b() -bs(462.35,311.95,0) -bs(466.199,304.25,0) -bs(470.05,311.95,0) +bs(449.75,316.898,0) +bs(453.602,309.199,0) +bs(457.449,316.898,0) lw(1.12) lc(2) -ld((0, 2.4999899999999999)) +ld((0, 2.5)) b() -bs(308.7,339.25,0) -bs(308.7,328.05,0) +bs(352.801,344.199,0) +bs(352.801,333,0) lw(1.12) lc(2) -ld((0, 2.0088900000000001)) +ld((0, 2.0089299999999999)) b() -bs(308.7,328.05,0) -bs(308.7,332.55,0) +bs(352.801,333,0) +bs(352.801,337.5,0) +lw(1.12) +lc(2) +ld((0, 2.4543599999999999)) +b() +bs(352.801,337.5,0) +bs(352.801,337.5,0) +bc(352.801,335.645,353.539,333.863,354.852,332.551,0) lw(1.12) lc(2) ld((0, 2.45438)) b() -bs(308.7,332.55,0) -bs(308.7,332.55,0) -bc(308.7,330.694,309.438,328.913,310.75,327.601,0) +bs(354.852,332.551,0) +bs(354.852,332.551,0) +bc(356.164,331.238,357.945,330.5,359.801,330.5,0) lw(1.12) lc(2) -ld((0, 2.4543599999999999)) +ld((0, 2.4743300000000001)) b() -bs(310.75,327.6,0) -bs(310.75,327.601,0) -bc(312.063,326.288,313.844,325.55,315.7,325.55,0) +bs(359.801,330.5,0) +bs(470.648,330.5,0) lw(1.12) lc(2) -ld((0, 2.4857100000000001)) +ld((0, 2.4743300000000001)) b() -bs(459.2,325.6,0) -bs(594.1,325.55,0) +bs(470.648,330.5,0) +bs(581.5,330.5,0) lw(1.12) lc(2) -ld((0, 2.4543900000000001)) +ld((0, 2.45438)) b() -bs(594.1,325.55,0) -bs(594.1,325.55,0) -bc(595.956,325.55,597.737,324.813,599.05,323.5,0) +bs(581.5,330.5,0) +bs(581.5,330.5,0) +bc(583.355,330.5,585.137,329.762,586.449,328.449,0) lw(1.12) lc(2) -ld((0, 2.4544100000000002)) +ld((0, 2.45438)) b() -bs(599.05,323.5,0) -bs(599.05,323.5,0) -bc(600.362,322.187,601.1,320.407,601.1,318.55,0) +bs(586.449,328.449,0) +bs(586.449,328.449,0) +bc(587.762,327.137,588.5,325.355,588.5,323.5,0) lw(1.12) lc(2) -ld((0, 2.3660899999999998)) +ld((0, 2.36605)) b() -bs(601.1,318.55,0) -bs(601.1,313.25,0) +bs(588.5,323.5,0) +bs(588.5,318.199,0) lw(1.12) lc(2) ld((0, 2.5)) b() -bs(601.1,313.25,0) -bs(601.1,311.85,0) +bs(588.5,318.199,0) +bs(588.5,316.801,0) fp((0,0,0)) le() b() -bs(597.25,311.85,0) -bs(601.099,304.15,0) -bs(604.949,311.85,0) +bs(584.648,316.801,0) +bs(588.5,309.102,0) +bs(592.352,316.801,0) lw(1.12) lc(2) b() -bs(266.7,351.775,0) -bs(255.5,351.775,0) +bs(310.801,356.727,0) +bs(299.602,356.727,0) lw(1.12) lc(2) b() -bs(255.5,351.775,0) -bs(57.3999,351.775,0) +bs(299.602,356.727,0) +bs(158.199,356.727,0) lw(1.12) lc(2) b() -bs(57.3999,351.775,0) -bs(57.3999,351.775,0) -bc(53.5339,351.775,50.3999,348.641,50.3999,344.775,0) +bs(158.199,356.727,0) +bs(158.199,356.727,0) +bc(154.336,356.727,151.199,353.59,151.199,349.727,0) lw(1.12) lc(2) b() -bs(50.3999,344.775,0) -bs(50.3999,194.95,0) +bs(151.199,349.727,0) +bs(151.199,195.949,0) lw(1.12) lc(2) b() -bs(50.3999,194.95,0) -bs(50.3999,193.55,0) +bs(151.199,195.949,0) +bs(151.199,194.551,0) fp((0,0,0)) le() b() -bs(46.5496,193.55,0) -bs(50.3994,185.85,0) -bs(54.2495,193.55,0) +bs(147.352,194.551,0) +bs(151.199,186.852,0) +bs(155.051,194.551,0) lw(1.12) lc(2) b() -bs(50.3999,160.8,0) -bs(50.3999,133.5,0) +bs(151.199,161.801,0) +bs(151.199,133.5,0) fp((0,0,0)) le() b() -bs(46.5496,133.5,0) -bs(50.3994,125.8,0) -bs(54.2495,133.5,0) +bs(147.352,133.5,0) +bs(151.199,125.801,0) +bs(155.051,133.5,0) lw(1.12) lc(2) ld((0, 2)) b() -bs(50.3999,160.8,0) -bs(50.3999,149.6,0) +bs(151.199,161.801,0) +bs(151.199,150.602,0) lw(1.12) lc(2) -ld((0, 1.7745500000000001)) +ld((0, 1.5513600000000001)) b() -bs(50.3999,149.6,0) -bs(50.3999,153.575,0) +bs(151.199,150.602,0) +bs(151.199,154.074,0) lw(1.12) lc(2) -ld((0, 2.4543599999999999)) +ld((0, 2.4543400000000002)) b() -bs(50.3999,153.575,0) -bs(50.3999,153.575,0) -bc(50.3999,151.719,51.1375,149.938,52.4502,148.625,0) +bs(151.199,154.074,0) +bs(151.199,154.074,0) +bc(151.199,152.219,151.938,150.438,153.25,149.125,0) lw(1.12) lc(2) ld((0, 2.4543699999999999)) b() -bs(52.45,148.625,0) -bs(52.4502,148.625,0) -bc(53.7629,147.313,55.5435,146.575,57.3999,146.575,0) +bs(153.25,149.125,0) +bs(153.25,149.125,0) +bc(154.562,147.812,156.344,147.074,158.199,147.074,0) lw(1.12) lc(2) ld((0, 2.4218799999999998)) b() -bs(57.3999,146.575,0) -bs(100.8,146.575,0) +bs(158.199,147.074,0) +bs(201.602,147.074,0) lw(1.12) lc(2) ld((0, 2.4218799999999998)) b() -bs(100.8,146.575,0) -bs(144.2,146.575,0) +bs(201.602,147.074,0) +bs(245,147.074,0) lw(1.12) lc(2) ld((0, 2.45438)) b() -bs(144.2,146.575,0) -bs(144.2,146.575,0) -bc(146.056,146.575,147.837,145.838,149.15,144.525,0) +bs(245,147.074,0) +bs(245,147.074,0) +bc(246.855,147.074,248.637,146.336,249.949,145.023,0) lw(1.12) lc(2) -ld((0, 2.4543699999999999)) +ld((0, 2.4543900000000001)) b() -bs(149.15,144.525,0) -bs(149.15,144.525,0) -bc(150.462,143.212,151.2,141.432,151.2,139.575,0) +bs(249.949,145.023,0) +bs(249.949,145.023,0) +bc(251.262,143.711,252,141.93,252,140.074,0) lw(1.12) lc(2) -ld((0, 1.73363)) +ld((0, 1.88243)) b() -bs(151.2,139.575,0) -bs(151.2,133.75,0) +bs(252,140.074,0) +bs(252,133.75,0) lw(1.12) lc(2) ld((0, 2.5)) b() -bs(151.2,133.75,0) -bs(151.2,132.35,0) +bs(252,133.75,0) +bs(252,132.352,0) fp((0,0,0)) le() b() -bs(147.35,132.35,0) -bs(151.199,124.65,0) -bs(155.05,132.35,0) +bs(248.148,132.352,0) +bs(252,124.648,0) +bs(255.852,132.352,0) lw(1.12) lc(2) b() -bs(350.7,351.775,0) -bs(361.9,351.775,0) +bs(394.801,356.727,0) +bs(406,356.727,0) lw(1.12) lc(2) b() -bs(361.9,351.775,0) -bs(694.9,351.775,0) +bs(406,356.727,0) +bs(682.301,356.727,0) lw(1.12) lc(2) b() -bs(694.9,351.775,0) -bs(694.9,351.775,0) -bc(698.766,351.775,701.9,348.641,701.9,344.775,0) +bs(682.301,356.727,0) +bs(682.301,356.727,0) +bc(686.164,356.727,689.301,353.59,689.301,349.727,0) lw(1.12) lc(2) b() -bs(701.9,344.775,0) -bs(701.9,254.15,0) +bs(689.301,349.727,0) +bs(689.301,259.102,0) lw(1.12) lc(2) b() -bs(701.9,254.15,0) -bs(701.9,252.75,0) +bs(689.301,259.102,0) +bs(689.301,257.699,0) fp((0,0,0)) le() b() -bs(698.05,252.75,0) -bs(701.899,245.05,0) -bs(705.75,252.75,0) +bs(685.449,257.699,0) +bs(689.301,250,0) +bs(693.148,257.699,0) lw(1.12) lc(2) -ld((0, 2.4375200000000001)) +ld((0, 2.4375)) b() -bs(308.7,339.25,0) -bs(308.7,311.95,0) +bs(352.801,344.199,0) +bs(352.801,316.898,0) fp((0,0,0)) le() b() -bs(304.85,311.95,0) -bs(308.699,304.25,0) -bs(312.55,311.95,0) +bs(348.949,316.898,0) +bs(352.801,309.199,0) +bs(356.648,316.898,0) lw(1.12) lc(2) -ld((0, 2.4999899999999999)) +ld((0, 2.5)) b() -bs(308.7,339.25,0) -bs(308.7,328.05,0) +bs(352.801,344.199,0) +bs(352.801,333,0) lw(1.12) lc(2) -ld((0, 2.0312000000000001)) +ld((0, 2.03125)) b() -bs(308.7,328.05,0) -bs(308.7,332.6,0) +bs(352.801,333,0) +bs(352.801,337.551,0) lw(1.12) lc(2) ld((0, 2.45438)) b() -bs(308.7,332.6,0) -bs(308.7,332.6,0) -bc(308.7,330.744,307.962,328.963,306.65,327.651,0) +bs(352.801,337.551,0) +bs(352.801,337.551,0) +bc(352.801,335.695,352.062,333.914,350.75,332.602,0) lw(1.12) lc(2) ld((0, 2.45438)) b() -bs(306.65,327.65,0) -bs(306.65,327.651,0) -bc(305.337,326.338,303.556,325.601,301.7,325.601,0) +bs(350.75,332.602,0) +bs(350.75,332.602,0) +bc(349.438,331.289,347.656,330.551,345.801,330.551,0) lw(1.12) lc(2) -ld((0, 2.4639500000000001)) +ld((0, 2.4218799999999998)) b() -bs(301.7,325.6,0) -bs(229.95,325.6,0) +bs(345.801,330.551,0) +bs(302.398,330.551,0) lw(1.12) lc(2) -ld((0, 2.4639500000000001)) +ld((0, 2.4218799999999998)) b() -bs(229.95,325.6,0) -bs(158.2,325.6,0) +bs(302.398,330.551,0) +bs(259,330.551,0) lw(1.12) lc(2) -ld((0, 2.4543699999999999)) +ld((0, 2.45438)) b() -bs(158.2,325.6,0) -bs(158.2,325.6,0) -bc(156.344,325.6,154.563,324.863,153.25,323.55,0) +bs(259,330.551,0) +bs(259,330.551,0) +bc(257.145,330.551,255.363,329.812,254.051,328.5,0) lw(1.12) lc(2) ld((0, 2.45438)) b() -bs(153.25,323.55,0) -bs(153.25,323.55,0) -bc(151.938,322.237,151.2,320.457,151.2,318.6,0) +bs(254.051,328.5,0) +bs(254.051,328.5,0) +bc(252.738,327.188,252,325.406,252,323.551,0) lw(1.12) lc(2) -ld((0, 2.3437899999999998)) +ld((0, 2.3437399999999999)) b() -bs(151.2,318.6,0) -bs(151.2,313.35,0) +bs(252,323.551,0) +bs(252,318.301,0) lw(1.12) lc(2) ld((0, 2.5)) b() -bs(151.2,313.35,0) -bs(151.2,311.95,0) +bs(252,318.301,0) +bs(252,316.898,0) fp((0,0,0)) le() b() -bs(147.35,311.95,0) -bs(151.199,304.25,0) -bs(155.05,311.95,0) +bs(248.148,316.898,0) +bs(252,309.199,0) +bs(255.852,316.898,0) lw(1.12) lc(2) b() -bs(308.7,280.05,0) -bs(308.7,252.75,0) +bs(352.801,285,0) +bs(352.801,257.699,0) fp((0,0,0)) le() b() -bs(304.85,252.75,0) -bs(308.699,245.05,0) -bs(312.55,252.75,0) +bs(348.949,257.699,0) +bs(352.801,250,0) +bs(356.648,257.699,0) lw(1.12) lc(2) b() -bs(466.2,280.05,0) -bs(466.2,193.15,0) +bs(453.602,285,0) +bs(453.602,194.102,0) fp((0,0,0)) le() b() -bs(462.35,193.15,0) -bs(466.199,185.45,0) -bs(470.05,193.15,0) +bs(449.75,194.102,0) +bs(453.602,186.398,0) +bs(457.449,194.102,0) lw(1.12) lc(2) b() -bs(151.2,280.05,0) -bs(151.2,268.85,0) +bs(252,285,0) +bs(252,273.801,0) lw(1.12) lc(2) b() -bs(151.2,268.85,0) -bs(151.2,239.95,0) +bs(252,273.801,0) +bs(252,244.898,0) lw(1.12) lc(2) b() -bs(151.2,239.95,0) -bs(151.2,239.95,0) -bc(151.2,236.084,154.334,232.95,158.2,232.95,0) +bs(252,244.898,0) +bs(252,244.898,0) +bc(252,241.035,255.137,237.898,259,237.898,0) lw(1.12) lc(2) b() -bs(158.2,232.95,0) -bs(257.6,232.95,0) +bs(259,237.898,0) +bs(301.699,237.898,0) lw(1.12) lc(2) b() -bs(257.6,232.95,0) -bs(259,232.95,0) +bs(301.699,237.898,0) +bs(303.102,237.898,0) fp((0,0,0)) le() b() -bs(259,229.1,0) -bs(266.699,232.95,0) -bs(259,236.8,0) +bs(303.102,234.051,0) +bs(310.801,237.898,0) +bs(303.102,241.75,0) lw(1.12) lc(2) b() -bs(350.7,232.95,0) -bs(361.9,232.95,0) +bs(394.801,237.898,0) +bs(406,237.898,0) lw(1.12) lc(2) b() -bs(361.9,232.95,0) -bs(459.2,232.95,0) +bs(406,237.898,0) +bs(446.602,237.898,0) lw(1.12) lc(2) b() -bs(459.2,232.95,0) -bs(459.2,232.95,0) -bc(463.066,232.95,466.2,229.816,466.2,225.95,0) +bs(446.602,237.898,0) +bs(446.602,237.898,0) +bc(450.465,237.898,453.602,234.762,453.602,230.898,0) lw(1.12) lc(2) b() -bs(466.2,225.95,0) -bs(466.2,194.55,0) +bs(453.602,230.898,0) +bs(453.602,195.5,0) lw(1.12) lc(2) b() -bs(466.2,194.55,0) -bs(466.2,193.15,0) +bs(453.602,195.5,0) +bs(453.602,194.102,0) fp((0,0,0)) le() b() -bs(462.35,193.15,0) -bs(466.199,185.45,0) -bs(470.05,193.15,0) +bs(449.75,194.102,0) +bs(453.602,186.398,0) +bs(457.449,194.102,0) lw(1.12) lc(2) b() -bs(559.1,292.15,0) -bs(547.9,292.15,0) +bs(546.5,297.102,0) +bs(535.301,297.102,0) lw(1.12) lc(2) b() -bs(547.9,292.15,0) -bs(544.5,292.15,0) +bs(535.301,297.102,0) +bs(531.898,297.102,0) lw(1.12) lc(2) b() -bs(544.5,292.15,0) -bs(544.5,292.15,0) -bc(542.643,292.15,540.863,291.413,539.55,290.1,0) +bs(531.898,297.102,0) +bs(531.898,297.102,0) +bc(530.043,297.102,528.262,296.363,526.949,295.051,0) lw(1.12) lc(2) b() -bs(539.55,290.1,0) -bs(539.55,290.1,0) -bc(538.238,288.787,537.5,287.007,537.5,285.15,0) +bs(526.949,295.051,0) +bs(526.949,295.051,0) +bc(525.637,293.738,524.898,291.957,524.898,290.102,0) lw(1.12) lc(2) b() -bs(537.5,285.15,0) -bs(537.5,232.75,0) +bs(524.898,290.102,0) +bs(524.898,235.699,0) lw(1.12) lc(2) b() -bs(537.5,232.75,0) -bs(537.5,180.35,0) +bs(524.898,235.699,0) +bs(524.898,181.301,0) lw(1.12) lc(2) b() -bs(537.5,180.35,0) -bs(537.5,180.35,0) -bc(537.5,178.494,536.762,176.713,535.449,175.401,0) +bs(524.898,181.301,0) +bs(524.898,181.301,0) +bc(524.898,179.445,524.16,177.664,522.852,176.352,0) lw(1.12) lc(2) b() -bs(535.449,175.4,0) -bs(535.449,175.401,0) -bc(534.137,174.088,532.356,173.35,530.5,173.35,0) +bs(522.852,176.352,0) +bs(522.852,176.352,0) +bc(521.539,175.039,519.754,174.301,517.898,174.301,0) lw(1.12) lc(2) b() -bs(530.5,173.35,0) -bs(517.3,173.35,0) +bs(517.898,174.301,0) +bs(504.699,174.301,0) lw(1.12) lc(2) b() -bs(517.3,173.35,0) -bs(515.9,173.35,0) +bs(504.699,174.301,0) +bs(503.301,174.301,0) fp((0,0,0)) le() b() -bs(515.9,177.2,0) -bs(508.2,173.351,0) -bs(515.9,169.5,0) +bs(503.301,178.148,0) +bs(495.602,174.301,0) +bs(503.301,170.449,0) lw(1.12) lc(2) b() -bs(701.9,220.95,0) -bs(701.9,193.3,0) +bs(689.301,225.898,0) +bs(689.301,194.301,0) fp((0,0,0)) le() b() -bs(698.05,193.3,0) -bs(701.899,185.6,0) -bs(705.75,193.3,0) +bs(685.449,194.301,0) +bs(689.301,186.602,0) +bs(693.148,194.301,0) lw(1.12) lc(2) b() -bs(659.9,233,0) -bs(648.7,233,0) +bs(647.301,237.949,0) +bs(636.102,237.949,0) lw(1.12) lc(2) b() -bs(648.7,233,0) -bs(594.9,233,0) +bs(636.102,237.949,0) +bs(582.301,237.949,0) lw(1.12) lc(2) b() -bs(594.9,233,0) -bs(594.9,233,0) -bc(593.043,233,591.263,232.263,589.95,230.95,0) +bs(582.301,237.949,0) +bs(582.301,237.949,0) +bc(580.445,237.949,578.664,237.211,577.352,235.898,0) lw(1.12) lc(2) b() -bs(589.95,230.95,0) -bs(589.95,230.95,0) -bc(588.638,229.637,587.9,227.857,587.9,226,0) +bs(577.352,235.898,0) +bs(577.352,235.898,0) +bc(576.039,234.586,575.301,232.805,575.301,230.949,0) lw(1.12) lc(2) b() -bs(587.9,226,0) -bs(587.9,172.675,0) +bs(575.301,230.949,0) +bs(575.301,175.148,0) lw(1.12) lc(2) b() -bs(587.9,172.675,0) -bs(587.9,119.35,0) +bs(575.301,175.148,0) +bs(575.301,119.352,0) lw(1.12) lc(2) b() -bs(587.9,119.35,0) -bs(587.9,119.35,0) -bc(587.9,117.494,587.162,115.713,585.85,114.401,0) +bs(575.301,119.352,0) +bs(575.301,119.352,0) +bc(575.301,117.496,574.562,115.711,573.25,114.398,0) lw(1.12) lc(2) b() -bs(585.85,114.4,0) -bs(585.85,114.401,0) -bc(584.537,113.088,582.756,112.35,580.9,112.35,0) +bs(573.25,114.398,0) +bs(573.25,114.398,0) +bc(571.938,113.09,570.156,112.352,568.301,112.352,0) lw(1.12) lc(2) b() -bs(580.9,112.35,0) -bs(517.3,112.35,0) +bs(568.301,112.352,0) +bs(504.699,112.352,0) lw(1.12) lc(2) b() -bs(517.3,112.35,0) -bs(515.9,112.35,0) +bs(504.699,112.352,0) +bs(503.301,112.352,0) fp((0,0,0)) le() b() -bs(515.9,116.2,0) -bs(508.2,112.35,0) -bs(515.9,108.5,0) +bs(503.301,116.199,0) +bs(495.602,112.352,0) +bs(503.301,108.5,0) lw(1.12) lc(2) b() -bs(701.9,161.05,0) -bs(701.9,132.35,0) +bs(689.301,162.051,0) +bs(689.301,132.352,0) fp((0,0,0)) le() b() -bs(698.05,132.35,0) -bs(701.899,124.65,0) -bs(705.75,132.35,0) +bs(685.449,132.352,0) +bs(689.301,124.648,0) +bs(693.148,132.352,0) lw(1.12) lc(2) b() -bs(466.2,161.25,0) -bs(466.2,132.05,0) +bs(453.602,162.199,0) +bs(453.602,132.051,0) fp((0,0,0)) le() b() -bs(462.35,132.05,0) -bs(466.199,124.35,0) -bs(470.05,132.05,0) +bs(449.75,132.051,0) +bs(453.602,124.352,0) +bs(457.449,132.051,0) lw(1.12) lc(2) b() -bs(151.2,280.05,0) -bs(151.2,268.85,0) +bs(252,285,0) +bs(252,273.801,0) lw(1.12) lc(2) b() -bs(151.2,268.85,0) -bs(151.2,180.325,0) +bs(252,273.801,0) +bs(252,181.324,0) lw(1.12) lc(2) b() -bs(151.2,180.325,0) -bs(151.2,180.325,0) -bc(151.2,176.459,154.334,173.325,158.2,173.325,0) +bs(252,181.324,0) +bs(252,181.324,0) +bc(252,177.461,255.137,174.324,259,174.324,0) lw(1.12) lc(2) b() -bs(158.2,173.325,0) -bs(257.6,173.325,0) +bs(259,174.324,0) +bs(301.699,174.324,0) lw(1.12) lc(2) b() -bs(257.6,173.325,0) -bs(259,173.325,0) +bs(301.699,174.324,0) +bs(303.102,174.324,0) fp((0,0,0)) le() b() -bs(259,169.475,0) -bs(266.699,173.325,0) -bs(259,177.175,0) +bs(303.102,170.477,0) +bs(310.801,174.324,0) +bs(303.102,178.176,0) lw(1.12) lc(2) b() -bs(308.7,161.15,0) -bs(308.7,149.95,0) +bs(352.801,162.148,0) +bs(352.801,150.949,0) lw(1.12) lc(2) b() -bs(308.7,149.95,0) -bs(308.7,153.6,0) +bs(352.801,150.949,0) +bs(352.801,154.102,0) lw(1.12) lc(2) b() -bs(308.7,153.6,0) -bs(308.7,153.6,0) -bc(308.7,151.744,309.438,149.963,310.75,148.651,0) +bs(352.801,154.102,0) +bs(352.801,154.102,0) +bc(352.801,152.246,353.539,150.461,354.852,149.148,0) lw(1.12) lc(2) b() -bs(310.75,148.65,0) -bs(310.75,148.651,0) -bc(312.063,147.338,313.844,146.6,315.7,146.6,0) +bs(354.852,149.148,0) +bs(354.852,149.148,0) +bc(356.164,147.84,357.945,147.102,359.801,147.102,0) lw(1.12) lc(2) b() -bs(315.7,146.6,0) -bs(387.45,146.6,0) +bs(359.801,147.102,0) +bs(403.199,147.102,0) lw(1.12) lc(2) b() -bs(387.45,146.6,0) -bs(459.2,146.6,0) +bs(403.199,147.102,0) +bs(446.602,147.102,0) lw(1.12) lc(2) b() -bs(459.2,146.6,0) -bs(459.2,146.6,0) -bc(461.056,146.6,462.837,145.863,464.15,144.55,0) +bs(446.602,147.102,0) +bs(446.602,147.102,0) +bc(448.457,147.102,450.238,146.363,451.551,145.051,0) lw(1.12) lc(2) b() -bs(464.15,144.55,0) -bs(464.15,144.55,0) -bc(465.462,143.237,466.2,141.457,466.2,139.6,0) +bs(451.551,145.051,0) +bs(451.551,145.051,0) +bc(452.863,143.738,453.602,141.957,453.602,140.102,0) lw(1.12) lc(2) b() -bs(466.2,139.6,0) -bs(466.2,133.45,0) +bs(453.602,140.102,0) +bs(453.602,133.449,0) lw(1.12) lc(2) b() -bs(466.2,133.45,0) -bs(466.2,132.05,0) +bs(453.602,133.449,0) +bs(453.602,132.051,0) fp((0,0,0)) le() b() -bs(462.35,132.05,0) -bs(466.199,124.35,0) -bs(470.05,132.05,0) +bs(449.75,132.051,0) +bs(453.602,124.352,0) +bs(457.449,132.051,0) lw(1.12) lc(2) -ld((0, 2.2889599999999999)) +ld((0, 2.5)) b() -bs(552.65,41.8,0) -bs(580.85,41.8,0) -G_() -G() -fp((0,0,0)) -Fn('Helvetica') -Fs(16) -txt('libr',(341.317,393.4)) -fp((0,0,0)) -Fn('Helvetica') -Fs(16) -txt('ar',(362.494,393.4)) +bs(310.801,356.727,0) +bs(299.602,356.727,0) +lw(1.12) +lc(2) +ld((0, 2.48563)) +b() +bs(299.602,356.727,0) +bs(57.3984,356.727,0) +lw(1.12) +lc(2) +ld((0, 2.4543699999999999)) +b() +bs(57.3984,356.727,0) +bs(57.3984,356.727,0) +bc(53.5352,356.727,50.3984,353.59,50.3984,349.727,0) +lw(1.12) +lc(2) +ld((0, 2.4519700000000002)) +b() +bs(50.3984,349.727,0) +bs(50.3984,259.102,0) +lw(1.12) +lc(2) +ld((0, 2.5)) +b() +bs(50.3984,259.102,0) +bs(50.3984,257.699,0) fp((0,0,0)) -Fn('Helvetica') -Fs(16) -txt('y',(377.168,393.4)) +le() +b() +bs(46.5508,257.699,0) +bs(50.3984,250,0) +bs(54.25,257.699,0) +lw(1.12) +lc(2) +ld((0, 2.4375100000000001)) +b() +bs(50.3984,222.801,0) +bs(50.3984,195.5,0) fp((0,0,0)) -Fn('Helvetica') -Fs(16) -txt('dependencies',(389.267,393.4)) +le() +b() +bs(46.5508,195.5,0) +bs(50.3984,187.801,0) +bs(54.25,195.5,0) +lw(1.12) +lc(2) +b() +bs(50.3984,160.801,0) +bs(50.3984,154.148,0) +lw(1.12) +lc(2) +b() +bs(50.3984,154.148,0) +bs(50.3984,154.148,0) +bc(50.3984,152.293,51.1367,150.512,52.4492,149.199,0) +lw(1.12) +lc(2) +b() +bs(52.4492,149.199,0) +bs(52.4492,149.199,0) +bc(53.7617,147.887,55.543,147.148,57.3984,147.148,0) +lw(1.12) +lc(2) +b() +bs(57.3984,147.148,0) +bs(100.801,147.148,0) +lw(1.12) +lc(2) +b() +bs(100.801,147.148,0) +bs(144.199,147.148,0) +lw(1.12) +lc(2) +b() +bs(144.199,147.148,0) +bs(144.199,147.148,0) +bc(146.055,147.148,147.836,146.41,149.148,145.102,0) +lw(1.12) +lc(2) +b() +bs(149.148,145.102,0) +bs(149.148,145.102,0) +bc(150.461,143.789,151.199,142.004,151.199,140.148,0) +lw(1.12) +lc(2) +b() +bs(151.199,140.148,0) +bs(151.199,134.898,0) +lw(1.12) +lc(2) +b() +bs(151.199,134.898,0) +bs(151.199,133.5,0) fp((0,0,0)) -Fn('Helvetica') -Fs(16) -txt('Qt for X11',(265.517,393.4)) -G_() +le() +b() +bs(147.352,133.5,0) +bs(151.199,125.801,0) +bs(155.051,133.5,0) +lw(1.12) +lc(2) +ld((0, 2.2889599999999999)) +b() +bs(540.051,41.8008,0) +bs(568.25,41.8008,0) guidelayer('Guide Lines',1,0,0,1,(0,0,1)) grid((0,0,5,5),1,(0,0,1),'Grid') diff --git a/doc/src/images/x11_dependencies.png b/doc/src/images/x11_dependencies.png index 02bce1a..6ad952e 100644 Binary files a/doc/src/images/x11_dependencies.png and b/doc/src/images/x11_dependencies.png differ -- cgit v0.12 From 1034e372f1b9ec972d9f0586321c8f299c3955f0 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Mon, 8 Jun 2009 13:31:40 +0200 Subject: Fix GDI object leak. In case the SetWindowRgn() fails, the region object has to be deleted. Task-number: 251293 Reviewed-by: Denis Dzyubenko --- src/gui/kernel/qwidget_win.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 0f341fd..ea79329 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -1845,7 +1845,8 @@ void QWidgetPrivate::setMask_sys(const QRegion ®ion) OffsetRgn(wr, offset.x(), offset.y()); Q_ASSERT(q->testAttribute(Qt::WA_WState_Created)); - SetWindowRgn(data.winid, wr, true); + if (!SetWindowRgn(data.winid, wr, true)) + DeleteObject(wr); } void QWidgetPrivate::updateFrameStrut() -- cgit v0.12 From cbb9af732fee50010bb540d0a3dc39e67f2e4e7e Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Mon, 8 Jun 2009 14:01:26 +0200 Subject: Compile with gcc 4.0.x --- tools/qdoc3/qdoc3.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro index 5438e5f..ed27669 100644 --- a/tools/qdoc3/qdoc3.pro +++ b/tools/qdoc3/qdoc3.pro @@ -1,8 +1,8 @@ DEFINES += QDOC2_COMPAT DEFINES += QT_NO_CAST_TO_ASCII #DEFINES += QT_NO_CAST_FROM_ASCII -DEFINES += QT_USE_FAST_OPERATOR_PLUS -DEFINES += QT_USE_FAST_CONCATENATION +#DEFINES += QT_USE_FAST_OPERATOR_PLUS +#DEFINES += QT_USE_FAST_CONCATENATION QT = core xml CONFIG += console -- cgit v0.12 From e0405b6b42ddf794935af27a0265ca259c73ce4c Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Mon, 8 Jun 2009 14:00:42 +0200 Subject: Make the easing curve icons more beautiful. Draw the curve with anti-aliasing. Do not use absolute black, but rather a dark black color for the lines. Draw the red and blue dots, indicating the start and end points. Reviewed-by: Jan-Arve --- examples/animation/easing/window.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/examples/animation/easing/window.cpp b/examples/animation/easing/window.cpp index cf4be15..f575483 100644 --- a/examples/animation/easing/window.cpp +++ b/examples/animation/easing/window.cpp @@ -94,11 +94,24 @@ void Window::createCurveIcons() qreal yAxis = m_iconSize.width()/3; painter.drawLine(0, xAxis, m_iconSize.width(), xAxis); painter.drawLine(yAxis, 0, yAxis, m_iconSize.height()); - painter.setPen(Qt::black); qreal curveScale = m_iconSize.height()/2; - QPoint currentPos(yAxis, xAxis); - + + painter.setPen(Qt::NoPen); + + // start point + painter.setBrush(Qt::red); + QPoint start(yAxis, xAxis - curveScale * curve.valueForProgress(0)); + painter.drawRect(start.x() - 1, start.y() - 1, 3, 3); + + // end point + painter.setBrush(Qt::blue); + QPoint end(yAxis + curveScale, xAxis - curveScale * curve.valueForProgress(1)); + painter.drawRect(end.x() - 1, end.y() - 1, 3, 3); + + painter.setPen(QColor(32, 32, 32)); + painter.setRenderHint(QPainter::Antialiasing, true); + QPoint currentPos(start); for (qreal t = 0; t < 1.0; t+=1.0/curveScale) { QPoint to; to.setX(yAxis + curveScale * t); @@ -106,6 +119,7 @@ void Window::createCurveIcons() painter.drawLine(currentPos, to); currentPos = to; } + painter.setRenderHint(QPainter::Antialiasing, false); QListWidgetItem *item = new QListWidgetItem; item->setIcon(QIcon(pix)); item->setText(metaEnum.key(i)); -- cgit v0.12 From f75ff5e473c2a8fea0092d12c289698e90bff297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Mon, 8 Jun 2009 14:24:52 +0200 Subject: Remove trailing whitespace. --- examples/animation/easing/window.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/animation/easing/window.cpp b/examples/animation/easing/window.cpp index f575483..5a1f764 100644 --- a/examples/animation/easing/window.cpp +++ b/examples/animation/easing/window.cpp @@ -41,28 +41,28 @@ #include "window.h" -Window::Window(QWidget *parent) +Window::Window(QWidget *parent) : QWidget(parent), m_iconSize(64, 64) { m_ui.setupUi(this); QButtonGroup *buttonGroup = qFindChild(this); // ### workaround for uic in 4.4 - m_ui.easingCurvePicker->setIconSize(m_iconSize); + m_ui.easingCurvePicker->setIconSize(m_iconSize); m_ui.easingCurvePicker->setMinimumHeight(m_iconSize.height() + 50); buttonGroup->setId(m_ui.lineRadio, 0); buttonGroup->setId(m_ui.circleRadio, 1); - + QEasingCurve dummy; m_ui.periodSpinBox->setValue(dummy.period()); m_ui.amplitudeSpinBox->setValue(dummy.amplitude()); m_ui.overshootSpinBox->setValue(dummy.overshoot()); - + connect(m_ui.easingCurvePicker, SIGNAL(currentRowChanged(int)), this, SLOT(curveChanged(int))); connect(buttonGroup, SIGNAL(buttonClicked(int)), this, SLOT(pathChanged(int))); connect(m_ui.periodSpinBox, SIGNAL(valueChanged(double)), this, SLOT(periodChanged(double))); connect(m_ui.amplitudeSpinBox, SIGNAL(valueChanged(double)), this, SLOT(amplitudeChanged(double))); connect(m_ui.overshootSpinBox, SIGNAL(valueChanged(double)), this, SLOT(overshootChanged(double))); createCurveIcons(); - + QPixmap pix(QLatin1String(":/images/qt-logo.png")); m_item = new PixmapItem(pix); m_scene.addItem(m_item); @@ -94,7 +94,7 @@ void Window::createCurveIcons() qreal yAxis = m_iconSize.width()/3; painter.drawLine(0, xAxis, m_iconSize.width(), xAxis); painter.drawLine(yAxis, 0, yAxis, m_iconSize.height()); - + qreal curveScale = m_iconSize.height()/2; painter.setPen(Qt::NoPen); @@ -141,7 +141,7 @@ void Window::curveChanged(int row) QEasingCurve::Type curveType = (QEasingCurve::Type)row; m_anim->setEasingCurve(curveType); m_anim->setCurrentTime(0); - + bool isElastic = curveType >= QEasingCurve::InElastic && curveType <= QEasingCurve::OutInElastic; bool isBounce = curveType >= QEasingCurve::InBounce && curveType <= QEasingCurve::OutInBounce; m_ui.periodSpinBox->setEnabled(isElastic); -- cgit v0.12 From 4003ec67b479ae9bb14d65464403fcdad6e9f394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Mon, 8 Jun 2009 14:27:51 +0200 Subject: Use a QPainterPath instead to draw the graph. This enables the antialiazing to be done on the graph as a whole, and not on every tiny line segment. The result is that the curve is painter prettier. --- examples/animation/easing/window.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/animation/easing/window.cpp b/examples/animation/easing/window.cpp index 5a1f764..8a6d850 100644 --- a/examples/animation/easing/window.cpp +++ b/examples/animation/easing/window.cpp @@ -109,16 +109,16 @@ void Window::createCurveIcons() QPoint end(yAxis + curveScale, xAxis - curveScale * curve.valueForProgress(1)); painter.drawRect(end.x() - 1, end.y() - 1, 3, 3); - painter.setPen(QColor(32, 32, 32)); - painter.setRenderHint(QPainter::Antialiasing, true); - QPoint currentPos(start); + QPainterPath curvePath; + curvePath.moveTo(start); for (qreal t = 0; t < 1.0; t+=1.0/curveScale) { QPoint to; to.setX(yAxis + curveScale * t); to.setY(xAxis - curveScale * curve.valueForProgress(t)); - painter.drawLine(currentPos, to); - currentPos = to; + curvePath.lineTo(to); } + painter.setRenderHint(QPainter::Antialiasing, true); + painter.strokePath(curvePath, QColor(32, 32, 32)); painter.setRenderHint(QPainter::Antialiasing, false); QListWidgetItem *item = new QListWidgetItem; item->setIcon(QIcon(pix)); -- cgit v0.12 From 4662f3984a89b7a702a7d24c02cb30b0a5e76ef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Mon, 8 Jun 2009 14:29:55 +0200 Subject: Make sure we draw the complete curve. --- examples/animation/easing/window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/animation/easing/window.cpp b/examples/animation/easing/window.cpp index 8a6d850..3e44873 100644 --- a/examples/animation/easing/window.cpp +++ b/examples/animation/easing/window.cpp @@ -111,7 +111,7 @@ void Window::createCurveIcons() QPainterPath curvePath; curvePath.moveTo(start); - for (qreal t = 0; t < 1.0; t+=1.0/curveScale) { + for (qreal t = 0; t <= 1.0; t+=1.0/curveScale) { QPoint to; to.setX(yAxis + curveScale * t); to.setY(xAxis - curveScale * curve.valueForProgress(t)); -- cgit v0.12 From b6542eb2b1e44aea5d82ad89b8506c567aef18ad Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 8 Jun 2009 14:46:53 +0200 Subject: Small fix to exported symbol --- src/corelib/tools/qunicodetables_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qunicodetables_p.h b/src/corelib/tools/qunicodetables_p.h index e588313..5f696dd 100644 --- a/src/corelib/tools/qunicodetables_p.h +++ b/src/corelib/tools/qunicodetables_p.h @@ -178,7 +178,7 @@ namespace QUnicodeTables { } Q_CORE_EXPORT int QT_FASTCALL script(uint ucs4); - Q_CORE_EXPORT_INLINE int QT_FASTCALL script(const QChar &ch) { + inline int script(const QChar &ch) { return script(ch.unicode()); } -- cgit v0.12 From eda070eb1f0e65366eaece43e5d86baf9fb8cd89 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 8 Jun 2009 14:47:13 +0200 Subject: small code cleanup --- src/gui/itemviews/qlistview.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp index 8b50d0e..03ba641 100644 --- a/src/gui/itemviews/qlistview.cpp +++ b/src/gui/itemviews/qlistview.cpp @@ -1100,14 +1100,8 @@ void QListView::paintEvent(QPaintEvent *e) QPainter painter(d->viewport); QRect area = e->rect(); - QVector toBeRendered; -// QVector rects = e->region().rects(); -// for (int i = 0; i < rects.size(); ++i) { -// d->intersectingSet(rects.at(i).translated(horizontalOffset(), verticalOffset())); -// toBeRendered += d->intersectVector; -// } d->intersectingSet(e->rect().translated(horizontalOffset(), verticalOffset()), false); - toBeRendered = d->intersectVector; + const QVector toBeRendered = d->intersectVector; const QModelIndex current = currentIndex(); const QModelIndex hover = d->hover; -- cgit v0.12 From 9281ea186212591e636437d30747e7efd6138af6 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 8 Jun 2009 14:47:33 +0200 Subject: Fixed ListView so that it is able to move items in negative space and still paint them. The autotest is included. Task-number: 254449 Reviewed-by: ogoffart --- src/gui/itemviews/qlistview_p.h | 2 +- tests/auto/qlistview/tst_qlistview.cpp | 51 ++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/src/gui/itemviews/qlistview_p.h b/src/gui/itemviews/qlistview_p.h index 4568d8c..6514496 100644 --- a/src/gui/itemviews/qlistview_p.h +++ b/src/gui/itemviews/qlistview_p.h @@ -84,7 +84,7 @@ public: inline bool operator!=(const QListViewItem &other) const { return !(*this == other); } inline bool isValid() const - { return (x > -1) && (y > -1) && (w > 0) && (h > 0) && (indexHint > -1); } + { return rect().isValid() && (indexHint > -1); } inline void invalidate() { x = -1; y = -1; w = 0; h = 0; } inline void resize(const QSize &size) diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp index f70db14..8338ffa 100644 --- a/tests/auto/qlistview/tst_qlistview.cpp +++ b/tests/auto/qlistview/tst_qlistview.cpp @@ -52,6 +52,7 @@ #include #include #include +#include #if defined(Q_OS_WIN) || defined(Q_OS_WINCE) #include #endif @@ -107,6 +108,7 @@ private slots: void task248430_crashWith0SizedItem(); void task250446_scrollChanged(); void task196118_visualRegionForSelection(); + void task254449_draggingItemToNegativeCoordinates(); void keyboardSearch(); }; @@ -1580,6 +1582,55 @@ void tst_QListView::task196118_visualRegionForSelection() QVERIFY(view.visualRegionForSelection().isEmpty()); } +void tst_QListView::task254449_draggingItemToNegativeCoordinates() +{ + //we'll check that the items are painted correctly + class MyListView : public QListView + { + public: + void setPositionForIndex(const QPoint &position, const QModelIndex &index) + { QListView::setPositionForIndex(position, index); } + + } list; + + QStandardItemModel model(1,1); + QModelIndex index = model.index(0,0); + model.setData(index, QLatin1String("foo")); + list.setModel(&model); + list.setViewMode(QListView::IconMode); + list.show(); + QTest::qWait(200); //makes sure the layout is done + + const QPoint topLeft(-6, 0); + + + list.setPositionForIndex(topLeft, index); + + class MyItemDelegate : public QStyledItemDelegate + { + public: + MyItemDelegate() : numPaints(0) { } + void paint(QPainter *painter, + const QStyleOptionViewItem &option, const QModelIndex &index) const + { + numPaints++; + QStyledItemDelegate::paint(painter, option, index); + } + + mutable int numPaints; + } delegate; + + list.setItemDelegate(&delegate); + + //we'll make sure the item is repainted + delegate.numPaints = 0; + list.viewport()->repaint(); + + QCOMPARE(list.visualRect(index).topLeft(), topLeft); + QCOMPARE(delegate.numPaints, 1); +} + + void tst_QListView::keyboardSearch() { QStringList items; -- cgit v0.12 From a825991ad68f4b999b3063db05e3cdb73fbee834 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 8 Jun 2009 14:55:56 +0200 Subject: qdoc: Changed to mountain fresh blue. I didn't test this, because I can't build qdoc3 due to changes in QStringBuilder. --- tools/qdoc3/test/classic.css | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css index fa0167b..3e2370d 100644 --- a/tools/qdoc3/test/classic.css +++ b/tools/qdoc3/test/classic.css @@ -14,12 +14,11 @@ H3 { h3.fn,span.fn { - background-color: #d5e1d5; + background-color: #e0eff6; border-width: 1px; border-style: solid; - border-color: #66bc29; + border-color: #3388be #e0eff6 #e9f8ff #e0eff6; font-weight: bold; - -moz-border-radius: 8px 8px 8px 8px; padding: 6px 0px 6px 10px; } -- cgit v0.12 From c7296d97ae0dc92b2383dfd47e1f85aa570d5d0c Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Mon, 8 Jun 2009 16:22:09 +0200 Subject: Sync the French tutorial with the English version Reviewed-by: Pierre --- examples/tutorials/addressbook-fr/part3/addressbook.cpp | 4 +--- examples/tutorials/addressbook-fr/part4/addressbook.cpp | 3 --- examples/tutorials/addressbook-fr/part5/addressbook.cpp | 3 --- examples/tutorials/addressbook-fr/part6/addressbook.cpp | 3 --- examples/tutorials/addressbook-fr/part7/addressbook.cpp | 3 --- 5 files changed, 1 insertion(+), 15 deletions(-) diff --git a/examples/tutorials/addressbook-fr/part3/addressbook.cpp b/examples/tutorials/addressbook-fr/part3/addressbook.cpp index 49c5206..332e808 100644 --- a/examples/tutorials/addressbook-fr/part3/addressbook.cpp +++ b/examples/tutorials/addressbook-fr/part3/addressbook.cpp @@ -125,8 +125,7 @@ void AddressBook::submitContact() if (name == "" || address == "") { QMessageBox::information(this, tr("Empty Field"), - tr("Please enter a name and adderss.")); - return; + tr("Please enter a name and address.")); } if (!contacts.contains(name)) { @@ -136,7 +135,6 @@ void AddressBook::submitContact() } else { QMessageBox::information(this, tr("Add Unsuccessful"), tr("Sorry, \"%1\" is already in your address book.").arg(name)); - return; } if (contacts.isEmpty()) { diff --git a/examples/tutorials/addressbook-fr/part4/addressbook.cpp b/examples/tutorials/addressbook-fr/part4/addressbook.cpp index 95def9c..06f8a09 100644 --- a/examples/tutorials/addressbook-fr/part4/addressbook.cpp +++ b/examples/tutorials/addressbook-fr/part4/addressbook.cpp @@ -135,7 +135,6 @@ void AddressBook::submitContact() if (name == "" || address == "") { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); - return; } //! [submitContact() function part1] if (currentMode == AddingMode) { @@ -147,7 +146,6 @@ void AddressBook::submitContact() } else { QMessageBox::information(this, tr("Add Unsuccessful"), tr("Sorry, \"%1\" is already in your address book.").arg(name)); - return; } //! [submitContact() function part1] //! [submitContact() function part2] @@ -162,7 +160,6 @@ void AddressBook::submitContact() } else { QMessageBox::information(this, tr("Edit Unsuccessful"), tr("Sorry, \"%1\" is already in your address book.").arg(name)); - return; } } else if (oldAddress != address) { QMessageBox::information(this, tr("Edit Successful"), diff --git a/examples/tutorials/addressbook-fr/part5/addressbook.cpp b/examples/tutorials/addressbook-fr/part5/addressbook.cpp index 5afb6b8..af3c2d0 100644 --- a/examples/tutorials/addressbook-fr/part5/addressbook.cpp +++ b/examples/tutorials/addressbook-fr/part5/addressbook.cpp @@ -142,7 +142,6 @@ void AddressBook::submitContact() if (name == "" || address == "") { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); - return; } if (currentMode == AddingMode) { @@ -154,7 +153,6 @@ void AddressBook::submitContact() } else { QMessageBox::information(this, tr("Add Unsuccessful"), tr("Sorry, \"%1\" is already in your address book.").arg(name)); - return; } } else if (currentMode == EditingMode) { @@ -167,7 +165,6 @@ void AddressBook::submitContact() } else { QMessageBox::information(this, tr("Edit Unsuccessful"), tr("Sorry, \"%1\" is already in your address book.").arg(name)); - return; } } else if (oldAddress != address) { QMessageBox::information(this, tr("Edit Successful"), diff --git a/examples/tutorials/addressbook-fr/part6/addressbook.cpp b/examples/tutorials/addressbook-fr/part6/addressbook.cpp index b7cd446..5f31c99 100644 --- a/examples/tutorials/addressbook-fr/part6/addressbook.cpp +++ b/examples/tutorials/addressbook-fr/part6/addressbook.cpp @@ -148,7 +148,6 @@ void AddressBook::submitContact() if (name == "" || address == "") { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); - return; } if (currentMode == AddingMode) { @@ -160,7 +159,6 @@ void AddressBook::submitContact() } else { QMessageBox::information(this, tr("Add Unsuccessful"), tr("Sorry, \"%1\" is already in your address book.").arg(name)); - return; } } else if (currentMode == EditingMode) { @@ -173,7 +171,6 @@ void AddressBook::submitContact() } else { QMessageBox::information(this, tr("Edit Unsuccessful"), tr("Sorry, \"%1\" is already in your address book.").arg(name)); - return; } } else if (oldAddress != address) { QMessageBox::information(this, tr("Edit Successful"), diff --git a/examples/tutorials/addressbook-fr/part7/addressbook.cpp b/examples/tutorials/addressbook-fr/part7/addressbook.cpp index 2f81d2b..8be4d2b 100644 --- a/examples/tutorials/addressbook-fr/part7/addressbook.cpp +++ b/examples/tutorials/addressbook-fr/part7/addressbook.cpp @@ -150,7 +150,6 @@ void AddressBook::submitContact() if (name == "" || address == "") { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name and address.")); - return; } if (currentMode == AddingMode) { @@ -162,7 +161,6 @@ void AddressBook::submitContact() } else { QMessageBox::information(this, tr("Add Unsuccessful"), tr("Sorry, \"%1\" is already in your address book.").arg(name)); - return; } } else if (currentMode == EditingMode) { @@ -175,7 +173,6 @@ void AddressBook::submitContact() } else { QMessageBox::information(this, tr("Edit Unsuccessful"), tr("Sorry, \"%1\" is already in your address book.").arg(name)); - return; } } else if (oldAddress != address) { QMessageBox::information(this, tr("Edit Successful"), -- cgit v0.12 From 168f75927390d4ab726870946d60604abf994654 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 8 Jun 2009 14:55:54 +0200 Subject: Small simplification on code --- src/corelib/io/qnoncontiguousbytedevice_p.h | 5 --- src/corelib/kernel/qobject.cpp | 4 +-- src/corelib/plugin/qplugin.h | 2 +- src/corelib/thread/qthread.cpp | 6 ---- src/corelib/thread/qthread_p.h | 54 +++++++++++++++-------------- src/gui/itemviews/qtablewidget.cpp | 10 +++--- 6 files changed, 35 insertions(+), 46 deletions(-) diff --git a/src/corelib/io/qnoncontiguousbytedevice_p.h b/src/corelib/io/qnoncontiguousbytedevice_p.h index acfc6eb..562b759 100644 --- a/src/corelib/io/qnoncontiguousbytedevice_p.h +++ b/src/corelib/io/qnoncontiguousbytedevice_p.h @@ -96,7 +96,6 @@ public: class QNonContiguousByteDeviceByteArrayImpl : public QNonContiguousByteDevice { - Q_OBJECT public: QNonContiguousByteDeviceByteArrayImpl(QByteArray *ba); ~QNonContiguousByteDeviceByteArrayImpl(); @@ -112,7 +111,6 @@ protected: class QNonContiguousByteDeviceRingBufferImpl : public QNonContiguousByteDevice { - Q_OBJECT public: QNonContiguousByteDeviceRingBufferImpl(QRingBuffer *rb); ~QNonContiguousByteDeviceRingBufferImpl(); @@ -129,7 +127,6 @@ protected: class QNonContiguousByteDeviceIoDeviceImpl : public QNonContiguousByteDevice { - Q_OBJECT public: QNonContiguousByteDeviceIoDeviceImpl(QIODevice *d); ~QNonContiguousByteDeviceIoDeviceImpl(); @@ -151,7 +148,6 @@ protected: class QNonContiguousByteDeviceBufferImpl : public QNonContiguousByteDevice { - Q_OBJECT public: QNonContiguousByteDeviceBufferImpl(QBuffer *b); ~QNonContiguousByteDeviceBufferImpl(); @@ -169,7 +165,6 @@ protected: // ... and the reverse thing class QByteDeviceWrappingIoDevice : public QIODevice { - Q_OBJECT public: QByteDeviceWrappingIoDevice (QNonContiguousByteDevice *bd); ~QByteDeviceWrappingIoDevice (); diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 1501351..5e33a71 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -2228,11 +2228,11 @@ static void err_method_notfound(const QObject *object, if (strchr(method,')') == 0) // common typing mistake qWarning("Object::%s: Parentheses expected, %s %s::%s%s%s", func, type, object->metaObject()->className(), method+1, - loc ? " in ":"\0", loc ? loc : "\0"); + loc ? " in ": "", loc ? loc : ""); else qWarning("Object::%s: No such %s %s::%s%s%s", func, type, object->metaObject()->className(), method+1, - loc ? " in ":"\0", loc ? loc : "\0"); + loc ? " in ": "", loc ? loc : ""); } diff --git a/src/corelib/plugin/qplugin.h b/src/corelib/plugin/qplugin.h index 121a875..e3b9d32 100644 --- a/src/corelib/plugin/qplugin.h +++ b/src/corelib/plugin/qplugin.h @@ -131,7 +131,7 @@ struct qt_plugin_instance_deleter "pattern=""QT_PLUGIN_VERIFICATION_DATA""\n" \ "version="QT_VERSION_STR"\n" \ "debug="QPLUGIN_DEBUG_STR"\n" \ - "buildkey="QT_BUILD_KEY"\0"; + "buildkey="QT_BUILD_KEY; # if defined (Q_OS_WIN32) && defined(Q_CC_BOR) # define Q_STANDARD_CALL __stdcall diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index 2fb6335..8fba574 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -113,12 +113,6 @@ QThreadData::~QThreadData() // fprintf(stderr, "QThreadData %p destroyed\n", this); } -QThreadData *QThreadData::get2(QThread *thread) -{ - Q_ASSERT_X(thread != 0, "QThread", "internal error"); - return thread->d_func()->data; -} - void QThreadData::ref() { #ifndef QT_NO_THREAD diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h index 75293ce..eb290db 100644 --- a/src/corelib/thread/qthread_p.h +++ b/src/corelib/thread/qthread_p.h @@ -107,32 +107,6 @@ public: { } }; -class Q_CORE_EXPORT QThreadData -{ - QAtomicInt _ref; - -public: - QThreadData(int initialRefCount = 1); - ~QThreadData(); - - static QThreadData *current(); - static QThreadData *get2(QThread *thread); - - void ref(); - void deref(); - - QThread *thread; - bool quitNow; - int loopLevel; - QAbstractEventDispatcher *eventDispatcher; - QStack eventLoops; - QPostEventList postEventList; - bool canWait; - QMap tls; - - QMutex mutex; -}; - #ifndef QT_NO_THREAD class QThreadPrivate : public QObjectPrivate { @@ -210,6 +184,34 @@ public: #endif // QT_NO_THREAD +class QThreadData +{ + QAtomicInt _ref; + +public: + QThreadData(int initialRefCount = 1); + ~QThreadData(); + + static QThreadData *current(); + static QThreadData *get2(QThread *thread) + { Q_ASSERT_X(thread != 0, "QThread", "internal error"); return thread->d_func()->data; } + + + void ref(); + void deref(); + + QThread *thread; + bool quitNow; + int loopLevel; + QAbstractEventDispatcher *eventDispatcher; + QStack eventLoops; + QPostEventList postEventList; + bool canWait; + QMap tls; + + QMutex mutex; +}; + QT_END_NAMESPACE #endif // QTHREAD_P_H diff --git a/src/gui/itemviews/qtablewidget.cpp b/src/gui/itemviews/qtablewidget.cpp index e88301e..8cb2e55 100644 --- a/src/gui/itemviews/qtablewidget.cpp +++ b/src/gui/itemviews/qtablewidget.cpp @@ -1662,10 +1662,9 @@ void QTableWidgetPrivate::_q_emitCurrentItemChanged(const QModelIndex ¤t, void QTableWidgetPrivate::_q_sort() { - Q_Q(QTableWidget); if (sortingEnabled) { - int column = q->horizontalHeader()->sortIndicatorSection(); - Qt::SortOrder order = q->horizontalHeader()->sortIndicatorOrder(); + int column = horizontalHeader->sortIndicatorSection(); + Qt::SortOrder order = horizontalHeader->sortIndicatorOrder(); model()->sort(column, order); } } @@ -1673,11 +1672,10 @@ void QTableWidgetPrivate::_q_sort() void QTableWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) { - Q_Q(QTableWidget); if (sortingEnabled && topLeft.isValid() && bottomRight.isValid()) { - int column = q->horizontalHeader()->sortIndicatorSection(); + int column = horizontalHeader->sortIndicatorSection(); if (column >= topLeft.column() && column <= bottomRight.column()) { - Qt::SortOrder order = q->horizontalHeader()->sortIndicatorOrder(); + Qt::SortOrder order = horizontalHeader->sortIndicatorOrder(); model()->ensureSorted(column, order, topLeft.row(), bottomRight.row()); } } -- cgit v0.12 From 4336436b8113d6a80428d70beda40a89713d04db Mon Sep 17 00:00:00 2001 From: Alex Cucos Date: Mon, 8 Jun 2009 16:29:18 +0200 Subject: Clip region to screen coordinates before setting its component rectangles dirty. When using Qt/E with VNC screen driver on top of the Linux framebuffer (export QWS_DISPLAY="VNC:LinuxFb") the region to be exposed needs be clipped to the real screen to avoid possible negative coordinates which in turn cause access to invalid memory locations when comparing the content of the VNC buffer with the Linux framebuffer. Merge-request: 603 Reviewed-by: Tom Cooksey --- src/gui/embedded/qscreenproxy_qws.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/embedded/qscreenproxy_qws.cpp b/src/gui/embedded/qscreenproxy_qws.cpp index 5b8f6f0..7652bd9 100644 --- a/src/gui/embedded/qscreenproxy_qws.cpp +++ b/src/gui/embedded/qscreenproxy_qws.cpp @@ -279,6 +279,7 @@ void QProxyScreen::exposeRegion(QRegion r, int changing) } realScreen->exposeRegion(r, changing); + r &= realScreen->region(); const QVector rects = r.rects(); for (int i = 0; i < rects.size(); ++i) -- cgit v0.12 From 9736f27a0a6c3dde4d1493e5129557e05160e546 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Mon, 8 Jun 2009 16:37:48 +0200 Subject: Make sure that indexes in the autogenerated locale info do not exceed 16bit range. Reviewed-By: TrustMe --- util/local_database/qlocalexml2cpp.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/util/local_database/qlocalexml2cpp.py b/util/local_database/qlocalexml2cpp.py index a9abe22..af6da33 100755 --- a/util/local_database/qlocalexml2cpp.py +++ b/util/local_database/qlocalexml2cpp.py @@ -237,7 +237,17 @@ class StringData: return self.hash[s] lst = map(lambda x: hex(ord(x)), s) - token = StringDataToken(len(self.data), len(lst)) + index = len(self.data) + if index >= 65535: + print "\n\n\n#error Data index is too big!" + sys.stderr.write ("\n\n\nERROR: index exceeds the uint16 range! index = %d\n" % index) + sys.exit(1) + size = len(lst) + if size >= 65535: + print "\n\n\n#error Data is too big!" + sys.stderr.write ("\n\n\nERROR: data size exceeds the uint16 range! size = %d\n" % size) + sys.exit(1) + token = StringDataToken(index, size) self.hash[s] = token self.data += lst return token -- cgit v0.12 From 3fdc5e9ca07c8058aef29d1a1e434b3ebf7815ae Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 8 Jun 2009 16:55:14 +0200 Subject: Reduce the members in QLocale to 16bit integer instea of 32 bits. That reduces memory usage. Reviewed-by: denis --- src/corelib/tools/qlocale_p.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h index b07b948..ed7fc10 100644 --- a/src/corelib/tools/qlocale_p.h +++ b/src/corelib/tools/qlocale_p.h @@ -140,29 +140,29 @@ public: QString dateTimeToString(const QString &format, const QDate *date, const QTime *time, const QLocale *q) const; - quint32 m_language_id, m_country_id; + quint16 m_language_id, m_country_id; quint16 m_decimal, m_group, m_list, m_percent, m_zero, m_minus, m_plus, m_exponential; - quint32 m_short_date_format_idx, m_short_date_format_size; - quint32 m_long_date_format_idx, m_long_date_format_size; - quint32 m_short_time_format_idx, m_short_time_format_size; - quint32 m_long_time_format_idx, m_long_time_format_size; - quint32 m_standalone_short_month_names_idx, m_standalone_short_month_names_size; - quint32 m_standalone_long_month_names_idx, m_standalone_long_month_names_size; - quint32 m_standalone_narrow_month_names_idx, m_standalone_narrow_month_names_size; - quint32 m_short_month_names_idx, m_short_month_names_size; - quint32 m_long_month_names_idx, m_long_month_names_size; - quint32 m_narrow_month_names_idx, m_narrow_month_names_size; - quint32 m_standalone_short_day_names_idx, m_standalone_short_day_names_size; - quint32 m_standalone_long_day_names_idx, m_standalone_long_day_names_size; - quint32 m_standalone_narrow_day_names_idx, m_standalone_narrow_day_names_size; - quint32 m_short_day_names_idx, m_short_day_names_size; - quint32 m_long_day_names_idx, m_long_day_names_size; - quint32 m_narrow_day_names_idx, m_narrow_day_names_size; - quint32 m_am_idx, m_am_size; - quint32 m_pm_idx, m_pm_size; + quint16 m_short_date_format_idx, m_short_date_format_size; + quint16 m_long_date_format_idx, m_long_date_format_size; + quint16 m_short_time_format_idx, m_short_time_format_size; + quint16 m_long_time_format_idx, m_long_time_format_size; + quint16 m_standalone_short_month_names_idx, m_standalone_short_month_names_size; + quint16 m_standalone_long_month_names_idx, m_standalone_long_month_names_size; + quint16 m_standalone_narrow_month_names_idx, m_standalone_narrow_month_names_size; + quint16 m_short_month_names_idx, m_short_month_names_size; + quint16 m_long_month_names_idx, m_long_month_names_size; + quint16 m_narrow_month_names_idx, m_narrow_month_names_size; + quint16 m_standalone_short_day_names_idx, m_standalone_short_day_names_size; + quint16 m_standalone_long_day_names_idx, m_standalone_long_day_names_size; + quint16 m_standalone_narrow_day_names_idx, m_standalone_narrow_day_names_size; + quint16 m_short_day_names_idx, m_short_day_names_size; + quint16 m_long_day_names_idx, m_long_day_names_size; + quint16 m_narrow_day_names_idx, m_narrow_day_names_size; + quint16 m_am_idx, m_am_size; + quint16 m_pm_idx, m_pm_size; }; inline char QLocalePrivate::digitToCLocale(const QChar &in) const -- cgit v0.12 From 917d812013b3c34bfe71e2edfd8caa7ebd958e55 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 8 Jun 2009 17:21:00 +0200 Subject: Reduce binary size by using 16bits integers in static data over 32 bits. Reviewed-by: ogoffart --- src/corelib/xml/qxmlstream_p.h | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/src/corelib/xml/qxmlstream_p.h b/src/corelib/xml/qxmlstream_p.h index cf1d228..26509ff 100644 --- a/src/corelib/xml/qxmlstream_p.h +++ b/src/corelib/xml/qxmlstream_p.h @@ -127,27 +127,22 @@ public: GOTO_CHECK_OFFSET = 1017 }; - static const char *const spell []; - static const int lhs []; - static const int rhs []; - static const int goto_default []; - static const int action_default []; - static const int action_index []; - static const int action_info []; - static const int action_check []; + static const char *const spell []; + static const qint16 lhs []; + static const qint16 rhs []; + static const qint16 goto_default []; + static const qint16 action_default []; + static const qint16 action_index []; + static const qint16 action_info []; + static const qint16 action_check []; static inline int nt_action (int state, int nt) { - const int *const goto_index = &action_index [GOTO_INDEX_OFFSET]; - const int *const goto_check = &action_check [GOTO_CHECK_OFFSET]; - - const int yyn = goto_index [state] + nt; - - if (yyn < 0 || goto_check [yyn] != nt) + const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt; + if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt) return goto_default [nt]; - const int *const goto_info = &action_info [GOTO_INFO_OFFSET]; - return goto_info [yyn]; + return action_info [GOTO_INFO_OFFSET + yyn]; } static inline int t_action (int state, int token) @@ -170,7 +165,7 @@ const char *const QXmlStreamReader_Table::spell [] = { "EMPTY", "ANY", "PCDATA", 0, 0, 0, 0, "CDATA", "ID", "IDREF", "IDREFS", "ENTITIES", "NMTOKEN", "NMTOKENS", " Date: Mon, 8 Jun 2009 18:38:51 +0200 Subject: openUrl("mailto:") fails to open Thunderbird on windows. Thunderbird sets only the user level shell association for mailto. This is now being read before the default mail application registry. The registry crawling could have been avoided by using the ShellExecute() but it supports only around 2KBytes of data as parameter, so we will continue using CreateProcess(). Task-number: 251554 Reviewed-by: Jens Bache-Wiig --- src/gui/util/qdesktopservices_win.cpp | 64 +++++++++++++++-------------------- 1 file changed, 28 insertions(+), 36 deletions(-) diff --git a/src/gui/util/qdesktopservices_win.cpp b/src/gui/util/qdesktopservices_win.cpp index 0449cba..8d2701c 100644 --- a/src/gui/util/qdesktopservices_win.cpp +++ b/src/gui/util/qdesktopservices_win.cpp @@ -98,32 +98,35 @@ static bool launchWebBrowser(const QUrl &url) { if (url.scheme() == QLatin1String("mailto")) { //Retrieve the commandline for the default mail client - //the key used below is the command line for the mailto: shell command + //the default key used below is the command line for the mailto: shell command DWORD bufferSize = 2 * MAX_PATH; long returnValue = -1; QString command; HKEY handle; LONG res; - QT_WA ({ - res = RegOpenKeyExW(HKEY_CLASSES_ROOT, L"mailto\\Shell\\Open\\Command", 0, KEY_READ, &handle); - if (res != ERROR_SUCCESS) - return false; - - wchar_t keyValue[2 * MAX_PATH] = {0}; - returnValue = RegQueryValueExW(handle, L"", 0, 0, reinterpret_cast(keyValue), &bufferSize); - if (!returnValue) - command = QString::fromRawData((QChar*)keyValue, bufferSize); - }, { - res = RegOpenKeyExA(HKEY_CLASSES_ROOT, "mailto\\Shell\\Open\\Command", 0, KEY_READ, &handle); - if (res != ERROR_SUCCESS) - return false; - - char keyValue[2 * MAX_PATH] = {0}; - returnValue = RegQueryValueExA(handle, "", 0, 0, reinterpret_cast(keyValue), &bufferSize); + wchar_t keyValue[2 * MAX_PATH] = {0}; + QString keyName(QLatin1String("mailto")); + + //Check if user has set preference, otherwise use default. + res = RegOpenKeyExW(HKEY_CURRENT_USER, + L"Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\mailto\\UserChoice", + 0, KEY_READ, &handle); + if (res == ERROR_SUCCESS) { + returnValue = RegQueryValueEx(handle, L"Progid", 0, 0, reinterpret_cast(keyValue), &bufferSize); if (!returnValue) - command = QString::fromLocal8Bit(keyValue); - }); + keyName = QString::fromUtf16(keyValue); + RegCloseKey(handle); + } + keyName += QLatin1String("\\Shell\\Open\\Command"); + res = RegOpenKeyExW(HKEY_CLASSES_ROOT, keyName.utf16(), 0, KEY_READ, &handle); + if (res != ERROR_SUCCESS) + return false; + + bufferSize = 2 * MAX_PATH; + returnValue = RegQueryValueExW(handle, L"", 0, 0, reinterpret_cast(keyValue), &bufferSize); + if (!returnValue) + command = QString::fromRawData((QChar*)keyValue, bufferSize); RegCloseKey(handle); if(returnValue) @@ -145,19 +148,11 @@ static bool launchWebBrowser(const QUrl &url) //start the process PROCESS_INFORMATION pi; ZeroMemory(&pi, sizeof(pi)); - QT_WA ({ - STARTUPINFO si; - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - - returnValue = CreateProcess(NULL, (TCHAR*)command.utf16(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - }, { - STARTUPINFOA si; - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); + STARTUPINFO si; + ZeroMemory(&si, sizeof(si)); + si.cb = sizeof(si); - returnValue = CreateProcessA(NULL, command.toLocal8Bit().data(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); - }); + returnValue = CreateProcess(NULL, (TCHAR*)command.utf16(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); if (!returnValue) return false; @@ -171,11 +166,8 @@ static bool launchWebBrowser(const QUrl &url) return false; quintptr returnValue; - QT_WA ({ - returnValue = (quintptr)ShellExecute(0, 0, (TCHAR *) QString::fromUtf8(url.toEncoded().constData()).utf16(), 0, 0, SW_SHOWNORMAL); - } , { - returnValue = (quintptr)ShellExecuteA(0, 0, url.toEncoded().constData(), 0, 0, SW_SHOWNORMAL); - }); + returnValue = (quintptr)ShellExecute(0, 0, (TCHAR *) QString::fromUtf8(url.toEncoded().constData()).utf16(), + 0, 0, SW_SHOWNORMAL); return (returnValue > 32); } -- cgit v0.12 From 3ac9b6bdeb9f7522fa857fbc25a9da48e6d82186 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Tue, 9 Jun 2009 10:50:10 +1000 Subject: Fixed compile with MinGW 3.4. This compiler doesn't seem to follow the same rule as others for implicit conversions to/from wchar_t. Add the necessary casts, keeping in mind that sizeof(wchar_t) == 2 on Windows. --- src/gui/util/qdesktopservices_win.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/util/qdesktopservices_win.cpp b/src/gui/util/qdesktopservices_win.cpp index 8d2701c..9f8efb4 100644 --- a/src/gui/util/qdesktopservices_win.cpp +++ b/src/gui/util/qdesktopservices_win.cpp @@ -115,11 +115,11 @@ static bool launchWebBrowser(const QUrl &url) if (res == ERROR_SUCCESS) { returnValue = RegQueryValueEx(handle, L"Progid", 0, 0, reinterpret_cast(keyValue), &bufferSize); if (!returnValue) - keyName = QString::fromUtf16(keyValue); + keyName = QString::fromUtf16((const ushort*)keyValue); RegCloseKey(handle); } keyName += QLatin1String("\\Shell\\Open\\Command"); - res = RegOpenKeyExW(HKEY_CLASSES_ROOT, keyName.utf16(), 0, KEY_READ, &handle); + res = RegOpenKeyExW(HKEY_CLASSES_ROOT, (const wchar_t*)keyName.utf16(), 0, KEY_READ, &handle); if (res != ERROR_SUCCESS) return false; -- cgit v0.12 From a359abb4ccf5a2dc3bd1fac9836231677b3dc14f Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Tue, 9 Jun 2009 10:53:25 +1000 Subject: Protect EGL property names that only exist in some versions with #ifdefs Reviewed-by: trustme --- src/opengl/qegl.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/opengl/qegl.cpp b/src/opengl/qegl.cpp index f1ae4ed..290f77c 100644 --- a/src/opengl/qegl.cpp +++ b/src/opengl/qegl.cpp @@ -413,12 +413,18 @@ int QEglProperties::value(int name) const case EGL_RED_SIZE: return 0; case EGL_GREEN_SIZE: return 0; case EGL_BLUE_SIZE: return 0; - case EGL_LUMINANCE_SIZE: return 0; case EGL_ALPHA_SIZE: return 0; +#if defined(EGL_LUMINANCE_SIZE) + case EGL_LUMINANCE_SIZE: return 0; +#endif +#if defined(EGL_ALPHA_MASK_SIZE) case EGL_ALPHA_MASK_SIZE: return 0; +#endif case EGL_BIND_TO_TEXTURE_RGB: return EGL_DONT_CARE; case EGL_BIND_TO_TEXTURE_RGBA: return EGL_DONT_CARE; +#if defined(EGL_COLOR_BUFFER_TYPE) case EGL_COLOR_BUFFER_TYPE: return EGL_RGB_BUFFER; +#endif case EGL_CONFIG_CAVEAT: return EGL_DONT_CARE; case EGL_CONFIG_ID: return EGL_DONT_CARE; case EGL_DEPTH_SIZE: return 0; @@ -427,7 +433,9 @@ int QEglProperties::value(int name) const case EGL_NATIVE_VISUAL_TYPE: return EGL_DONT_CARE; case EGL_MAX_SWAP_INTERVAL: return EGL_DONT_CARE; case EGL_MIN_SWAP_INTERVAL: return EGL_DONT_CARE; +#if defined(EGL_RENDERABLE_TYPE) case EGL_RENDERABLE_TYPE: return EGL_OPENGL_ES_BIT; +#endif case EGL_SAMPLE_BUFFERS: return 0; case EGL_SAMPLES: return 0; case EGL_STENCIL_SIZE: return 0; -- cgit v0.12 From 1bbe23c5814dfda4cc6154c49e5bbf7c6ead7eba Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Tue, 9 Jun 2009 10:54:37 +1000 Subject: Make OpenGL/ES 1.1 work again for Qt/Embedded Reviewed-by: trustme --- src/opengl/qgl.cpp | 15 +++++++++++++++ src/opengl/qgl_p.h | 3 +-- src/opengl/qglframebufferobject.cpp | 2 ++ src/opengl/qglpixelbuffer.cpp | 5 +++-- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 2e72851..37a9916 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -65,12 +65,19 @@ #include "qimage.h" #include "qgl_p.h" +#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) #include "gl2paintengineex/qpaintengineex_opengl2_p.h" +#endif #ifndef QT_OPENGL_ES_2 #include #endif +#ifdef Q_WS_QWS +#include +#include +#endif + #include #include @@ -4428,7 +4435,11 @@ void QGLDrawable::swapBuffers() void QGLDrawable::makeCurrent() { previous_fbo = 0; +#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) if (!pixmapData && !fbo) { +#else +#endif + if (!fbo) { QGLContext *ctx = context(); previous_fbo = ctx->d_ptr->current_fbo; ctx->d_ptr->current_fbo = 0; @@ -4561,8 +4572,10 @@ QColor QGLDrawable::backgroundColor() const { if (widget) return widget->palette().brush(widget->backgroundRole()).color(); +#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) else if (pixmapData) return pixmapData->fillColor(); +#endif return QApplication::palette().brush(QPalette::Background).color(); } @@ -4590,8 +4603,10 @@ bool QGLDrawable::autoFillBackground() const { if (widget) return widget->autoFillBackground(); +#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) else if (pixmapData) return pixmapData->needsFill(); +#endif else return false; } diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index b3523d4..4af8598 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -428,8 +428,7 @@ private: extern Q_OPENGL_EXPORT QGLShareRegister* qgl_share_reg(); #ifdef Q_WS_QWS -class QOpenGLPaintEngine; -extern QOpenGLPaintEngine* qt_qgl_paint_engine(); +extern QPaintEngine* qt_qgl_paint_engine(); extern EGLDisplay qt_qgl_egl_display(); #endif diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 3e7ca0a..fb16107 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -43,7 +43,9 @@ #include #include +#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) #include +#endif #ifndef QT_OPENGL_ES_2 #include diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp index 483856a..0af97e3 100644 --- a/src/opengl/qglpixelbuffer.cpp +++ b/src/opengl/qglpixelbuffer.cpp @@ -76,12 +76,13 @@ \sa {opengl/pbuffers}{Pbuffers Example} */ -#include - #include #include #include +#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#include +#endif #ifndef QT_OPENGL_ES_2 #include #endif -- cgit v0.12 From 6d4fe549e7a258913b19f52e29bcfb84cc8a97ad Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Tue, 9 Jun 2009 12:58:10 +1000 Subject: Fix build breakage from 1bbe23c5 - endif in the wrong place Reviewed-by: trustme --- src/opengl/qgl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 37a9916..146d088 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -4438,8 +4438,8 @@ void QGLDrawable::makeCurrent() #if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) if (!pixmapData && !fbo) { #else -#endif if (!fbo) { +#endif QGLContext *ctx = context(); previous_fbo = ctx->d_ptr->current_fbo; ctx->d_ptr->current_fbo = 0; -- cgit v0.12 From cea87b08520888feff2f10d1bbf71bc8c2f1d780 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Tue, 9 Jun 2009 13:20:51 +1000 Subject: Another breakage in 1bbe23c5 - move qpaintengineex_opengl2_p.h include up Moving qpaintengineex_opengl2_p.h down caused it to come after an include of , which causes problems on some platforms. Move it back up again. Reviewed-by: trustme --- src/opengl/qglpixelbuffer.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp index 0af97e3..9b7a506 100644 --- a/src/opengl/qglpixelbuffer.cpp +++ b/src/opengl/qglpixelbuffer.cpp @@ -76,13 +76,16 @@ \sa {opengl/pbuffers}{Pbuffers Example} */ -#include -#include -#include +#include #if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) #include #endif + +#include +#include +#include + #ifndef QT_OPENGL_ES_2 #include #endif -- cgit v0.12 From ebcf875d90d940103e409de9127bb592d7336afe Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 9 Jun 2009 09:10:53 +0200 Subject: qdoc: Inserted
      between summary sections. Also added the left and right borders to the function headers in the detail sections. --- tools/qdoc3/htmlgenerator.cpp | 3 ++- tools/qdoc3/test/classic.css | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 90d3b04..0c21534 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1073,6 +1073,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, if (!s->inherited.isEmpty()) needOtherSection = true; } else { + out() << "
      \n"; out() << "\n"; @@ -2335,7 +2336,7 @@ void HtmlGenerator::generateSynopsis(const Node *node, QString HtmlGenerator::highlightedCode(const QString& markedCode, CodeMarker *marker, const Node *relative, - CodeMarker::SynopsisStyle style, + CodeMarker::SynopsisStyle , bool nameAlignment) { QString src = markedCode; diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css index 3e2370d..85bb348 100644 --- a/tools/qdoc3/test/classic.css +++ b/tools/qdoc3/test/classic.css @@ -17,7 +17,7 @@ h3.fn,span.fn background-color: #e0eff6; border-width: 1px; border-style: solid; - border-color: #3388be #e0eff6 #e9f8ff #e0eff6; + border-color: #3388be #3388be #e9f8ff #3388be; font-weight: bold; padding: 6px 0px 6px 10px; } -- cgit v0.12 From 662d1db6ee1a78c298acc11e7528e73c0415fc75 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 9 Jun 2009 10:32:20 +0200 Subject: doc: Corrected the rich text page wrt smallcaps. Task-number: 254912 --- doc/src/richtext.qdoc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/src/richtext.qdoc b/doc/src/richtext.qdoc index fbd8adb..6ea82f8 100644 --- a/doc/src/richtext.qdoc +++ b/doc/src/richtext.qdoc @@ -1058,8 +1058,11 @@ Ideas for other sections: \o Specifies where an image or a text will be placed in another element. Note that the \c float property is only supported for tables and images. \row \o \c text-transform - \o [ uppercase | lowercase | smallcaps ] + \o [ uppercase | lowercase ] \o Select the transformation that will be performed on the text prior to displaying it. + \row \o \c font-variant + \o small-caps + \o Perform the smallcaps transformation on the text prior to displaying it. \row \o \c word-spacing \o px \o Specifies an alternate spacing between each word. -- cgit v0.12 From 91ceb21d1d5f6447a47853b6625fb51d2f21cf16 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 9 Jun 2009 10:51:26 +0200 Subject: small refactoring to reduce memory usage of static data --- src/corelib/codecs/qisciicodec.cpp | 2 +- src/corelib/tools/qlocale.cpp | 2 +- src/corelib/tools/qlocale_data_p.h | 10 +++++----- src/corelib/xml/qxmlstream.cpp | 7 +++---- util/local_database/qlocalexml2cpp.py | 6 +++--- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/corelib/codecs/qisciicodec.cpp b/src/corelib/codecs/qisciicodec.cpp index dd2bc8d..de1e477 100644 --- a/src/corelib/codecs/qisciicodec.cpp +++ b/src/corelib/codecs/qisciicodec.cpp @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE struct Codecs { - const char *name; + const char name[10]; ushort base; }; diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 00132d7..4898e10 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -772,7 +772,7 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const Instead it can return a "Windows code". This maps windows codes to ISO country names. */ struct WindowsToISOListElt { - int windows_code; + ushort windows_code; char iso_name[6]; }; diff --git a/src/corelib/tools/qlocale_data_p.h b/src/corelib/tools/qlocale_data_p.h index 37f59a4..e0eecf3 100644 --- a/src/corelib/tools/qlocale_data_p.h +++ b/src/corelib/tools/qlocale_data_p.h @@ -60,8 +60,8 @@ QT_BEGIN_NAMESPACE */ struct CountryLanguage { - quint32 languageId; - quint32 countryId; + quint16 languageId; + quint16 countryId; }; static const CountryLanguage ImperialMeasurementSystems[] = { { 31, 225 }, @@ -83,7 +83,7 @@ static const int ImperialMeasurementSystemsCount = */ -static const uint locale_index[] = { +static const quint16 locale_index[] = { 0, // unused 0, // C 0, // Abkhazian @@ -2313,7 +2313,7 @@ static const char language_name_list[] = "Chewa\0" ; -static const uint language_name_index[] = { +static const quint16 language_name_index[] = { 0, // Unused 8, // C 10, // Abkhazian @@ -2727,7 +2727,7 @@ static const char country_name_list[] = "SerbiaAndMontenegro\0" ; -static const uint country_name_index[] = { +static const quint16 country_name_index[] = { 0, // AnyCountry 8, // Afghanistan 20, // Albania diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index 5e1fec3..fddcecf 100644 --- a/src/corelib/xml/qxmlstream.cpp +++ b/src/corelib/xml/qxmlstream.cpp @@ -629,7 +629,7 @@ while () { $sizes[$i++] = $counter; $counter += length 1 + $_; } -print " \"\\0\";\n\nstatic const int QXmlStreamReader_tokenTypeString_indices[] = {\n "; +print " \"\\0\";\n\nstatic const short QXmlStreamReader_tokenTypeString_indices[] = {\n "; for ($j = 0; $j < $i; ++$j) { printf "$sizes[$j], "; } @@ -660,10 +660,9 @@ static const char QXmlStreamReader_tokenTypeString_string[] = "Comment\0" "DTD\0" "EntityReference\0" - "ProcessingInstruction\0" - "\0"; + "ProcessingInstruction\0"; -static const int QXmlStreamReader_tokenTypeString_indices[] = { +static const short QXmlStreamReader_tokenTypeString_indices[] = { 0, 8, 16, 30, 42, 55, 66, 77, 85, 89, 105, 0 }; diff --git a/util/local_database/qlocalexml2cpp.py b/util/local_database/qlocalexml2cpp.py index af6da33..d625cfd 100755 --- a/util/local_database/qlocalexml2cpp.py +++ b/util/local_database/qlocalexml2cpp.py @@ -318,7 +318,7 @@ def main(): print # Locale index - print "static const uint locale_index[] = {" + print "static const quint16 locale_index[] = {" print " 0, // unused" index = 0 for key in language_map.keys(): @@ -454,7 +454,7 @@ def main(): print # Language name index - print "static const uint language_name_index[] = {" + print "static const quint16 language_name_index[] = {" print " 0, // Unused" index = 8 for key in language_map.keys(): @@ -477,7 +477,7 @@ def main(): print # Country name index - print "static const uint country_name_index[] = {" + print "static const quint16 country_name_index[] = {" print " 0, // AnyCountry" index = 8 for key in country_map.keys(): -- cgit v0.12 From b1658783099b75097f02bef85c4ea2a469826d37 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 4 Jun 2009 19:49:41 +0200 Subject: make bic test works in shadow build --- tests/auto/bic/bic.pro | 6 ++++++ tests/auto/bic/tst_bic.cpp | 33 +++++++++++++++++---------------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/tests/auto/bic/bic.pro b/tests/auto/bic/bic.pro index a168d77..82711c9 100644 --- a/tests/auto/bic/bic.pro +++ b/tests/auto/bic/bic.pro @@ -2,3 +2,9 @@ load(qttest_p4) SOURCES += tst_bic.cpp qbic.cpp QT = core +wince*:{ + DEFINES += SRCDIR=\\\"\\\" +} else { + DEFINES += SRCDIR=\\\"$$PWD/\\\" +} + diff --git a/tests/auto/bic/tst_bic.cpp b/tests/auto/bic/tst_bic.cpp index 181c275..8bc8d4f 100644 --- a/tests/auto/bic/tst_bic.cpp +++ b/tests/auto/bic/tst_bic.cpp @@ -165,30 +165,30 @@ void tst_Bic::sizesAndVTables_data() #if defined Q_OS_LINUX && defined Q_WS_X11 # if defined(__powerpc__) && !defined(__powerpc64__) - archFileName400 = "data/%1.4.0.0.linux-gcc-ppc32.txt"; - archFileName410 = "data/%1.4.1.0.linux-gcc-ppc32.txt"; - archFileName420 = "data/%1.4.2.0.linux-gcc-ppc32.txt"; + archFileName400 = SRCDIR "data/%1.4.0.0.linux-gcc-ppc32.txt"; + archFileName410 = SRCDIR "data/%1.4.1.0.linux-gcc-ppc32.txt"; + archFileName420 = SRCDIR "data/%1.4.2.0.linux-gcc-ppc32.txt"; # elif defined(__amd64__) - archFileName400 = "data/%1.4.0.0.linux-gcc-amd64.txt"; + archFileName400 = SRCDIR "data/%1.4.0.0.linux-gcc-amd64.txt"; # elif defined(__i386__) - archFileName400 = "data/%1.4.0.0.linux-gcc-ia32.txt"; - archFileName410 = "data/%1.4.1.0.linux-gcc-ia32.txt"; - archFileName420 = "data/%1.4.2.0.linux-gcc-ia32.txt"; - archFileName430 = "data/%1.4.3.0.linux-gcc-ia32.txt"; + archFileName400 = SRCDIR "data/%1.4.0.0.linux-gcc-ia32.txt"; + archFileName410 = SRCDIR "data/%1.4.1.0.linux-gcc-ia32.txt"; + archFileName420 = SRCDIR "data/%1.4.2.0.linux-gcc-ia32.txt"; + archFileName430 = SRCDIR "data/%1.4.3.0.linux-gcc-ia32.txt"; # endif #elif defined Q_OS_AIX if (sizeof(void*) == 4) - archFileName400 = "data/%1.4.0.0.aix-gcc-power32.txt"; + archFileName400 = SRCDIR "data/%1.4.0.0.aix-gcc-power32.txt"; #elif defined Q_OS_MAC && defined(__powerpc__) - archFileName400 = "data/%1.4.0.0.macx-gcc-ppc32.txt"; - archFileName410 = "data/%1.4.1.0.macx-gcc-ppc32.txt"; - archFileName420 = "data/%1.4.2.0.macx-gcc-ppc32.txt"; + archFileName400 = SRCDIR "data/%1.4.0.0.macx-gcc-ppc32.txt"; + archFileName410 = SRCDIR "data/%1.4.1.0.macx-gcc-ppc32.txt"; + archFileName420 = SRCDIR "data/%1.4.2.0.macx-gcc-ppc32.txt"; #elif defined Q_OS_MAC && defined(__i386__) - archFileName410 = "data/%1.4.1.0.macx-gcc-ia32.txt"; - archFileName420 = "data/%1.4.2.0.macx-gcc-ia32.txt"; + archFileName410 = SRCDIR "data/%1.4.1.0.macx-gcc-ia32.txt"; + archFileName420 = SRCDIR "data/%1.4.2.0.macx-gcc-ia32.txt"; #elif defined Q_OS_WIN && defined Q_CC_GNU - archFileName410 = "data/%1.4.1.0.win32-gcc-ia32.txt"; - archFileName420 = "data/%1.4.2.0.win32-gcc-ia32.txt"; + archFileName410 = SRCDIR "data/%1.4.1.0.win32-gcc-ia32.txt"; + archFileName420 = SRCDIR "data/%1.4.2.0.win32-gcc-ia32.txt"; #endif if (archFileName400.isEmpty() && archFileName410.isEmpty() @@ -293,6 +293,7 @@ void tst_Bic::sizesAndVTables() bool isFailed = false; + qDebug() << oldLib.arg(libName); if (oldLib.isEmpty() || !QFile::exists(oldLib.arg(libName))) QSKIP("No platform spec found for this platform/version.", SkipSingle); -- cgit v0.12 From c5a9996213a535ad6b1e183ed258913082213073 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 9 Jun 2009 11:10:46 +0200 Subject: Fix focus frame on combobox on non-Windows styles State_KeyboardFocusChange only makes sens on Windows. Follow the logic on the combobox as in PE_FrameFocusRect in the QWindowsStyle Task-number: 255482 Reviewed-by: jbache --- src/gui/styles/qcleanlooksstyle.cpp | 3 ++- src/gui/styles/qgtkstyle.cpp | 2 +- src/gui/styles/qplastiquestyle.cpp | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp index b33dfc1..805cd05 100644 --- a/src/gui/styles/qcleanlooksstyle.cpp +++ b/src/gui/styles/qcleanlooksstyle.cpp @@ -3305,7 +3305,8 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp } } // Draw the focus rect - if ((focus && (option->state & State_KeyboardFocusChange)) && !comboBox->editable) { + if (focus && !comboBox->editable + && ((option->state & State_KeyboardFocusChange) || styleHint(SH_UnderlineShortcut, option, widget))) { QStyleOptionFocusRect focus; focus.rect = subControlRect(CC_ComboBox, &comboBoxCopy, SC_ComboBoxEditField, widget) .adjusted(0, 2, option->direction == Qt::RightToLeft ? 1 : -1, -2); diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index 1fe4627..ab81d97 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -1426,7 +1426,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom QGtk::gtk_widget_style_get(gtkToggleButton, "interior-focus", &interiorFocus, NULL); int xt = interiorFocus ? gtkToggleButton->style->xthickness : 0; int yt = interiorFocus ? gtkToggleButton->style->ythickness : 0; - if ((focus && (option->state & State_KeyboardFocusChange))) + if (focus && ((option->state & State_KeyboardFocusChange) || styleHint(SH_UnderlineShortcut, option, widget))) gtkCachedPainter.paintFocus(gtkToggleButton, "button", option->rect.adjusted(xt, yt, -xt, -yt), option->state & State_Sunken ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL, diff --git a/src/gui/styles/qplastiquestyle.cpp b/src/gui/styles/qplastiquestyle.cpp index 01c0e44..0a56213 100644 --- a/src/gui/styles/qplastiquestyle.cpp +++ b/src/gui/styles/qplastiquestyle.cpp @@ -4568,7 +4568,8 @@ void QPlastiqueStyle::drawComplexControl(ComplexControl control, const QStyleOpt } // Draw the focus rect - if (((option->state & State_HasFocus) && (option->state & State_KeyboardFocusChange)) && !comboBox->editable) { + if ((option->state & State_HasFocus) && !comboBox->editable + && ((option->state & State_KeyboardFocusChange) || styleHint(SH_UnderlineShortcut, option, widget))) { QStyleOptionFocusRect focus; focus.rect = subControlRect(CC_ComboBox, option, SC_ComboBoxEditField, widget) .adjusted(-2, 0, 2, 0); -- cgit v0.12 From 9b88c6f485016b53d394a88106a048495cf79294 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Tue, 9 Jun 2009 11:58:45 +0200 Subject: Fix QImageReader autotest compilation --- tests/auto/qimagereader/qimagereader.qrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qimagereader/qimagereader.qrc b/tests/auto/qimagereader/qimagereader.qrc index 3c674ad..c6b963b 100644 --- a/tests/auto/qimagereader/qimagereader.qrc +++ b/tests/auto/qimagereader/qimagereader.qrc @@ -30,7 +30,7 @@ images/image.pgm images/image.png images/image.ppm - images/image.tif + images/image_100dpi.tif images/kollada.png images/marble.xpm images/namedcolors.xpm -- cgit v0.12 From d826a08add652314bb22bee44e0d43bbd672f272 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Tue, 9 Jun 2009 12:02:59 +0200 Subject: Fix floating point exception in QImageReader::setScaledSize(QSize(0, 0)) Avoid a division by 0 when doing QImageReader::setScaledSize(QSize(0, 0)) for jpeg formats. Reviewed-by: thierry Task-number: 255627 --- src/plugins/imageformats/jpeg/qjpeghandler.cpp | 3 ++- tests/auto/qimagereader/tst_qimagereader.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp index 6d0bc1f..088ef97 100644 --- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp +++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp @@ -781,7 +781,8 @@ static bool read_jpeg_image(QIODevice *device, QImage *outImage, #ifndef QT_NO_IMAGE_SMOOTHSCALE // If high quality not required, shrink image during decompression - if (scaledSize.isValid() && quality < HIGH_QUALITY_THRESHOLD && !params.contains(QLatin1String("GetHeaderInformation")) ) { + if (scaledSize.isValid() && !scaledSize.isEmpty() && quality < HIGH_QUALITY_THRESHOLD + && !params.contains(QLatin1String("GetHeaderInformation")) ) { cinfo.scale_denom = qMin(cinfo.image_width / scaledSize.width(), cinfo.image_width / scaledSize.height()); if (cinfo.scale_denom < 2) { diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp index f5313eb..0b32f0a 100644 --- a/tests/auto/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/qimagereader/tst_qimagereader.cpp @@ -156,6 +156,9 @@ private slots: void pixelCompareWithBaseline_data(); void pixelCompareWithBaseline(); + + void task255627_setNullScaledSize_data(); + void task255627_setNullScaledSize(); }; static const QLatin1String prefix(SRCDIR "/images/"); @@ -333,6 +336,29 @@ void tst_QImageReader::setScaledSize() QCOMPARE(image.size(), newSize); } +void tst_QImageReader::task255627_setNullScaledSize_data() +{ + setScaledSize_data(); +} + +void tst_QImageReader::task255627_setNullScaledSize() +{ + QFETCH(QString, fileName); + QFETCH(QByteArray, format); + + if (!format.isEmpty() && !QImageReader::supportedImageFormats().contains(format)) + QSKIP("Qt does not support reading the \"" + format + "\" format", SkipSingle); + + QImageReader reader(prefix + fileName); + + // set a null size + reader.setScaledSize(QSize(0, 0)); + reader.setQuality(0); + QImage image = reader.read(); + QVERIFY(image.isNull()); + QCOMPARE(image.size(), QSize(0, 0)); +} + void tst_QImageReader::setClipRect_data() { QTest::addColumn("fileName"); -- cgit v0.12 From 2de2018a33ea45b32963378bb4f7ef24cd181485 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Tue, 9 Jun 2009 12:32:05 +0200 Subject: WinCE doesn't have time() function, use QTime --- examples/statemachine/tankgameplugins/random_ai/random_ai_plugin.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/statemachine/tankgameplugins/random_ai/random_ai_plugin.cpp b/examples/statemachine/tankgameplugins/random_ai/random_ai_plugin.cpp index d360de9..2368608 100644 --- a/examples/statemachine/tankgameplugins/random_ai/random_ai_plugin.cpp +++ b/examples/statemachine/tankgameplugins/random_ai/random_ai_plugin.cpp @@ -42,13 +42,12 @@ #include "random_ai_plugin.h" #include +#include #include -#include - QState *RandomAiPlugin::create(QState *parentState, QObject *tank) { - qsrand(uint(time(NULL))); + qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); QState *topLevel = new QState(parentState); -- cgit v0.12 From d6f171c9baa61858aea0db36fd8b1bd3219ffd0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 5 Jun 2009 11:47:32 +0200 Subject: Improved clipping in GL2 paint engine. Use the stencil method to draw clip paths and regions to the Z-buffer instead of using glClear / glScissor. Using different depth values for the various clip parts also makes restore() very cheap when only IntersectClip is used. As an additional bonus this patch gives antialiased clip in the GL 2 paint engine. Task-number: 254658 Reviewed-by: Trond --- src/gui/painting/qpaintengineex.cpp | 80 ++++- src/gui/painting/qpaintengineex_p.h | 32 +- src/gui/painting/qpainter.h | 1 + .../gl2paintengineex/qglengineshadermanager.cpp | 3 +- .../gl2paintengineex/qglengineshadersource_p.h | 14 + .../gl2paintengineex/qpaintengineex_opengl2.cpp | 374 ++++++++++++--------- .../gl2paintengineex/qpaintengineex_opengl2_p.h | 25 +- 7 files changed, 343 insertions(+), 186 deletions(-) diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index 28f9220..3cf5ff9 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -138,6 +138,76 @@ QPaintEngineExPrivate::~QPaintEngineExPrivate() } +void QPaintEngineExPrivate::replayClipOperations() +{ + Q_Q(QPaintEngineEx); + + QPainter *p = q->painter(); + if (!p || !p->d_ptr) + return; + + QPainterPrivate *pp = p->d_ptr; + QList clipInfo = pp->state->clipInfo; + + QTransform transform = q->state()->matrix; + + QTransform redirection; + redirection.translate(-q->state()->redirection_offset.x(), -q->state()->redirection_offset.y()); + + for (int i = 0; i < clipInfo.size(); ++i) { + const QPainterClipInfo &info = clipInfo.at(i); + + QTransform combined = info.matrix * redirection; + + if (combined != q->state()->matrix) { + q->state()->matrix = combined; + q->transformChanged(); + } + + switch (info.clipType) { + case QPainterClipInfo::RegionClip: + q->clip(info.region, info.operation); + break; + case QPainterClipInfo::PathClip: + q->clip(info.path, info.operation); + break; + case QPainterClipInfo::RectClip: + q->clip(info.rect, info.operation); + break; + case QPainterClipInfo::RectFClip: { + qreal right = info.rectf.x() + info.rectf.width(); + qreal bottom = info.rectf.y() + info.rectf.height(); + qreal pts[] = { info.rectf.x(), info.rectf.y(), + right, info.rectf.y(), + right, bottom, + info.rectf.x(), bottom }; + QVectorPath vp(pts, 4, 0, QVectorPath::RectangleHint); + q->clip(vp, info.operation); + break; + } + } + } + + if (transform != q->state()->matrix) { + q->state()->matrix = transform; + q->transformChanged(); + } +} + + +bool QPaintEngineExPrivate::hasClipOperations() const +{ + Q_Q(const QPaintEngineEx); + + QPainter *p = q->painter(); + if (!p || !p->d_ptr) + return false; + + QPainterPrivate *pp = p->d_ptr; + QList clipInfo = pp->state->clipInfo; + + return !clipInfo.isEmpty(); +} /******************************************************************************* * @@ -244,13 +314,18 @@ static void qpaintengineex_cubicTo(qreal c1x, qreal c1y, qreal c2x, qreal c2y, q ((StrokeHandler *) data)->types.add(QPainterPath::CurveToDataElement); } +QPaintEngineEx::QPaintEngineEx() + : QPaintEngine(*new QPaintEngineExPrivate, AllFeatures) +{ + extended = true; +} + QPaintEngineEx::QPaintEngineEx(QPaintEngineExPrivate &data) : QPaintEngine(data, AllFeatures) { extended = true; } - QPainterState *QPaintEngineEx::createState(QPainterState *orig) const { if (!orig) @@ -483,6 +558,9 @@ void QPaintEngineEx::clip(const QRect &r, Qt::ClipOperation op) void QPaintEngineEx::clip(const QRegion ®ion, Qt::ClipOperation op) { + if (region.numRects() == 1) + clip(region.boundingRect(), op); + QVector rects = region.rects(); if (rects.size() <= 32) { qreal pts[2*32*4]; diff --git a/src/gui/painting/qpaintengineex_p.h b/src/gui/painting/qpaintengineex_p.h index 1c55242..3f64260 100644 --- a/src/gui/painting/qpaintengineex_p.h +++ b/src/gui/painting/qpaintengineex_p.h @@ -139,27 +139,13 @@ public: QDebug Q_GUI_EXPORT &operator<<(QDebug &, const QVectorPath &path); #endif -class Q_GUI_EXPORT QPaintEngineExPrivate : public QPaintEnginePrivate -{ -public: - QPaintEngineExPrivate(); - ~QPaintEngineExPrivate(); - - QStroker stroker; - QDashStroker dasher; - StrokeHandler *strokeHandler; - QStrokerOps *activeStroker; - QPen strokerPen; -}; - class QPixmapFilter; class Q_GUI_EXPORT QPaintEngineEx : public QPaintEngine { Q_DECLARE_PRIVATE(QPaintEngineEx) public: - inline QPaintEngineEx() - : QPaintEngine(*new QPaintEngineExPrivate, AllFeatures) { extended = true; } + QPaintEngineEx(); virtual QPainterState *createState(QPainterState *orig) const; @@ -224,6 +210,22 @@ protected: QPaintEngineEx(QPaintEngineExPrivate &data); }; +class Q_GUI_EXPORT QPaintEngineExPrivate : public QPaintEnginePrivate +{ + Q_DECLARE_PUBLIC(QPaintEngineEx) +public: + QPaintEngineExPrivate(); + ~QPaintEngineExPrivate(); + + void replayClipOperations(); + bool hasClipOperations() const; + + QStroker stroker; + QDashStroker dasher; + StrokeHandler *strokeHandler; + QStrokerOps *activeStroker; + QPen strokerPen; +}; inline uint QVectorPath::polygonFlags(QPaintEngine::PolygonDrawMode mode) { switch (mode) { diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h index f3df7a3..78cd713 100644 --- a/src/gui/painting/qpainter.h +++ b/src/gui/painting/qpainter.h @@ -507,6 +507,7 @@ private: friend class QFontEngineXLFD; friend class QWSManager; friend class QPaintEngine; + friend class QPaintEngineExPrivate; friend class QOpenGLPaintEngine; friend class QX11PaintEngine; friend class QX11PaintEnginePrivate; diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp index ea57fdf..5c541d0 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp +++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp @@ -157,6 +157,7 @@ QGLEngineShaderManager::QGLEngineShaderManager(QGLContext* context) simpleShaderProg->addShader(compiledShaders[PositionOnlyVertexShader]); simpleShaderProg->addShader(compiledShaders[MainFragmentShader]); simpleShaderProg->addShader(compiledShaders[ShockingPinkSrcFragmentShader]); + simpleShaderProg->bindAttributeLocation("vertexCoordsArray", QT_VERTEX_COORDS_ATTR); simpleShaderProg->link(); if (!simpleShaderProg->isLinked()) { qCritical() << "Errors linking simple shader:" @@ -444,7 +445,7 @@ bool QGLEngineShaderManager::useCorrectShaderProg() requiredProgram.program->addShader(requiredProgram.compositionFragShader); // We have to bind the vertex attribute names before the program is linked: - requiredProgram.program->bindAttributeLocation("inputVertex", QT_VERTEX_COORDS_ATTR); + requiredProgram.program->bindAttributeLocation("vertexCoordsArray", QT_VERTEX_COORDS_ATTR); if (useTextureCoords) requiredProgram.program->bindAttributeLocation("textureCoordArray", QT_TEXTURE_COORDS_ATTR); diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h index 920d0bc..70cc67e 100644 --- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h @@ -84,16 +84,20 @@ static const char* const qglslMainWithTexCoordsVertexShader = "\ static const char* const qglslPositionOnlyVertexShader = "\ attribute highp vec4 vertexCoordsArray;\ uniform highp mat4 pmvMatrix;\ + uniform highp float depth;\ void setPosition(void)\ {\ gl_Position = pmvMatrix * vertexCoordsArray;\ + gl_Position.z = depth;\ }"; static const char* const qglslUntransformedPositionVertexShader = "\ attribute highp vec4 vertexCoordsArray;\ + uniform highp float depth;\ void setPosition(void)\ {\ gl_Position = vertexCoordsArray;\ + gl_Position.z = depth;\ }"; // Pattern Brush - This assumes the texture size is 8x8 and thus, the inverted size is 0.125 @@ -104,9 +108,11 @@ static const char* const qglslPositionWithPatternBrushVertexShader = "\ uniform mediump vec2 invertedTextureSize; \ uniform mediump mat3 brushTransform; \ varying mediump vec2 patternTexCoords; \ + uniform highp float depth;\ void setPosition(void) { \ gl_Position = pmvMatrix * vertexCoordsArray;\ gl_Position.xy = gl_Position.xy / gl_Position.w; \ + gl_Position.z = depth;\ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \ @@ -136,9 +142,11 @@ static const char* const qglslPositionWithLinearGradientBrushVertexShader = "\ uniform highp vec3 linearData; \ uniform highp mat3 brushTransform; \ varying mediump float index ; \ + uniform highp float depth;\ void setPosition() { \ gl_Position = pmvMatrix * vertexCoordsArray;\ gl_Position.xy = gl_Position.xy / gl_Position.w; \ + gl_Position.z = depth;\ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \ @@ -166,10 +174,12 @@ static const char* const qglslPositionWithConicalGradientBrushVertexShader = "\ uniform mediump vec2 halfViewportSize; \ uniform highp mat3 brushTransform; \ varying highp vec2 A; \ + uniform highp float depth;\ void setPosition(void)\ {\ gl_Position = pmvMatrix * vertexCoordsArray;\ gl_Position.xy = gl_Position.xy / gl_Position.w; \ + gl_Position.z = depth; \ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \ @@ -205,10 +215,12 @@ static const char* const qglslPositionWithRadialGradientBrushVertexShader = "\ uniform highp vec2 fmp; \ varying highp float b; \ varying highp vec2 A; \ + uniform highp float depth;\ void setPosition(void) \ {\ gl_Position = pmvMatrix * vertexCoordsArray;\ gl_Position.xy = gl_Position.xy / gl_Position.w; \ + gl_Position.z = depth; \ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \ @@ -242,9 +254,11 @@ static const char* const qglslPositionWithTextureBrushVertexShader = "\ uniform mediump vec2 invertedTextureSize; \ uniform mediump mat3 brushTransform; \ varying mediump vec2 brushTextureCoords; \ + uniform highp float depth;\ void setPosition(void) { \ gl_Position = pmvMatrix * vertexCoordsArray;\ gl_Position.xy = gl_Position.xy / gl_Position.w; \ + gl_Position.z = depth; \ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \ diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 868adcf..fae3045 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -183,8 +183,8 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height) pex->transferMode(BrushDrawingMode); - glDisable(GL_SCISSOR_TEST); glDisable(GL_DEPTH_TEST); + glDisable(GL_SCISSOR_TEST); glViewport(0, 0, oldWidth, oldHeight); @@ -217,7 +217,7 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height) glBindFramebuffer(GL_FRAMEBUFFER_EXT, ctx->d_ptr->current_fbo); glViewport(0, 0, pex->width, pex->height); - pex->updateDepthClip(); + pex->updateDepthScissorTest(); } void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph) @@ -297,6 +297,11 @@ void QGL2PaintEngineExPrivate::useSimpleShader() shaderManager->simpleProgram()->setUniformValue("pmvMatrix", pmvMatrix); simpleShaderMatrixUniformDirty = false; } + + if (simpleShaderDepthUniformDirty) { + shaderManager->simpleProgram()->setUniformValue("depth", (GLfloat)q->state()->currentDepth); + simpleShaderDepthUniformDirty = false; + } } @@ -709,6 +714,7 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) if (path.shape() == QVectorPath::RectangleHint) { QGLRect rect(points[0].x(), points[0].y(), points[2].x(), points[2].y()); prepareForDraw(currentBrush->isOpaque()); + composite(rect); } else if (path.shape() == QVectorPath::EllipseHint) { @@ -739,13 +745,13 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) void QGL2PaintEngineExPrivate::fillStencilWithVertexArray(QGL2PEXVertexArray& vertexArray, bool useWindingFill) { // qDebug("QGL2PaintEngineExPrivate::fillStencilWithVertexArray()"); - if (stencilBuferDirty) { + if (stencilBufferDirty) { // Clear the stencil buffer to zeros glDisable(GL_STENCIL_TEST); glStencilMask(0xFFFF); // Enable writing to stencil buffer, otherwise glClear wont do anything. glClearStencil(0); // Clear to zero glClear(GL_STENCIL_BUFFER_BIT); - stencilBuferDirty = false; + stencilBufferDirty = false; } glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); // Disable color writes @@ -843,6 +849,7 @@ void QGL2PaintEngineExPrivate::prepareForDraw(bool srcPixelsAreOpaque) // The shader program has changed so mark all uniforms as dirty: brushUniformsDirty = true; shaderMatrixUniformDirty = true; + depthUniformDirty = true; } if (brushUniformsDirty && mode != ImageDrawingMode) @@ -853,6 +860,11 @@ void QGL2PaintEngineExPrivate::prepareForDraw(bool srcPixelsAreOpaque) shaderMatrixUniformDirty = false; } + if (depthUniformDirty) { + shaderManager->currentProgram()->setUniformValue("depth", (GLfloat)q->state()->currentDepth); + depthUniformDirty = false; + } + if (useGlobalOpacityUniform) shaderManager->currentProgram()->setUniformValue("globalOpacity", (GLfloat)q->state()->opacity); } @@ -1062,7 +1074,6 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(const QPointF &p, const QTextIte matrix.translate(p.x(), p.y()); ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions); - QFontEngineGlyphCache::Type glyphType = ti.fontEngine->glyphFormat >= 0 ? QFontEngineGlyphCache::Type(ti.fontEngine->glyphFormat) : QFontEngineGlyphCache::Raster_A8; @@ -1146,6 +1157,7 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) } d->ctx->d_ptr->active_engine = this; + d->last_created_state = 0; d->drawable.makeCurrent(); QSize sz = d->drawable.size(); @@ -1172,12 +1184,16 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) d->brushUniformsDirty = true; d->matrixDirty = true; d->compositionModeDirty = true; - d->stencilBuferDirty = true; + d->stencilBufferDirty = true; + d->simpleShaderDepthUniformDirty = true; + d->depthUniformDirty = true; d->use_system_clip = !systemClip().isEmpty(); glDisable(GL_DEPTH_TEST); glDisable(GL_SCISSOR_TEST); + glDepthFunc(GL_LEQUAL); + glDepthMask(false); QGLPixmapData *source = d->drawable.copyOnBegin(); if (d->drawable.context()->d_func()->clear_on_painter_begin && d->drawable.autoFillBackground()) { @@ -1201,7 +1217,7 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) d->drawTexture(QRectF(rect), QRectF(rect), rect.size(), true); } - updateClipRegion(QRegion(), Qt::NoClip); + d->systemStateChanged(); return true; } @@ -1245,260 +1261,296 @@ void QGL2PaintEngineEx::ensureActive() ctx->d_ptr->active_engine = this; glDisable(GL_DEPTH_TEST); - glDisable(GL_SCISSOR_TEST); glViewport(0, 0, d->width, d->height); + setState(state()); - d->updateDepthClip(); } } +void QGL2PaintEngineExPrivate::updateDepthScissorTest() +{ + Q_Q(QGL2PaintEngineEx); + if (q->state()->depthTestEnabled) + glEnable(GL_DEPTH_TEST); + else + glDisable(GL_DEPTH_TEST); -/////////////////////////////////// State/Clipping stolen from QOpenGLPaintEngine ////////////////////////////////////////// + if (q->state()->scissorTestEnabled) + glEnable(GL_SCISSOR_TEST); + else + glDisable(GL_SCISSOR_TEST); +} void QGL2PaintEngineEx::clipEnabledChanged() { Q_D(QGL2PaintEngineEx); - d->updateDepthClip(); + d->simpleShaderDepthUniformDirty = true; + d->depthUniformDirty = true; + + if (painter()->hasClipping()) { + d->regenerateDepthClip(); + } else { + if (d->use_system_clip) { + state()->currentDepth = -0.5f; + } else { + glDisable(GL_DEPTH_TEST); + state()->depthTestEnabled = false; + } + } } -void QGL2PaintEngineEx::clip(const QVectorPath &path, Qt::ClipOperation op) +void QGL2PaintEngineExPrivate::writeClip(const QVectorPath &path, float depth) { -// qDebug("QGL2PaintEngineEx::clip()"); - const qreal *points = path.points(); - const QPainterPath::ElementType *types = path.elements(); - if (!types && path.shape() == QVectorPath::RectangleHint) { - QRectF r(points[0], points[1], points[4]-points[0], points[5]-points[1]); - updateClipRegion(QRegion(r.toRect()), op); - return; - } + transferMode(BrushDrawingMode); - QPainterPath p; - if (types) { - int id = 0; - for (int i=0; istate()->needsDepthBufferClear) { + glDepthMask(true); + glClearDepth(0.5); + glClear(GL_DEPTH_BUFFER_BIT); + q->state()->needsDepthBufferClear = false; + glDepthMask(false); } - if (path.hints() & QVectorPath::WindingFill) - p.setFillRule(Qt::WindingFill); - updateClipRegion(QRegion(p.toFillPolygon().toPolygon(), p.fillRule()), op); - return; + if (path.isEmpty()) + return; + + glDisable(GL_BLEND); + glDepthMask(false); + + vertexCoordinateArray.clear(); + vertexCoordinateArray.addPath(path, inverseScale); + + glDepthMask(GL_FALSE); + fillStencilWithVertexArray(vertexCoordinateArray, path.hasWindingFill()); + + // Stencil the clip onto the clip buffer + glColorMask(false, false, false, false); + glDepthMask(true); + + shaderManager->simpleProgram()->setUniformValue("depth", depth); + simpleShaderDepthUniformDirty = true; + + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_ALWAYS); + + glStencilFunc(GL_NOTEQUAL, 0, 0xFFFF); // Pass if stencil buff value != 0 + + glEnable(GL_STENCIL_TEST); + composite(vertexCoordinateArray.boundingRect()); + glDisable(GL_STENCIL_TEST); + + glColorMask(true, true, true, true); + glDepthMask(false); + + cleanStencilBuffer(vertexCoordinateArray.boundingRect()); } -void QGL2PaintEngineEx::updateClipRegion(const QRegion &clipRegion, Qt::ClipOperation op) +void QGL2PaintEngineEx::clip(const QVectorPath &path, Qt::ClipOperation op) { -// qDebug("QGL2PaintEngineEx::updateClipRegion()"); +// qDebug("QGL2PaintEngineEx::clip()"); Q_D(QGL2PaintEngineEx); - QRegion sysClip = systemClip(); - if (op == Qt::NoClip && !d->use_system_clip) { - state()->hasClipping = false; - state()->clipRegion = QRegion(); - d->updateDepthClip(); - return; - } + if (op == Qt::ReplaceClip && !d->hasClipOperations()) + op = Qt::IntersectClip; - bool isScreenClip = false; - if (!d->use_system_clip) { - QVector untransformedRects = clipRegion.rects(); + if (!path.isEmpty() && op == Qt::IntersectClip && (path.hints() & QVectorPath::RectangleHint)) { + const QPointF* const points = reinterpret_cast(path.points()); + QRectF rect(points[0], points[2]); - if (untransformedRects.size() == 1) { - QPainterPath path; - path.addRect(untransformedRects[0]); - //path = d->matrix.map(path); - path = state()->matrix.map(path); - -// if (path.contains(QRectF(QPointF(), d->drawable.size()))) -// isScreenClip = true; - if (path.contains(QRectF(0.0, 0.0, d->width, d->height))) - isScreenClip = true; + if (state()->matrix.type() <= QTransform::TxScale) { + rect = state()->matrix.mapRect(rect); + + if (d->use_system_clip && rect.contains(d->systemClip.boundingRect()) + || rect.contains(QRect(0, 0, d->width, d->height))) + return; } } -// QRegion region = isScreenClip ? QRegion() : clipRegion * d->matrix; - QRegion region = isScreenClip ? QRegion() : clipRegion * state()->matrix; switch (op) { case Qt::NoClip: - if (!d->use_system_clip) - break; - state()->clipRegion = sysClip; + if (d->use_system_clip) { + glEnable(GL_DEPTH_TEST); + state()->depthTestEnabled = true; + state()->currentDepth = -0.5; + } else { + glDisable(GL_DEPTH_TEST); + state()->depthTestEnabled = false; + } + state()->canRestoreClip = false; break; case Qt::IntersectClip: - if (isScreenClip) - return; - if (state()->hasClipping) { - state()->clipRegion &= region; - break; - } - // fall through + state()->maxDepth = (1.0f + state()->maxDepth) * 0.5; + d->writeClip(path, state()->maxDepth); + state()->currentDepth = 1.5 * state()->maxDepth - 0.5f; + state()->depthTestEnabled = true; + break; case Qt::ReplaceClip: - if (d->use_system_clip && !sysClip.isEmpty()) - state()->clipRegion = region & sysClip; - else - state()->clipRegion = region; + d->systemStateChanged(); + state()->maxDepth = 0.5f; + glDepthFunc(GL_ALWAYS); + d->writeClip(path, state()->maxDepth); + state()->currentDepth = 0.25f; + state()->canRestoreClip = false; + state()->depthTestEnabled = true; break; case Qt::UniteClip: - state()->clipRegion |= region; - if (d->use_system_clip && !sysClip.isEmpty()) - state()->clipRegion &= sysClip; - break; - default: + glDepthFunc(GL_ALWAYS); + d->writeClip(path, state()->maxDepth); + state()->canRestoreClip = false; + state()->depthTestEnabled = true; break; } - if (isScreenClip) { - state()->hasClipping = false; - state()->clipRegion = QRegion(); - } else { - state()->hasClipping = op != Qt::NoClip || d->use_system_clip; + glDepthFunc(GL_LEQUAL); + if (state()->depthTestEnabled) { + glEnable(GL_DEPTH_TEST); + d->simpleShaderDepthUniformDirty = true; + d->depthUniformDirty = true; } - - d->updateDepthClip(); } -void QGL2PaintEngineExPrivate::systemStateChanged() +void QGL2PaintEngineExPrivate::regenerateDepthClip() { - Q_Q(QGL2PaintEngineEx); - use_system_clip = !systemClip.isEmpty(); - - if (q->painter()->hasClipping()) - q->updateClipRegion(q->painter()->clipRegion(), Qt::ReplaceClip); - else - q->updateClipRegion(QRegion(), Qt::NoClip); + systemStateChanged(); + replayClipOperations(); } -void QGL2PaintEngineExPrivate::updateDepthClip() +void QGL2PaintEngineExPrivate::systemStateChanged() { -// qDebug("QGL2PaintEngineExPrivate::updateDepthClip()"); - Q_Q(QGL2PaintEngineEx); + use_system_clip = !systemClip.isEmpty(); - q->ensureActive(); glDisable(GL_DEPTH_TEST); + q->state()->depthTestEnabled = false; + q->state()->scissorTestEnabled = false; + q->state()->needsDepthBufferClear = true; + glDisable(GL_SCISSOR_TEST); - if (!q->state()->hasClipping) - return; + q->state()->currentDepth = -0.5f; + q->state()->maxDepth = 0.5f; - const QVector rects = q->state()->clipEnabled ? q->state()->clipRegion.rects() : q->systemClip().rects(); - if (rects.size() == 1) { - QRect fastClip = rects.at(0); + if (use_system_clip) { + QRect bounds = systemClip.boundingRect(); + if (systemClip.numRects() == 1 + && bounds == QRect(0, 0, width, height)) + { + q->state()->needsDepthBufferClear = true; + } else { + glEnable(GL_SCISSOR_TEST); - glEnable(GL_SCISSOR_TEST); + const int left = bounds.left(); + const int width = bounds.width(); + const int bottom = height - (bounds.top() + bounds.height()); + const int height = bounds.height(); - const int left = fastClip.left(); - const int width = fastClip.width(); - const int bottom = height - (fastClip.bottom() + 1); - const int height = fastClip.height(); + glScissor(left, bottom, width, height); - glScissor(left, bottom, width, height); - return; - } + QTransform transform = q->state()->matrix; + q->state()->matrix = QTransform(); + q->transformChanged(); - glClearDepth(0x0); - glDepthMask(true); - glClear(GL_DEPTH_BUFFER_BIT); - glClearDepth(0x1); + q->state()->needsDepthBufferClear = false; - glEnable(GL_SCISSOR_TEST); - for (int i = 0; i < rects.size(); ++i) { - QRect rect = rects.at(i); + glDepthMask(true); - const int left = rect.left(); - const int width = rect.width(); - const int bottom = height - (rect.bottom() + 1); - const int height = rect.height(); + glClearDepth(0); + glClear(GL_DEPTH_BUFFER_BIT); - glScissor(left, bottom, width, height); + QPainterPath path; + path.addRegion(systemClip); - glClear(GL_DEPTH_BUFFER_BIT); - } - glDisable(GL_SCISSOR_TEST); + glDepthFunc(GL_ALWAYS); + writeClip(qtVectorPathForPath(path), 0.0f); + glDepthFunc(GL_LEQUAL); - glDepthMask(false); - glDepthFunc(GL_LEQUAL); - glEnable(GL_DEPTH_TEST); -} + glEnable(GL_DEPTH_TEST); + q->state()->depthTestEnabled = true; + q->state()->scissorTestEnabled = true; + q->state()->matrix = transform; + q->transformChanged(); + } + q->state()->currentDepth = -0.5f; + simpleShaderDepthUniformDirty = true; + depthUniformDirty = true; + } +} void QGL2PaintEngineEx::setState(QPainterState *new_state) { -// qDebug("QGL2PaintEngineEx::setState()"); + // qDebug("QGL2PaintEngineEx::setState()"); Q_D(QGL2PaintEngineEx); QOpenGL2PaintEngineState *s = static_cast(new_state); - QOpenGL2PaintEngineState *old_state = state(); - const bool needsDepthClipUpdate = !old_state - || s->clipEnabled != old_state->clipEnabled - || (s->clipEnabled && s->clipRegion != old_state->clipRegion); QPaintEngineEx::setState(s); - if (needsDepthClipUpdate) - d->updateDepthClip(); + if (s == d->last_created_state) { + d->last_created_state = 0; + return; + } d->matrixDirty = true; d->compositionModeDirty = true; d->brushTextureDirty = true; d->brushUniformsDirty = true; + d->simpleShaderDepthUniformDirty = true; + d->depthUniformDirty = true; d->simpleShaderMatrixUniformDirty = true; d->shaderMatrixUniformDirty = true; + + if (old_state && old_state != s && old_state->canRestoreClip) { + d->updateDepthScissorTest(); + glDepthMask(false); + glDepthFunc(GL_LEQUAL); + s->maxDepth = old_state->maxDepth; + } else { + d->regenerateDepthClip(); + } } QPainterState *QGL2PaintEngineEx::createState(QPainterState *orig) const { + Q_D(const QGL2PaintEngineEx); + QOpenGL2PaintEngineState *s; if (!orig) s = new QOpenGL2PaintEngineState(); else s = new QOpenGL2PaintEngineState(*static_cast(orig)); + d->last_created_state = s; return s; } QOpenGL2PaintEngineState::QOpenGL2PaintEngineState(QOpenGL2PaintEngineState &other) : QPainterState(other) { - clipRegion = other.clipRegion; - hasClipping = other.hasClipping; + needsDepthBufferClear = other.needsDepthBufferClear; + depthTestEnabled = other.depthTestEnabled; + scissorTestEnabled = other.scissorTestEnabled; + currentDepth = other.currentDepth; + maxDepth = other.maxDepth; + canRestoreClip = other.canRestoreClip; } QOpenGL2PaintEngineState::QOpenGL2PaintEngineState() { - hasClipping = false; + needsDepthBufferClear = true; + depthTestEnabled = false; + scissorTestEnabled = false; + currentDepth = -0.5f; + maxDepth = 0.5f; + canRestoreClip = true; } QOpenGL2PaintEngineState::~QOpenGL2PaintEngineState() diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 7213474..2cea8d6 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -77,8 +77,15 @@ public: QOpenGL2PaintEngineState(); ~QOpenGL2PaintEngineState(); - QRegion clipRegion; - bool hasClipping; + bool needsDepthBufferClear; + qreal depthBufferClearValue; + + bool depthTestEnabled; + bool scissorTestEnabled; + qreal currentDepth; + qreal maxDepth; + + bool canRestoreClip; }; @@ -116,7 +123,6 @@ public: Type type() const { return OpenGL; } - // State stuff is just for clipping and ripped off from QGLPaintEngine void setState(QPainterState *s); QPainterState *createState(QPainterState *orig) const; inline QOpenGL2PaintEngineState *state() { @@ -125,7 +131,6 @@ public: inline const QOpenGL2PaintEngineState *state() const { return static_cast(QPaintEngineEx::state()); } - void updateClipRegion(const QRegion &clipRegion, Qt::ClipOperation op); virtual void sync(); private: @@ -180,9 +185,10 @@ public: QGLDrawable drawable; int width, height; QGLContext *ctx; - EngineMode mode; + mutable QOpenGL2PaintEngineState *last_created_state; + // Dirty flags bool matrixDirty; // Implies matrix uniforms are also dirty bool compositionModeDirty; @@ -190,7 +196,9 @@ public: bool brushUniformsDirty; bool simpleShaderMatrixUniformDirty; bool shaderMatrixUniformDirty; - bool stencilBuferDirty; + bool stencilBufferDirty; + bool depthUniformDirty; + bool simpleShaderDepthUniformDirty; const QBrush* currentBrush; // May not be the state's brush! @@ -206,8 +214,9 @@ public: QGLEngineShaderManager* shaderManager; - // Clipping & state stuff stolen from QOpenGLPaintEngine: - void updateDepthClip(); + void writeClip(const QVectorPath &path, float depth); + void updateDepthScissorTest(); + void regenerateDepthClip(); void systemStateChanged(); uint use_system_clip : 1; }; -- cgit v0.12 From 73ea2f5766d2c0925af1bee7037610c2c75e89c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 9 Jun 2009 10:54:42 +0200 Subject: Resolved FBO extensions as well when resolving GL 2 extensions. The new GL 2 text drawing requries the FBO function pointers to be resolved. --- src/opengl/qglextensions.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/opengl/qglextensions.cpp b/src/opengl/qglextensions.cpp index 3c198fb..10ca613 100644 --- a/src/opengl/qglextensions.cpp +++ b/src/opengl/qglextensions.cpp @@ -337,6 +337,9 @@ bool qt_resolve_version_2_0_functions(QGLContext *ctx) if (!qt_resolve_version_1_3_functions(ctx)) gl2supported = false; + if (!qt_resolve_framebufferobject_extensions(ctx)) + gl2supported = false; + if (glStencilOpSeparate) return gl2supported; -- cgit v0.12 From 6495eb4953c5fca93d8cfe91c66b50ce82ce24cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 9 Jun 2009 13:02:47 +0200 Subject: Optimized stencil buffer clearing in GL 2 paint engine. Based on Zack's patch, 17e1bca1ce366395f8331e16aa96b7176ca1abac. Instead of manually clearing the stencil buffer after drawing we simply do the clearing and drawing in one go. Reviewed-by: Trond --- .../gl2paintengineex/qpaintengineex_opengl2.cpp | 50 ++++------------------ .../gl2paintengineex/qpaintengineex_opengl2_p.h | 1 - 2 files changed, 9 insertions(+), 42 deletions(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index fae3045..bdea187 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -732,12 +732,14 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) // Stencil the brush onto the dest buffer glStencilFunc(GL_NOTEQUAL, 0, 0xFFFF); // Pass if stencil buff value != 0 + glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE); + glEnable(GL_STENCIL_TEST); prepareForDraw(currentBrush->isOpaque()); composite(vertexCoordinateArray.boundingRect()); glDisable(GL_STENCIL_TEST); - cleanStencilBuffer(vertexCoordinateArray.boundingRect()); + glStencilMask(0); } } @@ -745,17 +747,17 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) void QGL2PaintEngineExPrivate::fillStencilWithVertexArray(QGL2PEXVertexArray& vertexArray, bool useWindingFill) { // qDebug("QGL2PaintEngineExPrivate::fillStencilWithVertexArray()"); + glStencilMask(0xFFFF); // Enable stencil writes + if (stencilBufferDirty) { // Clear the stencil buffer to zeros glDisable(GL_STENCIL_TEST); - glStencilMask(0xFFFF); // Enable writing to stencil buffer, otherwise glClear wont do anything. glClearStencil(0); // Clear to zero glClear(GL_STENCIL_BUFFER_BIT); stencilBufferDirty = false; } glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); // Disable color writes - glStencilMask(0xFFFF); // Enable stencil writes glStencilFunc(GL_ALWAYS, 0, 0xFFFF); // Always pass the stencil test // Setup the stencil op: @@ -765,7 +767,7 @@ void QGL2PaintEngineExPrivate::fillStencilWithVertexArray(QGL2PEXVertexArray& ve } else glStencilOp(GL_KEEP, GL_KEEP, GL_INVERT); // Simply invert the stencil bit - // No point in using a fancy gradiant shader for writing into the stencil buffer! + // No point in using a fancy gradient shader for writing into the stencil buffer! useSimpleShader(); glEnable(GL_STENCIL_TEST); // For some reason, this has to happen _after_ the simple shader is use()'d @@ -776,41 +778,6 @@ void QGL2PaintEngineExPrivate::fillStencilWithVertexArray(QGL2PEXVertexArray& ve // Enable color writes & disable stencil writes glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - glStencilMask(0); -} - -void QGL2PaintEngineExPrivate::cleanStencilBuffer(const QGLRect& area) -{ -// qDebug("QGL2PaintEngineExPrivate::cleanStencilBuffer()"); - useSimpleShader(); - - GLfloat rectVerts[] = { - area.left, area.top, - area.left, area.bottom, - area.right, area.bottom, - area.right, area.top - }; - - glEnableVertexAttribArray(QT_VERTEX_COORDS_ATTR); - glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, rectVerts); - - glEnable(GL_STENCIL_TEST); - glStencilFunc(GL_ALWAYS, 0, 0xFFFF); // Always pass the stencil test - - glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); // Disable color writes - glStencilMask(0xFFFF); // Enable writing to stencil buffer - glStencilOp(GL_ZERO, GL_ZERO, GL_ZERO); // Write 0's to stencil buffer - - glDisable(GL_BLEND); - - glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - - glDisableVertexAttribArray(QT_VERTEX_COORDS_ATTR); - - // Enable color writes & disable stencil writes - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - glStencilMask(0); - glDisable(GL_STENCIL_TEST); } void QGL2PaintEngineExPrivate::prepareForDraw(bool srcPixelsAreOpaque) @@ -1339,15 +1306,16 @@ void QGL2PaintEngineExPrivate::writeClip(const QVectorPath &path, float depth) glDepthFunc(GL_ALWAYS); glStencilFunc(GL_NOTEQUAL, 0, 0xFFFF); // Pass if stencil buff value != 0 + glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE); glEnable(GL_STENCIL_TEST); composite(vertexCoordinateArray.boundingRect()); glDisable(GL_STENCIL_TEST); + glStencilMask(0); + glColorMask(true, true, true, true); glDepthMask(false); - - cleanStencilBuffer(vertexCoordinateArray.boundingRect()); } void QGL2PaintEngineEx::clip(const QVectorPath &path, Qt::ClipOperation op) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 2cea8d6..db39ced 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -174,7 +174,6 @@ public: // ^ Composites the bounding rect onto dest buffer void fillStencilWithVertexArray(QGL2PEXVertexArray& vertexArray, bool useWindingFill); // ^ Calls drawVertexArrays to render into stencil buffer - void cleanStencilBuffer(const QGLRect& area); void prepareForDraw(bool srcPixelsAreOpaque); -- cgit v0.12 From 923cadc12b993a0b41200750f151d73662856482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 9 Jun 2009 13:23:08 +0200 Subject: Prevented pixmap FBOs from growing too big. If we're painting to very wide and then very tall pixmaps we don't want the FBO to grow to max_width * max_height, instead we should recreate the FBO if it grows too large compared to what's being painted. Reviewed-by: Trond --- src/opengl/qpixmapdata_gl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index 8d94c8b..98c406b 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -389,6 +389,11 @@ QPaintEngine* QGLPixmapData::paintEngine() const sz.setWidth(qMax(m_width, qRound(sz.width() * 1.5))); if (sz.height() < m_height) sz.setHeight(qMax(m_height, qRound(sz.height() * 1.5))); + + // wasting too much space? + if (sz.width() * sz.height() > m_width * m_height * 2.5) + sz = QSize(m_width, m_height); + delete textureBufferStack.at(currentTextureBuffer).fbo; textureBufferStack[currentTextureBuffer] = createTextureBuffer(sz, textureBufferStack.at(currentTextureBuffer).engine); -- cgit v0.12 From 7cd3e8233090f2937e38aff846a30635bcd14eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 9 Jun 2009 14:05:03 +0200 Subject: Removed background caching in embeddeddialogs demo. No point in caching a background that is already a pixmap. When maximizing the window this pixmap gets huge, and it doesn't help performance either. Reviewed-by: Trond --- demos/embeddeddialogs/main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/demos/embeddeddialogs/main.cpp b/demos/embeddeddialogs/main.cpp index cfb31c4..c9b6ee1 100644 --- a/demos/embeddeddialogs/main.cpp +++ b/demos/embeddeddialogs/main.cpp @@ -76,7 +76,6 @@ int main(int argc, char *argv[]) view.scale(0.5, 0.5); view.setRenderHints(view.renderHints() | QPainter::Antialiasing | QPainter::SmoothPixmapTransform); view.setBackgroundBrush(QPixmap(":/No-Ones-Laughing-3.jpg")); - view.setCacheMode(QGraphicsView::CacheBackground); view.setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate); view.show(); view.setWindowTitle("Embedded Dialogs Demo"); -- cgit v0.12 From 5039d39f3af42d23bba1f1c0ae10365ebcd82b4a Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 9 Jun 2009 12:17:03 +0200 Subject: small change to reduce static data size --- src/corelib/kernel/qvariant.cpp | 2 +- src/gui/text/qtexthtmlparser.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 2ff9818..e6f1c48 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -1823,7 +1823,7 @@ QVariant::Type QVariant::nameToType(const char *name) #ifndef QT_NO_DATASTREAM enum { MapFromThreeCount = 35 }; -static const uint map_from_three[MapFromThreeCount] = +static const ushort map_from_three[MapFromThreeCount] = { QVariant::Invalid, QVariant::Map, diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp index ee743dc..76c59c3 100644 --- a/src/gui/text/qtexthtmlparser.cpp +++ b/src/gui/text/qtexthtmlparser.cpp @@ -343,7 +343,7 @@ static QChar resolveEntity(const QString &entity) return e->code; } -static const uint windowsLatin1ExtendedCharacters[0xA0 - 0x80] = { +static const ushort windowsLatin1ExtendedCharacters[0xA0 - 0x80] = { 0x20ac, // 0x80 0x0081, // 0x81 direct mapping 0x201a, // 0x82 -- cgit v0.12 From b9f5e151b3c0bca74136720c5b42c9a93c8f25a8 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 9 Jun 2009 14:04:55 +0200 Subject: small improvement/refactor to cssparser --- src/gui/text/qcssparser.cpp | 42 +----------------------------- src/gui/text/qcssparser_p.h | 1 - tests/auto/qcssparser/tst_cssparser.cpp | 45 +++++++++++++++++++++++++++++++-- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index 0494b72..a05e5a1 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -57,46 +57,6 @@ QT_BEGIN_NAMESPACE using namespace QCss; -const char *Scanner::tokenName(QCss::TokenType t) -{ - switch (t) { - case NONE: return "NONE"; - case S: return "S"; - case CDO: return "CDO"; - case CDC: return "CDC"; - case INCLUDES: return "INCLUDES"; - case DASHMATCH: return "DASHMATCH"; - case LBRACE: return "LBRACE"; - case PLUS: return "PLUS"; - case GREATER: return "GREATER"; - case COMMA: return "COMMA"; - case STRING: return "STRING"; - case INVALID: return "INVALID"; - case IDENT: return "IDENT"; - case HASH: return "HASH"; - case ATKEYWORD_SYM: return "ATKEYWORD_SYM"; - case EXCLAMATION_SYM: return "EXCLAMATION_SYM"; - case LENGTH: return "LENGTH"; - case PERCENTAGE: return "PERCENTAGE"; - case NUMBER: return "NUMBER"; - case FUNCTION: return "FUNCTION"; - case COLON: return "COLON"; - case SEMICOLON: return "SEMICOLON"; - case RBRACE: return "RBRACE"; - case SLASH: return "SLASH"; - case MINUS: return "MINUS"; - case DOT: return "DOT"; - case STAR: return "STAR"; - case LBRACKET: return "LBRACKET"; - case RBRACKET: return "RBRACKET"; - case EQUAL: return "EQUAL"; - case LPAREN: return "LPAREN"; - case RPAREN: return "RPAREN"; - case OR: return "OR"; - } - return ""; -} - struct QCssKnownValue { const char *name; @@ -279,7 +239,7 @@ static const QCssKnownValue values[NumKnownValues - 1] = { }; //Map id to strings as they appears in the 'values' array above -static const int indexOfId[NumKnownValues] = { 0, 40, 47, 41, 48, 53, 34, 26, 68, 69, 25, 42, 5, 62, 46, +static const short indexOfId[NumKnownValues] = { 0, 40, 47, 41, 48, 53, 34, 26, 68, 69, 25, 42, 5, 62, 46, 29, 57, 58, 27, 50, 60, 6, 10, 38, 55, 19, 13, 17, 18, 20, 21, 49, 24, 45, 65, 36, 3, 2, 39, 61, 16, 11, 56, 14, 32, 63, 54, 64, 33, 67, 8, 28, 37, 12, 35, 59, 7, 9, 4, 66, 52, 22, 23, 30, 31, 1, 15, 0, 51, 44, 43 }; diff --git a/src/gui/text/qcssparser_p.h b/src/gui/text/qcssparser_p.h index 72bd637..81f306d 100644 --- a/src/gui/text/qcssparser_p.h +++ b/src/gui/text/qcssparser_p.h @@ -731,7 +731,6 @@ class Q_AUTOTEST_EXPORT Scanner public: static QString preprocess(const QString &input, bool *hasEscapeSequences = 0); static void scan(const QString &preprocessedInput, QVector *symbols); - static const char *tokenName(TokenType t); }; class Q_GUI_EXPORT Parser diff --git a/tests/auto/qcssparser/tst_cssparser.cpp b/tests/auto/qcssparser/tst_cssparser.cpp index b41a745..27258b7 100644 --- a/tests/auto/qcssparser/tst_cssparser.cpp +++ b/tests/auto/qcssparser/tst_cssparser.cpp @@ -114,11 +114,52 @@ void tst_CssParser::scanner_data() } } + +static char *tokenName(QCss::TokenType t) +{ + switch (t) { + case QCss::NONE: return "NONE"; + case QCss::S: return "S"; + case QCss::CDO: return "CDO"; + case QCss::CDC: return "CDC"; + case QCss::INCLUDES: return "INCLUDES"; + case QCss::DASHMATCH: return "DASHMATCH"; + case QCss::LBRACE: return "LBRACE"; + case QCss::PLUS: return "PLUS"; + case QCss::GREATER: return "GREATER"; + case QCss::COMMA: return "COMMA"; + case QCss::STRING: return "STRING"; + case QCss::INVALID: return "INVALID"; + case QCss::IDENT: return "IDENT"; + case QCss::HASH: return "HASH"; + case QCss::ATKEYWORD_SYM: return "ATKEYWORD_SYM"; + case QCss::EXCLAMATION_SYM: return "EXCLAMATION_SYM"; + case QCss::LENGTH: return "LENGTH"; + case QCss::PERCENTAGE: return "PERCENTAGE"; + case QCss::NUMBER: return "NUMBER"; + case QCss::FUNCTION: return "FUNCTION"; + case QCss::COLON: return "COLON"; + case QCss::SEMICOLON: return "SEMICOLON"; + case QCss::RBRACE: return "RBRACE"; + case QCss::SLASH: return "SLASH"; + case QCss::MINUS: return "MINUS"; + case QCss::DOT: return "DOT"; + case QCss::STAR: return "STAR"; + case QCss::LBRACKET: return "LBRACKET"; + case QCss::RBRACKET: return "RBRACKET"; + case QCss::EQUAL: return "EQUAL"; + case QCss::LPAREN: return "LPAREN"; + case QCss::RPAREN: return "RPAREN"; + case QCss::OR: return "OR"; + } + return ""; +} + static void debug(const QVector &symbols, int index = -1) { qDebug() << "all symbols:"; for (int i = 0; i < symbols.count(); ++i) - qDebug() << "(" << i << "); Token:" << QCss::Scanner::tokenName(symbols.at(i).token) << "; Lexem:" << symbols.at(i).lexem(); + qDebug() << "(" << i << "); Token:" << tokenName(symbols.at(i).token) << "; Lexem:" << symbols.at(i).lexem(); if (index != -1) qDebug() << "failure at index" << index; } @@ -160,7 +201,7 @@ void tst_CssParser::scanner() QCOMPARE(l.count(), 2); const QString expectedToken = l.at(0); const QString expectedLexem = l.at(1); - QString actualToken = QString::fromLatin1(QCss::Scanner::tokenName(symbols.at(i).token)); + QString actualToken = QString::fromLatin1(tokenName(symbols.at(i).token)); if (actualToken != expectedToken) { debug(symbols, i); QCOMPARE(actualToken, expectedToken); -- cgit v0.12 From d367ee08d1a07f1a30665b77ec11acec96e65a65 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 9 Jun 2009 15:23:59 +0200 Subject: Doc: Fixed QWebPage::forwardUnsupportedContent documentation and added more information about Web plugins. Reviewed-by: Trust Me --- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 8 +++++--- src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp | 22 +++++++++++++++------- src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc | 3 ++- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index 01b68eb..77add54 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -1986,10 +1986,12 @@ bool QWebPage::isContentEditable() const /*! \property QWebPage::forwardUnsupportedContent - \brief whether QWebPage should forward unsupported content through the - unsupportedContent signal + \brief whether QWebPage should forward unsupported content - If disabled the download of such content is aborted immediately. + If enabled, the unsupportedContent() signal is emitted with a network reply that + can be used to read the content. + + If disabled, the download of such content is aborted immediately. By default unsupported content is not forwarded. */ diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp index 1ad23f6..b516263 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp @@ -213,17 +213,25 @@ QWebSettings *QWebSettings::globalSettings() Each QWebPage object has its own QWebSettings object, which configures the settings for that page. If a setting is not configured, then it is looked up in the global settings object, which can be accessed using - QWebSettings::globalSettings(). + globalSettings(). - QWebSettings allows configuring font properties such as font size and font - family, the location of a custom stylesheet, and generic attributes like java - script, plugins, etc. The \l{QWebSettings::WebAttribute}{WebAttribute} - enum further describes this. + QWebSettings allows configuration of browser properties, such as font sizes and + families, the location of a custom style sheet, and generic attributes like + JavaScript and plugins. Individual attributes are set using the setAttribute() + function. The \l{QWebSettings::WebAttribute}{WebAttribute} enum further describes + each attribute. - QWebSettings also configures global properties such as the web page memory - cache and the web page icon database, local database storage and offline + QWebSettings also configures global properties such as the Web page memory + cache and the Web page icon database, local database storage and offline applications storage. + \section1 Enabling Plugins + + Support for browser plugins can enabled by setting the + \l{QWebSettings::PluginsEnabled}{PluginsEnabled} attribute. For many applications, + this attribute is enabled for all pages by setting it on the + \l{globalSettings()}{global settings object}. + \section1 Web Application Support WebKit provides support for features specified in \l{HTML 5} that improve the diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc index 06305e0..119c126 100644 --- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc +++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc @@ -96,7 +96,8 @@ Since WebKit supports the Netscape Plugin API, Qt applications can display Web pages that embed common plugins, as long as the user has the appropriate - binary files for those plugins installed. + binary files for those plugins installed and the \l{QWebSettings::PluginsEnabled} + attribute is set for the application. The following locations are searched for plugins: -- cgit v0.12 From 4d7a1cbb060a7fe933f674e1a9ebaa9e81fe2896 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 9 Jun 2009 15:54:19 +0200 Subject: qdoc: The gray version. --- src/corelib/kernel/qtimer.cpp | 2 +- tools/qdoc3/htmlgenerator.cpp | 2 -- tools/qdoc3/test/classic.css | 49 +++++++++++++++++++++++++++++++++++++------ 3 files changed, 44 insertions(+), 9 deletions(-) diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp index 8ca53b9..29bdf7e 100644 --- a/src/corelib/kernel/qtimer.cpp +++ b/src/corelib/kernel/qtimer.cpp @@ -251,7 +251,7 @@ void QTimer::stop() /*! - \reimp + \reimp */ void QTimer::timerEvent(QTimerEvent *e) { diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 0c21534..fb33de4 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2349,8 +2349,6 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, // replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*()" static const QString linkTag("link"); - if (src.contains("setAcceptDrops")) - qDebug() << "SRC:" << src; bool done = false; for (int i = 0, n = src.size(); i < n;) { if (src.at(i) == charLangle && src.at(i + 1).unicode() == '@') { diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css index 85bb348..9c59c81 100644 --- a/tools/qdoc3/test/classic.css +++ b/tools/qdoc3/test/classic.css @@ -14,12 +14,49 @@ H3 { h3.fn,span.fn { - background-color: #e0eff6; + background-color: #eee; border-width: 1px; border-style: solid; - border-color: #3388be #3388be #e9f8ff #3388be; + border-color: #ddd #ddd #ddd #ddd ; font-weight: bold; padding: 6px 0px 6px 10px; + margin: 42px 0px 0px 0px; +} + +hr { + border: 0; + color: #9E9E9E; + background-color: #ccc; + height: 1px; + width: 100%; + text-align: left; + margin: 34px 0px 34px 0px; +} + +table { + border-width: 1px 1px 1px 1px; + border-style: solid; + border-color: #dddddd; + border-collapse: collapse; + background-color: #f0f0f0; + margin-left: 1.5%; + width: 97% +} + +table th { + border-width: 1px 1px 1px 2px; + padding: 4px; + border-style: solid; + border-color: #444; + color:white; + background-color:#444; +} + +p { + margin-left: 1.5%; + margin-top: 8px; + width: 97% + margin-bottom: 8px; } a:link @@ -66,7 +103,7 @@ body table td.memItemLeft { width: 200px; - padding: 1px 0px 0px 8px; + padding: 2px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; @@ -76,7 +113,7 @@ table td.memItemLeft { border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; - border-top-style: solid; + border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; @@ -85,7 +122,7 @@ table td.memItemLeft { white-space: nowrap } table td.memItemRight { - padding: 1px 8px 0px 8px; + padding: 2px 8px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; @@ -95,7 +132,7 @@ table td.memItemRight { border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; - border-top-style: solid; + border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; -- cgit v0.12 From a15cce3256e57464720ea7fe7cf663c973f43c7b Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 9 Jun 2009 16:46:18 +0200 Subject: small changes in private headers --- src/gui/image/qpicture_p.h | 2 +- src/gui/painting/qtextureglyphcache_p.h | 2 +- src/gui/text/qfontengine.cpp | 6 ------ src/gui/text/qfontengine_p.h | 1 - src/gui/text/qfontengineglyphcache_p.h | 4 ++-- 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/gui/image/qpicture_p.h b/src/gui/image/qpicture_p.h index a3fd34f..3e8391f 100644 --- a/src/gui/image/qpicture_p.h +++ b/src/gui/image/qpicture_p.h @@ -69,7 +69,7 @@ class QPaintEngine; extern const char *qt_mfhdr_tag; -class Q_GUI_EXPORT QPicturePrivate +class QPicturePrivate { Q_DECLARE_PUBLIC(QPicture) friend class QPicturePaintEngine; diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h index cb5be75..689c091 100644 --- a/src/gui/painting/qtextureglyphcache_p.h +++ b/src/gui/painting/qtextureglyphcache_p.h @@ -121,7 +121,7 @@ protected: }; -class Q_GUI_EXPORT QImageTextureGlyphCache : public QTextureGlyphCache +class QImageTextureGlyphCache : public QTextureGlyphCache { public: QImageTextureGlyphCache(QFontEngineGlyphCache::Type type, const QTransform &matrix) diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 6e8adcf..79e341a 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -70,12 +70,6 @@ static inline bool qtransform_equals_no_translate(const QTransform &a, const QTr } } - - -QFontEngineGlyphCache::~QFontEngineGlyphCache() -{ -} - // Harfbuzz helper functions static HB_Bool hb_stringToGlyphs(HB_Font font, const HB_UChar16 *string, hb_uint32 length, HB_Glyph *glyphs, hb_uint32 *numGlyphs, HB_Bool rightToLeft) diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 0f8d81c..3ef9d5f 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -93,7 +93,6 @@ struct QGlyphLayout; class Q_GUI_EXPORT QFontEngine : public QObject { - Q_OBJECT public: enum Type { Box, diff --git a/src/gui/text/qfontengineglyphcache_p.h b/src/gui/text/qfontengineglyphcache_p.h index 8589cc6..ca67e3f 100644 --- a/src/gui/text/qfontengineglyphcache_p.h +++ b/src/gui/text/qfontengineglyphcache_p.h @@ -72,7 +72,7 @@ QT_BEGIN_NAMESPACE -class Q_GUI_EXPORT QFontEngineGlyphCache +class QFontEngineGlyphCache { public: QFontEngineGlyphCache(const QTransform &matrix) : m_transform(matrix) { } @@ -83,7 +83,7 @@ public: Raster_Mono }; - virtual ~QFontEngineGlyphCache(); + virtual ~QFontEngineGlyphCache() { } QTransform m_transform; }; -- cgit v0.12 From df7d44d9e826e608d280270125b2d376c33c66ad Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 9 Jun 2009 17:02:32 +0200 Subject: removed foreach usage from animation API --- src/corelib/animation/qparallelanimationgroup.cpp | 33 +++++++++++++---------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/corelib/animation/qparallelanimationgroup.cpp b/src/corelib/animation/qparallelanimationgroup.cpp index c148cb5d..6ec4679 100644 --- a/src/corelib/animation/qparallelanimationgroup.cpp +++ b/src/corelib/animation/qparallelanimationgroup.cpp @@ -135,13 +135,14 @@ void QParallelAnimationGroup::updateCurrentTime(int) // simulate completion of the loop int dura = duration(); if (dura > 0) { - foreach (QAbstractAnimation *animation, d->animations) { - animation->setCurrentTime(dura); // will stop + for (int i = 0; i < d->animations.size(); ++i) { + d->animations.at(i)->setCurrentTime(dura); // will stop } } } else if (d->currentLoop < d->lastLoop) { // simulate completion of the loop seeking backwards - foreach (QAbstractAnimation *animation, d->animations) { + for (int i = 0; i < d->animations.size(); ++i) { + QAbstractAnimation *animation = d->animations.at(i); animation->setCurrentTime(0); animation->stop(); } @@ -154,7 +155,8 @@ void QParallelAnimationGroup::updateCurrentTime(int) __LINE__, d->currentTime, d->currentLoop, d->lastLoop, timeFwd, d->lastCurrentTime, state()); #endif // finally move into the actual time of the current loop - foreach (QAbstractAnimation *animation, d->animations) { + for (int i = 0; i < d->animations.size(); ++i) { + QAbstractAnimation *animation = d->animations.at(i); const int dura = animation->totalDuration(); if (dura == -1 && d->isUncontrolledAnimationFinished(animation)) continue; @@ -200,17 +202,18 @@ void QParallelAnimationGroup::updateState(QAbstractAnimation::State oldState, switch (newState) { case Stopped: - foreach (QAbstractAnimation *animation, d->animations) - animation->stop(); + for (int i = 0; i < d->animations.size(); ++i) + d->animations.at(i)->stop(); d->disconnectUncontrolledAnimations(); break; case Paused: - foreach (QAbstractAnimation *animation, d->animations) - animation->pause(); + for (int i = 0; i < d->animations.size(); ++i) + d->animations.at(i)->pause(); break; case Running: d->connectUncontrolledAnimations(); - foreach (QAbstractAnimation *animation, d->animations) { + for (int i = 0; i < d->animations.size(); ++i) { + QAbstractAnimation *animation = d->animations.at(i); animation->stop(); animation->setDirection(d->direction); animation->start(); @@ -243,8 +246,8 @@ void QParallelAnimationGroupPrivate::_q_uncontrolledAnimationFinished() return; int maxDuration = 0; - foreach (QAbstractAnimation *a, animations) - maxDuration = qMax(maxDuration, a->totalDuration()); + for (int i = 0; i < animations.size(); ++i) + maxDuration = qMax(maxDuration, animations.at(i)->totalDuration()); if (currentTime >= maxDuration) q->stop(); @@ -267,7 +270,8 @@ void QParallelAnimationGroupPrivate::connectUncontrolledAnimations() { Q_Q(QParallelAnimationGroup); - foreach (QAbstractAnimation *animation, animations) { + for (int i = 0; i < animations.size(); ++i) { + QAbstractAnimation *animation = animations.at(i); if (animation->duration() == -1 || animation->loopCount() < 0) { uncontrolledFinishTime[animation] = -1; QObject::connect(animation, SIGNAL(finished()), q, SLOT(_q_uncontrolledAnimationFinished())); @@ -288,8 +292,9 @@ void QParallelAnimationGroup::updateDirection(QAbstractAnimation::Direction dire Q_D(QParallelAnimationGroup); //we need to update the direction of the current animation if (state() != Stopped) { - foreach(QAbstractAnimation *anim, d->animations) { - anim->setDirection(direction); + for (int i = 0; i < d->animations.size(); ++i) { + QAbstractAnimation *animation = d->animations.at(i); + animation->setDirection(direction); } } else { if (direction == Forward) { -- cgit v0.12 From 861bf225fedc452ab5b18c12e18e38c4172a5f1a Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 9 Jun 2009 17:04:33 +0200 Subject: Improves the documentation of QHeaderView::setResizeMode to specify that the section indicated by the parameter logicalIndex should exist Task-number: 255541 --- src/gui/itemviews/qheaderview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index d28c08a..7ad825a 100644 --- a/src/gui/itemviews/qheaderview.cpp +++ b/src/gui/itemviews/qheaderview.cpp @@ -1153,7 +1153,8 @@ void QHeaderView::setResizeMode(ResizeMode mode) \overload Sets the constraints on how the section specified by \a logicalIndex in - the header can be resized to those described by the given \a mode. + the header can be resized to those described by the given \a mode. The logical + index should exist at the time this function is called. \note This setting will be ignored for the last section if the stretchLastSection property is set to true. This is the default for the horizontal headers provided -- cgit v0.12 From 2312b121131774a84d01854b3e47d3d2a035a6a1 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Thu, 4 Jun 2009 12:10:06 +0200 Subject: Implemented the NET_WM_SYNC protocol on X11. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Done with Thorbjørn Lindeijer Task-number: 220550 Reviewed-by: Thorbjørn Lindeijer Reviewed-by: mae --- src/gui/kernel/qapplication_x11.cpp | 87 ++++++++++++++++++++++++++++++++++++- src/gui/kernel/qt_x11_p.h | 6 +++ src/gui/kernel/qwidget_p.h | 8 ++++ src/gui/kernel/qwidget_x11.cpp | 28 +++++++++++- 4 files changed, 127 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 1473421..8ebea19 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -157,6 +157,8 @@ static const char * x11_atomnames = { "WM_TAKE_FOCUS\0" "_NET_WM_PING\0" "_NET_WM_CONTEXT_HELP\0" + "_NET_WM_SYNC_REQUEST\0" + "_NET_WM_SYNC_REQUEST_COUNTER\0" // ICCCM window state "WM_STATE\0" @@ -508,6 +510,7 @@ static Bool qt_xfixes_scanner(Display*, XEvent *event, XPointer arg) class QETWidget : public QWidget // event translator widget { public: + QWidgetPrivate* d_func() { return QWidget::d_func(); } bool translateMouseEvent(const XEvent *); void translatePaintEvent(const XEvent *); bool translateConfigEvent(const XEvent *); @@ -718,6 +721,44 @@ static int qt_xio_errhandler(Display *) } #endif +#ifndef QT_NO_XSYNC +struct qt_sync_request_event_data +{ + WId window; +}; + +#if defined(Q_C_CALLBACKS) +extern "C" { +#endif + +static Bool qt_sync_request_scanner(Display*, XEvent *event, XPointer arg) +{ + qt_sync_request_event_data *data = + reinterpret_cast(arg); + if (event->type == ClientMessage && + event->xany.window == data->window && + event->xclient.message_type == ATOM(WM_PROTOCOLS) && + (Atom)event->xclient.data.l[0] == ATOM(_NET_WM_SYNC_REQUEST)) { + QWidget *w = QWidget::find(event->xany.window); + if (QTLWExtra *tlw = ((QETWidget*)w)->d_func()->maybeTopData()) { + const ulong timestamp = (const ulong) event->xclient.data.l[1]; + if (timestamp > X11->time) + X11->time = timestamp; + if (timestamp == CurrentTime || timestamp > tlw->syncRequestTimestamp) { + tlw->syncRequestTimestamp = timestamp; + tlw->newCounterValueLo = event->xclient.data.l[2]; + tlw->newCounterValueHi = event->xclient.data.l[3]; + } + } + return true; + } + return false; +} + +#if defined(Q_C_CALLBACKS) +} +#endif +#endif // QT_NO_XSYNC static void qt_x11_create_intern_atoms() { @@ -2090,6 +2131,13 @@ void qt_init(QApplicationPrivate *priv, int, #endif // QT_RUNTIME_XCURSOR #endif // QT_NO_XCURSOR +#ifndef QT_NO_XSYNC + int xsync_evbase, xsync_errbase; + int major, minor; + if (XSyncQueryExtension(X11->display, &xsync_evbase, &xsync_errbase)) + XSyncInitialize(X11->display, &major, &minor); +#endif // QT_NO_XSYNC + #ifndef QT_NO_XINERAMA #ifdef QT_RUNTIME_XINERAMA X11->ptrXineramaQueryExtension = 0; @@ -3116,6 +3164,19 @@ int QApplication::x11ClientMessage(QWidget* w, XEvent* event, bool passive_only) XSendEvent(event->xclient.display, event->xclient.window, False, SubstructureNotifyMask|SubstructureRedirectMask, event); } +#ifndef QT_NO_XSYNC + } else if (a == ATOM(_NET_WM_SYNC_REQUEST)) { + const ulong timestamp = (const ulong) event->xclient.data.l[1]; + if (timestamp > X11->time) + X11->time = timestamp; + if (QTLWExtra *tlw = w->d_func()->maybeTopData()) { + if (timestamp == CurrentTime || timestamp > tlw->syncRequestTimestamp) { + tlw->syncRequestTimestamp = timestamp; + tlw->newCounterValueLo = event->xclient.data.l[2]; + tlw->newCounterValueHi = event->xclient.data.l[3]; + } + } +#endif } } else if (event->xclient.message_type == ATOM(_QT_SCROLL_DONE)) { widget->translateScrollDoneEvent(event); @@ -4144,7 +4205,9 @@ bool QETWidget::translateMouseEvent(const XEvent *event) || ((nextEvent.type == EnterNotify || nextEvent.type == LeaveNotify) && qt_button_down == this) || (nextEvent.type == ClientMessage - && nextEvent.xclient.message_type == ATOM(_QT_SCROLL_DONE))) { + && (nextEvent.xclient.message_type == ATOM(_QT_SCROLL_DONE) || + (nextEvent.xclient.message_type == ATOM(WM_PROTOCOLS) && + (Atom)nextEvent.xclient.data.l[0] == ATOM(_NET_WM_SYNC_REQUEST))))) { qApp->x11ProcessEvent(&nextEvent); continue; } else if (nextEvent.type != MotionNotify || @@ -5200,6 +5263,14 @@ bool QETWidget::translateConfigEvent(const XEvent *event) otherEvent.xconfigure.border_width; } } +#ifndef QT_NO_XSYNC + qt_sync_request_event_data sync_event; + sync_event.window = internalWinId(); + for (XEvent ev;;) { + if (!XCheckIfEvent(X11->display, &ev, &qt_sync_request_scanner, (XPointer)&sync_event)) + break; + } +#endif // QT_NO_XSYNC } QRect cr (geometry()); @@ -5285,6 +5356,20 @@ bool QETWidget::translateConfigEvent(const XEvent *event) if (d->extra && d->extra->topextra) d->extra->topextra->inTopLevelResize = false; } +#ifndef QT_NO_XSYNC + if (QTLWExtra *tlwExtra = d->maybeTopData()) { + if (tlwExtra->newCounterValueLo != 0 || tlwExtra->newCounterValueHi != 0) { + XSyncValue value; + XSyncIntsToValue(&value, + tlwExtra->newCounterValueLo, + tlwExtra->newCounterValueHi); + + XSyncSetCounter(X11->display, tlwExtra->syncUpdateCounter, value); + tlwExtra->newCounterValueHi = 0; + tlwExtra->newCounterValueLo = 0; + } + } +#endif return true; } diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h index b9ace9d..21bb550 100644 --- a/src/gui/kernel/qt_x11_p.h +++ b/src/gui/kernel/qt_x11_p.h @@ -154,6 +154,10 @@ extern "C" { # include #endif // QT_NO_XRENDER +#ifndef QT_NO_XSYNC +# include "X11/extensions/sync.h" +#endif + // #define QT_NO_XKB #ifndef QT_NO_XKB # include @@ -514,6 +518,8 @@ struct QX11Data WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_CONTEXT_HELP, + _NET_WM_SYNC_REQUEST, + _NET_WM_SYNC_REQUEST_COUNTER, // ICCCM window state WM_STATE, diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index bf4f091..ff194f7 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -131,6 +131,10 @@ struct QTLWExtra { uint embedded : 1; // *************************** Platform specific values (bit fields first) ********** +#ifndef QT_NO_XSYNC + int newCounterValueHi : 32; + uint newCounterValueLo : 32; +#endif #if defined(Q_WS_X11) // <----------------------------------------------------------- X11 uint spont_unmapped: 1; // window was spontaneously unmapped uint dnd : 1; // DND properties installed @@ -156,6 +160,10 @@ struct QTLWExtra { QWSManager *qwsManager; #endif #endif +#ifndef QT_NO_XSYNC + WId syncUpdateCounter; + ulong syncRequestTimestamp; +#endif }; struct QWExtra { diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index 4e34045..8159f8e 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -754,11 +754,14 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO qBound(1, data.crect.width(), XCOORD_MAX), qBound(1, data.crect.height(), XCOORD_MAX)); XStoreName(dpy, id, appName.data()); - Atom protocols[4]; + Atom protocols[5]; int n = 0; protocols[n++] = ATOM(WM_DELETE_WINDOW); // support del window protocol protocols[n++] = ATOM(WM_TAKE_FOCUS); // support take focus window protocol protocols[n++] = ATOM(_NET_WM_PING); // support _NET_WM_PING protocol +#ifndef QT_NO_XSYNC + protocols[n++] = ATOM(_NET_WM_SYNC_REQUEST); // support _NET_WM_SYNC_REQUEST protocol +#endif // QT_NO_XSYNC if (flags & Qt::WindowContextHelpButtonHint) protocols[n++] = ATOM(_NET_WM_CONTEXT_HELP); XSetWMProtocols(dpy, id, protocols, n); @@ -1877,6 +1880,23 @@ void QWidgetPrivate::show_sys() if (setUserTime) qt_net_update_user_time(q, userTime); +#ifndef QT_NO_XSYNC + if (!topData()->syncUpdateCounter) { + XSyncValue value; + XSyncIntToValue(&value, 0); + topData()->syncUpdateCounter = XSyncCreateCounter(X11->display, value); + + XChangeProperty(X11->display, q->internalWinId(), + ATOM(_NET_WM_SYNC_REQUEST_COUNTER), + XA_CARDINAL, + 32, PropModeReplace, + (uchar *) &topData()->syncUpdateCounter, 1); + + topData()->newCounterValueHi = 0; + topData()->newCounterValueLo = 0; + } +#endif + if (!topData()->embedded && (topData()->validWMState || topData()->waitingForMapNotify) && !q->isMinimized()) { @@ -2687,6 +2707,12 @@ void QWidgetPrivate::createTLSysExtra() extra->topextra->waitingForMapNotify = 0; extra->topextra->parentWinId = 0; extra->topextra->userTimeWindow = 0; +#ifndef QT_NO_XSYNC + extra->topextra->syncUpdateCounter = 0; + extra->topextra->syncRequestTimestamp = 0; + extra->topextra->newCounterValueHi = 0; + extra->topextra->newCounterValueLo = 0; +#endif } void QWidgetPrivate::deleteTLSysExtra() -- cgit v0.12 From 2dc47ad36f235ba053a329179be4ed87d0b4d484 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Tue, 9 Jun 2009 18:48:16 +0200 Subject: Add support for TIFF formats (Mono and indexed) Add support for reading and writing for Mono, MonoLSB and Indexed images in the tiff format. Previously, the images were always written in RGB32, dismissing the input format. Task-number: 254317 Reviewed-by: Samuel --- src/plugins/imageformats/tiff/qtiffhandler.cpp | 342 +++++++++++++++++++------ tests/auto/qimagewriter/tst_qimagewriter.cpp | 26 ++ 2 files changed, 285 insertions(+), 83 deletions(-) diff --git a/src/plugins/imageformats/tiff/qtiffhandler.cpp b/src/plugins/imageformats/tiff/qtiffhandler.cpp index 77dfeb3..791aeaa 100644 --- a/src/plugins/imageformats/tiff/qtiffhandler.cpp +++ b/src/plugins/imageformats/tiff/qtiffhandler.cpp @@ -131,58 +131,138 @@ bool QTiffHandler::read(QImage *image) if (!canRead()) return false; - TIFF *tiff = TIFFClientOpen("foo", - "r", - this, - qtiffReadProc, - qtiffWriteProc, - qtiffSeekProc, - qtiffCloseProc, - qtiffSizeProc, - qtiffMapProc, - qtiffUnmapProc); - - if (tiff) { - uint32 width = 0; - uint32 height = 0; - TIFFGetField(tiff, TIFFTAG_IMAGEWIDTH, &width); - TIFFGetField(tiff, TIFFTAG_IMAGELENGTH, &height); - if (image->size() != QSize(width, height) || image->format() != QImage::Format_ARGB32) - *image = QImage(width, height, QImage::Format_ARGB32); + TIFF *const tiff = TIFFClientOpen("foo", + "r", + this, + qtiffReadProc, + qtiffWriteProc, + qtiffSeekProc, + qtiffCloseProc, + qtiffSizeProc, + qtiffMapProc, + qtiffUnmapProc); + + if (!tiff) { + return false; + } + uint32 width; + uint32 height; + uint16 photometric; + if (!TIFFGetField(tiff, TIFFTAG_IMAGEWIDTH, &width) + || !TIFFGetField(tiff, TIFFTAG_IMAGELENGTH, &height) + || !TIFFGetField(tiff, TIFFTAG_PHOTOMETRIC, &photometric)) { + TIFFClose(tiff); + return false; + } + + if (photometric == PHOTOMETRIC_MINISBLACK || photometric == PHOTOMETRIC_MINISWHITE) { + if (image->size() != QSize(width, height) || image->format() != QImage::Format_Mono) + *image = QImage(width, height, QImage::Format_Mono); + QVector colortable(2); + if (photometric == PHOTOMETRIC_MINISBLACK) { + colortable[0] = 0xff000000; + colortable[1] = 0xffffffff; + } else { + colortable[0] = 0xffffffff; + colortable[1] = 0xff000000; + } + image->setColorTable(colortable); + if (!image->isNull()) { - if (TIFFReadRGBAImageOriented(tiff, width, height, reinterpret_cast(image->bits()), ORIENTATION_TOPLEFT, 0)) { - uint16 resUnit = RESUNIT_NONE; - float resX = 0; - float resY = 0; - TIFFGetField(tiff, TIFFTAG_RESOLUTIONUNIT, &resUnit); - TIFFGetField(tiff, TIFFTAG_XRESOLUTION, &resX); - TIFFGetField(tiff, TIFFTAG_YRESOLUTION, &resY); - switch(resUnit) { - case RESUNIT_CENTIMETER: - image->setDotsPerMeterX(qRound(resX * 100)); - image->setDotsPerMeterY(qRound(resY * 100)); - break; - case RESUNIT_INCH: - image->setDotsPerMeterX(qRound(resX * (100 / 2.54))); - image->setDotsPerMeterY(qRound(resY * (100 / 2.54))); - break; - default: - // do nothing as defaults have already - // been set within the QImage class - break; + for (uint32 y=0; yscanLine(y), y, 0) < 0) { + TIFFClose(tiff); + return false; + } + } + } + } else { + uint16 bitPerSample; + if (!TIFFGetField(tiff, TIFFTAG_BITSPERSAMPLE, &bitPerSample)) { + TIFFClose(tiff); + return false; + } + if (photometric == PHOTOMETRIC_PALETTE && bitPerSample == 8) { + if (image->size() != QSize(width, height) || image->format() != QImage::Format_Indexed8) + *image = QImage(width, height, QImage::Format_Indexed8); + if (!image->isNull()) { + // create the color table + const uint16 tableSize = 256; + uint16 *redTable = static_cast(qMalloc(tableSize * sizeof(uint16))); + uint16 *greenTable = static_cast(qMalloc(tableSize * sizeof(uint16))); + uint16 *blueTable = static_cast(qMalloc(tableSize * sizeof(uint16))); + if (!redTable || !greenTable || !blueTable) { + TIFFClose(tiff); + return false; + } + if (!TIFFGetField(tiff, TIFFTAG_COLORMAP, &redTable, &greenTable, &blueTable)) { + TIFFClose(tiff); + return false; + } + + QVector qtColorTable(tableSize); + for (int i = 0; isetColorTable(qtColorTable); + for (uint32 y=0; yscanLine(y), y, 0) < 0) { + TIFFClose(tiff); + return false; + } + } + + // free redTable, greenTable and greenTable done by libtiff + } + } else { + if (image->size() != QSize(width, height) || image->format() != QImage::Format_ARGB32) + *image = QImage(width, height, QImage::Format_ARGB32); + if (!image->isNull()) { + if (TIFFReadRGBAImageOriented(tiff, width, height, reinterpret_cast(image->bits()), ORIENTATION_TOPLEFT, 0)) { + for (uint32 y=0; yscanLine(y), width); + } else { + TIFFClose(tiff); + return false; } - for (uint32 y=0; yscanLine(y), width); - } else { - *image = QImage(); } } - TIFFClose(tiff); } - if (image->isNull()) + if (image->isNull()) { + TIFFClose(tiff); return false; + } + + float resX = 0; + float resY = 0; + uint16 resUnit = RESUNIT_NONE; + if (TIFFGetField(tiff, TIFFTAG_RESOLUTIONUNIT, &resUnit) + && TIFFGetField(tiff, TIFFTAG_XRESOLUTION, &resX) + && TIFFGetField(tiff, TIFFTAG_YRESOLUTION, &resY)) { + + switch(resUnit) { + case RESUNIT_CENTIMETER: + image->setDotsPerMeterX(qRound(resX * 100)); + image->setDotsPerMeterY(qRound(resY * 100)); + break; + case RESUNIT_INCH: + image->setDotsPerMeterX(qRound(resX * (100 / 2.54))); + image->setDotsPerMeterY(qRound(resY * (100 / 2.54))); + break; + default: + // do nothing as defaults have already + // been set within the QImage class + break; + } + } + TIFFClose(tiff); return true; } @@ -191,48 +271,145 @@ bool QTiffHandler::write(const QImage &image) if (!device()->isWritable()) return false; - TIFF *tiff = TIFFClientOpen("foo", - "w", - this, - qtiffReadProc, - qtiffWriteProc, - qtiffSeekProc, - qtiffCloseProc, - qtiffSizeProc, - qtiffMapProc, - qtiffUnmapProc); - - if (tiff) { - int width = image.width(); - int height = image.height(); - int depth = 32; - - if (!TIFFSetField(tiff, TIFFTAG_IMAGEWIDTH, width) - || !TIFFSetField(tiff, TIFFTAG_IMAGELENGTH, height) - || !TIFFSetField(tiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB) - || !TIFFSetField(tiff, TIFFTAG_COMPRESSION, compression == NoCompression ? COMPRESSION_NONE : COMPRESSION_LZW) - || !TIFFSetField(tiff, TIFFTAG_SAMPLESPERPIXEL, depth/8) - || !TIFFSetField(tiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG) - || !TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, 8)) { + TIFF *const tiff = TIFFClientOpen("foo", + "w", + this, + qtiffReadProc, + qtiffWriteProc, + qtiffSeekProc, + qtiffCloseProc, + qtiffSizeProc, + qtiffMapProc, + qtiffUnmapProc); + if (!tiff) + return false; + + const int width = image.width(); + const int height = image.height(); + + if (!TIFFSetField(tiff, TIFFTAG_IMAGEWIDTH, width) + || !TIFFSetField(tiff, TIFFTAG_IMAGELENGTH, height) + || !TIFFSetField(tiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG)) { + TIFFClose(tiff); + return false; + } + + // set the resolution + bool resolutionSet = false; + const int dotPerMeterX = image.dotsPerMeterX(); + const int dotPerMeterY = image.dotsPerMeterY(); + if ((dotPerMeterX % 100) == 0 + && (dotPerMeterY % 100) == 0) { + resolutionSet = TIFFSetField(tiff, TIFFTAG_RESOLUTIONUNIT, RESUNIT_CENTIMETER) + && TIFFSetField(tiff, TIFFTAG_XRESOLUTION, dotPerMeterX/100.0) + && TIFFSetField(tiff, TIFFTAG_YRESOLUTION, dotPerMeterY/100.0); + } else { + resolutionSet = TIFFSetField(tiff, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH) + && TIFFSetField(tiff, TIFFTAG_XRESOLUTION, static_cast(image.logicalDpiX())) + && TIFFSetField(tiff, TIFFTAG_YRESOLUTION, static_cast(image.logicalDpiY())); + } + if (!resolutionSet) { + TIFFClose(tiff); + return false; + } + + // configure image depth + const QImage::Format format = image.format(); + if (format == QImage::Format_Mono || format == QImage::Format_MonoLSB) { + uint16 photometric = PHOTOMETRIC_MINISBLACK; + if (image.colorTable().at(0) == 0xffffffff) + photometric = PHOTOMETRIC_MINISWHITE; + if (!TIFFSetField(tiff, TIFFTAG_PHOTOMETRIC, photometric) + || !TIFFSetField(tiff, TIFFTAG_COMPRESSION, compression == NoCompression ? COMPRESSION_NONE : COMPRESSION_CCITTRLE)) { TIFFClose(tiff); return false; } - // set the resolution - bool resolutionSet = false; - const int dotPerMeterX = image.dotsPerMeterX(); - const int dotPerMeterY = image.dotsPerMeterY(); - if ((dotPerMeterX % 100) == 0 - && (dotPerMeterY % 100) == 0) { - resolutionSet = TIFFSetField(tiff, TIFFTAG_RESOLUTIONUNIT, RESUNIT_CENTIMETER) - && TIFFSetField(tiff, TIFFTAG_XRESOLUTION, dotPerMeterX/100.0) - && TIFFSetField(tiff, TIFFTAG_YRESOLUTION, dotPerMeterY/100.0); - } else { - resolutionSet = TIFFSetField(tiff, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH) - && TIFFSetField(tiff, TIFFTAG_XRESOLUTION, static_cast(image.logicalDpiX())) - && TIFFSetField(tiff, TIFFTAG_YRESOLUTION, static_cast(image.logicalDpiY())); + // try to do the conversion in chunks no greater than 16 MB + int chunks = (width * height / (1024 * 1024 * 16)) + 1; + int chunkHeight = qMax(height / chunks, 1); + + int y = 0; + while (y < height) { + QImage chunk = image.copy(0, y, width, qMin(chunkHeight, height - y)).convertToFormat(QImage::Format_Mono); + + int chunkStart = y; + int chunkEnd = y + chunk.height(); + while (y < chunkEnd) { + if (TIFFWriteScanline(tiff, reinterpret_cast(chunk.scanLine(y - chunkStart)), y) != 1) { + TIFFClose(tiff); + return false; + } + ++y; + } + } + TIFFClose(tiff); + } else if (format == QImage::Format_Indexed8) { + if (!TIFFSetField(tiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_PALETTE) + || !TIFFSetField(tiff, TIFFTAG_COMPRESSION, compression == NoCompression ? COMPRESSION_NONE : COMPRESSION_PACKBITS) + || !TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, 8)) { + TIFFClose(tiff); + return false; + } + //// write the color table + // allocate the color tables + uint16 *redTable = static_cast(qMalloc(256 * sizeof(uint16))); + uint16 *greenTable = static_cast(qMalloc(256 * sizeof(uint16))); + uint16 *blueTable = static_cast(qMalloc(256 * sizeof(uint16))); + if (!redTable || !greenTable || !blueTable) { + TIFFClose(tiff); + return false; + } + + // set the color table + const QVector colorTable = image.colorTable(); + + const int tableSize = colorTable.size(); + Q_ASSERT(tableSize <= 256); + for (int i = 0; i(chunk.scanLine(y - chunkStart)), y) != 1) { + TIFFClose(tiff); + return false; + } + ++y; + } } - if (!resolutionSet) { + TIFFClose(tiff); + + } else { + if (!TIFFSetField(tiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB) + || !TIFFSetField(tiff, TIFFTAG_COMPRESSION, compression == NoCompression ? COMPRESSION_NONE : COMPRESSION_LZW) + || !TIFFSetField(tiff, TIFFTAG_SAMPLESPERPIXEL, 4) + || !TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, 8)) { TIFFClose(tiff); return false; } @@ -260,9 +437,8 @@ bool QTiffHandler::write(const QImage &image) } } TIFFClose(tiff); - } else { - return false; } + return true; } diff --git a/tests/auto/qimagewriter/tst_qimagewriter.cpp b/tests/auto/qimagewriter/tst_qimagewriter.cpp index 349afa5..3ceb2c2 100644 --- a/tests/auto/qimagewriter/tst_qimagewriter.cpp +++ b/tests/auto/qimagewriter/tst_qimagewriter.cpp @@ -59,6 +59,7 @@ Q_DECLARE_METATYPE(QStringMap) Q_DECLARE_METATYPE(QIntList) Q_DECLARE_METATYPE(QImageWriter::ImageWriterError) Q_DECLARE_METATYPE(QIODevice *) +Q_DECLARE_METATYPE(QImage::Format) //TESTED_FILES= @@ -82,6 +83,9 @@ private slots: void writeImage2(); void supportedFormats(); + void readWriteNonDestructive_data(); + void readWriteNonDestructive(); + #if defined QTEST_HAVE_TIFF void largeTiff(); #endif @@ -376,6 +380,28 @@ void tst_QImageWriter::supportedFormats() QCOMPARE(formatSet.size(), formats.size()); } +void tst_QImageWriter::readWriteNonDestructive_data() +{ + QTest::addColumn("format"); + QTest::addColumn("expectedFormat"); + QTest::newRow("tiff mono") << QImage::Format_Mono << QImage::Format_Mono; + QTest::newRow("tiff indexed") << QImage::Format_Indexed8 << QImage::Format_Indexed8; + QTest::newRow("tiff rgb32") << QImage::Format_ARGB32 << QImage::Format_ARGB32; +} + +void tst_QImageWriter::readWriteNonDestructive() +{ + QFETCH(QImage::Format, format); + QFETCH(QImage::Format, expectedFormat); + QImage image = QImage(prefix + "colorful.bmp").convertToFormat(format); + QVERIFY(image.save(prefix + "gen-readWriteNonDestructive.tiff")); + + QImage image2 = QImage(prefix + "gen-readWriteNonDestructive.tiff"); + QImage::Format readFormat = image2.format(); + QCOMPARE(readFormat, expectedFormat); + QCOMPARE(image, image2); +} + void tst_QImageWriter::setDescription_data() { QTest::addColumn("fileName"); -- cgit v0.12 From 5b24c5793607c809b1bac82c7cc3696001ee9217 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Tue, 9 Jun 2009 18:49:40 +0200 Subject: Opening links with cyrillic file names does not work in QLabel. QDestopServices was converting the file names to percentage encoding before calling ShellExecute. This will not work with URLs without a scheme. These are now being treated similar to a file. Task-number: 254501 Reviewed-by: Jens Bache-Wiig --- src/gui/util/qdesktopservices_win.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/util/qdesktopservices_win.cpp b/src/gui/util/qdesktopservices_win.cpp index 9f8efb4..a8aa11c 100644 --- a/src/gui/util/qdesktopservices_win.cpp +++ b/src/gui/util/qdesktopservices_win.cpp @@ -165,6 +165,9 @@ static bool launchWebBrowser(const QUrl &url) if (!url.isValid()) return false; + if (url.scheme().isEmpty()) + return openDocument(url); + quintptr returnValue; returnValue = (quintptr)ShellExecute(0, 0, (TCHAR *) QString::fromUtf8(url.toEncoded().constData()).utf16(), 0, 0, SW_SHOWNORMAL); -- cgit v0.12