From 8cb263eeaffa2948477a8b3a1c8512f94ec9bb0b Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 9 Sep 2009 13:58:16 +0200 Subject: QHttpNetworkConnection autotest: include zlib dir test was not building Reviewed-by: Trust Me --- tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro b/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro index bc750c5..43284b3 100644 --- a/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro +++ b/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro @@ -1,4 +1,5 @@ load(qttest_p4) SOURCES += tst_qhttpnetworkconnection.cpp +INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/zlib QT = core network -- cgit v0.12 From d6993e7d88750a55d62bf5acbe7e7d03069dfbdf Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 9 Sep 2009 14:27:18 +0200 Subject: Avoid garbled output on Windows for non-ascii-compatible text In the Windows print engine, we try to send a text item as a raw string of characters to the printer driver if this is possible. This is to facilitate using PDF-printers as much as possible, allowing them to save the text in the document so for searching etc. We can only safely do this if all the characters in the string are ASCII-compatible, i.e. in the 7 bit range, since this is the only part of the set which is guaranteed to be compatible across code pages. Task-number: 180655 Reviewed-by: Trond --- src/gui/painting/qprintengine_win.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/painting/qprintengine_win.cpp b/src/gui/painting/qprintengine_win.cpp index d239581..96e8cff 100644 --- a/src/gui/painting/qprintengine_win.cpp +++ b/src/gui/painting/qprintengine_win.cpp @@ -400,11 +400,11 @@ void QWin32PrintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem return ; } - // We only want to convert the glyphs to text if the entire string is latin1 - bool latin1String = true; + // We only want to convert the glyphs to text if the entire string is compatible with ASCII + bool convertToText = true; for (int i=0; i < ti.num_chars; ++i) { - if (ti.chars[i].unicode() >= 0x100) { - latin1String = false; + if (ti.chars[i].unicode() >= 0x80) { + convertToText = false; break; } } @@ -414,7 +414,7 @@ void QWin32PrintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem SelectObject(d->hdc, CreatePen(PS_SOLID, 1, cf)); SetTextColor(d->hdc, cf); - draw_text_item_win(p, ti, d->hdc, latin1String, d->matrix, d->devPaperRect.topLeft()); + draw_text_item_win(p, ti, d->hdc, convertToText, d->matrix, d->devPaperRect.topLeft()); DeleteObject(SelectObject(d->hdc,GetStockObject(HOLLOW_BRUSH))); DeleteObject(SelectObject(d->hdc,GetStockObject(BLACK_PEN))); } -- cgit v0.12 From 0d1677a6e42aee1d9700cc57f053da59879ba3fb Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 9 Sep 2009 14:42:05 +0200 Subject: tst_qhostinfo: Backported some 4.6 fixes, increased timeout --- tests/auto/qhostinfo/tst_qhostinfo.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp index c632eb7..1fd805a 100644 --- a/tests/auto/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp @@ -214,10 +214,7 @@ void tst_QHostInfo::lookupIPv4_data() QTest::newRow("empty") << "" << "" << int(QHostInfo::HostNotFound); - QTest::newRow("lupinella_00") << "l" << lupinellaIp << int(QHostInfo::NoError); - QTest::newRow("lupinella_01") << "lupinella" << lupinellaIp << int(QHostInfo::NoError); - QTest::newRow("lupinella_02") << "lupinella.troll.no" << lupinellaIp << int(QHostInfo::NoError); - QTest::newRow("lupinella_03") << "lupinella.trolltech.com" << lupinellaIp << int(QHostInfo::NoError); + QTest::newRow("single_ip4") << "lupinella.troll.no" << lupinellaIp << int(QHostInfo::NoError); QTest::newRow("multiple_ip4") << "multi.dev.troll.no" << "1.2.3.4 1.2.3.5 10.3.3.31" << int(QHostInfo::NoError); QTest::newRow("literal_ip4") << lupinellaIp << lupinellaIp << int(QHostInfo::NoError); QTest::newRow("notfound") << "this-name-does-not-exist-hopefully." << "" << int(QHostInfo::HostNotFound); @@ -235,7 +232,7 @@ void tst_QHostInfo::lookupIPv4() lookupDone = false; QHostInfo::lookupHost(hostname, this, SLOT(resultsReady(const QHostInfo&))); - QTestEventLoop::instance().enterLoop(3); + QTestEventLoop::instance().enterLoop(10); QVERIFY(!QTestEventLoop::instance().timeout()); QVERIFY(lookupDone); @@ -305,8 +302,8 @@ void tst_QHostInfo::reverseLookup_data() // ### Use internal DNS instead. Discussed with Andreas. //QTest::newRow("classical.hexago.com") << QString("2001:5c0:0:2::24") << QStringList(QString("classical.hexago.com")) << 0; - QTest::newRow("www.cisco.com") << QString("198.133.219.25") << QStringList(QString("origin-www.cisco.com")) << 0; - QTest::newRow("bogusexample.doenstexist.org") << QString("1::2::3::4") << QStringList() << 1; + QTest::newRow("origin.cisco.com") << QString("12.159.148.94") << QStringList(QString("origin.cisco.com")) << 0; + QTest::newRow("bogus-name") << QString("1::2::3::4") << QStringList() << 1; } void tst_QHostInfo::reverseLookup() -- cgit v0.12 From e5bb1e69a0c3165f92edebf9152dfd41bdab712f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 9 Sep 2009 15:51:47 +0200 Subject: Autotest: fix the test for NUL in SAN. It was missing "www". Reviewed-by: Marius Bugge Monsen --- tests/auto/qsslcertificate/tst_qsslcertificate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp index 2f0c3a4..f41803c 100644 --- a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp +++ b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp @@ -761,7 +761,7 @@ void tst_QSslCertificate::nulInSan() QVERIFY(!dnssan.isEmpty()); QVERIFY(dnssan != "www.bank.com"); - static const char realSAN[] = "www.bank.com\0.badguy.com"; + static const char realSAN[] = "www.bank.com\0www.badguy.com"; QCOMPARE(dnssan, QString::fromLatin1(realSAN, sizeof realSAN - 1)); } -- cgit v0.12 From a77cc371917f7cda40e823b530693d38b85e666b Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 9 Sep 2009 16:55:13 +0200 Subject: Doc: Note that Netscape plugins are only available on desktop platforms. Reviewed-by: Takumi Asaki Also-applied-as: 3f257dcf8c8ca812d60d4a6a4c2cd2da96bba526 --- src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc index 06305e0..6ad2183 100644 --- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc +++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc @@ -94,14 +94,18 @@ \section1 Netscape Plugin Support + \note Netscape plugin support is only available on desktop platforms. + 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. + Web pages that embed common plugins on platforms for which those plugins + are available. To enable plugin support, the user must have the appropriate + binary files for those plugins installed and the \l{QWebSettings::PluginsEnabled} + attribute must be enabled for the application. The following locations are searched for plugins: \table - \header \o Linux/Unix \o Windows + \header \o Linux/Unix (X11) \o Windows \row \o{1,3} \list \o \c{.mozilla/plugins} in the user's home directory -- cgit v0.12 From b19372c11549bc1f88b3e59fa94745645503b8e6 Mon Sep 17 00:00:00 2001 From: Bill King Date: Tue, 1 Sep 2009 13:08:02 +1000 Subject: Fixes determination of end of odbc string on deficient driver Ported this fix backwards from 4.6 to 4.5 Adds some cleanups (using QVarLengthArray), and reverting to the initial and correct calculation (when the driver doesn't deem fit to return SQL_NO_DATA). --- src/sql/drivers/odbc/qsql_odbc.cpp | 12 ++++---- tests/auto/qsqldatabase/tst_qsqldatabase.cpp | 41 ++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index ae522ee..a5c713d 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -314,12 +314,12 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool uni colSize *= 2; // a tiny bit faster, since it saves a SQLGetData() call } } - char* buf = new char[colSize]; + QVarLengthArray buf(colSize); while (true) { r = SQLGetData(hStmt, column+1, unicode ? SQL_C_WCHAR : SQL_C_CHAR, - (SQLPOINTER)buf, + (SQLPOINTER)buf.data(), colSize, &lengthIndicator); if (r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO) { @@ -334,11 +334,12 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool uni // colSize-1: remove 0 termination when there is more data to fetch int rSize = (r == SQL_SUCCESS_WITH_INFO) ? (unicode ? colSize-2 : colSize-1) : lengthIndicator; if (unicode) { - fieldVal += QString((QChar*) buf, rSize / 2); + fieldVal += QString((const QChar*) buf.constData(), rSize / 2); } else { - fieldVal += QString::fromAscii(buf, rSize); + fieldVal += QString::fromAscii(buf.constData(), rSize); } - if (lengthIndicator - fieldVal.size() <= 0) { + memset(buf.data(), 0, colSize); + if (lengthIndicator < colSize) { // workaround for Drivermanagers that don't return SQL_NO_DATA break; } @@ -350,7 +351,6 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool uni break; } } - delete[] buf; return fieldVal; } diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp index 782bff8..9ca48f5 100644 --- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp @@ -180,6 +180,8 @@ private slots: void odbc_uintfield(); void odbc_bindBoolean_data() { generic_data("QODBC"); } void odbc_bindBoolean(); + void odbc_testqGetString_data() { generic_data("QODBC"); } + void odbc_testqGetString(); void oci_serverDetach_data() { generic_data("QOCI"); } void oci_serverDetach(); // For task 154518 @@ -347,6 +349,7 @@ void tst_QSqlDatabase::dropTestTables(QSqlDatabase db) << qTableName("numericfields") << qTableName("qtest_ibaseblobs") << qTableName("qtestBindBool") + << qTableName("testqGetString") << qTableName("qtest_sqlguid") << qTableName("uint_table") << qTableName("uint_test") @@ -2005,6 +2008,44 @@ void tst_QSqlDatabase::odbc_bindBoolean() QCOMPARE(q.value(1).toBool(), false); } +void tst_QSqlDatabase::odbc_testqGetString() +{ + QFETCH(QString, dbName); + QSqlDatabase db = QSqlDatabase::database(dbName); + CHECK_DATABASE(db); + + QSqlQuery q(db); + QVERIFY_SQL(q, exec("CREATE TABLE " + qTableName("testqGetString") + "(id int, vcvalue varchar(65538))")); + + QString largeString; + largeString.fill('A', 65536); + + // Bind and insert + QVERIFY_SQL(q, prepare("INSERT INTO " + qTableName("testqGetString") + " VALUES(?, ?)")); + q.bindValue(0, 1); + q.bindValue(1, largeString); + QVERIFY_SQL(q, exec()); + q.bindValue(0, 2); + q.bindValue(1, largeString+QLatin1Char('B')); + QVERIFY_SQL(q, exec()); + q.bindValue(0, 3); + q.bindValue(1, largeString+QLatin1Char('B')+QLatin1Char('C')); + QVERIFY_SQL(q, exec()); + + // Retrive + QVERIFY_SQL(q, exec("SELECT id, vcvalue FROM " + qTableName("testqGetString") + " ORDER BY id")); + QVERIFY_SQL(q, next()); + QCOMPARE(q.value(0).toInt(), 1); + QCOMPARE(q.value(1).toString().length(), 65536); + QVERIFY_SQL(q, next()); + QCOMPARE(q.value(0).toInt(), 2); + QCOMPARE(q.value(1).toString().length(), 65537); + QVERIFY_SQL(q, next()); + QCOMPARE(q.value(0).toInt(), 3); + QCOMPARE(q.value(1).toString().length(), 65538); +} + + void tst_QSqlDatabase::mysql_multiselect() { QFETCH(QString, dbName); -- cgit v0.12 From df4033a1f7ef0786fba6d4d2027e38a2fffd1e27 Mon Sep 17 00:00:00 2001 From: Bill King Date: Wed, 9 Sep 2009 13:37:09 +1000 Subject: Fixes autotest for MS SQL Server Merging fix back into 4.5 tree --- tests/auto/qsqldatabase/tst_qsqldatabase.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp index 9ca48f5..a3a4712 100644 --- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp @@ -2015,7 +2015,10 @@ void tst_QSqlDatabase::odbc_testqGetString() CHECK_DATABASE(db); QSqlQuery q(db); - QVERIFY_SQL(q, exec("CREATE TABLE " + qTableName("testqGetString") + "(id int, vcvalue varchar(65538))")); + if (tst_Databases::isSqlServer(db)) + QVERIFY_SQL(q, exec("CREATE TABLE " + qTableName("testqGetString") + "(id int, vcvalue varchar(MAX))")); + else + QVERIFY_SQL(q, exec("CREATE TABLE " + qTableName("testqGetString") + "(id int, vcvalue varchar(65538))")); QString largeString; largeString.fill('A', 65536); -- cgit v0.12 From 44554f497d941acdc8c8e37948f77e04445f34d2 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 10 Sep 2009 19:34:39 +1000 Subject: Make opengl fragment program generator output license header. Stops the license checker failing each time the file is re-generated. Also added "_P" to the generated header guard, as it's a private header. Reviewed-by: Gunnar Sletta --- src/opengl/util/fragmentprograms_p.h | 4 +-- src/opengl/util/generator.cpp | 57 ++++++++++++++++++++++++++++++++++-- 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/src/opengl/util/fragmentprograms_p.h b/src/opengl/util/fragmentprograms_p.h index 15315e5..364f99f 100644 --- a/src/opengl/util/fragmentprograms_p.h +++ b/src/opengl/util/fragmentprograms_p.h @@ -38,8 +38,8 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#ifndef FRAGMENTPROGRAMS_H -#define FRAGMENTPROGRAMS_H +#ifndef FRAGMENTPROGRAMS_P_H +#define FRAGMENTPROGRAMS_P_H // // W A R N I N G diff --git a/src/opengl/util/generator.cpp b/src/opengl/util/generator.cpp index 87f42db..4704d54 100644 --- a/src/opengl/util/generator.cpp +++ b/src/opengl/util/generator.cpp @@ -258,8 +258,61 @@ void writeIncludeFile(const QSet &variables, QLatin1String tab(" "); - out << "#ifndef FRAGMENTPROGRAMS_H\n" - << "#define FRAGMENTPROGRAMS_H\n\n"; + out << "/****************************************************************************\n" + "**\n" + "** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).\n" + "** All rights reserved.\n" + "** Contact: Nokia Corporation (qt-info@nokia.com)\n" + "**\n" + "** This file is part of the test suite of the Qt Toolkit.\n" + "**\n" + "** $QT_BEGIN_LICENSE:LGPL$\n" + "** No Commercial Usage\n" + "** This file contains pre-release code and may not be distributed.\n" + "** You may use this file in accordance with the terms and conditions\n" + "** contained in the Technology Preview License Agreement accompanying\n" + "** this package.\n" + "**\n" + "** GNU Lesser General Public License Usage\n" + "** Alternatively, this file may be used under the terms of the GNU Lesser\n" + "** General Public License version 2.1 as published by the Free Software\n" + "** Foundation and appearing in the file LICENSE.LGPL included in the\n" + "** packaging of this file. Please review the following information to\n" + "** ensure the GNU Lesser General Public License version 2.1 requirements\n" + "** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n" + "**\n" + "** In addition, as a special exception, Nokia gives you certain additional\n" + "** rights. These rights are described in the Nokia Qt LGPL Exception\n" + "** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n" + "**\n" + "** If you have questions regarding the use of this file, please contact\n" + "** Nokia at qt-info@nokia.com.\n" + "**\n" + "**\n" + "**\n" + "**\n" + "**\n" + "**\n" + "**\n" + "**\n" + "** $QT_END_LICENSE$\n" + "**\n" + "****************************************************************************/\n" + "\n" + "#ifndef FRAGMENTPROGRAMS_P_H\n" + "#define FRAGMENTPROGRAMS_P_H\n" + "\n" + "//\n" + "// W A R N I N G\n" + "// -------------\n" + "//\n" + "// This file is not part of the Qt API. It exists purely as an\n" + "// implementation detail. This header file may change from version to\n" + "// version without notice, or even be removed.\n" + "//\n" + "// We mean it.\n" + "//\n" + "\n"; out << "enum FragmentVariable {\n"; foreach (QString str, variables) -- cgit v0.12 From ebc0079ee5fa70564816817a2ea4aecd7ff189db Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 10 Sep 2009 14:42:58 +0200 Subject: tst_qinfo: Be more verbose in case of failures --- tests/auto/qhostinfo/tst_qhostinfo.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp index 1fd805a..5f4dfaf 100644 --- a/tests/auto/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp @@ -236,6 +236,9 @@ void tst_QHostInfo::lookupIPv4() QVERIFY(!QTestEventLoop::instance().timeout()); QVERIFY(lookupDone); + if ((int)lookupResults.error() != (int)err) { + qWarning() << hostname << "=>" << lookupResults.errorString(); + } QCOMPARE((int)lookupResults.error(), (int)err); QStringList tmp; @@ -351,6 +354,9 @@ void tst_QHostInfo::blockingLookup() tmp.append(hostInfo.addresses().at(i).toString()); tmp.sort(); + if ((int)hostInfo.error() != (int)err) { + qWarning() << hostname << "=>" << lookupResults.errorString(); + } QCOMPARE((int)hostInfo.error(), (int)err); QStringList expected = addresses.split(' '); -- cgit v0.12 From 77945d775006c296632c293fb320c5308901d5ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 10 Sep 2009 14:40:52 +0200 Subject: Only reset the backend pointer after we're done with it Since 925912ebf552417306a5bd20fd986afda6a582be QNetworkReplyImplPrivate no longer holds its own pointer to the network cache and relies on the backend to get it. Since the cache is used in our call to finished, we must reset the backend only after that. This fixes a crash I was seeing in Arora... Reviewed-by: Markus Goetz Reviewed-by: Peter Hartmann --- src/network/access/qnetworkreplyimpl.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index 29bf238..87dd19a 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -540,10 +540,6 @@ void QNetworkReplyImpl::abort() return; // stop both upload and download - if (d->backend) { - d->backend->deleteLater(); - d->backend = 0; - } if (d->outgoingData) disconnect(d->outgoingData, 0, this, 0); if (d->copyDevice) @@ -557,6 +553,12 @@ void QNetworkReplyImpl::abort() d->finished(); } d->state = QNetworkReplyImplPrivate::Aborted; + + // finished may access the backend + if (d->backend) { + d->backend->deleteLater(); + d->backend = 0; + } } void QNetworkReplyImpl::close() -- cgit v0.12 From cc59689e4a09349b7475426bf98f4c0839f6ba6a Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Thu, 10 Sep 2009 15:41:42 +0200 Subject: QHttpNetworkConnection autotest: include zlib dir test was not building Reviewed-by: Trust Me --- tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro b/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro index 9593c55..2e41fcd 100644 --- a/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro +++ b/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro @@ -1,4 +1,5 @@ load(qttest_p4) SOURCES += tst_qhttpnetworkreply.cpp +INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/zlib QT = core network -- cgit v0.12 From 53e1c8983b0093ce2b63f90eaee856f57961c00f Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 10 Sep 2009 15:55:08 +0200 Subject: restoring a minimized window on Windows CE didn't work After restoring a minimized window we only saw the window decoration. All content was missing. That's because we don't get a WM_SIZE message for restoring the window. We must react on WM_ACTIVATE in this case. This fixes the issue for Windows mobile too. Task-number: 260702 Reviewed-by: thartman --- src/gui/kernel/qapplication_win.cpp | 8 ++++++-- src/gui/kernel/qguifunctions_wince.cpp | 9 ++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index d7d079c..1babb69 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -2084,8 +2084,12 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam // where it got it from; it would simply get a 0 value as the old focus widget. #ifdef Q_OS_WINCE { - if (widget->windowState() & Qt::WindowMinimized) - widget->dataPtr()->window_state &= ~Qt::WindowMinimized; + if (widget->windowState() & Qt::WindowMinimized) { + if (widget->windowState() & Qt::WindowMaximized) + widget->showMaximized(); + else + widget->show(); + } #else if (!(widget->windowState() & Qt::WindowMinimized)) { #endif diff --git a/src/gui/kernel/qguifunctions_wince.cpp b/src/gui/kernel/qguifunctions_wince.cpp index 6d6aec8..4bfc14b 100644 --- a/src/gui/kernel/qguifunctions_wince.cpp +++ b/src/gui/kernel/qguifunctions_wince.cpp @@ -314,8 +314,8 @@ void qt_wince_maximize(QWidget *widget) } } -void qt_wince_minimize(HWND hwnd) { - +void qt_wince_minimize(HWND hwnd) +{ uint exstyle = GetWindowLongW(hwnd, GWL_EXSTYLE); uint style = GetWindowLongW(hwnd, GWL_STYLE); RECT rect; @@ -324,10 +324,13 @@ void qt_wince_minimize(HWND hwnd) { AdjustWindowRectEx(&crect, style & ~WS_OVERLAPPED, FALSE, exstyle); MoveWindow(hwnd, rect.left - crect.left, rect.top - crect.top, 0, 0, true); SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong (hwnd, GWL_EXSTYLE) | WS_EX_NODRAG); +#ifdef Q_OS_WINCE_WM ShowWindow(hwnd, SW_HIDE); +#else + ShowWindow(hwnd, SW_MINIMIZE); +#endif } - void qt_wince_hide_taskbar(HWND hwnd) { if (ptrAygFullScreen) ptrAygFullScreen(hwnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON | SHFS_HIDESTARTICON); -- cgit v0.12 From aad2316995d46cb8a1bfc2763c0617b0c7c92307 Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Fri, 11 Sep 2009 07:27:16 +0200 Subject: Run on 10.3 Panther. HIViewSetNeedsDisplayInRect was added in 10.4. --- src/gui/kernel/qwidget_mac.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index c5418f6..09ac2c3 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3781,7 +3781,10 @@ static void qt_mac_update_widget_posisiton(QWidget *q, QRect oldRect, QRect newR (oldRect.isValid() == false || newRect.isValid() == false) || // the position update is a part of a drag-and-drop operation - QDragManager::self()->object + QDragManager::self()->object || + + // we are on Panther (no HIViewSetNeedsDisplayInRect) + QSysInfo::MacintoshVersion < QSysInfo::MV_10_4 ){ HIViewSetFrame(view, &bounds); return; -- cgit v0.12 From 8ee8f3383c05c0e82d81304f60b97ca7659074cc Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Fri, 11 Sep 2009 07:51:09 +0200 Subject: Run on 10.3. _HIViewScrollRectWithOptions needs to be declared as a weak-linked symbol in order to make static linking work. --- src/gui/kernel/qwidget_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 09ac2c3..987d2ae 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -122,7 +122,7 @@ QT_BEGIN_NAMESPACE extern "C" { extern OSStatus _HIViewScrollRectWithOptions(HIViewRef, const HIRect *, CGFloat, CGFloat, - OptionBits); + OptionBits) __attribute__ ((weak)); } #define kHIViewScrollRectAdjustInvalid 1 #define kHIViewScrollRectDontInvalidateRevealedArea 2 -- cgit v0.12 From c03d1a9e12c9b9766c1e652985aeeab23be352a8 Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Thu, 13 Aug 2009 12:37:39 +0200 Subject: Pick a suitable default architecture for qmake-based applications. If the Qt package contains one of x86 and x86_64, pick that one. If it contains both then use the compiler default. Make a similiar decision for PowerPC-based systems. Note that this logic assumes that Qt has been configured with an architecture that is usable on the system. Reviewed-by: Marius Storm-Olsen --- mkspecs/features/mac/default_post.prf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index ea9e9bd..210a704 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -1,2 +1,18 @@ load(default_post) !no_objective_c:CONFIG += objective_c + +# Pick a suitable default architecture for qmake-based applications. +# If the Qt package contains one of x86 and x86_64, pick that one. If it +# contains both then use the compiler default. Make a similiar decision for +# PowerPC-based systems. Note that this logic assumes that Qt has been +# configured with an architecture that is usable on the system. +message(hei $$QT_CONFIG ) +qt:!isEmpty(QT_CONFIG) { + contains(QMAKE_HOST.arch, ppc) { + !contains(QT_CONFIG, ppc64):contains(QT_CONFIG, ppc):CONFIG += ppc + contains(QT_CONFIG, ppc64):!contains(QT_CONFIG, ppc):CONFIG += ppc64 + } else { + !contains(QT_CONFIG, x86_64):contains(QT_CONFIG, x86):CONFIG += x86 + contains(QT_CONFIG, x86_64):!contains(QT_CONFIG, x86):CONFIG += x86_64 + } +} -- cgit v0.12 From 6ac7728fe442988e86786cb75a851063b4380404 Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Thu, 13 Aug 2009 13:08:46 +0200 Subject: Remove yet another forgotten debug message. --- mkspecs/features/mac/default_post.prf | 1 - 1 file changed, 1 deletion(-) diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index 210a704..4999762 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -6,7 +6,6 @@ load(default_post) # contains both then use the compiler default. Make a similiar decision for # PowerPC-based systems. Note that this logic assumes that Qt has been # configured with an architecture that is usable on the system. -message(hei $$QT_CONFIG ) qt:!isEmpty(QT_CONFIG) { contains(QMAKE_HOST.arch, ppc) { !contains(QT_CONFIG, ppc64):contains(QT_CONFIG, ppc):CONFIG += ppc -- cgit v0.12 From 0293aff5c44202e5c62e229b74d8bd0bf9206185 Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Fri, 11 Sep 2009 12:49:25 +0200 Subject: Fix memory leak when deleteLater is triggered via the main menu bar. The deleteLater was beeing created with loopLevel of 1, causing it to be defferd until QApplication::exec() returned. Add a QScopedLoopLevelCounter to increase the loopLevel while triggering the action. RevBy: Brad --- src/gui/kernel/qcocoamenuloader_mac.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/kernel/qcocoamenuloader_mac.mm b/src/gui/kernel/qcocoamenuloader_mac.mm index ce2a92c..9ab077f 100644 --- a/src/gui/kernel/qcocoamenuloader_mac.mm +++ b/src/gui/kernel/qcocoamenuloader_mac.mm @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -198,6 +199,7 @@ QT_USE_NAMESPACE - (IBAction)qtDispatcherToQAction:(id)sender { + QScopedLoopLevelCounter loopLevelCounter(QApplicationPrivate::instance()->threadData); NSMenuItem *item = static_cast(sender); if (QAction *action = reinterpret_cast([item tag])) { action->trigger(); -- cgit v0.12