summaryrefslogtreecommitdiffstats
path: root/test/dsets.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/dsets.c')
-rw-r--r--test/dsets.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/dsets.c b/test/dsets.c
index c1cac47..0c62736 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -8190,6 +8190,9 @@ main(void)
/* Close 2nd FAPL */
if(H5Pclose(fapl2) < 0) TEST_ERROR
+ /* Verify symbol table messages are cached */
+ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
+
if(nerrors)
goto error;
printf("All dataset tests passed.\n");
("If no capabilities are given, the binaries will be given the\n"); print("capabilities supported by self-signed certificates.\n"); print("\nUsage: patch_capabilities.pl pkg_filename [target-platform] [capability list]\n"); - print(" If template .pkg file is given, next agrument must be 'target-platform'.\n"); + print(" If template .pkg file is given, next agrument must be 'target-platform'.\n"); print("\nE.g. patch_capabilities.pl myapp_template.pkg release-armv5 \"All -TCB\"\n"); exit(); } @@ -27,15 +27,15 @@ if (@ARGV) my $pkgFileName = shift(@ARGV); # Check if using template .pkg and do preprocessing if needed - if (($pkgFileName =~ m|_template\.pkg$|i) && -r($pkgFileName)) + if (($pkgFileName =~ m|_template\.pkg$|i) && -r($pkgFileName)) { my $target; - unless ($target = shift(@ARGV)) + unless ($target = shift(@ARGV)) { Usage(); } - - system ("createpackage.bat -p ".$pkgFileName." ".$target); + + system ("createpackage.bat -p ".$pkgFileName." ".$target); $pkgFileName =~ s/_template\.pkg/_${target}\.pkg/; } -- cgit v0.12 From 9d24605add8daabfa55e1085e71ed47b14ed7d83 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 31 Aug 2009 16:46:59 +0200 Subject: QNAM HTTP Code: Some tests where failing ietf.org changed their server to use gzip, therefore our check for the content-length reply header was bogus. Rev-By: Peter Hartmann --- tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp | 8 ++++++-- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp index c54bf3c..639464e 100644 --- a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp +++ b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp @@ -177,7 +177,9 @@ void tst_QHttpNetworkConnection::head() QCOMPARE(reply->statusCode(), statusCode); QCOMPARE(reply->reasonPhrase(), statusString); - QCOMPARE(reply->contentLength(), qint64(contentLength)); + // only check it if it is set + if (reply->contentLength() != -1) + QCOMPARE(reply->contentLength(), qint64(contentLength)); QVERIFY(reply->isFinished()); @@ -237,7 +239,9 @@ void tst_QHttpNetworkConnection::get() QCOMPARE(reply->statusCode(), statusCode); QCOMPARE(reply->reasonPhrase(), statusString); - QCOMPARE(reply->contentLength(), qint64(contentLength)); + // only check it if it is set + if (reply->contentLength() != -1) + QCOMPARE(reply->contentLength(), qint64(contentLength)); stopWatch.start(); QByteArray ba; diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 3216a6a..48a48f4 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -1081,8 +1081,10 @@ void tst_QNetworkReply::getFromHttp() QCOMPARE(reply->url(), request.url()); QCOMPARE(reply->error(), QNetworkReply::NoError); QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200); - - QCOMPARE(reply->header(QNetworkRequest::ContentLengthHeader).toLongLong(), reference.size()); + QCOMPARE(reply->size(), reference.size()); + // only compare when the header is set. + if (reply->header(QNetworkRequest::ContentLengthHeader).isValid()) + QCOMPARE(reply->header(QNetworkRequest::ContentLengthHeader).toLongLong(), reference.size()); QCOMPARE(reply->readAll(), reference.readAll()); } -- cgit v0.12 From 7c06af4528d7aa7186b12546c261d5d2a0a3641d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 27 Aug 2009 18:56:47 +0200 Subject: Reset QTemporaryFile's state after failed open() on Windows This fixes a regression introduced in 4.5.2 where QTemporaryFile would no longer attempt to generate a random name after a failed open. Under certain situations, this led to a non-random file being left behind in QDir::tempPath when using the fallback implementation of QFile::copy. Avoid calling QFSFileEngine::setFileName() on a template, so as not to process it as file name. By consistently not calling setFileTemplate in the constructor, we also delay allocation of the fileEngine. Changes made to that function also keep it from unnecessarily allocating the fileEngine. Task-number: 260165 Reviewed-by: Thiago Macieira --- src/corelib/io/qtemporaryfile.cpp | 38 ++++++++--- tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp | 82 ++++++++++++++++++++++++ 2 files changed, 112 insertions(+), 8 deletions(-) diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index bd039c8..47fa257 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -292,14 +292,20 @@ class QTemporaryFileEngine : public QFSFileEngine Q_DECLARE_PRIVATE(QFSFileEngine) public: QTemporaryFileEngine(const QString &file, bool fileIsTemplate = true) - : QFSFileEngine(file), filePathIsTemplate(fileIsTemplate) + : QFSFileEngine(), filePathIsTemplate(fileIsTemplate) { + Q_D(QFSFileEngine); + d->filePath = file; + + if (!filePathIsTemplate) + QFSFileEngine::setFileName(file); } ~QTemporaryFileEngine(); bool isReallyOpen(); void setFileName(const QString &file); + void setFileTemplate(const QString &fileTemplate); bool open(QIODevice::OpenMode flags); bool remove(); @@ -336,6 +342,13 @@ void QTemporaryFileEngine::setFileName(const QString &file) QFSFileEngine::setFileName(file); } +void QTemporaryFileEngine::setFileTemplate(const QString &fileTemplate) +{ + Q_D(QFSFileEngine); + if (filePathIsTemplate) + d->filePath = fileTemplate; +} + bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode) { Q_D(QFSFileEngine); @@ -382,12 +395,19 @@ bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode) return false; } + QString template_ = d->filePath; d->filePath = QString::fromLocal8Bit(filename); - filePathIsTemplate = false; d->nativeInitFileName(); - d->closeFileHandle = true; delete [] filename; - return QFSFileEngine::open(openMode); + + if (QFSFileEngine::open(openMode)) { + filePathIsTemplate = false; + return true; + } + + d->filePath = template_; + d->nativeFilePath.clear(); + return false; #endif } @@ -533,7 +553,8 @@ QTemporaryFile::QTemporaryFile() QTemporaryFile::QTemporaryFile(const QString &templateName) : QFile(*new QTemporaryFilePrivate, 0) { - setFileTemplate(templateName); + Q_D(QTemporaryFile); + d->templateName = templateName; } /*! @@ -567,7 +588,8 @@ QTemporaryFile::QTemporaryFile(QObject *parent) QTemporaryFile::QTemporaryFile(const QString &templateName, QObject *parent) : QFile(*new QTemporaryFilePrivate, parent) { - setFileTemplate(templateName); + Q_D(QTemporaryFile); + d->templateName = templateName; } #endif @@ -671,10 +693,10 @@ QString QTemporaryFile::fileTemplate() const */ void QTemporaryFile::setFileTemplate(const QString &name) { - Q_ASSERT(!isOpen()); Q_D(QTemporaryFile); - fileEngine()->setFileName(name); d->templateName = name; + if (d->fileEngine) + static_cast(d->fileEngine)->setFileTemplate(name); } /*! diff --git a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp index 2541b48..73486e7 100644 --- a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp +++ b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp @@ -89,6 +89,8 @@ private slots: void renameFdLeak(); void reOpenThroughQFile(); void keepOpenMode(); + void resetTemplateAfterError(); + void setTemplateAfterOpen(); public: }; @@ -472,5 +474,85 @@ void tst_QTemporaryFile::keepOpenMode() } } +void tst_QTemporaryFile::resetTemplateAfterError() +{ + // calling setFileTemplate on a failed open + + QString tempPath = QDir::tempPath(); + + QString const fileTemplate("destination/qt_temp_file_test.XXXXXX"); + QString const fileTemplate2(tempPath + "/qt_temp_file_test.XXXXXX"); + + QVERIFY2( QDir(tempPath).exists() || QDir().mkpath(tempPath), "Test precondition" ); + QVERIFY2( !QFile::exists("destination"), "Test precondition" ); + QVERIFY2( !QFile::exists(fileTemplate2) || QFile::remove(fileTemplate2), "Test precondition" ); + + QFile file(fileTemplate2); + QByteArray fileContent("This file is intentionally NOT left empty."); + + QVERIFY( file.open(QIODevice::ReadWrite | QIODevice::Truncate) ); + QCOMPARE( file.write(fileContent), (qint64)fileContent.size() ); + QVERIFY( file.flush() ); + + QString fileName; + { + QTemporaryFile temp; + + QVERIFY( temp.fileName().isEmpty() ); + QVERIFY( !temp.fileTemplate().isEmpty() ); + + temp.setFileTemplate( fileTemplate ); + + QVERIFY( temp.fileName().isEmpty() ); + QCOMPARE( temp.fileTemplate(), fileTemplate ); + + QVERIFY( !temp.open() ); + + QVERIFY( temp.fileName().isEmpty() ); + QCOMPARE( temp.fileTemplate(), fileTemplate ); + + temp.setFileTemplate( fileTemplate2 ); + QVERIFY( temp.open() ); + + fileName = temp.fileName(); + QVERIFY( QFile::exists(fileName) ); + QVERIFY( !fileName.isEmpty() ); + QVERIFY2( fileName != fileTemplate2, + ("Generated name shouldn't be same as template: " + fileTemplate2).toLocal8Bit().constData() ); + } + + QVERIFY( !QFile::exists(fileName) ); + + file.seek(0); + QCOMPARE( QString(file.readAll()), QString(fileContent) ); + QVERIFY( file.remove() ); +} + +void tst_QTemporaryFile::setTemplateAfterOpen() +{ + QTemporaryFile temp; + + QVERIFY( temp.fileName().isEmpty() ); + QVERIFY( !temp.fileTemplate().isEmpty() ); + + QVERIFY( temp.open() ); + + QString const fileName = temp.fileName(); + QString const newTemplate("funny-path/funny-name-XXXXXX.tmp"); + + QVERIFY( !fileName.isEmpty() ); + QVERIFY( QFile::exists(fileName) ); + QVERIFY( !temp.fileTemplate().isEmpty() ); + QVERIFY( temp.fileTemplate() != newTemplate ); + + temp.close(); // QTemporaryFile::setFileTemplate will assert on isOpen() up to 4.5.2 + temp.setFileTemplate(newTemplate); + QCOMPARE( temp.fileTemplate(), newTemplate ); + + QVERIFY( temp.open() ); + QCOMPARE( temp.fileName(), fileName ); + QCOMPARE( temp.fileTemplate(), newTemplate ); +} + QTEST_MAIN(tst_QTemporaryFile) #include "tst_qtemporaryfile.moc" -- cgit v0.12 From 20cc50a21eb5841b3a3e8546877e805f5a4df528 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 31 Aug 2009 19:33:10 +0200 Subject: Fix #error line not to have a ' as it's not correct Merge-request: 753 Reviewed-by: Thiago Macieira --- src/3rdparty/webkit/WebCore/DerivedSources.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/WebCore/DerivedSources.cpp b/src/3rdparty/webkit/WebCore/DerivedSources.cpp index f698913..aaf8983 100644 --- a/src/3rdparty/webkit/WebCore/DerivedSources.cpp +++ b/src/3rdparty/webkit/WebCore/DerivedSources.cpp @@ -334,5 +334,5 @@ // want StaticConstructors.h to "pollute" all the source files we #include here // accidentally, so we'll throw an error whenever any file includes it. #ifdef StaticConstructors_h -#error Don't include any file in DerivedSources.cpp that includes StaticConstructors.h +#error Do not include any file in DerivedSources.cpp that includes StaticConstructors.h #endif -- cgit v0.12 From 28635d8aeefbd0aa807f333769a0ab9fea9324b0 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 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 742d596..2692c96 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -323,12 +323,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) { @@ -343,11 +343,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; } @@ -359,7 +360,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 a6b887a..e9a0670 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") @@ -2024,6 +2027,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 ec581ee164cbdab1a321d44f0795a79d62faf569 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 1 Sep 2009 13:27:21 +1000 Subject: Update license headers. Reviewed-by: Trust Me --- tests/auto/qmargins/tst_qmargins.cpp | 27 ++++++++++----------- .../qtabletevent/device_information/main.cpp | 28 +++++++++++----------- .../qtabletevent/device_information/tabletwidget.h | 26 ++++++++++---------- .../manual/qtabletevent/event_compression/main.cpp | 28 +++++++++++----------- 4 files changed, 54 insertions(+), 55 deletions(-) diff --git a/tests/auto/qmargins/tst_qmargins.cpp b/tests/auto/qmargins/tst_qmargins.cpp index 070aa19..6ee2495 100644 --- a/tests/auto/qmargins/tst_qmargins.cpp +++ b/tests/auto/qmargins/tst_qmargins.cpp @@ -9,8 +9,8 @@ ** 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. +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -21,25 +21,24 @@ ** 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 +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this ** package. ** -** 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 have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** ** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ - #include #include diff --git a/tests/manual/qtabletevent/device_information/main.cpp b/tests/manual/qtabletevent/device_information/main.cpp index 0c2eda3..69867bc 100644 --- a/tests/manual/qtabletevent/device_information/main.cpp +++ b/tests/manual/qtabletevent/device_information/main.cpp @@ -3,14 +3,14 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the test suite module of the Qt Toolkit. +** 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. +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -21,20 +21,20 @@ ** 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 +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this ** package. ** -** 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 have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** ** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/manual/qtabletevent/device_information/tabletwidget.h b/tests/manual/qtabletevent/device_information/tabletwidget.h index b16e9ed..d3ccb32 100644 --- a/tests/manual/qtabletevent/device_information/tabletwidget.h +++ b/tests/manual/qtabletevent/device_information/tabletwidget.h @@ -9,8 +9,8 @@ ** 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. +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -21,20 +21,20 @@ ** 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 +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this ** package. ** -** 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 have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** ** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/manual/qtabletevent/event_compression/main.cpp b/tests/manual/qtabletevent/event_compression/main.cpp index 3b869e3..26611d3 100644 --- a/tests/manual/qtabletevent/event_compression/main.cpp +++ b/tests/manual/qtabletevent/event_compression/main.cpp @@ -3,14 +3,14 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the test suite module of the Qt Toolkit. +** 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. +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -21,20 +21,20 @@ ** 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 +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this ** package. ** -** 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 have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** ** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ -- cgit v0.12 From b2d9dc8c487a8b87347a7d45a6c4f9dc827ddbfe Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Tue, 1 Sep 2009 13:57:30 +1000 Subject: Add #define's for highp/mediump after #version/#extension headers GLSL shaders require that #version and #extension must appear before any other code. The #define's we insert for highp/mediump/etc must therefore be moved down to just after them. Reviewed-by: Gunnar Sletta --- src/opengl/qglshaderprogram.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index c4d9322..56b55d0 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -501,6 +501,25 @@ bool QGLShader::compile(const char *source) return d->compile(this); } else if (d->shader) { QVarLengthArray src; + int headerLen = 0; + while (source && source[headerLen] == '#') { + // Skip #version and #extension directives at the start of + // the shader code. We need to insert the qualifierDefines + // and redefineHighp just after them. + if (qstrncmp(source + headerLen, "#version", 8) != 0 && + qstrncmp(source + headerLen, "#extension", 10) != 0) { + break; + } + while (source[headerLen] != '\0' && source[headerLen] != '\n') + ++headerLen; + if (source[headerLen] == '\n') + ++headerLen; + } + QByteArray header; + if (headerLen > 0) { + header = QByteArray(source, headerLen); + src.append(header.constData()); + } #ifdef QGL_DEFINE_QUALIFIERS src.append(qualifierDefines); #endif @@ -509,7 +528,7 @@ bool QGLShader::compile(const char *source) d->shaderType == PartialFragmentShader) src.append(redefineHighp); #endif - src.append(source); + src.append(source + headerLen); QGLContextGroup *ctx = d->ctx; glShaderSource(d->shader, src.size(), src.data(), 0); return d->compile(this); -- cgit v0.12 From 632c430a70e2aa50d57c80e35e15391f0b859749 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 1 Sep 2009 09:58:30 +0200 Subject: doc: Fixed several qdoc errors. Also removed four function declarations from QMargins that had no definitions. --- src/corelib/tools/qmargins.cpp | 8 +++----- src/corelib/tools/qmargins.h | 5 ----- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/corelib/tools/qmargins.cpp b/src/corelib/tools/qmargins.cpp index df08da1..747ea5e 100644 --- a/src/corelib/tools/qmargins.cpp +++ b/src/corelib/tools/qmargins.cpp @@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE \class QMargins \ingroup painting - \brief The QMargins + \brief The QMargins class defines the four margins of a rectangle. QMargin defines a set of four margins; left, top, right and bottom, that describe the size of the borders surrounding a rectangle. @@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE Constructs a margins object with all margins set to 0. - \sa isValid() + \sa isNull() */ /*! @@ -78,7 +78,7 @@ QT_BEGIN_NAMESPACE Constructs margins with the given \a left, \a top, \a right, \a bottom - \sa setWidth(), setHeight() + \sa setLeft(), setRight(), setTop(), setBottom() */ /*! @@ -86,8 +86,6 @@ QT_BEGIN_NAMESPACE Returns true if all margins are is 0; otherwise returns false. - - \sa isValid(), isEmpty() */ diff --git a/src/corelib/tools/qmargins.h b/src/corelib/tools/qmargins.h index be918cc..2691c62 100644 --- a/src/corelib/tools/qmargins.h +++ b/src/corelib/tools/qmargins.h @@ -68,11 +68,6 @@ public: void setRight(int right); void setBottom(int bottom); - int &rleft(); - int &rtop(); - int &rright(); - int &rbottom(); - private: int m_left; int m_top; -- cgit v0.12 From 76d18f5f06f55c7f908ceb9fba4cac41c0c852f8 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 31 Aug 2009 20:27:13 +0200 Subject: QMetaObject::normalizeType: fix out-of-bound access. As reported in merge request 1375 Also use QVarLenghtArray instead of manually allocated char* Reviewed-by: Thierry --- src/corelib/kernel/qmetaobject.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 30f1cc8..c311465 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -943,7 +943,7 @@ QByteArray QMetaObject::normalizedType(const char *type) if (!type || !*type) return result; - QVarLengthArray stackbuf((int)strlen(type)); + QVarLengthArray stackbuf(int(strlen(type)) + 1); qRemoveWhitespace(type, stackbuf.data()); int templdepth = 0; qNormalizeType(stackbuf.data(), templdepth, result); @@ -968,10 +968,9 @@ QByteArray QMetaObject::normalizedSignature(const char *method) if (!method || !*method) return result; int len = int(strlen(method)); - char stackbuf[64]; - char *buf = (len >= 64 ? new char[len+1] : stackbuf); - qRemoveWhitespace(method, buf); - char *d = buf; + QVarLengthArray stackbuf(len + 1); + char *d = stackbuf.data(); + qRemoveWhitespace(method, d); result.reserve(len); @@ -987,8 +986,6 @@ QByteArray QMetaObject::normalizedSignature(const char *method) result += *d++; } - if (buf != stackbuf) - delete [] buf; return result; } -- cgit v0.12 From 16edcd5ff94ecc731146e3703aaf25cd6bb3fb67 Mon Sep 17 00:00:00 2001 From: Raul Metsma Date: Tue, 1 Sep 2009 10:14:07 +0200 Subject: Implement QSslCertificate::version() and QSslCertificate::serialNumber() Task-number: 251830 Merge-request: 1383 Reviewed-by: Peter Hartmann --- src/network/ssl/qsslcertificate.cpp | 8 ++++++++ src/network/ssl/qsslsocket_openssl_symbols.cpp | 2 ++ src/network/ssl/qsslsocket_openssl_symbols_p.h | 1 + 3 files changed, 11 insertions(+) diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index 666770d..5db6d0a 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -250,6 +250,10 @@ void QSslCertificate::clear() */ QByteArray QSslCertificate::version() const { + if (d->versionString.isEmpty() && d->x509) + d->versionString = + QByteArray::number( qlonglong(q_ASN1_INTEGER_get( d->x509->cert_info->version )) ); + return d->versionString; } @@ -258,6 +262,10 @@ QByteArray QSslCertificate::version() const */ QByteArray QSslCertificate::serialNumber() const { + if (d->serialNumberString.isEmpty() && d->x509) + d->serialNumberString = + QByteArray::number( qlonglong(q_ASN1_INTEGER_get( d->x509->cert_info->serialNumber )) ); + return d->serialNumberString; } diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index 5b04a57..d3dcd51 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -94,6 +94,7 @@ QT_BEGIN_NAMESPACE #ifdef SSLEAY_MACROS DEFINEFUNC3(void *, ASN1_dup, i2d_of_void *a, a, d2i_of_void *b, b, char *c, c, return 0, return) #endif +DEFINEFUNC(long, ASN1_INTEGER_get, ASN1_INTEGER *a, a, return 0, return) DEFINEFUNC(unsigned char *, ASN1_STRING_data, ASN1_STRING *a, a, return 0, return) DEFINEFUNC(int, ASN1_STRING_length, ASN1_STRING *a, a, return 0, return) DEFINEFUNC4(long, BIO_ctrl, BIO *a, a, int b, b, long c, c, void *d, d, return -1, return) @@ -608,6 +609,7 @@ bool q_resolveOpenSslSymbols() #ifdef SSLEAY_MACROS RESOLVEFUNC(ASN1_dup) #endif + RESOLVEFUNC(ASN1_INTEGER_get) RESOLVEFUNC(ASN1_STRING_data) RESOLVEFUNC(ASN1_STRING_length) RESOLVEFUNC(BIO_ctrl) diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h index f9c92e5..30762ca 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols_p.h +++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h @@ -201,6 +201,7 @@ QT_BEGIN_NAMESPACE #endif // !defined QT_LINKED_OPENSSL bool q_resolveOpenSslSymbols(); +long q_ASN1_INTEGER_get(ASN1_INTEGER *a); unsigned char * q_ASN1_STRING_data(ASN1_STRING *a); int q_ASN1_STRING_length(ASN1_STRING *a); long q_BIO_ctrl(BIO *a, int b, long c, void *d); -- cgit v0.12 From 8f1596ae9b64870c54958611552c71b0b390038f Mon Sep 17 00:00:00 2001 From: Raul Metsma Date: Tue, 1 Sep 2009 10:14:08 +0200 Subject: QSslCertificate: Add + 1 to serialNumber Merge-request: 1383 Reviewed-by: Peter Hartmann --- src/network/ssl/qsslcertificate.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index 5db6d0a..c128da9 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -252,7 +252,7 @@ QByteArray QSslCertificate::version() const { if (d->versionString.isEmpty() && d->x509) d->versionString = - QByteArray::number( qlonglong(q_ASN1_INTEGER_get( d->x509->cert_info->version )) ); + QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->version))); return d->versionString; } @@ -264,7 +264,7 @@ QByteArray QSslCertificate::serialNumber() const { if (d->serialNumberString.isEmpty() && d->x509) d->serialNumberString = - QByteArray::number( qlonglong(q_ASN1_INTEGER_get( d->x509->cert_info->serialNumber )) ); + QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->serialNumber)) + 1); return d->serialNumberString; } -- cgit v0.12 From 0e03e0d96c65250cf4b982b4dd2be55f948e65c9 Mon Sep 17 00:00:00 2001 From: Benjamin C Meyer Date: Tue, 1 Sep 2009 09:51:53 +0200 Subject: Initialize QNetworkAccessBackend's private variables to 0 in the constructor and when creating a CacheBackend set the manager pointer. Merge-request: 1124 Reviewed-by: Thiago Macieira --- src/network/access/qnetworkaccessbackend.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/network/access/qnetworkaccessbackend.cpp b/src/network/access/qnetworkaccessbackend.cpp index ad9ec06..615ce7c 100644 --- a/src/network/access/qnetworkaccessbackend.cpp +++ b/src/network/access/qnetworkaccessbackend.cpp @@ -90,8 +90,11 @@ QNetworkAccessBackend *QNetworkAccessManagerPrivate::findBackend(QNetworkAccessM QNetworkRequest::PreferNetwork).toInt()); if (mode == QNetworkRequest::AlwaysCache && (op == QNetworkAccessManager::GetOperation - || op == QNetworkAccessManager::HeadOperation)) - return new QNetworkAccessCacheBackend; + || op == QNetworkAccessManager::HeadOperation)) { + QNetworkAccessBackend *backend = new QNetworkAccessCacheBackend; + backend->manager = this; + return backend; + } if (!factoryDataShutdown) { QMutexLocker locker(&factoryData()->mutex); @@ -110,6 +113,8 @@ QNetworkAccessBackend *QNetworkAccessManagerPrivate::findBackend(QNetworkAccessM } QNetworkAccessBackend::QNetworkAccessBackend() + : manager(0) + , reply(0) { } -- cgit v0.12 From 63e2f5d2c95ece21fd32d0690022b89c38fee865 Mon Sep 17 00:00:00 2001 From: Benjamin C Meyer Date: Tue, 1 Sep 2009 09:51:54 +0200 Subject: Use the QDesktopServices::CacheLocation to determine the location to store the temporary cache rather than QDesktopServices::DataLocation Merge-request: 1124 Reviewed-by: Thiago Macieira --- tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp index 92610db..e338075 100644 --- a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp +++ b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp @@ -81,8 +81,8 @@ public: : QNetworkDiskCache(parent) , gotData(false) { - QString location = QDesktopServices::storageLocation(QDesktopServices::DataLocation) - + QLatin1String("/cache/"); + QString location = QDesktopServices::storageLocation(QDesktopServices::CacheLocation) + + QLatin1String("/qnetworkdiskcache/"); setCacheDirectory(location); clear(); } -- cgit v0.12 From 925912ebf552417306a5bd20fd986afda6a582be Mon Sep 17 00:00:00 2001 From: Benjamin C Meyer Date: Tue, 1 Sep 2009 09:51:56 +0200 Subject: QNetworkAccessManager can delete the QAbstractNetworkCache pointer at any point. Rather then keep a separate pointer to the cache in the reply use the pointer kept by the manager so the reply never tries to access a cache pointer that has already been deleted. Autotest: included Merge-request: 1124 Reviewed-by: Thiago Macieira --- src/network/access/qnetworkaccessbackend.cpp | 4 ++- src/network/access/qnetworkaccessmanager.cpp | 3 -- src/network/access/qnetworkreplyimpl.cpp | 35 ++++++++++++---------- src/network/access/qnetworkreplyimpl_p.h | 3 +- .../tst_qabstractnetworkcache.cpp | 16 ++++++++++ 5 files changed, 40 insertions(+), 21 deletions(-) diff --git a/src/network/access/qnetworkaccessbackend.cpp b/src/network/access/qnetworkaccessbackend.cpp index 615ce7c..947313c 100644 --- a/src/network/access/qnetworkaccessbackend.cpp +++ b/src/network/access/qnetworkaccessbackend.cpp @@ -176,7 +176,9 @@ QList QNetworkAccessBackend::proxyList() const QAbstractNetworkCache *QNetworkAccessBackend::networkCache() const { - return reply->networkCache; // should be the same as manager->networkCache + if (!manager) + return 0; + return manager->networkCache; } void QNetworkAccessBackend::setCachingEnabled(bool enable) diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index aafe44b..5a8756b 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -692,9 +692,6 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera // third step: setup the reply priv->setup(op, request, outgoingData); - if (request.attribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferNetwork).toInt() != - QNetworkRequest::AlwaysNetwork) - priv->setNetworkCache(d->networkCache); #ifndef QT_NO_NETWORKPROXY QList proxyList = d->queryProxy(QNetworkProxyQuery(request.url())); priv->proxyList = proxyList; diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index c37c66d..c805d59 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE inline QNetworkReplyImplPrivate::QNetworkReplyImplPrivate() : backend(0), outgoingData(0), - copyDevice(0), networkCache(0), + copyDevice(0), cacheEnabled(false), cacheSaveDevice(0), notificationHandlingPaused(false), bytesDownloaded(0), lastBytesDownloaded(-1), bytesUploaded(-1), @@ -203,11 +203,6 @@ void QNetworkReplyImplPrivate::setup(QNetworkAccessManager::Operation op, const QMetaObject::invokeMethod(q, "_q_startOperation", Qt::QueuedConnection); } -void QNetworkReplyImplPrivate::setNetworkCache(QAbstractNetworkCache *nc) -{ - networkCache = nc; -} - void QNetworkReplyImplPrivate::backendNotify(InternalNotifications notification) { Q_Q(QNetworkReplyImpl); @@ -277,17 +272,27 @@ void QNetworkReplyImplPrivate::resumeNotificationHandling() QCoreApplication::postEvent(q, new QEvent(QEvent::NetworkReplyUpdated)); } +QAbstractNetworkCache *QNetworkReplyImplPrivate::networkCache() const +{ + if (!backend) + return 0; + return backend->networkCache(); +} + void QNetworkReplyImplPrivate::createCache() { // check if we can save and if we're allowed to - if (!networkCache || !request.attribute(QNetworkRequest::CacheSaveControlAttribute, true).toBool()) + if (!networkCache() + || request.attribute(QNetworkRequest::CacheLoadControlAttribute, + QNetworkRequest::PreferNetwork).toInt() + == QNetworkRequest::AlwaysNetwork) return; cacheEnabled = true; } bool QNetworkReplyImplPrivate::isCachingEnabled() const { - return (cacheEnabled && networkCache != 0); + return (cacheEnabled && networkCache() != 0); } void QNetworkReplyImplPrivate::setCachingEnabled(bool enable) @@ -311,7 +316,7 @@ void QNetworkReplyImplPrivate::setCachingEnabled(bool enable) qDebug("QNetworkReplyImpl: setCachingEnabled(true) called after setCachingEnabled(false) -- " "backend %s probably needs to be fixed", backend->metaObject()->className()); - networkCache->remove(url); + networkCache()->remove(url); cacheSaveDevice = 0; cacheEnabled = false; } @@ -320,9 +325,9 @@ void QNetworkReplyImplPrivate::setCachingEnabled(bool enable) void QNetworkReplyImplPrivate::completeCacheSave() { if (cacheEnabled && errorCode != QNetworkReplyImpl::NoError) { - networkCache->remove(url); + networkCache()->remove(url); } else if (cacheEnabled && cacheSaveDevice) { - networkCache->insert(cacheSaveDevice); + networkCache()->insert(cacheSaveDevice); } cacheSaveDevice = 0; cacheEnabled = false; @@ -385,15 +390,15 @@ void QNetworkReplyImplPrivate::feed(const QByteArray &data) metaData.setAttributes(attributes); } - cacheSaveDevice = networkCache->prepare(metaData); + cacheSaveDevice = networkCache()->prepare(metaData); if (!cacheSaveDevice || (cacheSaveDevice && !cacheSaveDevice->isOpen())) { if (cacheSaveDevice && !cacheSaveDevice->isOpen()) qCritical("QNetworkReplyImpl: network cache returned a device that is not open -- " "class %s probably needs to be fixed", - networkCache->metaObject()->className()); + networkCache()->metaObject()->className()); - networkCache->remove(url); + networkCache()->remove(url); cacheSaveDevice = 0; cacheEnabled = false; } @@ -524,7 +529,7 @@ QNetworkReplyImpl::~QNetworkReplyImpl() { Q_D(QNetworkReplyImpl); if (d->isCachingEnabled()) - d->networkCache->remove(url()); + d->networkCache()->remove(url()); } void QNetworkReplyImpl::abort() diff --git a/src/network/access/qnetworkreplyimpl_p.h b/src/network/access/qnetworkreplyimpl_p.h index 0accaab..f723b7f 100644 --- a/src/network/access/qnetworkreplyimpl_p.h +++ b/src/network/access/qnetworkreplyimpl_p.h @@ -128,7 +128,6 @@ public: void setup(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData); - void setNetworkCache(QAbstractNetworkCache *networkCache); void pauseNotificationHandling(); void resumeNotificationHandling(); @@ -153,7 +152,7 @@ public: QNetworkAccessBackend *backend; QIODevice *outgoingData; QIODevice *copyDevice; - QAbstractNetworkCache *networkCache; + QAbstractNetworkCache *networkCache() const; bool cacheEnabled; QIODevice *cacheSaveDevice; diff --git a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp index e338075..ee49210 100644 --- a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp +++ b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp @@ -69,6 +69,8 @@ private slots: void cacheControl_data(); void cacheControl(); + void deleteCache(); + private: void check(); }; @@ -269,6 +271,20 @@ void tst_QAbstractNetworkCache::check() QCOMPARE(diskCache->gotData, fetchFromCache); } +void tst_QAbstractNetworkCache::deleteCache() +{ + QNetworkAccessManager manager; + NetworkDiskCache *diskCache = new NetworkDiskCache(&manager); + manager.setCache(diskCache); + + QString url = "httpcachetest_cachecontrol.cgi?max-age=1000"; + QNetworkRequest request(QUrl(TESTFILE + url)); + QNetworkReply *reply = manager.get(request); + QSignalSpy downloaded1(reply, SIGNAL(finished())); + manager.setCache(0); + QTRY_COMPARE(downloaded1.count(), 1); +} + QTEST_MAIN(tst_QAbstractNetworkCache) #include "tst_qabstractnetworkcache.moc" -- cgit v0.12 From 651f63172e4f68f8e084c16415499fdbda08bf39 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 1 Sep 2009 09:53:10 +0200 Subject: Re-add check for saving to cache, which was removed by accident. Discussed with Ben Meyer. --- src/network/access/qnetworkreplyimpl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index c805d59..71e007f 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -283,6 +283,7 @@ void QNetworkReplyImplPrivate::createCache() { // check if we can save and if we're allowed to if (!networkCache() + || !request.attribute(QNetworkRequest::CacheSaveControlAttribute, true).toBool() || request.attribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferNetwork).toInt() == QNetworkRequest::AlwaysNetwork) -- cgit v0.12 From 67d5b1b800df55c61241c7fa33feeeea41a31513 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Tue, 1 Sep 2009 10:30:11 +0200 Subject: QSslCertificate: fix previous patch, add autotest and documentation The +1 must be added to the version, not the serial number. Reviewed-by: trustme --- src/network/ssl/qsslcertificate.cpp | 6 +++--- tests/auto/qsslcertificate/tst_qsslcertificate.cpp | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index c128da9..3793b1e 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -252,19 +252,19 @@ QByteArray QSslCertificate::version() const { if (d->versionString.isEmpty() && d->x509) d->versionString = - QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->version))); + QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->version)) + 1); return d->versionString; } /*! - Returns the certificate's serial number string. + Returns the certificate's serial number string in decimal format. */ QByteArray QSslCertificate::serialNumber() const { if (d->serialNumberString.isEmpty() && d->x509) d->serialNumberString = - QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->serialNumber)) + 1); + QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->serialNumber))); return d->serialNumberString; } diff --git a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp index add48c4..4dfb6b9 100644 --- a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp +++ b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp @@ -267,6 +267,8 @@ void tst_QSslCertificate::compareCertificates( QCOMPARE(cert1.alternateSubjectNames(), cert2.alternateSubjectNames()); QCOMPARE(cert1.effectiveDate(), cert2.effectiveDate()); QCOMPARE(cert1.expiryDate(), cert2.expiryDate()); + QCOMPARE(cert1.version(), cert2.version()); + QCOMPARE(cert1.serialNumber(), cert2.serialNumber()); // ### add more functions here ... } @@ -677,7 +679,9 @@ void tst_QSslCertificate::certInfo() QCOMPARE(cert.subjectInfo("C"), QString("NO")); QCOMPARE(cert.subjectInfo("ST"), QString()); - QCOMPARE(cert.version(), QByteArray()); + QCOMPARE(cert.version(), QByteArray::number(1)); + QCOMPARE(cert.serialNumber(), QByteArray::number(17)); + QCOMPARE(cert.toPem().constData(), (const char*)pem); QCOMPARE(cert.toDer(), QByteArray::fromHex(der)); -- cgit v0.12 From f39ead322f7b2e485cc6767b609eb5bc8a10b0ea Mon Sep 17 00:00:00 2001 From: Bernhard Rosenkraenzer Date: Tue, 1 Sep 2009 10:40:49 +0200 Subject: qlist.h uses memcpy() without including or Attempting to make use of the inlined QList::node_copy without including or with gcc 4.4 results in (e.g.) /usr/lib64/qt4/include/QtCore/qlist.h: In member function "void QList::node_copy(QList::Node*, QList::Node*, QList::Node*) [with T = net::Port]": /usr/lib64/qt4/include/QtCore/qlist.h:600: instantiated from "void QList::detach_helper() [with T = net::Port]" /usr/lib64/qt4/include/QtCore/qlist.h:121: instantiated from "void QList::detach() [with T = net::Port]" /usr/lib64/qt4/include/QtCore/qlist.h:462: instantiated from "void QList::append(const T&) [with T = net::Port]" /usr/src/ark/BUILD/kdenetwork/kget/transfer-plugins/bittorrent/libbtcore/net/portlist.cpp:54: instantiated from here /usr/lib64/qt4/include/QtCore/qlist.h:388: error: "memcpy" was not declared in this scope Task-number: reported, but not yet assigned a number Merge-request: 1388 Reviewed-by: Thiago Macieira --- src/corelib/tools/qlist.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index ba8ae56..c2bdbee 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -52,6 +52,7 @@ #endif #include +#include QT_BEGIN_HEADER -- cgit v0.12 From a985aaccfcaf2e24b7094875f2e6f51d80c45997 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Tue, 1 Sep 2009 10:31:37 +0200 Subject: Reduce the flickering caused by QAxClientSite::EnableModeless Lock the updates during this call from the activex control. Task-number: 257593 Reviewed-by: Trust Me --- src/activeqt/container/qaxwidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/activeqt/container/qaxwidget.cpp b/src/activeqt/container/qaxwidget.cpp index 621c836..22e7a82 100644 --- a/src/activeqt/container/qaxwidget.cpp +++ b/src/activeqt/container/qaxwidget.cpp @@ -1437,6 +1437,7 @@ extern Q_GUI_EXPORT bool qt_win_ignoreNextMouseReleaseEvent; HRESULT WINAPI QAxClientSite::EnableModeless(BOOL fEnable) { + LockWindowUpdate(host->window()->winId()); EnableWindow(host->window()->winId(), fEnable); if (!fEnable) { @@ -1447,6 +1448,7 @@ HRESULT WINAPI QAxClientSite::EnableModeless(BOOL fEnable) QApplicationPrivate::leaveModal(host); } qt_win_ignoreNextMouseReleaseEvent = false; + LockWindowUpdate(0); return S_OK; } -- cgit v0.12 From efe61b3b44c0c391d4c11bd061e531f03bf8fb4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 1 Sep 2009 09:55:13 +0200 Subject: Fixed poor utilization of depth buffer range in GL 2 paint engine. Before this patch we were only able to do 20 or so IntersectClips before failing, this patch instead adapts to the fixed point nature of typical depth buffer implementations and lets us do ~2^15 IntersectClip operations before failing, which should be a reasonable limit for any real-world application. Using the following mapping of old floating point depths to integer depths: -1.0 -> 0, -0.5 -> 1, 0.0 -> 2, 0.25 -> 3, 0.5 -> 4, 0.625 -> 5, etc.. Reviewed-by: Tom --- .../gl2paintengineex/qpaintengineex_opengl2.cpp | 51 +++++++++++----------- .../gl2paintengineex/qpaintengineex_opengl2_p.h | 19 ++++++-- 2 files changed, 41 insertions(+), 29 deletions(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index a976a02..0c01263 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -380,7 +380,7 @@ void QGL2PaintEngineExPrivate::useSimpleShader() } if (simpleShaderDepthUniformDirty) { - shaderManager->simpleProgram()->setUniformValue("depth", (GLfloat)q->state()->currentDepth); + shaderManager->simpleProgram()->setUniformValue("depth", normalizedDeviceDepth(q->state()->currentDepth)); simpleShaderDepthUniformDirty = false; } } @@ -731,7 +731,6 @@ void QGL2PaintEngineExPrivate::resetGLState() glActiveTexture(GL_TEXTURE0); glDisable(GL_DEPTH_TEST); glDisable(GL_SCISSOR_TEST); - glDepthFunc(GL_LESS); glDepthMask(true); glClearDepth(1); } @@ -959,7 +958,7 @@ bool QGL2PaintEngineExPrivate::prepareForDraw(bool srcPixelsAreOpaque) } if (depthUniformDirty) { - shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::Depth), (GLfloat)q->state()->currentDepth); + shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::Depth), normalizedDeviceDepth(q->state()->currentDepth)); depthUniformDirty = false; } @@ -1351,7 +1350,7 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) if (!d->inRenderText) { glDisable(GL_DEPTH_TEST); glDisable(GL_SCISSOR_TEST); - glDepthFunc(GL_LEQUAL); + glDepthFunc(GL_LESS); glDepthMask(false); } @@ -1441,7 +1440,7 @@ void QGL2PaintEngineEx::ensureActive() if (d->needsSync) { glViewport(0, 0, d->width, d->height); glDepthMask(false); - glDepthFunc(GL_LEQUAL); + glDepthFunc(GL_LESS); setState(state()); d->needsSync = false; } @@ -1492,7 +1491,7 @@ void QGL2PaintEngineEx::clipEnabledChanged() d->regenerateDepthClip(); } else { if (d->use_system_clip) { - state()->currentDepth = -0.5f; + state()->currentDepth = 0; } else { state()->depthTestEnabled = false; } @@ -1501,7 +1500,7 @@ void QGL2PaintEngineEx::clipEnabledChanged() } } -void QGL2PaintEngineExPrivate::writeClip(const QVectorPath &path, float depth) +void QGL2PaintEngineExPrivate::writeClip(const QVectorPath &path, uint depth) { transferMode(BrushDrawingMode); @@ -1510,7 +1509,7 @@ void QGL2PaintEngineExPrivate::writeClip(const QVectorPath &path, float depth) if (q->state()->needsDepthBufferClear) { glDepthMask(true); - glClearDepth(0.5); + glClearDepth(rawDepth(2)); glClear(GL_DEPTH_BUFFER_BIT); q->state()->needsDepthBufferClear = false; glDepthMask(false); @@ -1532,7 +1531,7 @@ void QGL2PaintEngineExPrivate::writeClip(const QVectorPath &path, float depth) glColorMask(false, false, false, false); glDepthMask(true); - shaderManager->simpleProgram()->setUniformValue("depth", depth); + shaderManager->simpleProgram()->setUniformValue("depth", normalizedDeviceDepth(depth)); simpleShaderDepthUniformDirty = true; glEnable(GL_DEPTH_TEST); @@ -1596,12 +1595,12 @@ void QGL2PaintEngineEx::clip(const QVectorPath &path, Qt::ClipOperation op) glDepthFunc(GL_ALWAYS); - state()->maxDepth = 0.5f; + state()->maxDepth = 4; d->writeClip(qtVectorPathForPath(path), state()->maxDepth); - state()->currentDepth = 0.25f; + state()->currentDepth = 3; state()->depthTestEnabled = true; - glDepthFunc(GL_LEQUAL); + glDepthFunc(GL_LESS); glEnable(GL_DEPTH_TEST); } @@ -1610,7 +1609,7 @@ void QGL2PaintEngineEx::clip(const QVectorPath &path, Qt::ClipOperation op) if (d->use_system_clip) { glEnable(GL_DEPTH_TEST); state()->depthTestEnabled = true; - state()->currentDepth = -0.5; + state()->currentDepth = 0; } else { glDisable(GL_DEPTH_TEST); state()->depthTestEnabled = false; @@ -1618,18 +1617,18 @@ void QGL2PaintEngineEx::clip(const QVectorPath &path, Qt::ClipOperation op) state()->canRestoreClip = false; break; case Qt::IntersectClip: - state()->maxDepth = (1.0f + state()->maxDepth) * 0.5; + ++state()->maxDepth; d->writeClip(path, state()->maxDepth); - state()->currentDepth = 1.5 * state()->maxDepth - 0.5f; + state()->currentDepth = state()->maxDepth - 1; state()->depthTestEnabled = true; break; case Qt::ReplaceClip: d->systemStateChanged(); state()->rectangleClip = QRect(); - state()->maxDepth = 0.5f; + state()->maxDepth = 4; glDepthFunc(GL_ALWAYS); d->writeClip(path, state()->maxDepth); - state()->currentDepth = 0.25f; + state()->currentDepth = 3; state()->canRestoreClip = false; state()->depthTestEnabled = true; break; @@ -1641,7 +1640,7 @@ void QGL2PaintEngineEx::clip(const QVectorPath &path, Qt::ClipOperation op) break; } - glDepthFunc(GL_LEQUAL); + glDepthFunc(GL_LESS); if (state()->depthTestEnabled) { glEnable(GL_DEPTH_TEST); d->simpleShaderDepthUniformDirty = true; @@ -1672,8 +1671,8 @@ void QGL2PaintEngineExPrivate::systemStateChanged() glDisable(GL_SCISSOR_TEST); - q->state()->currentDepth = -0.5f; - q->state()->maxDepth = 0.5f; + q->state()->currentDepth = 1; + q->state()->maxDepth = 4; q->state()->rectangleClip = QRect(0, 0, width, height); @@ -1708,8 +1707,8 @@ void QGL2PaintEngineExPrivate::systemStateChanged() path.addRegion(systemClip); glDepthFunc(GL_ALWAYS); - writeClip(qtVectorPathForPath(path), 0.0f); - glDepthFunc(GL_LEQUAL); + writeClip(qtVectorPathForPath(path), 2); + glDepthFunc(GL_LESS); glEnable(GL_DEPTH_TEST); q->state()->depthTestEnabled = true; @@ -1718,7 +1717,7 @@ void QGL2PaintEngineExPrivate::systemStateChanged() q->transformChanged(); } - q->state()->currentDepth = -0.5f; + q->state()->currentDepth = 1; simpleShaderDepthUniformDirty = true; depthUniformDirty = true; } @@ -1757,7 +1756,7 @@ void QGL2PaintEngineEx::setState(QPainterState *new_state) if (old_state && old_state != s && old_state->canRestoreClip) { d->updateDepthScissorTest(); glDepthMask(false); - glDepthFunc(GL_LEQUAL); + glDepthFunc(GL_LESS); s->maxDepth = old_state->maxDepth; } else { d->regenerateDepthClip(); @@ -1802,8 +1801,8 @@ QOpenGL2PaintEngineState::QOpenGL2PaintEngineState() needsDepthBufferClear = true; depthTestEnabled = false; scissorTestEnabled = false; - currentDepth = -0.5f; - maxDepth = 0.5f; + currentDepth = 1; + maxDepth = 4; canRestoreClip = true; hasRectangleClip = false; } diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 58fcde1..552e390 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -82,8 +82,8 @@ public: bool depthTestEnabled; bool scissorTestEnabled; - qreal currentDepth; - qreal maxDepth; + uint maxDepth; + uint currentDepth; bool canRestoreClip; QRect rectangleClip; @@ -230,13 +230,26 @@ public: QGLEngineShaderManager* shaderManager; - void writeClip(const QVectorPath &path, float depth); + void writeClip(const QVectorPath &path, uint depth); void updateDepthScissorTest(); void setScissor(const QRect &rect); void regenerateDepthClip(); void systemStateChanged(); uint use_system_clip : 1; + static inline GLfloat rawDepth(uint depth) + { + // assume at least 16 bits in the depth buffer, and + // use 2^15 depth levels to be safe with regard to + // rounding issues etc + return depth * (1.0f / GLfloat((1 << 15) - 1)); + } + + static inline GLfloat normalizedDeviceDepth(uint depth) + { + return 2.0f * rawDepth(depth) - 1.0f; + } + uint location(QGLEngineShaderManager::Uniform uniform) { return shaderManager->getUniformLocation(uniform); -- cgit v0.12 From b2e91ecd641b9c891ea823cfc647f729af6228e8 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 1 Sep 2009 07:58:11 +0200 Subject: Make the existence of the LICENSE.GPL3 file optional The repository no longer carries this license. The final releases will still have it. In any case, the LGPLv2.1 is compatible with the GPLv3. Required-By: Nokia Legal Reviewed-by: Marius Storm-Olsen --- LICENSE.GPL3 | 696 --------------------------------------- configure | 15 +- tools/configure/configureapp.cpp | 9 +- 3 files changed, 17 insertions(+), 703 deletions(-) delete mode 100644 LICENSE.GPL3 diff --git a/LICENSE.GPL3 b/LICENSE.GPL3 deleted file mode 100644 index 265c4ea..0000000 --- a/LICENSE.GPL3 +++ /dev/null @@ -1,696 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - - The Qt GUI Toolkit is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). - Contact: Nokia Corporation (qt-info@nokia.com) - - You may use, distribute and copy the Qt GUI Toolkit under the terms of - GNU General Public License version 3, which is displayed below. - -------------------------------------------------------------------------- - - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. - -------------------------------------------------------------------------- - -In addition, as a special exception, Nokia gives permission to link the -code of its release of Qt with the OpenSSL project's "OpenSSL" library (or -modified versions of it that use the same license as the "OpenSSL" -library), and distribute the linked executables. You must comply with the -GNU General Public License versions 2.0 or 3.0 in all respects for all of -the code used other than the "OpenSSL" code. If you modify this file, you -may extend this exception to your version of the file, but you are not -obligated to do so. If you do not wish to do so, delete this exception -statement from your version of this file. diff --git a/configure b/configure index 7af8487..6832ad3 100755 --- a/configure +++ b/configure @@ -3710,16 +3710,21 @@ if [ "$Edition" = "NokiaInternalBuild" ]; then elif [ "$Edition" = "OpenSource" ]; then while true; do echo "You are licensed to use this software under the terms of" - echo "the GNU General Public License (GPL) versions 3." - echo "You are also licensed to use this software under the terms of" echo "the Lesser GNU General Public License (LGPL) versions 2.1." + if [ -e "$relpath/LICENSE.GPL3" ]; then + echo "You are also licensed to use this software under the terms of" + echo "the GNU General Public License (GPL) versions 3." + affix="either" + else + affix="the" + fi echo - affix="either" if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then - echo "You have already accepted the terms of the $LicenseType license." + echo "You have already accepted the terms of the $LicenseType license." acceptance=yes else - echo "Type '3' to view the GNU General Public License version 3." + test -e "$relpath/LICENSE.GPL3" && \ + echo "Type '3' to view the GNU General Public License version 3." echo "Type 'L' to view the Lesser GNU General Public License version 2.1." echo "Type 'yes' to accept this license offer." echo "Type 'no' to decline this license offer." diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 7ccd35b..193f8aa 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3415,10 +3415,14 @@ bool Configure::showLicense(QString orgLicenseFile) return true; } + bool haveGpl3 = false; QString licenseFile = orgLicenseFile; QString theLicense; if (dictionary["EDITION"] == "OpenSource" || dictionary["EDITION"] == "Snapshot") { - theLicense = "GNU General Public License (GPL) version 3 \nor the GNU Lesser General Public License (LGPL) version 2.1"; + haveGpl3 = QFile::exists(orgLicenseFile + "/LICENSE.GPL3"); + theLicense = "GNU Lesser General Public License (LGPL) version 2.1"; + if (haveGpl3) + theLicense += "\nor the GNU General Public License (GPL) version 3"; } else { // the first line of the license file tells us which license it is QFile file(licenseFile); @@ -3435,7 +3439,8 @@ bool Configure::showLicense(QString orgLicenseFile) << "the " << theLicense << "." << endl << endl; if (dictionary["EDITION"] == "OpenSource" || dictionary["EDITION"] == "Snapshot") { - cout << "Type '3' to view the GNU General Public License version 3 (GPLv3)." << endl; + if (haveGpl3) + cout << "Type '3' to view the GNU General Public License version 3 (GPLv3)." << endl; cout << "Type 'L' to view the Lesser GNU General Public License version 2.1 (LGPLv2.1)." << endl; } else { cout << "Type '?' to view the " << theLicense << "." << endl; -- cgit v0.12 From fa7bed077d882d32e208c6f3879bac6355bb3726 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 31 Aug 2009 14:36:37 +0200 Subject: QNAM HTTP Code: Pipelining used queue from wrong side Do it as it was done in dequeueAndSendRequest. Reviewed-by: TrustMe --- src/network/access/qhttpnetworkconnection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index e68aa3a..da9ec09 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -519,7 +519,7 @@ bool QHttpNetworkConnectionPrivate::fillPipeline(QList &queue, if (queue.isEmpty()) return true; - for (int i = 0; i < queue.length(); i++) { + for (int i = queue.count() - 1; i >= 0; --i) { HttpMessagePair messagePair = queue.at(i); const QHttpNetworkRequest &request = messagePair.first; -- cgit v0.12 From ab45aa26a040bdf84dc923792f5f384dd51f906d Mon Sep 17 00:00:00 2001 From: Andreas Aardal Hanssen Date: Tue, 1 Sep 2009 11:35:22 +0200 Subject: Make test more reliable - wait after show. This test failed randomly in the past, and more often on a KDE4 desktop with a slow graphics card. --- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 2acb76d..aa1f2b8 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -5420,6 +5420,7 @@ void tst_QGraphicsItem::contextMenuEventPropagation() qt_x11_wait_for_window_manager(&view); #endif view.resize(200, 200); + QTest::qWait(250); QContextMenuEvent event(QContextMenuEvent::Mouse, QPoint(10, 10), view.viewport()->mapToGlobal(QPoint(10, 10))); -- cgit v0.12 From 72d7a8e5d7cc5cf498078648f01a20869245d75e Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 1 Sep 2009 11:47:18 +0200 Subject: Fix compilation of QAbstractItemModel test --- tests/auto/qabstractitemmodel/dynamictreemodel.cpp | 9 +++------ tests/auto/qabstractitemmodel/dynamictreemodel.h | 9 +++------ tests/auto/qabstractitemmodel/qabstractitemmodel.pro | 2 +- tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp | 2 +- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/tests/auto/qabstractitemmodel/dynamictreemodel.cpp b/tests/auto/qabstractitemmodel/dynamictreemodel.cpp index 6425dcd..dd0615d 100644 --- a/tests/auto/qabstractitemmodel/dynamictreemodel.cpp +++ b/tests/auto/qabstractitemmodel/dynamictreemodel.cpp @@ -41,13 +41,10 @@ #include "dynamictreemodel.h" -#include -#include -#include +#include +#include +#include -#include - -#include DynamicTreeModel::DynamicTreeModel(QObject *parent) : QAbstractItemModel(parent), diff --git a/tests/auto/qabstractitemmodel/dynamictreemodel.h b/tests/auto/qabstractitemmodel/dynamictreemodel.h index d84bf68..a769c38 100644 --- a/tests/auto/qabstractitemmodel/dynamictreemodel.h +++ b/tests/auto/qabstractitemmodel/dynamictreemodel.h @@ -42,14 +42,11 @@ #ifndef DYNAMICTREEMODEL_H #define DYNAMICTREEMODEL_H -#include +#include -#include -#include +#include +#include -#include - -#include template class QList; diff --git a/tests/auto/qabstractitemmodel/qabstractitemmodel.pro b/tests/auto/qabstractitemmodel/qabstractitemmodel.pro index 84ed5a2..a31868b 100644 --- a/tests/auto/qabstractitemmodel/qabstractitemmodel.pro +++ b/tests/auto/qabstractitemmodel/qabstractitemmodel.pro @@ -2,5 +2,5 @@ load(qttest_p4) SOURCES += tst_qabstractitemmodel.cpp dynamictreemodel.cpp HEADERS += dynamictreemodel.h -QT = core + diff --git a/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp b/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp index da65e7d..58832c7 100644 --- a/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp +++ b/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp @@ -43,7 +43,7 @@ #include #include -#include +#include //TESTED_CLASS=QAbstractListModel QAbstractTableModel //TESTED_FILES= -- cgit v0.12 From bfa9b7e5cb1cd91aa0efad14bd91f14144e1acb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Mon, 31 Aug 2009 14:07:42 +0200 Subject: doc: Also mention HSL --- src/gui/painting/qcolor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index 422d5a3..173c870 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -298,7 +298,7 @@ QT_BEGIN_NAMESPACE /*! \enum QColor::Spec - The type of color specified, either RGB, HSV or CMYK. + The type of color specified, either RGB, HSV, CMYK or HSL. \value Rgb \value Hsv -- cgit v0.12 From 22ac5bb9aac73b0c7d319f2cdc42dd5bcd59f2b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Mon, 31 Aug 2009 16:02:23 +0200 Subject: Microoptimizations in QCleanLooksStyle Shaved 4K off the size of a release build of libQtGui. Reviewed-by: Jens Bache-Wiig --- src/gui/styles/qcleanlooksstyle.cpp | 364 ++++++++++++++++++++++-------------- 1 file changed, 224 insertions(+), 140 deletions(-) diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp index 6d957ca..20f1d26 100644 --- a/src/gui/styles/qcleanlooksstyle.cpp +++ b/src/gui/styles/qcleanlooksstyle.cpp @@ -561,14 +561,20 @@ static void qt_cleanlooks_draw_mdibutton(QPainter *painter, const QStyleOptionTi QColor mdiButtonBorderColor(active ? option->palette.highlight().color().darker(180): dark.darker(110)); painter->setPen(QPen(mdiButtonBorderColor, 1)); - painter->drawLine(tmp.left() + 2, tmp.top(), tmp.right() - 2, tmp.top()); - painter->drawLine(tmp.left() + 2, tmp.bottom(), tmp.right() - 2, tmp.bottom()); - painter->drawLine(tmp.left(), tmp.top() + 2, tmp.left(), tmp.bottom() - 2); - painter->drawLine(tmp.right(), tmp.top() + 2, tmp.right(), tmp.bottom() - 2); - painter->drawPoint(tmp.left() + 1, tmp.top() + 1); - painter->drawPoint(tmp.right() - 1, tmp.top() + 1); - painter->drawPoint(tmp.left() + 1, tmp.bottom() - 1); - painter->drawPoint(tmp.right() - 1, tmp.bottom() - 1); + const QLine lines[4] = { + QLine(tmp.left() + 2, tmp.top(), tmp.right() - 2, tmp.top()), + QLine(tmp.left() + 2, tmp.bottom(), tmp.right() - 2, tmp.bottom()), + QLine(tmp.left(), tmp.top() + 2, tmp.left(), tmp.bottom() - 2), + QLine(tmp.right(), tmp.top() + 2, tmp.right(), tmp.bottom() - 2) + }; + painter->drawLines(lines, 4); + const QPoint points[4] = { + QPoint(tmp.left() + 1, tmp.top() + 1), + QPoint(tmp.right() - 1, tmp.top() + 1), + QPoint(tmp.left() + 1, tmp.bottom() - 1), + QPoint(tmp.right() - 1, tmp.bottom() - 1) + }; + painter->drawPoints(points, 4); painter->setPen(titleBarHighlight); painter->drawLine(tmp.left() + 2, tmp.top() + 1, tmp.right() - 2, tmp.top() + 1); @@ -900,14 +906,17 @@ void QCleanlooksStyle::drawPrimitive(PrimitiveElement elem, QRect r = rect.adjusted(0, 1, 0, -1); painter->setPen(buttonShadowAlpha); painter->drawLine(QPoint(r.left() + 2, r.top() - 1), QPoint(r.right() - 2, r.top() - 1)); - painter->drawPoint(r.right() - 1, r.top()); - painter->drawPoint(r.right(), r.top() + 1); - painter->drawPoint(r.right() - 1, r.bottom()); - painter->drawPoint(r.right(), r.bottom() - 1); - painter->drawPoint(r.left() + 1, r.top() ); - painter->drawPoint(r.left(), r.top() + 1); - painter->drawPoint(r.left() + 1, r.bottom() ); - painter->drawPoint(r.left(), r.bottom() - 1); + const QPoint points[8] = { + QPoint(r.right() - 1, r.top()), + QPoint(r.right(), r.top() + 1), + QPoint(r.right() - 1, r.bottom()), + QPoint(r.right(), r.bottom() - 1), + QPoint(r.left() + 1, r.top() ), + QPoint(r.left(), r.top() + 1), + QPoint(r.left() + 1, r.bottom() ), + QPoint(r.left(), r.bottom() - 1) + }; + painter->drawPoints(points, 8); painter->setPen(QPen(option->palette.background().color(), 1)); painter->drawLine(QPoint(r.left() + 2, r.top() + 1), QPoint(r.right() - 2, r.top() + 1)); @@ -939,10 +948,13 @@ void QCleanlooksStyle::drawPrimitive(PrimitiveElement elem, painter->drawLine(QPoint(r.left(), r.top() + 2), QPoint(r.left(), r.bottom() - 2)); painter->drawLine(QPoint(r.right(), r.top() + 2), QPoint(r.right(), r.bottom() - 2)); painter->drawLine(QPoint(r.left() + 2, r.bottom()), QPoint(r.right() - 2, r.bottom())); - painter->drawPoint(QPoint(r.right() - 1, r.bottom() - 1)); - painter->drawPoint(QPoint(r.right() - 1, r.top() + 1)); - painter->drawPoint(QPoint(r.left() + 1, r.bottom() - 1)); - painter->drawPoint(QPoint(r.left() + 1, r.top() + 1)); + const QPoint points2[4] = { + QPoint(r.right() - 1, r.bottom() - 1), + QPoint(r.right() - 1, r.top() + 1), + QPoint(r.left() + 1, r.bottom() - 1), + QPoint(r.left() + 1, r.top() + 1) + }; + painter->drawPoints(points2, 4); painter->drawLine(QPoint(r.left() + 2, r.top()), QPoint(r.right() - 2, r.top())); painter->setPen(oldPen); } @@ -1040,10 +1052,13 @@ void QCleanlooksStyle::drawPrimitive(PrimitiveElement elem, painter->setBrush(QBrush(dark.darker(120), Qt::Dense4Pattern)); painter->setBrushOrigin(rect.topLeft()); painter->setPen(Qt::NoPen); - painter->drawRect(rect.left(), rect.top(), rect.width(), 1); // Top - painter->drawRect(rect.left(), rect.bottom(), rect.width(), 1); // Bottom - painter->drawRect(rect.left(), rect.top(), 1, rect.height()); // Left - painter->drawRect(rect.right(), rect.top(), 1, rect.height()); // Right + const QRect rects[4] = { + QRect(rect.left(), rect.top(), rect.width(), 1), // Top + QRect(rect.left(), rect.bottom(), rect.width(), 1), // Bottom + QRect(rect.left(), rect.top(), 1, rect.height()), // Left + QRect(rect.right(), rect.top(), 1, rect.height()) // Right + }; + painter->drawRects(rects, 4); painter->restore(); } break; @@ -1065,18 +1080,24 @@ void QCleanlooksStyle::drawPrimitive(PrimitiveElement elem, if (isDefault) { r = option->rect.adjusted(0, 1, 0, -1); painter->setPen(QPen(Qt::black, 0)); - painter->drawLine(QPoint(r.left() + 2, r.top()), - QPoint(r.right() - 2, r.top())); - painter->drawLine(QPoint(r.left(), r.top() + 2), - QPoint(r.left(), r.bottom() - 2)); - painter->drawLine(QPoint(r.right(), r.top() + 2), - QPoint(r.right(), r.bottom() - 2)); - painter->drawLine(QPoint(r.left() + 2, r.bottom()), - QPoint(r.right() - 2, r.bottom())); - painter->drawPoint(QPoint(r.right() - 1, r.bottom() - 1)); - painter->drawPoint(QPoint(r.right() - 1, r.top() + 1)); - painter->drawPoint(QPoint(r.left() + 1, r.bottom() - 1)); - painter->drawPoint(QPoint(r.left() + 1, r.top() + 1)); + const QLine lines[4] = { + QLine(QPoint(r.left() + 2, r.top()), + QPoint(r.right() - 2, r.top())), + QLine(QPoint(r.left(), r.top() + 2), + QPoint(r.left(), r.bottom() - 2)), + QLine(QPoint(r.right(), r.top() + 2), + QPoint(r.right(), r.bottom() - 2)), + QLine(QPoint(r.left() + 2, r.bottom()), + QPoint(r.right() - 2, r.bottom())) + }; + painter->drawLines(lines, 4); + const QPoint points[4] = { + QPoint(r.right() - 1, r.bottom() - 1), + QPoint(r.right() - 1, r.top() + 1), + QPoint(r.left() + 1, r.bottom() - 1), + QPoint(r.left() + 1, r.top() + 1) + }; + painter->drawPoints(points, 4); painter->setPen(oldPen); } return; @@ -1140,10 +1161,13 @@ void QCleanlooksStyle::drawPrimitive(PrimitiveElement elem, QPoint(r.right(), r.bottom() - 2)); p->drawLine(QPoint(r.left() + 2, r.bottom()), QPoint(r.right() - 2, r.bottom())); - p->drawPoint(QPoint(r.right() - 1, r.bottom() - 1)); - p->drawPoint(QPoint(r.right() - 1, r.top() + 1)); - p->drawPoint(QPoint(r.left() + 1, r.bottom() - 1)); - p->drawPoint(QPoint(r.left() + 1, r.top() + 1)); + const QPoint points[4] = { + QPoint(r.right() - 1, r.bottom() - 1), + QPoint(r.right() - 1, r.top() + 1), + QPoint(r.left() + 1, r.bottom() - 1), + QPoint(r.left() + 1, r.top() + 1) + }; + p->drawPoints(points, 4); if (!isDefault && !hasFocus && isEnabled) p->setPen(QPen(darkOutline.darker(110), 0)); @@ -1163,14 +1187,17 @@ void QCleanlooksStyle::drawPrimitive(PrimitiveElement elem, topShadow.setAlpha(60); p->setPen(topShadow); - p->drawPoint(QPoint(r.right(), r.top() + 1)); - p->drawPoint(QPoint(r.right() - 1, r.top() )); - p->drawPoint(QPoint(r.right(), r.bottom() - 1)); - p->drawPoint(QPoint(r.right() - 1, r.bottom() )); - p->drawPoint(QPoint(r.left() + 1, r.bottom())); - p->drawPoint(QPoint(r.left(), r.bottom() - 1)); - p->drawPoint(QPoint(r.left() + 1, r.top())); - p->drawPoint(QPoint(r.left(), r.top() + 1)); + const QPoint points2[8] = { + QPoint(r.right(), r.top() + 1), + QPoint(r.right() - 1, r.top() ), + QPoint(r.right(), r.bottom() - 1), + QPoint(r.right() - 1, r.bottom() ), + QPoint(r.left() + 1, r.bottom()), + QPoint(r.left(), r.bottom() - 1), + QPoint(r.left() + 1, r.top()), + QPoint(r.left(), r.top() + 1) + }; + p->drawPoints(points2, 8); topShadow.setAlpha(30); p->setPen(topShadow); @@ -1183,18 +1210,24 @@ void QCleanlooksStyle::drawPrimitive(PrimitiveElement elem, if (isDefault) { r.adjust(-1, -1, 1, 1); p->setPen(buttonShadowAlpha.darker(120)); - p->drawLine(r.topLeft() + QPoint(3, 0), r.topRight() - QPoint(3, 0)); - p->drawLine(r.bottomLeft() + QPoint(3, 0), r.bottomRight() - QPoint(3, 0)); - p->drawLine(r.topLeft() + QPoint(0, 3), r.bottomLeft() - QPoint(0, 3)); - p->drawLine(r.topRight() + QPoint(0, 3), r.bottomRight() - QPoint(0, 3)); - p->drawPoint(r.topRight() + QPoint(-2, 1)); - p->drawPoint(r.topRight() + QPoint(-1, 2)); - p->drawPoint(r.bottomRight() + QPoint(-1, -2)); - p->drawPoint(r.bottomRight() + QPoint(-2, -1)); - p->drawPoint(r.topLeft() + QPoint(1, 2)); - p->drawPoint(r.topLeft() + QPoint(2, 1)); - p->drawPoint(r.bottomLeft() + QPoint(1, -2)); - p->drawPoint(r.bottomLeft() + QPoint(2, -1)); + const QLine lines[4] = { + QLine(r.topLeft() + QPoint(3, 0), r.topRight() - QPoint(3, 0)), + QLine(r.bottomLeft() + QPoint(3, 0), r.bottomRight() - QPoint(3, 0)), + QLine(r.topLeft() + QPoint(0, 3), r.bottomLeft() - QPoint(0, 3)), + QLine(r.topRight() + QPoint(0, 3), r.bottomRight() - QPoint(0, 3)) + }; + p->drawLines(lines, 4); + const QPoint points3[8] = { + r.topRight() + QPoint(-2, 1), + r.topRight() + QPoint(-1, 2), + r.bottomRight() + QPoint(-1, -2), + r.bottomRight() + QPoint(-2, -1), + r.topLeft() + QPoint(1, 2), + r.topLeft() + QPoint(2, 1), + r.bottomLeft() + QPoint(1, -2), + r.bottomLeft() + QPoint(2, -1) + }; + p->drawPoints(points3, 8); } painter->setPen(oldPen); painter->setBrush(oldBrush); @@ -1307,12 +1340,15 @@ void QCleanlooksStyle::drawPrimitive(PrimitiveElement elem, painter->drawLine(innerBottomLine); painter->setPen(alphaCornerColor); - painter->drawPoint(leftBottomInnerCorner1); - painter->drawPoint(leftBottomInnerCorner2); - painter->drawPoint(rightBottomInnerCorner1); - painter->drawPoint(rightBottomInnerCorner2); - painter->drawPoint(leftTopInnerCorner1); - painter->drawPoint(leftTopInnerCorner2); + const QPoint points[6] = { + leftBottomInnerCorner1, + leftBottomInnerCorner2, + rightBottomInnerCorner1, + rightBottomInnerCorner2, + leftTopInnerCorner1, + leftTopInnerCorner2 + }; + painter->drawPoints(points, 6); } #endif // QT_NO_TABWIDGET painter->restore(); @@ -1670,19 +1706,25 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o painter->fillRect(rect, option->palette.base()); QColor borderColor = dark.lighter(110); painter->setPen(QPen(borderColor, 0)); - painter->drawLine(QPoint(rect.left() + 1, rect.top()), QPoint(rect.right() - 1, rect.top())); - painter->drawLine(QPoint(rect.left() + 1, rect.bottom()), QPoint(rect.right() - 1, rect.bottom())); - painter->drawLine(QPoint(rect.left(), rect.top() + 1), QPoint(rect.left(), rect.bottom() - 1)); - painter->drawLine(QPoint(rect.right(), rect.top() + 1), QPoint(rect.right(), rect.bottom() - 1)); + const QLine lines[4] = { + QLine(QPoint(rect.left() + 1, rect.top()), QPoint(rect.right() - 1, rect.top())), + QLine(QPoint(rect.left() + 1, rect.bottom()), QPoint(rect.right() - 1, rect.bottom())), + QLine(QPoint(rect.left(), rect.top() + 1), QPoint(rect.left(), rect.bottom() - 1)), + QLine(QPoint(rect.right(), rect.top() + 1), QPoint(rect.right(), rect.bottom() - 1)) + }; + painter->drawLines(lines, 4); QColor alphaCorner = mergedColors(borderColor, option->palette.background().color()); QColor innerShadow = mergedColors(borderColor, option->palette.base().color()); //corner smoothing painter->setPen(alphaCorner); - painter->drawPoint(rect.topRight()); - painter->drawPoint(rect.topLeft()); - painter->drawPoint(rect.bottomRight()); - painter->drawPoint(rect.bottomLeft()); + const QPoint points[4] = { + rect.topRight(), + rect.topLeft(), + rect.bottomRight(), + rect.bottomLeft() + }; + painter->drawPoints(points, 4); //inner shadow painter->setPen(innerShadow); @@ -1807,10 +1849,13 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o option->palette.highlight()); painter->setPen(QPen(highlightOutline, 0)); - painter->drawLine(QPoint(r.left(), r.top() + 1), QPoint(r.left(), r.bottom())); - painter->drawLine(QPoint(r.right(), r.top() + 1), QPoint(r.right(), r.bottom())); - painter->drawLine(QPoint(r.left() + 1, r.bottom()), QPoint(r.right() - 1, r.bottom())); - painter->drawLine(QPoint(r.left() + 1, r.top()), QPoint(r.right() - 1, r.top())); + const QLine lines[4] = { + QLine(QPoint(r.left(), r.top() + 1), QPoint(r.left(), r.bottom())), + QLine(QPoint(r.right(), r.top() + 1), QPoint(r.right(), r.bottom())), + QLine(QPoint(r.left() + 1, r.bottom()), QPoint(r.right() - 1, r.bottom())), + QLine(QPoint(r.left() + 1, r.top()), QPoint(r.right() - 1, r.top())) + }; + painter->drawLines(lines, 4); //draw text QPalette::ColorRole textRole = dis ? QPalette::Text : QPalette::HighlightedText; @@ -1864,10 +1909,13 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o highlight); r = r.adjusted(-1, 0, 1, 0); painter->setPen(QPen(highlightOutline, 0)); - painter->drawLine(QPoint(r.left(), r.top() + 1), QPoint(r.left(), r.bottom() - 1)); - painter->drawLine(QPoint(r.right(), r.top() + 1), QPoint(r.right(), r.bottom() - 1)); - painter->drawLine(QPoint(r.left() + 1, r.bottom()), QPoint(r.right() - 1, r.bottom())); - painter->drawLine(QPoint(r.left() + 1, r.top()), QPoint(r.right() - 1, r.top())); + const QLine lines[4] = { + QLine(QPoint(r.left(), r.top() + 1), QPoint(r.left(), r.bottom() - 1)), + QLine(QPoint(r.right(), r.top() + 1), QPoint(r.right(), r.bottom() - 1)), + QLine(QPoint(r.left() + 1, r.bottom()), QPoint(r.right() - 1, r.bottom())), + QLine(QPoint(r.left() + 1, r.top()), QPoint(r.right() - 1, r.top())) + }; + painter->drawLines(lines, 4); } else { painter->fillRect(option->rect, menuBackground); } @@ -2447,14 +2495,17 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp cachePainter.setPen(topShadow); // antialias corners - cachePainter.drawPoint(QPoint(r.right(), r.top() + 1)); - cachePainter.drawPoint(QPoint(r.right() - 1, r.top() )); - cachePainter.drawPoint(QPoint(r.right(), r.bottom() - 1)); - cachePainter.drawPoint(QPoint(r.right() - 1, r.bottom() )); - cachePainter.drawPoint(QPoint(r.left() + 1, r.bottom())); - cachePainter.drawPoint(QPoint(r.left(), r.bottom() - 1)); - cachePainter.drawPoint(QPoint(r.left() + 1, r.top())); - cachePainter.drawPoint(QPoint(r.left(), r.top() + 1)); + const QPoint points[8] = { + QPoint(r.right(), r.top() + 1), + QPoint(r.right() - 1, r.top() ), + QPoint(r.right(), r.bottom() - 1), + QPoint(r.right() - 1, r.bottom() ), + QPoint(r.left() + 1, r.bottom()), + QPoint(r.left(), r.bottom() - 1), + QPoint(r.left() + 1, r.top()), + QPoint(r.left(), r.top() + 1) + }; + cachePainter.drawPoints(points, 8); // draw frame topShadow.setAlpha(30); @@ -2482,10 +2533,13 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp cachePainter.setPen(QPen(darkOutline, 1)); // top and bottom lines - cachePainter.drawLine(QPoint(r.left() + 2, r.bottom()), QPoint(r.right()- 2, r.bottom())); - cachePainter.drawLine(QPoint(r.left() + 2, r.top()), QPoint(r.right() - 2, r.top())); - cachePainter.drawLine(QPoint(r.right(), r.top() + 2), QPoint(r.right(), r.bottom() - 2)); - cachePainter.drawLine(QPoint(r.left(), r.top() + 2), QPoint(r.left(), r.bottom() - 2)); + const QLine lines[4] = { + QLine(QPoint(r.left() + 2, r.bottom()), QPoint(r.right()- 2, r.bottom())), + QLine(QPoint(r.left() + 2, r.top()), QPoint(r.right() - 2, r.top())), + QLine(QPoint(r.right(), r.top() + 2), QPoint(r.right(), r.bottom() - 2)), + QLine(QPoint(r.left(), r.top() + 2), QPoint(r.left(), r.bottom() - 2)) + }; + cachePainter.drawLines(lines, 4); } // gradients @@ -2519,10 +2573,13 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp if (spinBox->frame) { // rounded corners - cachePainter.drawPoint(QPoint(r.left() + 1, r.bottom() - 1)); - cachePainter.drawPoint(QPoint(r.left() + 1, r.top() + 1)); - cachePainter.drawPoint(QPoint(r.right() - 1, r.bottom() - 1)); - cachePainter.drawPoint(QPoint(r.right() - 1, r.top() + 1)); + const QPoint points[4] = { + QPoint(r.left() + 1, r.bottom() - 1), + QPoint(r.left() + 1, r.top() + 1), + QPoint(r.right() - 1, r.bottom() - 1), + QPoint(r.right() - 1, r.top() + 1) + }; + cachePainter.drawPoints(points, 4); if (option->state & State_HasFocus) { QColor darkoutline = option->palette.highlight().color().darker(150); @@ -2531,10 +2588,13 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp if (spinBox->direction == Qt::LeftToRight) { cachePainter.drawRect(rect.adjusted(1, 2, -3 -downRect.width(), -3)); cachePainter.setPen(QPen(darkoutline, 0)); - cachePainter.drawLine(QPoint(r.left() + 2, r.bottom()), QPoint(r.right()- downRect.width() - 1, r.bottom())); - cachePainter.drawLine(QPoint(r.left() + 2, r.top()), QPoint(r.right() - downRect.width() - 1, r.top())); - cachePainter.drawLine(QPoint(r.right() - downRect.width() - 1, r.top() + 1), QPoint(r.right()- downRect.width() - 1, r.bottom() - 1)); - cachePainter.drawLine(QPoint(r.left(), r.top() + 2), QPoint(r.left(), r.bottom() - 2)); + const QLine lines[4] = { + QLine(QPoint(r.left() + 2, r.bottom()), QPoint(r.right()- downRect.width() - 1, r.bottom())), + QLine(QPoint(r.left() + 2, r.top()), QPoint(r.right() - downRect.width() - 1, r.top())), + QLine(QPoint(r.right() - downRect.width() - 1, r.top() + 1), QPoint(r.right()- downRect.width() - 1, r.bottom() - 1)), + QLine(QPoint(r.left(), r.top() + 2), QPoint(r.left(), r.bottom() - 2)) + }; + cachePainter.drawLines(lines, 4); cachePainter.drawPoint(QPoint(r.left() + 1, r.bottom() - 1)); cachePainter.drawPoint(QPoint(r.left() + 1, r.top() + 1)); cachePainter.drawLine(QPoint(r.left(), r.top() + 2), QPoint(r.left(), r.bottom() - 2)); @@ -2679,18 +2739,24 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp // top outline painter->drawLine(fullRect.left() + 5, fullRect.top(), fullRect.right() - 5, fullRect.top()); painter->drawLine(fullRect.left(), fullRect.top() + 4, fullRect.left(), fullRect.bottom()); - painter->drawPoint(fullRect.left() + 4, fullRect.top() + 1); - painter->drawPoint(fullRect.left() + 3, fullRect.top() + 1); - painter->drawPoint(fullRect.left() + 2, fullRect.top() + 2); - painter->drawPoint(fullRect.left() + 1, fullRect.top() + 3); - painter->drawPoint(fullRect.left() + 1, fullRect.top() + 4); + const QPoint points[5] = { + QPoint(fullRect.left() + 4, fullRect.top() + 1), + QPoint(fullRect.left() + 3, fullRect.top() + 1), + QPoint(fullRect.left() + 2, fullRect.top() + 2), + QPoint(fullRect.left() + 1, fullRect.top() + 3), + QPoint(fullRect.left() + 1, fullRect.top() + 4) + }; + painter->drawPoints(points, 5); painter->drawLine(fullRect.right(), fullRect.top() + 4, fullRect.right(), fullRect.bottom()); - painter->drawPoint(fullRect.right() - 3, fullRect.top() + 1); - painter->drawPoint(fullRect.right() - 4, fullRect.top() + 1); - painter->drawPoint(fullRect.right() - 2, fullRect.top() + 2); - painter->drawPoint(fullRect.right() - 1, fullRect.top() + 3); - painter->drawPoint(fullRect.right() - 1, fullRect.top() + 4); + const QPoint points2[5] = { + QPoint(fullRect.right() - 3, fullRect.top() + 1), + QPoint(fullRect.right() - 4, fullRect.top() + 1), + QPoint(fullRect.right() - 2, fullRect.top() + 2), + QPoint(fullRect.right() - 1, fullRect.top() + 3), + QPoint(fullRect.right() - 1, fullRect.top() + 4) + }; + painter->drawPoints(points2, 5); // draw bottomline painter->drawLine(fullRect.right(), fullRect.bottom(), fullRect.left(), fullRect.bottom()); @@ -2749,10 +2815,13 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp painter->drawLine(maxButtonIconRect.left() + 1, maxButtonIconRect.top() + 1, maxButtonIconRect.right() - 1, maxButtonIconRect.top() + 1); painter->setPen(textAlphaColor); - painter->drawPoint(maxButtonIconRect.topLeft()); - painter->drawPoint(maxButtonIconRect.topRight()); - painter->drawPoint(maxButtonIconRect.bottomLeft()); - painter->drawPoint(maxButtonIconRect.bottomRight()); + const QPoint points[4] = { + maxButtonIconRect.topLeft(), + maxButtonIconRect.topRight(), + maxButtonIconRect.bottomLeft(), + maxButtonIconRect.bottomRight() + }; + painter->drawPoints(points, 4); } } @@ -2765,18 +2834,24 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp qt_cleanlooks_draw_mdibutton(painter, titleBar, closeButtonRect, hover, sunken); QRect closeIconRect = closeButtonRect.adjusted(buttonMargin, buttonMargin, -buttonMargin, -buttonMargin); painter->setPen(textAlphaColor); - painter->drawLine(closeIconRect.left() + 1, closeIconRect.top(), - closeIconRect.right(), closeIconRect.bottom() - 1); - painter->drawLine(closeIconRect.left(), closeIconRect.top() + 1, - closeIconRect.right() - 1, closeIconRect.bottom()); - painter->drawLine(closeIconRect.right() - 1, closeIconRect.top(), - closeIconRect.left(), closeIconRect.bottom() - 1); - painter->drawLine(closeIconRect.right(), closeIconRect.top() + 1, - closeIconRect.left() + 1, closeIconRect.bottom()); - painter->drawPoint(closeIconRect.topLeft()); - painter->drawPoint(closeIconRect.topRight()); - painter->drawPoint(closeIconRect.bottomLeft()); - painter->drawPoint(closeIconRect.bottomRight()); + const QLine lines[4] = { + QLine(closeIconRect.left() + 1, closeIconRect.top(), + closeIconRect.right(), closeIconRect.bottom() - 1), + QLine(closeIconRect.left(), closeIconRect.top() + 1, + closeIconRect.right() - 1, closeIconRect.bottom()), + QLine(closeIconRect.right() - 1, closeIconRect.top(), + closeIconRect.left(), closeIconRect.bottom() - 1), + QLine(closeIconRect.right(), closeIconRect.top() + 1, + closeIconRect.left() + 1, closeIconRect.bottom()) + }; + painter->drawLines(lines, 4); + const QPoint points[4] = { + closeIconRect.topLeft(), + closeIconRect.topRight(), + closeIconRect.bottomLeft(), + closeIconRect.bottomRight() + }; + painter->drawPoints(points, 4); painter->setPen(textColor); painter->drawLine(closeIconRect.left() + 1, closeIconRect.top() + 1, @@ -2806,10 +2881,13 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp painter->drawLine(frontWindowRect.left() + 1, frontWindowRect.top() + 1, frontWindowRect.right() - 1, frontWindowRect.top() + 1); painter->setPen(textAlphaColor); - painter->drawPoint(frontWindowRect.topLeft()); - painter->drawPoint(frontWindowRect.topRight()); - painter->drawPoint(frontWindowRect.bottomLeft()); - painter->drawPoint(frontWindowRect.bottomRight()); + const QPoint points[4] = { + frontWindowRect.topLeft(), + frontWindowRect.topRight(), + frontWindowRect.bottomLeft(), + frontWindowRect.bottomRight() + }; + painter->drawPoints(points, 4); QRect backWindowRect = normalButtonIconRect.adjusted(3, 0, 0, -3); QRegion clipRegion = backWindowRect; @@ -2821,10 +2899,13 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp painter->drawLine(backWindowRect.left() + 1, backWindowRect.top() + 1, backWindowRect.right() - 1, backWindowRect.top() + 1); painter->setPen(textAlphaColor); - painter->drawPoint(backWindowRect.topLeft()); - painter->drawPoint(backWindowRect.topRight()); - painter->drawPoint(backWindowRect.bottomLeft()); - painter->drawPoint(backWindowRect.bottomRight()); + const QPoint points2[4] = { + backWindowRect.topLeft(), + backWindowRect.topRight(), + backWindowRect.bottomLeft(), + backWindowRect.bottomRight() + }; + painter->drawPoints(points2, 4); painter->restore(); } } @@ -3498,10 +3579,13 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp handlePainter.save(); handlePainter.setRenderHint(QPainter::Antialiasing); handlePainter.translate(0.5, 0.5); - handlePainter.drawLine(QPoint(r.left(), r.bottom() - 2), QPoint(r.left() + 2, r.bottom())); - handlePainter.drawLine(QPoint(r.left(), r.top() + 2), QPoint(r.left() + 2, r.top())); - handlePainter.drawLine(QPoint(r.right(), r.bottom() - 2), QPoint(r.right() - 2, r.bottom())); - handlePainter.drawLine(QPoint(r.right(), r.top() + 2), QPoint(r.right() - 2, r.top())); + const QLine lines[4] = { + QLine(QPoint(r.left(), r.bottom() - 2), QPoint(r.left() + 2, r.bottom())), + QLine(QPoint(r.left(), r.top() + 2), QPoint(r.left() + 2, r.top())), + QLine(QPoint(r.right(), r.bottom() - 2), QPoint(r.right() - 2, r.bottom())), + QLine(QPoint(r.right(), r.top() + 2), QPoint(r.right() - 2, r.top())) + }; + handlePainter.drawLines(lines, 4); handlePainter.restore();; handlePainter.setPen(QPen(outline.darker(130), 1)); handlePainter.drawLine(QPoint(r.left() + 3, r.top()), QPoint(r.right() - 3, r.top())); -- cgit v0.12 From 150c14bc50d28d2e6c768ff00654f527cb226812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Tue, 1 Sep 2009 10:37:56 +0200 Subject: Fixed QPainterPath::toFillPolygons autotest Now it verifies that there are two non-intersecting polygons. Reviewed-by: Gunnar Sletta --- tests/auto/qpainterpath/tst_qpainterpath.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/auto/qpainterpath/tst_qpainterpath.cpp b/tests/auto/qpainterpath/tst_qpainterpath.cpp index 26c1f9b..9c4cbc4 100644 --- a/tests/auto/qpainterpath/tst_qpainterpath.cpp +++ b/tests/auto/qpainterpath/tst_qpainterpath.cpp @@ -1145,8 +1145,9 @@ void tst_QPainterPath::testToFillPolygons() path.lineTo(QPointF(70, 100)); path.lineTo(QPointF(40, 100)); - QPolygonF polygon = path.toFillPolygons(QMatrix()).first(); - QCOMPARE(polygon.count(QPointF(70, 50)), 2); + const QList polygons = path.toFillPolygons(); + QCOMPARE(polygons.size(), 2); + QCOMPARE(polygons.first().count(QPointF(70, 50)), 0); } void tst_QPainterPath::connectPathDuplicatePoint() -- cgit v0.12 From 9aa88cf3d15bf7ed6d3faf03ebe9fd574e1667ec Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Tue, 1 Sep 2009 11:55:30 +0200 Subject: Fix compile error for WinCE Do not use LockWindowUpdate() in Win CE Reviewed-by: Trust Me --- src/activeqt/container/qaxwidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/activeqt/container/qaxwidget.cpp b/src/activeqt/container/qaxwidget.cpp index 22e7a82..94f85a5 100644 --- a/src/activeqt/container/qaxwidget.cpp +++ b/src/activeqt/container/qaxwidget.cpp @@ -1437,7 +1437,9 @@ extern Q_GUI_EXPORT bool qt_win_ignoreNextMouseReleaseEvent; HRESULT WINAPI QAxClientSite::EnableModeless(BOOL fEnable) { +#if !defined(Q_OS_WINCE) LockWindowUpdate(host->window()->winId()); +#endif EnableWindow(host->window()->winId(), fEnable); if (!fEnable) { @@ -1448,8 +1450,9 @@ HRESULT WINAPI QAxClientSite::EnableModeless(BOOL fEnable) QApplicationPrivate::leaveModal(host); } qt_win_ignoreNextMouseReleaseEvent = false; +#if !defined(Q_OS_WINCE) LockWindowUpdate(0); - +#endif return S_OK; } -- cgit v0.12 From c78d75db9467af9f5638073f74bed437c24c3584 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 1 Sep 2009 09:59:17 +0200 Subject: QMargins doesn't need to be exported as it is fully inline Reviewed-by: ogoffart --- src/corelib/tools/qmargins.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qmargins.h b/src/corelib/tools/qmargins.h index 2691c62..549c634 100644 --- a/src/corelib/tools/qmargins.h +++ b/src/corelib/tools/qmargins.h @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Core) -class Q_CORE_EXPORT QMargins +class QMargins { public: QMargins(); -- cgit v0.12 From c15e07884a29be26f1110e4d54a56da0001e3c53 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 1 Sep 2009 10:06:38 +0200 Subject: dynamic_cast in the demo was failing to build without rtti Reviewed-by: Kim Motoyoshi Kalland --- demos/boxes/qtbox.cpp | 14 ++++++++++---- demos/boxes/qtbox.h | 6 ++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/demos/boxes/qtbox.cpp b/demos/boxes/qtbox.cpp index 015bc95..54882fb 100644 --- a/demos/boxes/qtbox.cpp +++ b/demos/boxes/qtbox.cpp @@ -122,7 +122,7 @@ void ItemBase::duplicateSelectedItems(QGraphicsScene *scene) selected = scene->selectedItems(); foreach (QGraphicsItem *item, selected) { - ItemBase *itemBase = dynamic_cast(item); + ItemBase *itemBase = qgraphicsitem_cast(item); if (itemBase) scene->addItem(itemBase->createNew(itemBase->m_size, itemBase->pos().x() + itemBase->m_size, itemBase->pos().y())); } @@ -137,7 +137,7 @@ void ItemBase::deleteSelectedItems(QGraphicsScene *scene) selected = scene->selectedItems(); foreach (QGraphicsItem *item, selected) { - ItemBase *itemBase = dynamic_cast(item); + ItemBase *itemBase = qgraphicsitem_cast(item); if (itemBase) delete itemBase; } @@ -152,7 +152,7 @@ void ItemBase::growSelectedItems(QGraphicsScene *scene) selected = scene->selectedItems(); foreach (QGraphicsItem *item, selected) { - ItemBase *itemBase = dynamic_cast(item); + ItemBase *itemBase = qgraphicsitem_cast(item); if (itemBase) { itemBase->prepareGeometryChange(); itemBase->m_size *= 2; @@ -171,7 +171,7 @@ void ItemBase::shrinkSelectedItems(QGraphicsScene *scene) selected = scene->selectedItems(); foreach (QGraphicsItem *item, selected) { - ItemBase *itemBase = dynamic_cast(item); + ItemBase *itemBase = qgraphicsitem_cast(item); if (itemBase) { itemBase->prepareGeometryChange(); itemBase->m_size /= 2; @@ -257,6 +257,12 @@ void ItemBase::wheelEvent(QGraphicsSceneWheelEvent *event) m_size = MIN_ITEM_SIZE; } +int ItemBase::type() const +{ + return Type; +} + + bool ItemBase::isInResizeArea(const QPointF &pos) { return (-pos.y() < pos.x() - m_size + 9); diff --git a/demos/boxes/qtbox.h b/demos/boxes/qtbox.h index 6f39b0d..9465911 100644 --- a/demos/boxes/qtbox.h +++ b/demos/boxes/qtbox.h @@ -47,10 +47,11 @@ #include #include "glbuffers.h" -class ItemBase : public QObject, public QGraphicsItem +class ItemBase : public QGraphicsItem { - Q_OBJECT public: + enum { Type = UserType + 1 }; + ItemBase(int size, int x, int y); virtual ~ItemBase(); virtual QRectF boundingRect() const; @@ -64,6 +65,7 @@ protected: virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); virtual void keyPressEvent(QKeyEvent *event); virtual void wheelEvent(QGraphicsSceneWheelEvent *event); + virtual int type() const; bool isInResizeArea(const QPointF &pos); static void duplicateSelectedItems(QGraphicsScene *scene); -- cgit v0.12 From c78c520bde91c08cedc6f7cc5c943998155f078e Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 1 Sep 2009 12:11:03 +0200 Subject: Fixed warnings (just 2 Q_Q() that are not used any more --- src/corelib/kernel/qabstractitemmodel.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp index 0a6c628..ec8fb76 100644 --- a/src/corelib/kernel/qabstractitemmodel.cpp +++ b/src/corelib/kernel/qabstractitemmodel.cpp @@ -601,7 +601,6 @@ void QAbstractItemModelPrivate::rowsInserted(const QModelIndex &parent, void QAbstractItemModelPrivate::itemsAboutToBeMoved(const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation) { - Q_Q(QAbstractItemModel); QVector persistent_moved_explicitly; QVector persistent_moved_in_source; QVector persistent_moved_in_destination; @@ -2469,7 +2468,6 @@ void QAbstractItemModel::endRemoveRows() */ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int start, int end, const QModelIndex &destinationParent, int destinationStart, Qt::Orientation orientation) { - Q_Q(QAbstractItemModel); // Don't move the range within itself. if ( ( destinationParent == srcParent ) && ( destinationStart >= start ) -- cgit v0.12 From fa97a0f683bf288356f6fed8c77a03fb6c363624 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 1 Sep 2009 20:41:23 +1000 Subject: Fix misformatted license headers. Reviewed-by: Trust Me --- examples/qws/dbscreen/dbscreen.cpp | 21 +++++++++------------ examples/qws/dbscreen/dbscreen.h | 21 +++++++++------------ examples/qws/dbscreen/dbscreendriverplugin.cpp | 23 ++++++++++------------- qmake/generators/unix/unixmake.cpp | 19 ++++++++----------- src/gui/kernel/qt_mac.cpp | 19 ++++++++----------- 5 files changed, 44 insertions(+), 59 deletions(-) diff --git a/examples/qws/dbscreen/dbscreen.cpp b/examples/qws/dbscreen/dbscreen.cpp index 81df21d..3d3b15b 100644 --- a/examples/qws/dbscreen/dbscreen.cpp +++ b/examples/qws/dbscreen/dbscreen.cpp @@ -1,11 +1,11 @@ - /**************************************************************************** - ** - ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) - ** - ** This file is part of the examples of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ +** +** This file is part of the examples 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 @@ -36,11 +36,8 @@ ** ** ** $QT_END_LICENSE$ - ** - ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - ** - ****************************************************************************/ +** +****************************************************************************/ #include "dbscreen.h" #include diff --git a/examples/qws/dbscreen/dbscreen.h b/examples/qws/dbscreen/dbscreen.h index a3c392e..b177cfc 100644 --- a/examples/qws/dbscreen/dbscreen.h +++ b/examples/qws/dbscreen/dbscreen.h @@ -1,11 +1,11 @@ - /**************************************************************************** - ** - ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) - ** - ** This file is part of the examples of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ +** +** This file is part of the examples 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 @@ -36,11 +36,8 @@ ** ** ** $QT_END_LICENSE$ - ** - ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - ** - ****************************************************************************/ +** +****************************************************************************/ #ifndef DBSCREEN_H #define DBSCREEN_H diff --git a/examples/qws/dbscreen/dbscreendriverplugin.cpp b/examples/qws/dbscreen/dbscreendriverplugin.cpp index c1cc03c..bc2434b 100644 --- a/examples/qws/dbscreen/dbscreendriverplugin.cpp +++ b/examples/qws/dbscreen/dbscreendriverplugin.cpp @@ -1,11 +1,11 @@ - /**************************************************************************** - ** - ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) - ** - ** This file is part of the examples of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ +** +** This file is part of the examples 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 @@ -36,12 +36,9 @@ ** ** ** $QT_END_LICENSE$ - ** - ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - ** - ****************************************************************************/ - +** +****************************************************************************/ + #include #include "dbscreen.h" diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 2e6397b..4d8883c 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -1,11 +1,11 @@ /**************************************************************************** - ** - ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) - ** - ** This file is part of the qmake application of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ +** +** This file is part of the qmake application 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 @@ -36,11 +36,8 @@ ** ** ** $QT_END_LICENSE$ - ** - ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - ** - ****************************************************************************/ +** +****************************************************************************/ #include "unixmake.h" #include "option.h" diff --git a/src/gui/kernel/qt_mac.cpp b/src/gui/kernel/qt_mac.cpp index 6b2bbcb..2b9d073 100644 --- a/src/gui/kernel/qt_mac.cpp +++ b/src/gui/kernel/qt_mac.cpp @@ -1,11 +1,11 @@ /**************************************************************************** - ** - ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) - ** - ** This file is part of the QtGui module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ +** +** This file is part of the QtGui module 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 @@ -36,11 +36,8 @@ ** ** ** $QT_END_LICENSE$ - ** - ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - ** - ****************************************************************************/ +** +****************************************************************************/ #include #include -- cgit v0.12 From 2a9ffbeda34c04bede04c1aac24eab13fc490fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Tue, 1 Sep 2009 09:03:43 +0200 Subject: Make sure graphics effects updates properly when changing their properties. Reviewed-by: Leo --- src/gui/effects/qgraphicseffect.cpp | 23 +++++++++++++++++++++++ src/gui/effects/qgraphicseffect.h | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index ccbf7fc..1e0ea53 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -349,6 +349,22 @@ void QGraphicsEffect::setEnabled(bool enable) */ /*! + Schedules a redraw of the source. Call this function whenever the source + needs to be redrawn. + + This convenience function is equivalent to calling + QGraphicsEffectSource::update(). + + \sa updateBoundingRect(), QGraphicsEffectSource::update() +*/ +void QGraphicsEffect::update() +{ + Q_D(QGraphicsEffect); + if (d->source) + d->source->update(); +} + +/*! Returns a pointer to the source, which provides extra context information that can be useful for the effect. @@ -366,6 +382,8 @@ QGraphicsEffectSource *QGraphicsEffect::source() const function whenever you change any parameters that will cause the virtual boundingRectFor() function to return a different value. + This function will call update() if this is necessary. + \sa boundingRectFor(), boundingRect() */ void QGraphicsEffect::updateBoundingRect() @@ -523,6 +541,7 @@ void QGraphicsColorizeEffect::setColor(const QColor &color) return; d->filter->setColor(color); + update(); emit colorChanged(color); } @@ -610,6 +629,7 @@ void QGraphicsPixelizeEffect::setPixelSize(int size) return; d->pixelSize = size; + update(); emit pixelSizeChanged(size); } @@ -903,6 +923,7 @@ void QGraphicsDropShadowEffect::setColor(const QColor &color) return; d->filter->setColor(color); + update(); emit colorChanged(color); } @@ -1012,6 +1033,7 @@ void QGraphicsOpacityEffect::setOpacity(qreal opacity) d->isFullyOpaque = 0; else d->isFullyOpaque = qFuzzyIsNull(d->opacity - 1); + update(); emit opacityChanged(opacity); } @@ -1050,6 +1072,7 @@ void QGraphicsOpacityEffect::setOpacityMask(const QBrush &mask) d->opacityMask = mask; d->hasOpacityMask = (mask.style() != Qt::NoBrush); + update(); emit opacityMaskChanged(mask); } diff --git a/src/gui/effects/qgraphicseffect.h b/src/gui/effects/qgraphicseffect.h index 8e5384c..ad941a5 100644 --- a/src/gui/effects/qgraphicseffect.h +++ b/src/gui/effects/qgraphicseffect.h @@ -118,7 +118,7 @@ public: public Q_SLOTS: void setEnabled(bool enable); - // ### add update() slot + void update(); Q_SIGNALS: void enabledChanged(bool enabled); -- cgit v0.12 From cc6e8f466111dc04395041cdabb73a831ae802c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Tue, 1 Sep 2009 10:39:49 +0200 Subject: QGraphicsDropShadowEffect convenience; setXOffset() and setYOffset(). Reviewed-by: Andreas --- src/gui/effects/qgraphicseffect.cpp | 20 +++++++++++++++++++- src/gui/effects/qgraphicseffect.h | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index 1e0ea53..2be6a49 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -840,7 +840,7 @@ QGraphicsDropShadowEffect::~QGraphicsDropShadowEffect() By default, the offset is 8 pixels towards the lower right. - \sa blurRadius(), color() + \sa xOffset(), yOffset(), blurRadius(), color() */ QPointF QGraphicsDropShadowEffect::offset() const { @@ -860,6 +860,24 @@ void QGraphicsDropShadowEffect::setOffset(const QPointF &offset) } /*! + \property QGraphicsDropShadowEffect::xOffset + \brief the horizontal shadow offset in pixels. + + By default, the horizontal shadow offset is 8 pixels. + + \sa yOffset(), offset() +*/ + +/*! + \property QGraphicsDropShadowEffect::yOffset + \brief the vertical shadow offset in pixels. + + By default, the vertical shadow offset is 8 pixels. + + \sa xOffset(), offset() +*/ + +/*! \fn void QGraphicsDropShadowEffect::offsetChanged(const QPointF &offset) This signal is emitted whenever the effect's shadow offset changes. diff --git a/src/gui/effects/qgraphicseffect.h b/src/gui/effects/qgraphicseffect.h index ad941a5..aee7834 100644 --- a/src/gui/effects/qgraphicseffect.h +++ b/src/gui/effects/qgraphicseffect.h @@ -237,6 +237,8 @@ class Q_GUI_EXPORT QGraphicsDropShadowEffect: public QGraphicsEffect { Q_OBJECT Q_PROPERTY(QPointF offset READ offset WRITE setOffset NOTIFY offsetChanged) + Q_PROPERTY(qreal xOffset READ xOffset WRITE setXOffset NOTIFY offsetChanged) + Q_PROPERTY(qreal yOffset READ yOffset WRITE setYOffset NOTIFY offsetChanged) Q_PROPERTY(int blurRadius READ blurRadius WRITE setBlurRadius NOTIFY blurRadiusChanged) Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) public: @@ -245,15 +247,31 @@ public: QRectF boundingRectFor(const QRectF &rect) const; QPointF offset() const; + + inline qreal xOffset() const + { return offset().x(); } + + inline qreal yOffset() const + { return offset().y(); } + int blurRadius() const; QColor color() const; public Q_SLOTS: void setOffset(const QPointF &ofs); + inline void setOffset(qreal dx, qreal dy) { setOffset(QPointF(dx, dy)); } + inline void setOffset(qreal d) { setOffset(QPointF(d, d)); } + + inline void setXOffset(qreal dx) + { setOffset(QPointF(dx, yOffset())); } + + inline void setYOffset(qreal dy) + { setOffset(QPointF(xOffset(), dy)); } + void setBlurRadius(int blurRadius); void setColor(const QColor &color); -- cgit v0.12 From d3cf11841763ab222ae0ca62468e83a695116514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Tue, 1 Sep 2009 11:50:14 +0200 Subject: Add a benchmark for QGraphicsAnchorLayout. --- .../qgraphicsanchorlayout.pro | 6 + .../tst_qgraphicsanchorlayout.cpp | 197 +++++++++++++++++++++ 2 files changed, 203 insertions(+) create mode 100644 tests/benchmarks/qgraphicsanchorlayout/qgraphicsanchorlayout.pro create mode 100644 tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp diff --git a/tests/benchmarks/qgraphicsanchorlayout/qgraphicsanchorlayout.pro b/tests/benchmarks/qgraphicsanchorlayout/qgraphicsanchorlayout.pro new file mode 100644 index 0000000..0d563b9 --- /dev/null +++ b/tests/benchmarks/qgraphicsanchorlayout/qgraphicsanchorlayout.pro @@ -0,0 +1,6 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = tst_qgraphicsanchorlayout + +SOURCES += tst_qgraphicsanchorlayout.cpp + diff --git a/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp new file mode 100644 index 0000000..e419bae --- /dev/null +++ b/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp @@ -0,0 +1,197 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtOpenGL module 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 http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include + +class tst_QGraphicsAnchorLayout : public QObject +{ + Q_OBJECT +public: + tst_QGraphicsAnchorLayout() {} + ~tst_QGraphicsAnchorLayout() {} + +private slots: + void s60_hard_complex_data(); + void s60_hard_complex(); +}; + + +class RectWidget : public QGraphicsWidget +{ +public: + RectWidget(QGraphicsItem *parent = 0) : QGraphicsWidget(parent){} + + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) + { + Q_UNUSED(option); + Q_UNUSED(widget); + painter->drawRoundRect(rect()); + painter->drawLine(rect().topLeft(), rect().bottomRight()); + painter->drawLine(rect().bottomLeft(), rect().topRight()); + } +}; + +static QGraphicsWidget *createItem(const QSizeF &minimum = QSizeF(100.0, 100.0), + const QSizeF &preferred = QSize(150.0, 100.0), + const QSizeF &maximum = QSizeF(200.0, 100.0), + const QString &name = QString()) +{ + QGraphicsWidget *w = new RectWidget; + w->setMinimumSize(minimum); + w->setPreferredSize(preferred); + w->setMaximumSize(maximum); + w->setData(0, name); + return w; +} + +static void setAnchor(QGraphicsAnchorLayout *l, + QGraphicsLayoutItem *firstItem, + Qt::AnchorPoint firstEdge, + QGraphicsLayoutItem *secondItem, + Qt::AnchorPoint secondEdge, + qreal spacing) +{ + l->addAnchor(firstItem, firstEdge, secondItem, secondEdge); + l->setAnchorSpacing(firstItem, firstEdge, secondItem, secondEdge, spacing); +} + +void tst_QGraphicsAnchorLayout::s60_hard_complex_data() +{ + QTest::addColumn("whichSizeHint"); + QTest::newRow("minimumSizeHint") + << int(Qt::MinimumSize); + QTest::newRow("preferredSizeHint") + << int(Qt::PreferredSize); + QTest::newRow("maximumSizeHint") + << int(Qt::MaximumSize); + // Add it as a reference to see how much overhead the body of effectiveSizeHint takes. + QTest::newRow("noSizeHint") + << -1; +} + +void tst_QGraphicsAnchorLayout::s60_hard_complex() +{ + QFETCH(int, whichSizeHint); + + // Test for "hard" complex case, taken from wiki + // https://cwiki.nokia.com/S60QTUI/AnchorLayoutComplexCases + QSizeF min(0, 10); + QSizeF pref(50, 10); + QSizeF max(100, 10); + + QGraphicsWidget *a = createItem(min, pref, max, "a"); + QGraphicsWidget *b = createItem(min, pref, max, "b"); + QGraphicsWidget *c = createItem(min, pref, max, "c"); + QGraphicsWidget *d = createItem(min, pref, max, "d"); + QGraphicsWidget *e = createItem(min, pref, max, "e"); + QGraphicsWidget *f = createItem(min, pref, max, "f"); + QGraphicsWidget *g = createItem(min, pref, max, "g"); + + QGraphicsAnchorLayout *l = new QGraphicsAnchorLayout; + l->setContentsMargins(0, 0, 0, 0); + + // + setAnchor(l, l, Qt::AnchorLeft, a, Qt::AnchorLeft, 10); + setAnchor(l, a, Qt::AnchorRight, b, Qt::AnchorLeft, 10); + setAnchor(l, b, Qt::AnchorRight, c, Qt::AnchorLeft, 10); + setAnchor(l, c, Qt::AnchorRight, d, Qt::AnchorLeft, 10); + setAnchor(l, d, Qt::AnchorRight, l, Qt::AnchorRight, 10); + + // + setAnchor(l, b, Qt::AnchorLeft, e, Qt::AnchorLeft, 10); + setAnchor(l, e, Qt::AnchorRight, d, Qt::AnchorLeft, 10); + + // + setAnchor(l, a, Qt::AnchorHorizontalCenter, g, Qt::AnchorLeft, 10); + setAnchor(l, g, Qt::AnchorRight, f, Qt::AnchorHorizontalCenter, 10); + setAnchor(l, c, Qt::AnchorLeft, f, Qt::AnchorLeft, 10); + setAnchor(l, f, Qt::AnchorRight, d, Qt::AnchorRight, 10); + + // + setAnchor(l, l, Qt::AnchorTop, e, Qt::AnchorTop, 0); + setAnchor(l, e, Qt::AnchorBottom, a, Qt::AnchorTop, 0); + setAnchor(l, e, Qt::AnchorBottom, b, Qt::AnchorTop, 0); + setAnchor(l, e, Qt::AnchorBottom, c, Qt::AnchorTop, 0); + setAnchor(l, e, Qt::AnchorBottom, d, Qt::AnchorTop, 0); + setAnchor(l, a, Qt::AnchorBottom, f, Qt::AnchorTop, 0); + setAnchor(l, a, Qt::AnchorBottom, b, Qt::AnchorBottom, 0); + setAnchor(l, a, Qt::AnchorBottom, c, Qt::AnchorBottom, 0); + setAnchor(l, a, Qt::AnchorBottom, d, Qt::AnchorBottom, 0); + setAnchor(l, f, Qt::AnchorBottom, g, Qt::AnchorTop, 0); + setAnchor(l, g, Qt::AnchorBottom, l, Qt::AnchorBottom, 0); + + // It won't query the size hint if it already has a size set. + // If only one of the sizes is unset it will query sizeHint only of for that hint type. + l->setMinimumSize(60,40); + l->setPreferredSize(220,40); + l->setMaximumSize(240,40); + + switch (whichSizeHint) { + case Qt::MinimumSize: + l->setMinimumSize(-1, -1); + break; + case Qt::PreferredSize: + l->setPreferredSize(-1, -1); + break; + case Qt::MaximumSize: + l->setMaximumSize(-1, -1); + break; + default: + break; + } + + QSizeF sizeHint; + // warm up instruction cache + l->invalidate(); + sizeHint = l->effectiveSizeHint((Qt::SizeHint)whichSizeHint); + // ...then measure... + QBENCHMARK { + l->invalidate(); + sizeHint = l->effectiveSizeHint((Qt::SizeHint)whichSizeHint); + } +} + +QTEST_MAIN(tst_QGraphicsAnchorLayout) + +#include "tst_qgraphicsanchorlayout.moc" -- cgit v0.12 From 4f19cd391aa32b12b9f749af06ebe6836cd0cbae Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Tue, 1 Sep 2009 13:31:10 +0200 Subject: Doc: Said what happens when setFocus() is called on a widget in an inactive window. Task-number: 78707 Reviewed-by: Morten Engvoldsen --- src/gui/kernel/qwidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 37ffa8fb..863c43e 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -5962,6 +5962,8 @@ bool QWidget::hasFocus() const isActiveWindow() active window\endlink. The \a reason argument will be passed into any focus event sent from this function, it is used to give an explanation of what caused the widget to get focus. + If the window is not active, the widget will be given the focus when + the window becomes active. First, a focus out event is sent to the focus widget (if any) to tell it that it is about to lose the focus. Then a focus in event -- cgit v0.12 From 7b6152ad6ac588350b8acf4353fb05628e86af2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Tue, 1 Sep 2009 13:53:52 +0200 Subject: Compilation fixes for Windows CE on ARM My earlier cleanup/refactoring of qatomic_windows.h broke things on this platform. Should be fixed now. Reviewed-by: Joerg Bornemann --- src/corelib/arch/qatomic_windows.h | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/corelib/arch/qatomic_windows.h b/src/corelib/arch/qatomic_windows.h index 50dedc1..a09e9fd 100644 --- a/src/corelib/arch/qatomic_windows.h +++ b/src/corelib/arch/qatomic_windows.h @@ -68,7 +68,7 @@ # if _WIN32_WCE < 0x600 && defined(_X86_) // For X86 Windows CE, include winbase.h to catch inline functions which -// overwrite the regular definitions inside of coredll.dll. +// override the regular definitions inside of coredll.dll. // Though one could use the original version of Increment/Decrement, others are // not exported at all. # include @@ -76,19 +76,21 @@ // It's safer to remove the volatile and let the compiler add it as needed. # define QT_INTERLOCKED_NO_VOLATILE -# else // _WIN32_WCE >= 0x600 || _X86_ +# else // _WIN32_WCE >= 0x600 || !_X86_ # define QT_INTERLOCKED_PROTOTYPE __cdecl # define QT_INTERLOCKED_DECLARE_PROTOTYPES -# if _WIN32_WCE >= 0x600 && defined(_X86_) -# define QT_INTERLOCKED_PREFIX _ -# define QT_INTERLOCKED_INTRINSIC +# if _WIN32_WCE >= 0x600 +# if defined(_X86_) +# define QT_INTERLOCKED_PREFIX _ +# define QT_INTERLOCKED_INTRINSIC +# endif # else # define QT_INTERLOCKED_NO_VOLATILE # endif -# endif // _WIN32_WCE >= 0x600 || _X86_ +# endif // _WIN32_WCE >= 0x600 || !_X86_ #endif // Q_OS_WINCE @@ -132,9 +134,9 @@ extern "C" { long QT_INTERLOCKED_PROTOTYPE QT_INTERLOCKED_FUNCTION( InterlockedExchangeAdd )(long QT_INTERLOCKED_VOLATILE *, long); # if !defined(__i386__) && !defined(_M_IX86) - long QT_INTERLOCKED_FUNCTION( InterlockedCompareExchangePointer )(void * QT_INTERLOCKED_VOLATILE *, void *, void *); - long QT_INTERLOCKED_FUNCTION( InterlockedExchangePointer )(void * QT_INTERLOCKED_VOLATILE *, void *); - __int64 QT_INTERLOCKED_FUNCTION( InterlockedExchangeAdd64 )(__int64 QT_INTERLOCKED_VOLATILE *, long); + void * QT_INTERLOCKED_FUNCTION( InterlockedCompareExchangePointer )(void * QT_INTERLOCKED_VOLATILE *, void *, void *); + void * QT_INTERLOCKED_FUNCTION( InterlockedExchangePointer )(void * QT_INTERLOCKED_VOLATILE *, void *); + __int64 QT_INTERLOCKED_FUNCTION( InterlockedExchangeAdd64 )(__int64 QT_INTERLOCKED_VOLATILE *, __int64); # endif } @@ -190,7 +192,7 @@ extern "C" { QT_INTERLOCKED_REMOVE_VOLATILE( value ), \ valueToAdd ) -#if defined(__i386__) || defined(_M_IX86) +#if defined(Q_OS_WINCE) || defined(__i386__) || defined(_M_IX86) # define QT_INTERLOCKED_COMPARE_EXCHANGE_POINTER(value, newValue, expectedValue) \ reinterpret_cast( \ @@ -209,7 +211,7 @@ extern "C" { QT_INTERLOCKED_REMOVE_VOLATILE( value ## _integral ), \ valueToAdd ) -#else // !defined(__i386__) && !defined(_M_IX86) +#else // !defined(Q_OS_WINCE) && !defined(__i386__) && !defined(_M_IX86) # define QT_INTERLOCKED_COMPARE_EXCHANGE_POINTER(value, newValue, expectedValue) \ QT_INTERLOCKED_FUNCTION(InterlockedCompareExchangePointer)( \ @@ -227,7 +229,7 @@ extern "C" { QT_INTERLOCKED_REMOVE_VOLATILE( value ## _integral ), \ valueToAdd ) -#endif // !defined(__i386__) && !defined(_M_IX86) +#endif // !defined(Q_OS_WINCE) && !defined(__i386__) && !defined(_M_IX86) //////////////////////////////////////////////////////////////////////////////////////////////////// -- cgit v0.12 From d0b4bd21d5fc04febdfdb41111435d79750e5ff6 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 1 Sep 2009 14:14:18 +0200 Subject: Manual test for QNAM HTTP: Downloading a big file --- tests/manual/qhttpnetworkconnection/main.cpp | 81 ++++++++++++++++++++++ .../qhttpnetworkconnection.pro | 13 ++++ 2 files changed, 94 insertions(+) create mode 100644 tests/manual/qhttpnetworkconnection/main.cpp create mode 100644 tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro diff --git a/tests/manual/qhttpnetworkconnection/main.cpp b/tests/manual/qhttpnetworkconnection/main.cpp new file mode 100644 index 0000000..b15a7ed --- /dev/null +++ b/tests/manual/qhttpnetworkconnection/main.cpp @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +// This file contains benchmarks for QNetworkReply functions. + +#include +#include +#include +#include +#include +#include +#include "../../auto/network-settings.h" + +class tst_qhttpnetworkconnection : public QObject +{ + Q_OBJECT +private slots: + void bigRemoteFile(); + +}; + +void tst_qhttpnetworkconnection::bigRemoteFile() +{ + QNetworkAccessManager manager; + qint64 size; + QTime t; + QNetworkRequest request(QUrl("http://nds1.nokia.com/files/support/global/phones/software/Nokia_Ovi_Suite_webinstaller.exe")); + QNetworkReply* reply = manager.get(request); + connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection); + qDebug() << "Starting download"; + t.start(); + QTestEventLoop::instance().enterLoop(50); + QVERIFY(!QTestEventLoop::instance().timeout()); + size = reply->size(); + delete reply; + qDebug() << "Finished!" << endl; + qDebug() << "Time:" << t.elapsed() << "msec"; + qDebug() << "Bytes:" << size; + qDebug() << "Speed:" << (size / 1024) / (t.elapsed() / 1000) << "KB/sec"; +} + +QTEST_MAIN(tst_qhttpnetworkconnection) + +#include "main.moc" diff --git a/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro b/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro new file mode 100644 index 0000000..2471389 --- /dev/null +++ b/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro @@ -0,0 +1,13 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = tst_qhttpnetworkconnection +DEPENDPATH += . +INCLUDEPATH += . + +QT -= gui +QT += network + +CONFIG += release + +# Input +SOURCES += main.cpp -- cgit v0.12 From ae2f5c66d16fab9f92f960435057d955e9a832ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 1 Sep 2009 14:09:29 +0200 Subject: Fixed QGLFramebufferObject::toImage() releasing the FBO if bound. Reviewed-by: Trond --- src/opengl/qglframebufferobject.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 9659654..859afc7 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -875,9 +875,12 @@ QImage QGLFramebufferObject::toImage() const if (!d->valid) return QImage(); - const_cast(this)->bind(); + bool wasBound = isBound(); + if (!wasBound) + const_cast(this)->bind(); QImage image = qt_gl_read_framebuffer(d->size, d->ctx->format().alpha(), true); - const_cast(this)->release(); + if (!wasBound) + const_cast(this)->release(); return image; } -- cgit v0.12 From e0e0ae322e654b0b152fc54d99201b18b620a0ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 1 Sep 2009 14:16:08 +0200 Subject: Fixed toImage() not working on a multisample QGLFramebufferObject. Need to blit into a regular QGLFramebufferObject first to force a multisample resolve. Reviewed-by: Trond --- src/opengl/qglframebufferobject.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 859afc7..8fd113a 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -875,6 +875,16 @@ QImage QGLFramebufferObject::toImage() const if (!d->valid) return QImage(); + // qt_gl_read_framebuffer doesn't work on a multisample FBO + if (format().samples() != 0) { + QGLFramebufferObject temp(size()); + + QRect rect(QPoint(0, 0), size()); + blitFramebuffer(&temp, rect, const_cast(this), rect); + + return temp.toImage(); + } + bool wasBound = isBound(); if (!wasBound) const_cast(this)->bind(); -- cgit v0.12 From a7178d96d7e9c50a4392ab9ee23b219d26028ed3 Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Wed, 22 Jul 2009 12:55:25 +0200 Subject: Fixes the gif plugin's rendering for some animated gif files. In the case of optimized animated gifs, we don't want to discard the contents of the previous frame, this is handled if needed in the disposal process. Task-number: 247365 Reviewed-by: Samuel --- src/plugins/imageformats/gif/qgifhandler.cpp | 4 ++-- tests/auto/qimagereader/images/qt.gif | Bin 0 -> 26504 bytes tests/auto/qimagereader/images/qt1.gif | Bin 0 -> 7216 bytes tests/auto/qimagereader/images/qt2.gif | Bin 0 -> 5559 bytes tests/auto/qimagereader/images/qt3.gif | Bin 0 -> 4702 bytes tests/auto/qimagereader/images/qt4.gif | Bin 0 -> 4310 bytes tests/auto/qimagereader/images/qt5.gif | Bin 0 -> 4234 bytes tests/auto/qimagereader/images/qt6.gif | Bin 0 -> 4732 bytes tests/auto/qimagereader/images/qt7.gif | Bin 0 -> 5265 bytes tests/auto/qimagereader/images/qt8.gif | Bin 0 -> 6144 bytes tests/auto/qimagereader/qimagereader.qrc | 13 +++++++++++-- tests/auto/qimagereader/tst_qimagereader.cpp | 13 +++++++++++++ 12 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 tests/auto/qimagereader/images/qt.gif create mode 100644 tests/auto/qimagereader/images/qt1.gif create mode 100644 tests/auto/qimagereader/images/qt2.gif create mode 100644 tests/auto/qimagereader/images/qt3.gif create mode 100644 tests/auto/qimagereader/images/qt4.gif create mode 100644 tests/auto/qimagereader/images/qt5.gif create mode 100644 tests/auto/qimagereader/images/qt6.gif create mode 100644 tests/auto/qimagereader/images/qt7.gif create mode 100644 tests/auto/qimagereader/images/qt8.gif diff --git a/src/plugins/imageformats/gif/qgifhandler.cpp b/src/plugins/imageformats/gif/qgifhandler.cpp index de985d8..0f6a349 100644 --- a/src/plugins/imageformats/gif/qgifhandler.cpp +++ b/src/plugins/imageformats/gif/qgifhandler.cpp @@ -234,7 +234,7 @@ int QGIFFormat::decode(QImage *image, const uchar *buffer, int length, #define LM(l, m) (((m)<<8)|l) digress = false; - int initial = length; + const int initial = length; while (!digress && length) { length--; unsigned char ch=*buffer++; @@ -333,7 +333,7 @@ int QGIFFormat::decode(QImage *image, const uchar *buffer, int length, sheight = newtop + newheight; QImage::Format format = trans_index >= 0 ? QImage::Format_ARGB32 : QImage::Format_RGB32; - if (image->isNull() || (image->size() != QSize(swidth, sheight)) || image->format() != format) { + if (image->isNull()) { (*image) = QImage(swidth, sheight, format); memset(image->bits(), 0, image->numBytes()); diff --git a/tests/auto/qimagereader/images/qt.gif b/tests/auto/qimagereader/images/qt.gif new file mode 100644 index 0000000..e0a5a80 Binary files /dev/null and b/tests/auto/qimagereader/images/qt.gif differ diff --git a/tests/auto/qimagereader/images/qt1.gif b/tests/auto/qimagereader/images/qt1.gif new file mode 100644 index 0000000..0ce910c Binary files /dev/null and b/tests/auto/qimagereader/images/qt1.gif differ diff --git a/tests/auto/qimagereader/images/qt2.gif b/tests/auto/qimagereader/images/qt2.gif new file mode 100644 index 0000000..993a315 Binary files /dev/null and b/tests/auto/qimagereader/images/qt2.gif differ diff --git a/tests/auto/qimagereader/images/qt3.gif b/tests/auto/qimagereader/images/qt3.gif new file mode 100644 index 0000000..7391678 Binary files /dev/null and b/tests/auto/qimagereader/images/qt3.gif differ diff --git a/tests/auto/qimagereader/images/qt4.gif b/tests/auto/qimagereader/images/qt4.gif new file mode 100644 index 0000000..41109a9 Binary files /dev/null and b/tests/auto/qimagereader/images/qt4.gif differ diff --git a/tests/auto/qimagereader/images/qt5.gif b/tests/auto/qimagereader/images/qt5.gif new file mode 100644 index 0000000..5a3fb54 Binary files /dev/null and b/tests/auto/qimagereader/images/qt5.gif differ diff --git a/tests/auto/qimagereader/images/qt6.gif b/tests/auto/qimagereader/images/qt6.gif new file mode 100644 index 0000000..f22e7c9 Binary files /dev/null and b/tests/auto/qimagereader/images/qt6.gif differ diff --git a/tests/auto/qimagereader/images/qt7.gif b/tests/auto/qimagereader/images/qt7.gif new file mode 100644 index 0000000..a315671 Binary files /dev/null and b/tests/auto/qimagereader/images/qt7.gif differ diff --git a/tests/auto/qimagereader/images/qt8.gif b/tests/auto/qimagereader/images/qt8.gif new file mode 100644 index 0000000..2a7d09e Binary files /dev/null and b/tests/auto/qimagereader/images/qt8.gif differ diff --git a/tests/auto/qimagereader/qimagereader.qrc b/tests/auto/qimagereader/qimagereader.qrc index c6b963b..11b9406 100644 --- a/tests/auto/qimagereader/qimagereader.qrc +++ b/tests/auto/qimagereader/qimagereader.qrc @@ -1,5 +1,5 @@ - - + + images/16bpp.bmp images/4bpp-rle.bmp images/YCbCr_cmyk.jpg @@ -48,5 +48,14 @@ images/tst7.png images/transparent.xpm images/trolltech.gif + images/qt.gif + images/qt1.gif + images/qt2.gif + images/qt3.gif + images/qt4.gif + images/qt5.gif + images/qt6.gif + images/qt7.gif + images/qt8.gif diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp index 27c6925..a325a33 100644 --- a/tests/auto/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/qimagereader/tst_qimagereader.cpp @@ -140,6 +140,7 @@ private slots: #if defined QTEST_HAVE_GIF void gifHandlerBugs(); + void animatedGif(); #endif void readCorruptImage_data(); @@ -710,6 +711,18 @@ void tst_QImageReader::gifHandlerBugs() QCOMPARE(im1.convertToFormat(QImage::Format_ARGB32), im2.convertToFormat(QImage::Format_ARGB32)); } } + +void tst_QImageReader::animatedGif() +{ + QImageReader io(prefix + "qt.gif"); + QImage image= io.read(); + int i=0; + while(!image.isNull()){ + QString frameName = QString(prefix + "qt%1.gif").arg(++i); + QCOMPARE(image, QImage(frameName)); + image=io.read(); + } +} #endif class Server : public QObject -- cgit v0.12 From 505458d4e2d094eba7cf34a71c6cd960c28a52e4 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 1 Sep 2009 15:26:07 +0200 Subject: Doc: Fixed broken links to renamed functions. Reviewed-by: Trust Me --- src/gui/widgets/qcalendarwidget.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/widgets/qcalendarwidget.cpp b/src/gui/widgets/qcalendarwidget.cpp index dfd8639..8ed57cd 100644 --- a/src/gui/widgets/qcalendarwidget.cpp +++ b/src/gui/widgets/qcalendarwidget.cpp @@ -1967,9 +1967,7 @@ void QCalendarWidgetPrivate::_q_editingFinished() The widget is initialized with the current month and year, but QCalendarWidget provides several public slots to change the year - and month that is shown. The currently displayed month and year - can be retrieved using the currentPageMonth() and currentPageYear() - functions, respectively. + and month that is shown. By default, today's date is selected, and the user can select a date using both mouse and keyboard. The currently selected date @@ -1982,6 +1980,9 @@ void QCalendarWidgetPrivate::_q_editingFinished() all. Note that a date also can be selected programmatically using the setSelectedDate() slot. + The currently displayed month and year can be retrieved using the + monthShown() and yearShown() functions, respectively. + A newly created calendar widget uses abbreviated day names, and both Saturdays and Sundays are marked in red. The calendar grid is not visible. The week numbers are displayed, and the first column @@ -2287,7 +2288,7 @@ int QCalendarWidget::monthShown() const selected date. The currently displayed month and year can be retrieved using the - currentPageMonth() and currentPageYear() functions respectively. + monthShown() and yearShown() functions respectively. \sa yearShown(), monthShown(), showPreviousMonth(), showNextMonth(), showPreviousYear(), showNextYear() -- cgit v0.12 From d117525a4ff8757208231fa77f171c7fd7a30ef9 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 1 Sep 2009 15:27:35 +0200 Subject: fix Windows CE compile failure in qatomic_windows.h Reviewed-by: joao --- src/corelib/arch/qatomic_windows.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/arch/qatomic_windows.h b/src/corelib/arch/qatomic_windows.h index a09e9fd..9b7ff5d 100644 --- a/src/corelib/arch/qatomic_windows.h +++ b/src/corelib/arch/qatomic_windows.h @@ -133,7 +133,7 @@ extern "C" { long QT_INTERLOCKED_PROTOTYPE QT_INTERLOCKED_FUNCTION( InterlockedExchange )(long QT_INTERLOCKED_VOLATILE *, long); long QT_INTERLOCKED_PROTOTYPE QT_INTERLOCKED_FUNCTION( InterlockedExchangeAdd )(long QT_INTERLOCKED_VOLATILE *, long); -# if !defined(__i386__) && !defined(_M_IX86) +# if !defined(Q_OS_WINCE) && !defined(__i386__) && !defined(_M_IX86) void * QT_INTERLOCKED_FUNCTION( InterlockedCompareExchangePointer )(void * QT_INTERLOCKED_VOLATILE *, void *, void *); void * QT_INTERLOCKED_FUNCTION( InterlockedExchangePointer )(void * QT_INTERLOCKED_VOLATILE *, void *); __int64 QT_INTERLOCKED_FUNCTION( InterlockedExchangeAdd64 )(__int64 QT_INTERLOCKED_VOLATILE *, __int64); -- cgit v0.12 From 8abc68d262c40c1f035a2d77779e76f038261a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Tue, 1 Sep 2009 15:22:21 +0200 Subject: Make sure the BSP is updated when a graphics effect changes bounding rect. In the case of applying an effect to a QGraphicsItem, we have to notify the scene's BSP that the item's bounding rect has changed. We do this by calling prepareGeometryChange(). In the case of QWidget, it's sub-optimal that we update its parent, but there's no other way to solve it at the moment. --- src/gui/effects/qgraphicseffect.cpp | 4 ++-- src/gui/effects/qgraphicseffect_p.h | 1 + src/gui/graphicsview/qgraphicsitem_p.h | 3 +++ src/gui/kernel/qwidget_p.h | 10 ++++++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index 2be6a49..6624cfb 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -335,7 +335,7 @@ void QGraphicsEffect::setEnabled(bool enable) d->isEnabled = enable; if (d->source) - d->source->update(); + d->source->d_func()->effectBoundingRectChanged(); emit enabledChanged(enable); } @@ -390,7 +390,7 @@ void QGraphicsEffect::updateBoundingRect() { Q_D(QGraphicsEffect); if (d->source) - d->source->update(); + d->source->d_func()->effectBoundingRectChanged(); } /*! diff --git a/src/gui/effects/qgraphicseffect_p.h b/src/gui/effects/qgraphicseffect_p.h index bfabfc0..24b605f 100644 --- a/src/gui/effects/qgraphicseffect_p.h +++ b/src/gui/effects/qgraphicseffect_p.h @@ -76,6 +76,7 @@ public: virtual void update() = 0; virtual bool isPixmap() const = 0; virtual QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset = 0) const = 0; + virtual void effectBoundingRectChanged() = 0; friend class QGraphicsScenePrivate; friend class QGraphicsItem; friend class QGraphicsItemPrivate; diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index 1090620..49361cf 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -572,6 +572,9 @@ public: inline void update() { item->update(); } + inline void effectBoundingRectChanged() + { item->prepareGeometryChange(); } + inline bool isPixmap() const { return (item->type() == QGraphicsPixmapItem::Type); diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index ff0c453..f69c3a7 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -727,6 +727,16 @@ public: inline bool isPixmap() const { return false; } + inline void effectBoundingRectChanged() + { + // ### This function should take a rect parameter; then we can avoid + // updating too much on the parent widget. + if (QWidget *parent = m_widget->parentWidget()) + parent->update(); + else + m_widget->update(); + } + inline const QStyleOption *styleOption() const { return 0; } -- cgit v0.12 From 6b779a021a9c3d334127a4c460ad7f780a97ddb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Tue, 1 Sep 2009 15:52:27 +0200 Subject: Fix rounding bug in QGraphicsOpacityEffect. The pixmap was painted at wrong offset. --- src/gui/effects/qgraphicseffect.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index 6624cfb..f60e80e 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -1129,19 +1129,20 @@ void QGraphicsOpacityEffect::draw(QPainter *painter, QGraphicsEffectSource *sour const QPixmap pixmap = source->pixmap(Qt::LogicalCoordinates, &offset); painter->drawPixmap(offset, pixmap); } else { - QRectF srcBrect = source->boundingRect(); - QPixmap pixmap(srcBrect.size().toSize()); + QRect srcBrect = source->boundingRect().toAlignedRect(); + offset = srcBrect.topLeft(); + QPixmap pixmap(srcBrect.size()); pixmap.fill(Qt::transparent); QPainter pixmapPainter(&pixmap); pixmapPainter.setRenderHints(painter->renderHints()); - pixmapPainter.translate(-srcBrect.topLeft()); + pixmapPainter.translate(-offset); source->draw(&pixmapPainter); pixmapPainter.setCompositionMode(QPainter::CompositionMode_DestinationIn); pixmapPainter.fillRect(srcBrect, d->opacityMask); pixmapPainter.end(); - painter->drawPixmap(srcBrect.topLeft(), pixmap); + painter->drawPixmap(offset, pixmap); } } else { // Draw pixmap in device coordinates to avoid pixmap scaling; -- cgit v0.12 From 500de752ac6af943ced98cd685ed460457b3166d Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 1 Sep 2009 16:03:00 +0200 Subject: Coverity: Small fix for QIODevice --- src/corelib/io/qiodevice.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index 75f8e54..ac9f532 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -122,7 +122,12 @@ void debugBinaryString(const char *data, qint64 maxlen) */ QIODevicePrivate::QIODevicePrivate() : openMode(QIODevice::NotOpen), buffer(QIODEVICE_BUFFERSIZE), - pos(0), devicePos(0), accessMode(Unset) + pos(0), devicePos(0) + , baseReadLineDataCalled(false) + , accessMode(Unset) +#ifdef QT_NO_QOBJECT + , q_ptr(0) +#endif { } -- cgit v0.12 From 5632ba903c1b31717b4fabdfc2a3c8b710b5cbf1 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 1 Sep 2009 16:08:56 +0200 Subject: Socket code: Do not use magic buffer size value I have seen a performance increase of around 30% for big file transfers on Linux when having high bandwidth and higher latency. Reviewed-by: Thiago --- src/network/socket/qnativesocketengine.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp index 3e56995..3d9aa61 100644 --- a/src/network/socket/qnativesocketengine.cpp +++ b/src/network/socket/qnativesocketengine.cpp @@ -389,10 +389,19 @@ bool QNativeSocketEngine::initialize(QAbstractSocket::SocketType socketType, QAb qWarning("QNativeSocketEngine::initialize unable to inline out-of-band data"); } - // Set the send and receive buffer sizes to a magic size, found - // most optimal for our platforms. - setReceiveBufferSize(49152); - setSendBufferSize(49152); + // Before Qt 4.6, we always set the send and receive buffer size to 49152 as + // this was found to be an optimal value. However, modern OS + // all have some kind of auto tuning for this and we therefore don't set + // this explictly anymore. + // If it introduces any performance regressions for Qt 4.6.x (x > 0) then + // it will be put back in. + // + // You can use tests/manual/qhttpnetworkconnection to test HTTP download speed + // with this. + // + // pre-4.6: + // setReceiveBufferSize(49152); + // setSendBufferSize(49152); d->socketType = socketType; d->socketProtocol = protocol; -- cgit v0.12 From 9f59fb741183e1235b2a385b0e688e4a7f4b15c9 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Tue, 1 Sep 2009 16:25:49 +0200 Subject: Make sub-attaq working without the popup which make it working on Mac. --- demos/sub-attaq/graphicsscene.cpp | 13 +++++--- demos/sub-attaq/graphicsscene.h | 2 ++ demos/sub-attaq/states.cpp | 25 ++++++++++++--- demos/sub-attaq/states.h | 2 ++ demos/sub-attaq/sub-attaq.pro | 18 +++++++---- demos/sub-attaq/textinformationitem.cpp | 54 ++++++++++++++++++++++++++++++++ demos/sub-attaq/textinformationitem.h | 55 +++++++++++++++++++++++++++++++++ 7 files changed, 153 insertions(+), 16 deletions(-) create mode 100644 demos/sub-attaq/textinformationitem.cpp create mode 100644 demos/sub-attaq/textinformationitem.h diff --git a/demos/sub-attaq/graphicsscene.cpp b/demos/sub-attaq/graphicsscene.cpp index b4fd0c9..79de011 100644 --- a/demos/sub-attaq/graphicsscene.cpp +++ b/demos/sub-attaq/graphicsscene.cpp @@ -51,6 +51,7 @@ #include "animationmanager.h" #include "qanimationstate.h" #include "progressitem.h" +#include "textinformationitem.h" //Qt #include @@ -112,6 +113,8 @@ GraphicsScene::GraphicsScene(int x, int y, int width, int height, Mode mode) //The item that display score and level progressItem = new ProgressItem(backgroundItem); + textInformationItem = new TextInformationItem(backgroundItem); + textInformationItem->hide(); //We create the boat boat = new Boat(); addItem(boat); @@ -244,15 +247,15 @@ void GraphicsScene::setupScene(const QList &actions) lettersFadingState->setAnimation(lettersGroupFading); //if new game then we fade out the welcome screen and start playing - lettersMovingState->addTransition(newAction, SIGNAL(triggered()),lettersFadingState); - lettersFadingState->addTransition(lettersFadingState, SIGNAL(animationFinished()),gameState); + lettersMovingState->addTransition(newAction, SIGNAL(triggered()), lettersFadingState); + lettersFadingState->addTransition(lettersFadingState, SIGNAL(animationFinished()), gameState); //New Game is triggered then player start playing - gameState->addTransition(newAction, SIGNAL(triggered()),gameState); + gameState->addTransition(newAction, SIGNAL(triggered()), gameState); //Wanna quit, then connect to CTRL+Q - gameState->addTransition(quitAction, SIGNAL(triggered()),final); - lettersMovingState->addTransition(quitAction, SIGNAL(triggered()),final); + gameState->addTransition(quitAction, SIGNAL(triggered()), final); + lettersMovingState->addTransition(quitAction, SIGNAL(triggered()), final); //Welcome screen is the initial state machine->setInitialState(lettersMovingState); diff --git a/demos/sub-attaq/graphicsscene.h b/demos/sub-attaq/graphicsscene.h index 073ad17..8fa62f7 100644 --- a/demos/sub-attaq/graphicsscene.h +++ b/demos/sub-attaq/graphicsscene.h @@ -54,6 +54,7 @@ class Torpedo; class Bomb; class PixmapItem; class ProgressItem; +class TextInformationItem; QT_BEGIN_NAMESPACE class QAction; QT_END_NAMESPACE @@ -108,6 +109,7 @@ private: Mode mode; PixmapItem *backgroundItem; ProgressItem *progressItem; + TextInformationItem *textInformationItem; QAction * newAction; QAction * quitAction; Boat *boat; diff --git a/demos/sub-attaq/states.cpp b/demos/sub-attaq/states.cpp index 75a2615..5c809cb 100644 --- a/demos/sub-attaq/states.cpp +++ b/demos/sub-attaq/states.cpp @@ -47,6 +47,7 @@ #include "torpedo.h" #include "animationmanager.h" #include "progressitem.h" +#include "textinformationitem.h" //Qt #include @@ -226,8 +227,15 @@ void LostState::onEntry(QEvent *) //We clear the scene scene->clearScene(); - //we have only one view - QMessageBox::information(scene->views().at(0),"You lose",message); + //We inform the player + scene->textInformationItem->setMessage(message); + scene->textInformationItem->show(); +} + +void LostState::onExit(QEvent *) +{ + //we hide the information + scene->textInformationItem->hide(); } /** Win State */ @@ -242,7 +250,7 @@ void WinState::onEntry(QEvent *) QString message; if (scene->levelsData.size() - 1 != game->currentLevel) { - message = QString("You win the level %1. Your score is %2.\nPress Space to continue after closing this dialog.").arg(game->currentLevel+1).arg(game->score); + message = QString("You win the level %1. Your score is %2.\nPress Space to continue.").arg(game->currentLevel+1).arg(game->score); //We increment the level number game->currentLevel++; } else { @@ -253,8 +261,15 @@ void WinState::onEntry(QEvent *) game->score = 0; } - //we have only one view - QMessageBox::information(scene->views().at(0),"You win",message); + //We inform the player + scene->textInformationItem->setMessage(message); + scene->textInformationItem->show(); +} + +void WinState::onExit(QEvent *) +{ + //we hide the information + scene->textInformationItem->hide(); } /** UpdateScore State */ diff --git a/demos/sub-attaq/states.h b/demos/sub-attaq/states.h index 7635c0c..3176571 100644 --- a/demos/sub-attaq/states.h +++ b/demos/sub-attaq/states.h @@ -113,6 +113,7 @@ public: protected: void onEntry(QEvent *); + void onExit(QEvent *); private : GraphicsScene *scene; PlayState *game; @@ -125,6 +126,7 @@ public: protected: void onEntry(QEvent *); + void onExit(QEvent *); private : GraphicsScene *scene; PlayState *game; diff --git a/demos/sub-attaq/sub-attaq.pro b/demos/sub-attaq/sub-attaq.pro index ad1327d..ba2b54b 100644 --- a/demos/sub-attaq/sub-attaq.pro +++ b/demos/sub-attaq/sub-attaq.pro @@ -1,5 +1,4 @@ contains(QT_CONFIG, opengl):QT += opengl - HEADERS += boat.h \ bomb.h \ mainwindow.h \ @@ -13,7 +12,8 @@ HEADERS += boat.h \ submarine_p.h \ custompropertyanimation.h \ qanimationstate.h \ - progressitem.h + progressitem.h \ + textinformationitem.h SOURCES += boat.cpp \ bomb.cpp \ main.cpp \ @@ -26,12 +26,18 @@ SOURCES += boat.cpp \ states.cpp \ custompropertyanimation.cpp \ qanimationstate.cpp \ - progressitem.cpp + progressitem.cpp \ + textinformationitem.cpp RESOURCES += subattaq.qrc # install target.path = $$[QT_INSTALL_DEMOS]/animation/sub-attaq -sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS sub-attaq.pro pics +sources.files = $$SOURCES \ + $$HEADERS \ + $$RESOURCES \ + $$FORMS \ + sub-attaq.pro \ + pics sources.path = $$[QT_INSTALL_DEMOS]/animation/sub-attaq -INSTALLS += target sources - +INSTALLS += target \ + sources diff --git a/demos/sub-attaq/textinformationitem.cpp b/demos/sub-attaq/textinformationitem.cpp new file mode 100644 index 0000000..759aa56 --- /dev/null +++ b/demos/sub-attaq/textinformationitem.cpp @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "textinformationitem.h" +#include "pixmapitem.h" + +TextInformationItem::TextInformationItem (QGraphicsItem * parent) + : QGraphicsTextItem(parent) +{ + setFont(QFont("Comic Sans MS", 25)); +} +#include +void TextInformationItem::setMessage(const QString& text) +{ + setHtml(text); + setPos(parentItem()->boundingRect().center().x() - boundingRect().size().width()/2 , parentItem()->boundingRect().center().y()); +} diff --git a/demos/sub-attaq/textinformationitem.h b/demos/sub-attaq/textinformationitem.h new file mode 100644 index 0000000..aa7f0be --- /dev/null +++ b/demos/sub-attaq/textinformationitem.h @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef TEXTINFORMATIONITEM_H +#define TEXTINFORMATIONITEM_H + +//Qt +#include + +class TextInformationItem : public QGraphicsTextItem +{ +public: + TextInformationItem(QGraphicsItem * parent = 0); + void setMessage(const QString& text); +}; + +#endif // TEXTINFORMATIONITEM_H -- cgit v0.12 From 3418320aa5cad4a982f6278be1fbe8ce66c1558f Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Tue, 1 Sep 2009 16:27:57 +0200 Subject: Fixes examples/animation/states, supposedly hidden element was appearing Reviewed-by: trustme --- examples/animation/states/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/animation/states/main.cpp b/examples/animation/states/main.cpp index a78548c..9644049 100644 --- a/examples/animation/states/main.cpp +++ b/examples/animation/states/main.cpp @@ -179,8 +179,8 @@ int main(int argc, char *argv[]) // State 3 state3->assignProperty(button, "text", "Switch to state 1"); - state3->assignProperty(p1, "geometry", QRectF(5, 5, 64, 64)); - state3->assignProperty(p2, "geometry", QRectF(5, 5 + 64 + 5, 64, 64)); + state3->assignProperty(p1, "geometry", QRectF(0, 5, 64, 64)); + state3->assignProperty(p2, "geometry", QRectF(0, 5 + 64 + 5, 64, 64)); state3->assignProperty(p3, "geometry", QRectF(5, 5 + (64 + 5) + 64, 64, 64)); state3->assignProperty(p4, "geometry", QRectF(5 + 64 + 5, 5, 64, 64)); state3->assignProperty(p5, "geometry", QRectF(5 + 64 + 5, 5 + 64 + 5, 64, 64)); -- cgit v0.12 From 3dfde91fcbeaf304edd8d0d09e0732597055cd53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Tue, 1 Sep 2009 16:31:33 +0200 Subject: Cleanup examples/effects/lighting. There's no need to re-implement QGraphicsDropShadowEffect anymore. --- examples/effects/lighting/lighting.cpp | 22 +++++++-- examples/effects/lighting/lighting.h | 2 - examples/effects/lighting/lighting.pro | 4 +- examples/effects/lighting/shadoweffect.cpp | 76 ------------------------------ examples/effects/lighting/shadoweffect.h | 66 -------------------------- 5 files changed, 21 insertions(+), 149 deletions(-) delete mode 100644 examples/effects/lighting/shadoweffect.cpp delete mode 100644 examples/effects/lighting/shadoweffect.h diff --git a/examples/effects/lighting/lighting.cpp b/examples/effects/lighting/lighting.cpp index 2294b36..e309e2e 100644 --- a/examples/effects/lighting/lighting.cpp +++ b/examples/effects/lighting/lighting.cpp @@ -43,8 +43,6 @@ #include -#include "shadoweffect.h" - #ifndef M_PI #define M_PI 3.14159265358979323846 #endif @@ -98,7 +96,7 @@ void Lighting::setupScene() item->setPen(QPen(Qt::black)); item->setBrush(QBrush(Qt::white)); - item->setGraphicsEffect(new ShadowEffect(item, m_lightSource)); + item->setGraphicsEffect(new QGraphicsDropShadowEffect); item->setZValue(1); item->setPos(i * 80, j * 80); m_scene.addItem(item); @@ -114,6 +112,24 @@ void Lighting::animate() qreal xs = 200 * sin(angle) - 40 + 25; qreal ys = 200 * cos(angle) - 40 + 25; m_lightSource->setPos(xs, ys); + + for (int i = 0; i < m_items.size(); ++i) { + QGraphicsItem *item = m_items.at(i); + Q_ASSERT(item); + QGraphicsDropShadowEffect *effect = static_cast(item->graphicsEffect()); + Q_ASSERT(effect); + + QPointF delta(item->x() - xs, item->y() - ys); + effect->setOffset(delta.toPoint() / 30); + + qreal dx = delta.x(); + qreal dy = delta.y(); + qreal dd = sqrt(dx * dx + dy * dy); + QColor color = effect->color(); + color.setAlphaF(qBound(0.4, 1 - dd / 200.0, 0.7)); + effect->setColor(color); + } + m_scene.update(); } diff --git a/examples/effects/lighting/lighting.h b/examples/effects/lighting/lighting.h index 3e12fdf..eef5cae 100644 --- a/examples/effects/lighting/lighting.h +++ b/examples/effects/lighting/lighting.h @@ -45,8 +45,6 @@ #include #include -#include "shadoweffect.h" - class Lighting: public QGraphicsView { Q_OBJECT diff --git a/examples/effects/lighting/lighting.pro b/examples/effects/lighting/lighting.pro index ea9d5f6..432d1b5 100644 --- a/examples/effects/lighting/lighting.pro +++ b/examples/effects/lighting/lighting.pro @@ -1,5 +1,5 @@ -SOURCES += main.cpp lighting.cpp shadoweffect.cpp -HEADERS += lighting.h shadoweffect.h +SOURCES += main.cpp lighting.cpp +HEADERS += lighting.h # install target.path = $$[QT_INSTALL_EXAMPLES]/effects/lighting diff --git a/examples/effects/lighting/shadoweffect.cpp b/examples/effects/lighting/shadoweffect.cpp deleted file mode 100644 index 16e52fb..0000000 --- a/examples/effects/lighting/shadoweffect.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "shadoweffect.h" - -#include - -ShadowEffect::ShadowEffect(QGraphicsItem *item, QGraphicsItem *source) - : QGraphicsDropShadowEffect() - , item(item), m_lightSource(source) -{ - setBlurRadius(8); - m_color = color(); -} - -void ShadowEffect::adjustForItem() -{ - QPointF delta = item->pos() - m_lightSource->pos(); - setOffset(delta.toPoint() / 30); - - qreal dx = delta.x(); - qreal dy = delta.y(); - qreal dd = sqrt(dx * dx + dy * dy); - m_color.setAlphaF(qBound(0.4, 1 - dd / 200.0, 0.7)); - setColor(m_color); -} - -QRectF ShadowEffect::boundingRectFor(const QRectF &rect) const -{ - const_cast(this)->adjustForItem(); - return QGraphicsDropShadowEffect::boundingRectFor(rect); -} - -void ShadowEffect::draw(QPainter *painter, QGraphicsEffectSource *source) -{ - adjustForItem(); - QGraphicsDropShadowEffect::draw(painter, source); -} diff --git a/examples/effects/lighting/shadoweffect.h b/examples/effects/lighting/shadoweffect.h deleted file mode 100644 index 64314e5..0000000 --- a/examples/effects/lighting/shadoweffect.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef SHADOWEFFECT_H -#define SHADOWEFFECT_H - -#include -#include - -class ShadowEffect: public QGraphicsDropShadowEffect -{ -public: - ShadowEffect(QGraphicsItem *item, QGraphicsItem *source); - - QRectF boundingRectFor(const QRectF &rect) const; - - void draw(QPainter *painter, QGraphicsEffectSource *source); - -private: - void adjustForItem(); - -private: - QColor m_color; - QGraphicsItem *item; - QGraphicsItem *m_lightSource; -}; - -#endif // SHADOWEFFECT_H -- cgit v0.12 From efc616f2a1a83bd4ca50aea9d40a0df005ada063 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 1 Sep 2009 16:39:30 +0200 Subject: QTreeView: exapnding nodes just after replacing the model wouldn't work The problem is that deleting the previous model would triggera delayed reset. This reset could happen after the model has changed and nodes are expanded. We can now cancel a reset when reset is called from another place (like when we set a new model). Note: autotest included Task-number: 245654 Reviewed-by: ogoffart --- src/gui/itemviews/qabstractitemview.cpp | 8 +++++--- src/gui/itemviews/qabstractitemview_p.h | 10 ++++++++++ tests/auto/qtreeview/tst_qtreeview.cpp | 30 ++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 07c5454..ea98cb2 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -956,6 +956,7 @@ QModelIndex QAbstractItemView::currentIndex() const void QAbstractItemView::reset() { Q_D(QAbstractItemView); + d->delayedReset.stop(); //make sure we stop the timer QList::const_iterator it = d->editors.constBegin(); for (; it != d->editors.constEnd(); ++it) d->releaseEditor(it->editor); @@ -2208,7 +2209,9 @@ void QAbstractItemView::timerEvent(QTimerEvent *event) Q_D(QAbstractItemView); if (event->timerId() == d->fetchMoreTimer.timerId()) d->fetchMore(); - if (event->timerId() == d->autoScrollTimer.timerId()) + else if (event->timerId() == d->delayedReset.timerId()) + reset(); + else if (event->timerId() == d->autoScrollTimer.timerId()) doAutoScroll(); else if (event->timerId() == d->updateTimer.timerId()) d->updateDirtyRegion(); @@ -3132,9 +3135,8 @@ void QAbstractItemViewPrivate::_q_columnsInserted(const QModelIndex &, int, int) */ void QAbstractItemViewPrivate::_q_modelDestroyed() { - Q_Q(QAbstractItemView); model = QAbstractItemModelPrivate::staticEmptyModel(); - QMetaObject::invokeMethod(q, "reset", Qt::QueuedConnection); + doDelayedReset(); } /*! diff --git a/src/gui/itemviews/qabstractitemview_p.h b/src/gui/itemviews/qabstractitemview_p.h index 4517941..434d644 100644 --- a/src/gui/itemviews/qabstractitemview_p.h +++ b/src/gui/itemviews/qabstractitemview_p.h @@ -328,6 +328,15 @@ public: QStyleOptionViewItemV4 viewOptionsV4() const; + void doDelayedReset() + { + //we delay the reset of the timer because some views (QTableView) + //with headers can't handle the fact that the model has been destroyed + //all _q_modelDestroyed slots must have been called + if (!delayedReset.isActive()) + delayedReset.start(0, q_func()); + } + QAbstractItemModel *model; QPointer itemDelegate; QMap > rowDelegates; @@ -389,6 +398,7 @@ public: QBasicTimer updateTimer; QBasicTimer delayedEditing; QBasicTimer delayedAutoScroll; //used when an item is clicked + QBasicTimer delayedReset; QAbstractItemView::ScrollMode verticalScrollMode; QAbstractItemView::ScrollMode horizontalScrollMode; diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index ef43c3a..6709807 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -233,6 +233,7 @@ private slots: void task239271_addRowsWithFirstColumnHidden(); void task254234_proxySort(); void task248022_changeSelection(); + void task245654_changeModelAndExpandAll(); }; class QtTestModel: public QAbstractItemModel @@ -3463,6 +3464,35 @@ void tst_QTreeView::task248022_changeSelection() QCOMPARE(view.selectionModel()->selectedIndexes().count(), list.count()); } +void tst_QTreeView::task245654_changeModelAndExpandAll() +{ + QTreeView view; + QStandardItemModel *model = new QStandardItemModel; + QStandardItem *top = new QStandardItem("top"); + QStandardItem *sub = new QStandardItem("sub"); + top->appendRow(sub); + model->appendRow(top); + view.setModel(model); + view.expandAll(); + QApplication::processEvents(); + QVERIFY(view.isExpanded(top->index())); + + //now let's try to delete the model + //then repopulate and expand again + delete model; + model = new QStandardItemModel; + top = new QStandardItem("top"); + sub = new QStandardItem("sub"); + top->appendRow(sub); + model->appendRow(top); + view.setModel(model); + view.expandAll(); + QApplication::processEvents(); + QVERIFY(view.isExpanded(top->index())); + +} + + QTEST_MAIN(tst_QTreeView) #include "tst_qtreeview.moc" -- cgit v0.12 From 31e4c350981e10076ce4f2f1ecc7076983b9cefa Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Wed, 26 Aug 2009 15:51:15 +0200 Subject: Fix column number in QScriptEngineAgent Fix column number in QScriptEngineAgent with JIT enabled and in the same time with QT_BUILD_SCRIPT_LIB disabled Reviewed-by: Kent Hansen --- src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp index 2563848..e2542a5 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp @@ -2713,11 +2713,7 @@ DEFINE_STUB_FUNCTION(void, op_debug) int debugHookID = stackFrame.args[0].int32(); int firstLine = stackFrame.args[1].int32(); int lastLine = stackFrame.args[2].int32(); -#ifdef QT_BUILD_SCRIPT_LIB int column = stackFrame.args[3].int32(); -#else - int column = -1; -#endif stackFrame.globalData->interpreter->debug(callFrame, static_cast(debugHookID), firstLine, lastLine, column); } -- cgit v0.12 From 2a521d8d26577bfe0487a48c0d723e14e67ee0b5 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Tue, 1 Sep 2009 16:24:24 +0200 Subject: Create exceptionCatch events Call to JSC::Debugger::exceptionCatch when exception is catched were added for JIT enabled. Few XFAIL were moved. Reviewed-by: Kent Hansen --- src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp | 4 ++++ src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp | 11 +++++++++++ src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h | 3 +++ tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp | 10 ++++------ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp index 8371229..4a33e67 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp @@ -684,6 +684,10 @@ void JIT::emit_op_catch(Instruction* currentInstruction) killLastResultRegister(); // FIXME: Implicitly treat op_catch as a labeled statement, and remove this line of code. peek(callFrameRegister, OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof (void*)); emitPutVirtualRegister(currentInstruction[1].u.operand); +#ifdef QT_BUILD_SCRIPT_LIB + JITStubCall stubCall(this, JITStubs::cti_op_debug_catch); + stubCall.call(); +#endif } void JIT::emit_op_jmp_scopes(Instruction* currentInstruction) diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp index e2542a5..f0d3b84 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp @@ -2718,6 +2718,17 @@ DEFINE_STUB_FUNCTION(void, op_debug) stackFrame.globalData->interpreter->debug(callFrame, static_cast(debugHookID), firstLine, lastLine, column); } +#ifdef QT_BUILD_SCRIPT_LIB +DEFINE_STUB_FUNCTION(void, op_debug_catch) +{ + STUB_INIT_STACK_FRAME(stackFrame); + CallFrame* callFrame = stackFrame.callFrame; + if (JSC::Debugger* debugger = callFrame->lexicalGlobalObject()->debugger() ) { + debugger->exceptionCatch(DebuggerCallFrame(callFrame), callFrame->codeBlock()->ownerNode()->sourceID()); + } +} +#endif + DEFINE_STUB_FUNCTION(EncodedJSValue, vm_throw) { STUB_INIT_STACK_FRAME(stackFrame); diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h index 0493189..60bf64a 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h @@ -221,6 +221,9 @@ namespace JITStubs { extern "C" { void JIT_STUB cti_op_create_arguments(STUB_ARGS_DECLARATION); void JIT_STUB cti_op_create_arguments_no_params(STUB_ARGS_DECLARATION); void JIT_STUB cti_op_debug(STUB_ARGS_DECLARATION); +#ifdef QT_BUILD_SCRIPT_LIB + void JIT_STUB cti_op_debug_catch(STUB_ARGS_DECLARATION); +#endif void JIT_STUB cti_op_end(STUB_ARGS_DECLARATION); void JIT_STUB cti_op_jmp_scopes(STUB_ARGS_DECLARATION); void JIT_STUB cti_op_pop_scope(STUB_ARGS_DECLARATION); diff --git a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp index 68f0620..1f9476f 100644 --- a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp +++ b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp @@ -1593,8 +1593,6 @@ void tst_QScriptEngineAgent::exceptionThrowAndCatch() { spy->clear(); eng.evaluate("try { throw new Error('ciao'); } catch (e) { }"); - if (qt_script_isJITEnabled()) - QEXPECT_FAIL("", "Some events are missing when JIT is enabled", Abort); QCOMPARE(spy->count(), 2); QCOMPARE(spy->at(0).type, ScriptEngineEvent::ExceptionThrow); @@ -1606,6 +1604,8 @@ void tst_QScriptEngineAgent::exceptionThrowAndCatch() QCOMPARE(spy->at(1).type, ScriptEngineEvent::ExceptionCatch); QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); + if (qt_script_isJITEnabled()) + QEXPECT_FAIL("", "Exception value is not passed in exceptionCatch event when JIT is enabled", Continue); QVERIFY(spy->at(1).value.strictlyEquals(spy->at(0).value)); } } @@ -1728,8 +1728,6 @@ void tst_QScriptEngineAgent::eventOrder_throwAndCatch() { spy->clear(); eng.evaluate("try { throw new Error('ciao') } catch (e) { void(e); }"); - if (qt_script_isJITEnabled()) - QEXPECT_FAIL("", "One event is missing when JIT is enabled", Abort); QCOMPARE(spy->count(), 12); // load QCOMPARE(spy->at(0).type, ScriptEngineEvent::ScriptLoad); @@ -1751,6 +1749,8 @@ void tst_QScriptEngineAgent::eventOrder_throwAndCatch() QVERIFY(spy->at(7).hasExceptionHandler); // catch QCOMPARE(spy->at(8).type, ScriptEngineEvent::ExceptionCatch); + if (qt_script_isJITEnabled()) + QEXPECT_FAIL("", "Exception value is not passed in exceptionCatch event when JIT is enabled", Continue); QVERIFY(spy->at(8).value.isError()); // void(e) QCOMPARE(spy->at(9).type, ScriptEngineEvent::PositionChange); @@ -1914,8 +1914,6 @@ void tst_QScriptEngineAgent::eventOrder_throwCatchFinally() { spy->clear(); eng.evaluate("try { throw 1; } catch(e) { i = e; } finally { i = 2; }"); - if (qt_script_isJITEnabled()) - QEXPECT_FAIL("", "One event is missing when JIT is enabled", Abort); QCOMPARE(spy->count(), 9); // load -- cgit v0.12 From 8e2213ea0bb3692783c03fe4da2df659c1859136 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Tue, 1 Sep 2009 09:43:09 +0200 Subject: An an autotest to check QPainter rendering to an FBO works The test also checks that when we ask for CombinedDepthStencil, that's what we get. Reviewed-by: Samuel --- tests/auto/qgl/tst_qgl.cpp | 63 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index 073afc8..1629542 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -71,6 +72,7 @@ private slots: void partialGLWidgetUpdates_data(); void partialGLWidgetUpdates(); void glWidgetRendering(); + void glFBORendering(); void glPBufferRendering(); void glWidgetReparent(); void colormap(); @@ -706,6 +708,67 @@ void tst_QGL::glWidgetRendering() QCOMPARE(fb, reference); } +// NOTE: This tests that CombinedDepthStencil attachment works by assuming the +// GL2 engine is being used and is implemented the same way as it was when +// this autotest was written. If this is not the case, there may be some +// false-positives: I.e. The test passes when either the depth or stencil +// buffer is actually missing. But that's probably ok anyway. +void tst_QGL::glFBORendering() +{ + if (!QGLFramebufferObject::hasOpenGLFramebufferObjects()) + QSKIP("QGLFramebufferObject not supported on this platform", SkipSingle); + + QGLWidget glw; + glw.makeCurrent(); + + // No multisample with combined depth/stencil attachment: + QGLFramebufferObjectFormat fboFormat(0, QGLFramebufferObject::CombinedDepthStencil); + + // Don't complicate things by using NPOT: + QGLFramebufferObject *fbo = new QGLFramebufferObject(256, 128, fboFormat); + + QPainter fboPainter; + bool painterBegun = fboPainter.begin(fbo); + QVERIFY(painterBegun); + + QPainterPath intersectingPath; + intersectingPath.moveTo(0, 0); + intersectingPath.lineTo(100, 0); + intersectingPath.lineTo(0, 100); + intersectingPath.lineTo(100, 100); + intersectingPath.closeSubpath(); + + QPainterPath trianglePath; + trianglePath.moveTo(50, 0); + trianglePath.lineTo(100, 100); + trianglePath.lineTo(0, 100); + trianglePath.closeSubpath(); + + fboPainter.fillRect(0, 0, fbo->width(), fbo->height(), Qt::red); // Background + fboPainter.translate(14, 14); + fboPainter.fillPath(intersectingPath, Qt::blue); // Test stencil buffer works + fboPainter.translate(128, 0); + fboPainter.setClipPath(trianglePath); // Test depth buffer works + fboPainter.setTransform(QTransform()); // reset xform + fboPainter.fillRect(0, 0, fbo->width(), fbo->height(), Qt::green); + fboPainter.end(); + + QImage fb = fbo->toImage().convertToFormat(QImage::Format_RGB32); + delete fbo; + + // As we're doing more than trivial painting, we can't just compare to + // an image rendered with raster. Instead, we sample at well-defined + // test-points: + QCOMPARE(fb.pixel(39, 64), QColor(Qt::red).rgb()); + QCOMPARE(fb.pixel(89, 64), QColor(Qt::red).rgb()); + QCOMPARE(fb.pixel(64, 39), QColor(Qt::blue).rgb()); + QCOMPARE(fb.pixel(64, 89), QColor(Qt::blue).rgb()); + + QCOMPARE(fb.pixel(167, 39), QColor(Qt::red).rgb()); + QCOMPARE(fb.pixel(217, 39), QColor(Qt::red).rgb()); + QCOMPARE(fb.pixel(192, 64), QColor(Qt::green).rgb()); +} + void tst_QGL::glWidgetReparent() { // Try it as a top-level first: -- cgit v0.12 From 4d403875d9d88d2acb0433511eb3f44e0dee4377 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 1 Sep 2009 17:05:56 +0200 Subject: QtNetwork: More Coverity fixes --- src/network/access/qnetworkaccesscachebackend.cpp | 1 + src/network/socket/qhttpsocketengine.cpp | 1 + src/network/ssl/qsslsocket.cpp | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/network/access/qnetworkaccesscachebackend.cpp b/src/network/access/qnetworkaccesscachebackend.cpp index df66c9d..2be10db 100644 --- a/src/network/access/qnetworkaccesscachebackend.cpp +++ b/src/network/access/qnetworkaccesscachebackend.cpp @@ -52,6 +52,7 @@ QT_BEGIN_NAMESPACE QNetworkAccessCacheBackend::QNetworkAccessCacheBackend() : QNetworkAccessBackend() + , device(0) { } diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp index bb0915a..9ef92e1 100644 --- a/src/network/socket/qhttpsocketengine.cpp +++ b/src/network/socket/qhttpsocketengine.cpp @@ -752,6 +752,7 @@ QHttpSocketEnginePrivate::QHttpSocketEnginePrivate() , readNotificationPending(false) , writeNotificationPending(false) , connectionNotificationPending(false) + , pendingResponseData(0) { socket = 0; state = QHttpSocketEngine::None; diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index 6858d40..0e0c347 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -1745,7 +1745,13 @@ qint64 QSslSocket::writeData(const char *data, qint64 len) \internal */ QSslSocketPrivate::QSslSocketPrivate() - : initialized(false), readyReadEmittedPointer(0), plainSocket(0) + : initialized(false) + , mode(QSslSocket::UnencryptedMode) + , autoStartHandshake(false) + , connectionEncrypted(false) + , ignoreAllSslErrors(false) + , readyReadEmittedPointer(0) + , plainSocket(0) { QSslConfigurationPrivate::deepCopyDefaultConfiguration(&configuration); } -- cgit v0.12 From f88f879954c31e45c2edb1f5a8050673a471c78e Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 1 Sep 2009 14:11:48 +0200 Subject: Define QT_NO_EXCEPTIONS if we detect that we are building without exceptions on gcc This is necessary to compile applications that are compiled without exception support (many KDE applications) Reviewed-by: Thiago --- src/corelib/global/qglobal.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index c34fc31..765665c 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1364,6 +1364,9 @@ inline void qt_noop() {} #ifdef QT_BOOTSTRAPPED # define QT_NO_EXCEPTIONS #endif +#if defined(Q_CC_GNU) && !defined (__EXCEPTIONS) +# define QT_NO_EXCEPTIONS +#endif #ifdef QT_NO_EXCEPTIONS # define QT_TRY if (true) -- cgit v0.12 From cd027ea513ce57939964ee23b522eb1a7c4f9a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 1 Sep 2009 17:02:16 +0200 Subject: Unambiguated QGLFramebufferObject constructor on Mac OS X. Reviewed-by: Trond --- src/opengl/qglframebufferobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 8fd113a..427aab3 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -877,7 +877,7 @@ QImage QGLFramebufferObject::toImage() const // qt_gl_read_framebuffer doesn't work on a multisample FBO if (format().samples() != 0) { - QGLFramebufferObject temp(size()); + QGLFramebufferObject temp(size(), QGLFramebufferObjectFormat()); QRect rect(QPoint(0, 0), size()); blitFramebuffer(&temp, rect, const_cast(this), rect); -- cgit v0.12 From 4a7912195beca671c562f5f1f9c60c2fc2585166 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 1 Sep 2009 17:26:00 +0200 Subject: Tiny doc fix spotted by panter_dsd. Reviewed-by: trustme --- doc/src/snippets/code/src_corelib_io_qsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/snippets/code/src_corelib_io_qsettings.cpp b/doc/src/snippets/code/src_corelib_io_qsettings.cpp index 12a204b..c380d19 100644 --- a/doc/src/snippets/code/src_corelib_io_qsettings.cpp +++ b/doc/src/snippets/code/src_corelib_io_qsettings.cpp @@ -309,7 +309,7 @@ int main(int argc, char *argv[]) const QSettings::Format XmlFormat = QSettings::registerFormat("xml", readXmlFile, writeXmlFile); - QSettings settings(XmlFormat, QSettings::UserSettings, "MySoft", + QSettings settings(XmlFormat, QSettings::UserScope, "MySoft", "Star Runner"); ... -- cgit v0.12 From 950ab0520f0be607aaa1ec7e46dc33ebfde84f03 Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Tue, 1 Sep 2009 15:41:18 +0200 Subject: Doc: Fixed outdated docs in QStyle::styleHint(). Task-number: 256745 Reviewed-by: Trust Me --- src/gui/styles/qstyle.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp index d61d291..0500bff 100644 --- a/src/gui/styles/qstyle.cpp +++ b/src/gui/styles/qstyle.cpp @@ -1897,11 +1897,9 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, Returns an integer representing the specified style \a hint for the given \a widget described by the provided style \a option. - Note that currently, the \a returnData and \a widget parameters - are not used; they are provided for future enhancement. In - addition, the \a option parameter is used only in case of the - SH_ComboBox_Popup, SH_ComboBox_LayoutDirection, and - SH_GroupBox_TextLabelColor style hints. + \c returnData is used when the querying widget needs more detailed data than + the integer that styleHint() returns. See the QStyleHintReturn class + description for details. */ /*! -- cgit v0.12 From e86ddf19ca20cb2128465b42fae4a9129abe25b3 Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Tue, 1 Sep 2009 17:27:00 +0200 Subject: Doc: Fixed typos in QGraphicsItem and Diagram Scene Example Task-number: 257292 Reviewed-by: Trust Me --- doc/src/examples/diagramscene.qdoc | 7 ++++--- src/gui/graphicsview/qgraphicsitem.cpp | 27 +++++++++++++-------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/doc/src/examples/diagramscene.qdoc b/doc/src/examples/diagramscene.qdoc index 9f5d785..2011aa9 100644 --- a/doc/src/examples/diagramscene.qdoc +++ b/doc/src/examples/diagramscene.qdoc @@ -704,7 +704,7 @@ We use \c itemChange() and \c focusOutEvent() to notify the \c DiagramScene when the text item loses focus and gets selected. - Vi reimplement the functions that handle mouse events to make it + We reimplement the functions that handle mouse events to make it possible to alter the mouse behavior of QGraphicsTextItem. \section1 DiagramTextItem Implementation @@ -729,7 +729,8 @@ \snippet examples/graphicsview/diagramscene/diagramtextitem.cpp 2 \c DiagramScene uses the signal emitted when the text item looses - remove the item if it is empty, i.e., it contains no text. + focus to remove the item if it is empty, i.e., it contains no + text. This is the implementation of \c mouseDoubleClickEvent(): @@ -838,7 +839,7 @@ \snippet examples/graphicsview/diagramscene/arrow.cpp 7 - If the line is selected we draw to dotted lines that are + If the line is selected, we draw two dotted lines that are parallel with the line of the arrow. We do not use the default implementation, which uses \l{QGraphicsItem::}{boundingRect()} because the QRect bounding rectangle is considerably larger than diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 822c208..4c7765d 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -198,20 +198,19 @@ \o hoverEnterEvent(), hoverMoveEvent(), and hoverLeaveEvent() handles hover enter, move and leave events \o inputMethodEvent() handles input events, for accessibility support - \o keyPressEvent() and keyReleaseEvent handle key press and release events + \o keyPressEvent() and keyReleaseEvent() handle key press and release events \o mousePressEvent(), mouseMoveEvent(), mouseReleaseEvent(), and mouseDoubleClickEvent() handles mouse press, move, release, click and doubleclick events \endlist - You can filter events for any other item by installing event - filters. This functionaly is separate from from Qt's regular - event filters (see QObject::installEventFilter()), which only - work on subclasses of QObject. After installing your item as an - event filter for another item by calling - installSceneEventFilter(), the filtered events will be received - by the virtual function sceneEventFilter(). You can remove item - event filters by calling removeSceneEventFilter(). + You can filter events for any other item by installing event filters. This + functionality is separate from Qt's regular event filters (see + QObject::installEventFilter()), which only work on subclasses of QObject. After + installing your item as an event filter for another item by calling + installSceneEventFilter(), the filtered events will be received by the virtual + function sceneEventFilter(). You can remove item event filters by calling + removeSceneEventFilter(). \section1 Custom Data @@ -414,11 +413,11 @@ (same as transform()), and QGraphicsItem ignores the return value for this notification (i.e., a read-only notification). - \value ItemSelectedChange The item's selected state changes. If the item - is presently selected, it will become unselected, and vice verca. The - value argument is the new selected state (i.e., true or false). Do not - call setSelected() in itemChange() as this notification is delivered(); - instead, you can return the new selected state from itemChange(). + \value ItemSelectedChange The item's selected state changes. If the item is + presently selected, it will become unselected, and vice verca. The value + argument is the new selected state (i.e., true or false). Do not call + setSelected() in itemChange() as this notification is delivered; instead, you + can return the new selected state from itemChange(). \value ItemSelectedHasChanged The item's selected state has changed. The value argument is the new selected state (i.e., true or false). Do not -- cgit v0.12 From fe501b51b03c8c48c3efada83e8ae278c93ae5ab Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 1 Sep 2009 17:38:56 +0200 Subject: Doc: Fixed broken links to renamed functions. Reviewed-by: Trust Me --- src/gui/widgets/qcalendarwidget.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/widgets/qcalendarwidget.cpp b/src/gui/widgets/qcalendarwidget.cpp index 14efb9f..9c8ca01 100644 --- a/src/gui/widgets/qcalendarwidget.cpp +++ b/src/gui/widgets/qcalendarwidget.cpp @@ -1968,9 +1968,7 @@ void QCalendarWidgetPrivate::_q_editingFinished() The widget is initialized with the current month and year, but QCalendarWidget provides several public slots to change the year - and month that is shown. The currently displayed month and year - can be retrieved using the currentPageMonth() and currentPageYear() - functions, respectively. + and month that is shown. By default, today's date is selected, and the user can select a date using both mouse and keyboard. The currently selected date @@ -1983,6 +1981,9 @@ void QCalendarWidgetPrivate::_q_editingFinished() all. Note that a date also can be selected programmatically using the setSelectedDate() slot. + The currently displayed month and year can be retrieved using the + monthShown() and yearShown() functions, respectively. + A newly created calendar widget uses abbreviated day names, and both Saturdays and Sundays are marked in red. The calendar grid is not visible. The week numbers are displayed, and the first column @@ -2292,7 +2293,7 @@ int QCalendarWidget::monthShown() const selected date. The currently displayed month and year can be retrieved using the - currentPageMonth() and currentPageYear() functions respectively. + monthShown() and yearShown() functions respectively. \sa yearShown(), monthShown(), showPreviousMonth(), showNextMonth(), showPreviousYear(), showNextYear() -- cgit v0.12 From 8fab695b7987856da4ebb6b36410dd05aa48c13d Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Tue, 1 Sep 2009 13:22:04 +0200 Subject: Use QStringRef when parsing SVG transformation matrix. There is really no need to use QString for parsing the matrix, hence use QStringRef. In a complex SVG, this cuts significantly the time spent in parseTransform(). Reviewed-by: Kim --- src/svg/qsvghandler.cpp | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index 371b845..27de011 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -685,6 +685,28 @@ static QString idFromUrl(const QString &url) return id; } +static inline QStringRef trimRef(const QStringRef &str) +{ + if (str.isEmpty()) + return QStringRef(); + const QChar *s = str.string()->constData() + str.position(); + int end = str.length() - 1; + if (!s[0].isSpace() && !s[end].isSpace()) + return str; + + int start = 0; + while (start<=end && s[start].isSpace()) // skip white space from start + start++; + if (start <= end) { // only white space + while (s[end].isSpace()) // skip white space from end + end--; + } + int l = end - start + 1; + if (l <= 0) + return QStringRef(); + return QStringRef(str.string(), str.position() + start, l); +} + /** * returns true when successfuly set the color. false signifies * that the color should be inherited @@ -903,12 +925,16 @@ static void parseBrush(QSvgNode *node, -static QMatrix parseTransformationMatrix(const QString &value) +static QMatrix parseTransformationMatrix(const QStringRef &value) { + if (value.isEmpty()) + return QMatrix(); + QMatrix matrix; const QChar *str = value.constData(); + const QChar *end = str + value.length(); - while (*str != QLatin1Char(0)) { + while (str < end) { if (str->isSpace() || *str == QLatin1Char(',')) { ++str; continue; @@ -973,7 +999,7 @@ static QMatrix parseTransformationMatrix(const QString &value) } - while (str->isSpace()) + while (str < end && str->isSpace()) ++str; if (*str != QLatin1Char('(')) goto error; @@ -1212,10 +1238,7 @@ static void parseTransform(QSvgNode *node, { if (attributes.transform.isEmpty()) return; - QString value = attributes.transform.toString().trimmed(); - if (value.isEmpty()) - return; - QMatrix matrix = parseTransformationMatrix(value); + QMatrix matrix = parseTransformationMatrix(trimRef(attributes.transform)); if (!matrix.isIdentity()) { node->appendStyleProperty(new QSvgTransformStyle(QTransform(matrix)), someId(attributes)); @@ -2583,7 +2606,7 @@ static void parseBaseGradient(QSvgNode *node, QSvgHandler *handler) { QString link = attributes.value(QLatin1String("xlink:href")).toString(); - QString trans = attributes.value(QLatin1String("gradientTransform")).toString(); + QStringRef trans = attributes.value(QLatin1String("gradientTransform")); QString spread = attributes.value(QLatin1String("spreadMethod")).toString(); QString units = attributes.value(QLatin1String("gradientUnits")).toString(); -- cgit v0.12 From 928ee7059f42f7e5157dd25295bd6b9eea686f29 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Tue, 1 Sep 2009 16:54:09 +0200 Subject: Speed-up parsing of SVG path data. Instead of using operations that shuffle the array of numbers, just use pointer to iterate the numbers. This reduced the amount of memory operations during the parsing. In addition, parse the numbers to QVarLengthArray instead of QVector. This works well because usually a path element is typically followed by a short list of numbers. Loading tiger.svg (tests/benchmarks/qsvgrenderer) is now 8% faster, mostly due to the time spent in parsePathDataFast is reduced from 26.1 millions instructions to just 20.5 millions (27% speed-up). Reviewed-by: Kim --- src/svg/qsvghandler.cpp | 244 +++++++++++++++++++++++++----------------------- 1 file changed, 127 insertions(+), 117 deletions(-) diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index 27de011..9683efd 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -1414,24 +1414,29 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) QChar pathElem = *str; ++str; QChar endc = *end; - *const_cast(end) = 0; // parseNumbersList requires 0-termination that QStringRef cannot guarantee - QVector arg = parseNumbersList(str); + *const_cast(end) = 0; // parseNumbersArray requires 0-termination that QStringRef cannot guarantee + QVarLengthArray arg; + parseNumbersArray(str, arg); *const_cast(end) = endc; if (pathElem == QLatin1Char('z') || pathElem == QLatin1Char('Z')) arg.append(0);//dummy - while (!arg.isEmpty()) { + const qreal *num = arg.constData(); + int count = arg.count(); + while (count > 0) { qreal offsetX = x; // correction offsets qreal offsetY = y; // for relative commands switch (pathElem.unicode()) { case 'm': { - if (arg.count() < 2) { - arg.pop_front(); + if (count < 2) { + num++; + count--; break; } - x = x0 = arg[0] + offsetX; - y = y0 = arg[1] + offsetY; + x = x0 = num[0] + offsetX; + y = y0 = num[1] + offsetY; + num += 2; + count -= 2; path.moveTo(x0, y0); - arg.pop_front(); arg.pop_front(); // As per 1.2 spec 8.3.2 The "moveto" commands // If a 'moveto' is followed by multiple pairs of coordinates without explicit commands, @@ -1440,15 +1445,16 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) } break; case 'M': { - if (arg.count() < 2) { - arg.pop_front(); + if (count < 2) { + num++; + count--; break; } - x = x0 = arg[0]; - y = y0 = arg[1]; - + x = x0 = num[0]; + y = y0 = num[1]; + num += 2; + count -= 2; path.moveTo(x0, y0); - arg.pop_front(); arg.pop_front(); // As per 1.2 spec 8.3.2 The "moveto" commands // If a 'moveto' is followed by multiple pairs of coordinates without explicit commands, @@ -1460,96 +1466,104 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) case 'Z': { x = x0; y = y0; + count--; // skip dummy + num++; path.closeSubpath(); - arg.pop_front();//pop dummy } break; case 'l': { - if (arg.count() < 2) { - arg.pop_front(); + if (count < 2) { + num++; + count--; break; } - x = arg.front() + offsetX; - arg.pop_front(); - y = arg.front() + offsetY; - arg.pop_front(); + x = x0 = num[0] + offsetX; + y = y0 = num[1] + offsetY; + num += 2; + count -= 2; path.lineTo(x, y); } break; case 'L': { - if (arg.count() < 2) { - arg.pop_front(); + if (count < 2) { + num++; + count--; break; } - x = arg.front(); arg.pop_front(); - y = arg.front(); arg.pop_front(); + x = x0 = num[0]; + y = y0 = num[1]; + num += 2; + count -= 2; path.lineTo(x, y); } break; case 'h': { - x = arg.front() + offsetX; arg.pop_front(); + x = num[0] + offsetX; + num++; + count--; path.lineTo(x, y); } break; case 'H': { - x = arg[0]; + x = num[0]; + num++; + count--; path.lineTo(x, y); - arg.pop_front(); } break; case 'v': { - y = arg[0] + offsetY; + y = num[0] + offsetY; + num++; + count--; path.lineTo(x, y); - arg.pop_front(); } break; case 'V': { - y = arg[0]; + y = num[0]; + num++; + count--; path.lineTo(x, y); - arg.pop_front(); } break; case 'c': { - if (arg.count() < 6) { - while (arg.count()) - arg.pop_front(); + if (count < 6) { + num += count; + count = 0; break; } - QPointF c1(arg[0]+offsetX, arg[1]+offsetY); - QPointF c2(arg[2]+offsetX, arg[3]+offsetY); - QPointF e(arg[4]+offsetX, arg[5]+offsetY); + QPointF c1(num[0] + offsetX, num[1] + offsetY); + QPointF c2(num[2] + offsetX, num[3] + offsetY); + QPointF e(num[4] + offsetX, num[5] + offsetY); + num += 6; + count -= 6; path.cubicTo(c1, c2, e); ctrlPt = c2; x = e.x(); y = e.y(); - arg.pop_front(); arg.pop_front(); - arg.pop_front(); arg.pop_front(); - arg.pop_front(); arg.pop_front(); break; } case 'C': { - if (arg.count() < 6) { - while (arg.count()) - arg.pop_front(); + if (count < 6) { + num += count; + count = 0; break; } - QPointF c1(arg[0], arg[1]); - QPointF c2(arg[2], arg[3]); - QPointF e(arg[4], arg[5]); + QPointF c1(num[0], num[1]); + QPointF c2(num[2], num[3]); + QPointF e(num[4], num[5]); + num += 6; + count -= 6; path.cubicTo(c1, c2, e); ctrlPt = c2; x = e.x(); y = e.y(); - arg.pop_front(); arg.pop_front(); - arg.pop_front(); arg.pop_front(); - arg.pop_front(); arg.pop_front(); break; } case 's': { - if (arg.count() < 4) { - while (arg.count()) - arg.pop_front(); + if (count < 4) { + num += count; + count = 0; break; } QPointF c1; @@ -1558,20 +1572,20 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) c1 = QPointF(2*x-ctrlPt.x(), 2*y-ctrlPt.y()); else c1 = QPointF(x, y); - QPointF c2(arg[0]+offsetX, arg[1]+offsetY); - QPointF e(arg[2]+offsetX, arg[3]+offsetY); + QPointF c2(num[0] + offsetX, num[1] + offsetY); + QPointF e(num[2] + offsetX, num[3] + offsetY); + num += 4; + count -= 4; path.cubicTo(c1, c2, e); ctrlPt = c2; x = e.x(); y = e.y(); - arg.pop_front(); arg.pop_front(); - arg.pop_front(); arg.pop_front(); break; } case 'S': { - if (arg.count() < 4) { - while (arg.count()) - arg.pop_front(); + if (count < 4) { + num += count; + count = 0; break; } QPointF c1; @@ -1580,55 +1594,57 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) c1 = QPointF(2*x-ctrlPt.x(), 2*y-ctrlPt.y()); else c1 = QPointF(x, y); - QPointF c2(arg[0], arg[1]); - QPointF e(arg[2], arg[3]); + QPointF c2(num[0], num[1]); + QPointF e(num[2], num[3]); + num += 4; + count -= 4; path.cubicTo(c1, c2, e); ctrlPt = c2; x = e.x(); y = e.y(); - arg.pop_front(); arg.pop_front(); - arg.pop_front(); arg.pop_front(); break; } case 'q': { - if (arg.count() < 4) { - while (arg.count()) - arg.pop_front(); + if (count < 4) { + num += count; + count = 0; break; } - QPointF c(arg[0]+offsetX, arg[1]+offsetY); - QPointF e(arg[2]+offsetX, arg[3]+offsetY); + QPointF c(num[0] + offsetX, num[1] + offsetY); + QPointF e(num[2] + offsetX, num[3] + offsetY); + num += 4; + count -= 4; path.quadTo(c, e); ctrlPt = c; x = e.x(); y = e.y(); - arg.pop_front(); arg.pop_front(); - arg.pop_front(); arg.pop_front(); break; } case 'Q': { - if (arg.count() < 4) { - while (arg.count()) - arg.pop_front(); + if (count < 4) { + num += count; + count = 0; break; } - QPointF c(arg[0], arg[1]); - QPointF e(arg[2], arg[3]); + QPointF c(num[0], num[1]); + QPointF e(num[2], num[3]); + num += 4; + count -= 4; path.quadTo(c, e); ctrlPt = c; x = e.x(); y = e.y(); - arg.pop_front(); arg.pop_front(); - arg.pop_front(); arg.pop_front(); break; } case 't': { - if (arg.count() < 2) { - while (arg.count()) - arg.pop_front(); + if (count < 2) { + num += count; + count = 0; break; } - QPointF e(arg[0]+offsetX, arg[1]+offsetY); + QPointF e(num[0] + offsetX, num[1] + offsetY); + num += 2; + count -= 2; QPointF c; if (lastMode == 'q' || lastMode == 'Q' || lastMode == 't' || lastMode == 'T') @@ -1639,16 +1655,17 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) ctrlPt = c; x = e.x(); y = e.y(); - arg.pop_front(); arg.pop_front(); break; } case 'T': { - if (arg.count() < 2) { - while (arg.count()) - arg.pop_front(); + if (count < 2) { + num += count; + count = 0; break; } - QPointF e(arg[0], arg[1]); + QPointF e(num[0], num[1]); + num += 2; + count -= 2; QPointF c; if (lastMode == 'q' || lastMode == 'Q' || lastMode == 't' || lastMode == 'T') @@ -1659,22 +1676,22 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) ctrlPt = c; x = e.x(); y = e.y(); - arg.pop_front(); arg.pop_front(); break; } case 'a': { - if (arg.count() < 7) { - while (arg.count()) - arg.pop_front(); + if (count < 7) { + num += count; + count = 0; break; } - qreal rx = arg[0]; - qreal ry = arg[1]; - qreal xAxisRotation = arg[2]; - qreal largeArcFlag = arg[3]; - qreal sweepFlag = arg[4]; - qreal ex = arg[5] + offsetX; - qreal ey = arg[6] + offsetY; + qreal rx = (*num++); + qreal ry = (*num++); + qreal xAxisRotation = (*num++); + qreal largeArcFlag = (*num++); + qreal sweepFlag = (*num++); + qreal ex = (*num++) + offsetX; + qreal ey = (*num++) + offsetY; + count -= 7; qreal curx = x; qreal cury = y; pathArc(path, rx, ry, xAxisRotation, int(largeArcFlag), @@ -1682,36 +1699,29 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path) x = ex; y = ey; - - arg.pop_front(); arg.pop_front(); - arg.pop_front(); arg.pop_front(); - arg.pop_front(); arg.pop_front(); - arg.pop_front(); } break; case 'A': { - if (arg.count() < 7) { - while (arg.count()) - arg.pop_front(); + if (count < 7) { + num += count; + count = 0; break; } - qreal rx = arg[0]; - qreal ry = arg[1]; - qreal xAxisRotation = arg[2]; - qreal largeArcFlag = arg[3]; - qreal sweepFlag = arg[4]; - qreal ex = arg[5]; - qreal ey = arg[6]; + qreal rx = (*num++); + qreal ry = (*num++); + qreal xAxisRotation = (*num++); + qreal largeArcFlag = (*num++); + qreal sweepFlag = (*num++); + qreal ex = (*num++); + qreal ey = (*num++); + count -= 7; qreal curx = x; qreal cury = y; pathArc(path, rx, ry, xAxisRotation, int(largeArcFlag), int(sweepFlag), ex, ey, curx, cury); + x = ex; y = ey; - arg.pop_front(); arg.pop_front(); - arg.pop_front(); arg.pop_front(); - arg.pop_front(); arg.pop_front(); - arg.pop_front(); } break; default: -- cgit v0.12 From ec4f9047913c07897496e2362e859072c24e8d9f Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Tue, 1 Sep 2009 17:48:11 +0200 Subject: Doc: Stylesheet min/max-width/height are relative to the box content. Task-number: 235550 Reviewed-by: Olivier Goffart --- doc/src/widgets-and-layouts/stylesheet.qdoc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/src/widgets-and-layouts/stylesheet.qdoc b/doc/src/widgets-and-layouts/stylesheet.qdoc index 6355850..354050d 100644 --- a/doc/src/widgets-and-layouts/stylesheet.qdoc +++ b/doc/src/widgets-and-layouts/stylesheet.qdoc @@ -2067,6 +2067,9 @@ QMenuBar, QPushButton, QRadioButton, QSizeGrip, QSpinBox, QSplitter, QStatusBar, QTextEdit, and QToolTip. + The value is relative to the contents rect in the \l{The + Box Model}{box model}. + Example: \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 63 @@ -2084,6 +2087,9 @@ QMenuBar, QPushButton, QRadioButton, QSizeGrip, QSpinBox, QSplitter, QStatusBar, QTextEdit, and QToolTip. + The value is relative to the contents rect in the \l{The + Box Model}{box model}. + Example: \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 64 @@ -2121,6 +2127,9 @@ If this property is not specified, the minimum height is derived based on the widget's contents and the style. + The value is relative to the contents rect in the \l{The + Box Model}{box model}. + Example: \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 66 @@ -2141,6 +2150,9 @@ If this property is not specified, the minimum width is derived based on the widget's contents and the style. + The value is relative to the contents rect in the \l{The + Box Model}{box model}. + Example: \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 67 -- cgit v0.12 From 8ed29668c48dd2a4560ad7a4b0908f3809cbc0df Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 1 Sep 2009 17:09:47 +0200 Subject: QNAM HTTP Code: Removed unnecessary legacy loop Thank you Coverity! Thank you Biochemist! Reviewed-by: joao --- src/network/access/qhttpnetworkconnection.cpp | 39 +++++++++++---------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index da9ec09..bd6fa57 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -425,32 +425,25 @@ void QHttpNetworkConnectionPrivate::dequeueAndSendRequest(QAbstractSocket *socke int i = indexOf(socket); if (!highPriorityQueue.isEmpty()) { - for (int j = highPriorityQueue.count() - 1; j >= 0; --j) { - HttpMessagePair &messagePair = highPriorityQueue[j]; - if (!messagePair.second->d_func()->requestIsPrepared) - prepareRequest(messagePair); - - channels[i].request = messagePair.first; - channels[i].reply = messagePair.second; - // remove before sendRequest! else we might pipeline the same request again - highPriorityQueue.removeAt(j); - channels[i].sendRequest(); - return; - } + // remove from queue before sendRequest! else we might pipeline the same request again + HttpMessagePair messagePair = highPriorityQueue.takeLast(); + if (!messagePair.second->d_func()->requestIsPrepared) + prepareRequest(messagePair); + channels[i].request = messagePair.first; + channels[i].reply = messagePair.second; + channels[i].sendRequest(); + return; } if (!lowPriorityQueue.isEmpty()) { - for (int j = lowPriorityQueue.count() - 1; j >= 0; --j) { - HttpMessagePair &messagePair = lowPriorityQueue[j]; - if (!messagePair.second->d_func()->requestIsPrepared) - prepareRequest(messagePair); - channels[i].request = messagePair.first; - channels[i].reply = messagePair.second; - // remove before sendRequest! else we might pipeline the same request again - lowPriorityQueue.removeAt(j); - channels[i].sendRequest(); - return; - } + // remove from queue before sendRequest! else we might pipeline the same request again + HttpMessagePair messagePair = lowPriorityQueue.takeLast(); + if (!messagePair.second->d_func()->requestIsPrepared) + prepareRequest(messagePair); + channels[i].request = messagePair.first; + channels[i].reply = messagePair.second; + channels[i].sendRequest(); + return; } } -- cgit v0.12 From fc4c4071d6e5704e84a5cca4ae22548bedb7b19d Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Tue, 1 Sep 2009 17:52:45 +0200 Subject: QScriptEngineAgent autotest bug fix Default value for script id in tests should be <-1, because -1 mean that there is no script and all numbers >0 are valid. Two test cases were marked as expected to fail. Reviewed-by: TrustMe --- tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp index 1f9476f..8fe6839 100644 --- a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp +++ b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp @@ -155,7 +155,7 @@ struct ScriptEngineEvent lineNumber(lineNumber) { } - ScriptEngineEvent(Type type, qint64 scriptId = -1) + ScriptEngineEvent(Type type, qint64 scriptId = -777) : type(type), scriptId(scriptId) { } @@ -2098,6 +2098,7 @@ void tst_QScriptEngineAgent::syntaxError() i = 2; QCOMPARE(spy->at(i).type, ScriptEngineEvent::ContextPush); + QEXPECT_FAIL("","The test is broken, contextPush event do not provide scriptId", Continue); QVERIFY(spy->at(i).scriptId == -1); i = 3; QCOMPARE(spy->at(i).type, ScriptEngineEvent::FunctionEntry); @@ -2107,6 +2108,7 @@ void tst_QScriptEngineAgent::syntaxError() QVERIFY(spy->at(i).scriptId == -1); i = 5; QCOMPARE(spy->at(i).type, ScriptEngineEvent::ContextPop); + QEXPECT_FAIL("","The test is broken, contextPop event do not provide scriptId", Continue); QVERIFY(spy->at(i).scriptId == -1); i = 6; QCOMPARE(spy->at(i).type, ScriptEngineEvent::ExceptionThrow); -- cgit v0.12 From 400d72d5c4b1556ddcc188d82a24d5439f728bbe Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Tue, 1 Sep 2009 18:50:41 +0200 Subject: Don't seg-fault when printing error message in shader manager It's very likely that some of the shader objects in required program will be null, as not all are manditory. Check to see if they exist before de-referencing them and asking for their log string. Reviewed-by: Trustme --- .../gl2paintengineex/qglengineshadermanager.cpp | 36 +++++++++++++++------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp index 891c027..d48a7b6 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp +++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp @@ -570,20 +570,34 @@ bool QGLEngineShaderManager::useCorrectShaderProg() requiredProgram.program->link(); if (!requiredProgram.program->isLinked()) { + QLatin1String none("none"); + QLatin1String br("\n"); QString error; - qWarning() << "Shader program failed to link," + error = QLatin1String("Shader program failed to link,") #if defined(QT_DEBUG) - << '\n' - << " Shaders Used:" << '\n' - << " mainVertexShader = " << requiredProgram.mainVertexShader->objectName() << '\n' - << " positionVertexShader = " << requiredProgram.positionVertexShader->objectName() << '\n' - << " mainFragShader = " << requiredProgram.mainFragShader->objectName() << '\n' - << " srcPixelFragShader = " << requiredProgram.srcPixelFragShader->objectName() << '\n' - << " maskFragShader = " << requiredProgram.maskFragShader->objectName() << '\n' - << " compositionFragShader = "<< requiredProgram.compositionFragShader->objectName() << '\n' + + br + + QLatin1String(" Shaders Used:\n") + + QLatin1String(" mainVertexShader = ") + + (requiredProgram.mainVertexShader ? + requiredProgram.mainVertexShader->objectName() : none) + br + + QLatin1String(" positionVertexShader = ") + + (requiredProgram.positionVertexShader ? + requiredProgram.positionVertexShader->objectName() : none) + br + + QLatin1String(" mainFragShader = ") + + (requiredProgram.mainFragShader ? + requiredProgram.mainFragShader->objectName() : none) + br + + QLatin1String(" srcPixelFragShader = ") + + (requiredProgram.srcPixelFragShader ? + requiredProgram.srcPixelFragShader->objectName() : none) + br + + QLatin1String(" maskFragShader = ") + + (requiredProgram.maskFragShader ? + requiredProgram.maskFragShader->objectName() : none) + br + + QLatin1String(" compositionFragShader = ") + + (requiredProgram.compositionFragShader ? + requiredProgram.compositionFragShader->objectName() : none) + br #endif - << " Error Log:" << '\n' - << " " << requiredProgram.program->log(); + + QLatin1String(" Error Log:\n") + + QLatin1String(" ") + requiredProgram.program->log(); qWarning() << error; delete requiredProgram.program; } else { -- cgit v0.12 From d21fc5446c7583e153c1d566aefd7186f9c445cd Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Tue, 1 Sep 2009 18:55:05 +0200 Subject: Autotest which checks you can paint to an fbo in a gl widget's p.e. The test mimics examples/opengl/framebufferobjects in that it begins a QPainter on a QGLWidget in it's paint event, then begins a second QPainter on a QGLFramebufferObject, leaving 2 painters active at the same time. When the FBO's painter is ended, GL rendering should be re-targetted at the QGLWidget automatically. --- tests/auto/qgl/tst_qgl.cpp | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index 1629542..f979174 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -73,6 +73,7 @@ private slots: void partialGLWidgetUpdates(); void glWidgetRendering(); void glFBORendering(); + void glFBOUseInGLWidget(); void glPBufferRendering(); void glWidgetReparent(); void colormap(); @@ -769,6 +770,60 @@ void tst_QGL::glFBORendering() QCOMPARE(fb.pixel(192, 64), QColor(Qt::green).rgb()); } +class FBOUseInGLWidget : public QGLWidget +{ +public: + bool widgetPainterBeginOk; + bool fboPainterBeginOk; + QImage fboImage; +protected: + void paintEvent(QPaintEvent*) + { + QPainter widgetPainter; + widgetPainterBeginOk = widgetPainter.begin(this); + QGLFramebufferObjectFormat fboFormat(0, QGLFramebufferObject::CombinedDepthStencil); + QGLFramebufferObject *fbo = new QGLFramebufferObject(128, 128, fboFormat); + + QPainter fboPainter; + fboPainterBeginOk = fboPainter.begin(fbo); + fboPainter.fillRect(0, 0, 128, 128, Qt::red); + fboPainter.end(); + fboImage = fbo->toImage(); + + widgetPainter.fillRect(rect(), Qt::blue); + + delete fbo; + } + +}; + +void tst_QGL::glFBOUseInGLWidget() +{ + if (!QGLFramebufferObject::hasOpenGLFramebufferObjects()) + QSKIP("QGLFramebufferObject not supported on this platform", SkipSingle); + + FBOUseInGLWidget w; + w.resize(128, 128); + w.show(); + +#ifdef Q_WS_X11 + qt_x11_wait_for_window_manager(&w); +#endif + QTest::qWait(200); + + QVERIFY(w.widgetPainterBeginOk); + QVERIFY(w.fboPainterBeginOk); + + QImage widgetFB = w.grabFrameBuffer(false); + QImage widgetReference(widgetFB.size(), widgetFB.format()); + widgetReference.fill(0xff0000ff); + QCOMPARE(widgetFB, widgetReference); + + QImage fboReference(w.fboImage.size(), w.fboImage.format()); + fboReference.fill(0xffff0000); + QCOMPARE(w.fboImage, fboReference); +} + void tst_QGL::glWidgetReparent() { // Try it as a top-level first: -- cgit v0.12 From 491bf41b96fdc48aa166ae7702e00f3e6eb1825c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 1 Sep 2009 19:16:11 +0200 Subject: Fix Solaris build: test isn't test. configure: test: argument expected Reviewed-by: TrustMe --- configure | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 6832ad3..c519ab1 100755 --- a/configure +++ b/configure @@ -3723,8 +3723,9 @@ elif [ "$Edition" = "OpenSource" ]; then echo "You have already accepted the terms of the $LicenseType license." acceptance=yes else - test -e "$relpath/LICENSE.GPL3" && \ + if [ -e "$relpath/LICENSE.GPL3" ]; then echo "Type '3' to view the GNU General Public License version 3." + fi echo "Type 'L' to view the Lesser GNU General Public License version 2.1." echo "Type 'yes' to accept this license offer." echo "Type 'no' to decline this license offer." -- cgit v0.12 From 16bbf23d75f0754b0b1a458cb77de560b280755d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Tue, 1 Sep 2009 18:54:03 +0200 Subject: Don't check for null if never happens, but test it if it may... Making coverity happy. Reviewed-by: Olivier Goffart --- src/corelib/kernel/qobject.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 4d9d3b2..c0c97b8 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -3364,10 +3364,10 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_sign && (currentThreadData != sender->d_func()->threadData || receiver->d_func()->threadData != sender->d_func()->threadData)) || (c->connectionType == Qt::QueuedConnection)) { - queued_activate(sender, signal_absolute_index, c, argv); + queued_activate(sender, signal_absolute_index, c, argv ? argv : empty_argv); continue; } else if (c->connectionType == Qt::BlockingQueuedConnection) { - blocking_activate(sender, signal_absolute_index, c, argv); + blocking_activate(sender, signal_absolute_index, c, argv ? argv : empty_argv); continue; } @@ -3442,7 +3442,7 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_sign void QMetaObject::activate(QObject *sender, int signal_index, void **argv) { const QMetaObject *mo = sender->metaObject(); - while (mo && mo->methodOffset() > signal_index) + while (mo->methodOffset() > signal_index) mo = mo->superClass(); activate(sender, mo, signal_index - mo->methodOffset(), argv); } @@ -3706,7 +3706,7 @@ void QObject::dumpObjectInfo() const QMetaObject *mo = metaObject(); int signalOffset, methodOffset; computeOffsets(mo, &signalOffset, &methodOffset); - while (mo && signalOffset > signal_index) { + while (signalOffset > signal_index) { mo = mo->superClass(); offsetToNextMetaObject = signalOffset; computeOffsets(mo, &signalOffset, &methodOffset); -- cgit v0.12 From e2f53156a86457598f5fde00b6d8742061eb1f76 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Thu, 27 Aug 2009 07:40:30 -0700 Subject: Add directfb to CFG_GFX_AVAILABLE This is a first step in making it possible to build DirectFB as part of QtGui. Reviewed-by: Thiago Macieira --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 3b0cf5b..87d1428 100755 --- a/configure +++ b/configure @@ -643,7 +643,7 @@ CFG_MULTIMEDIA=yes CFG_SVG=yes CFG_WEBKIT=auto # (yes|no|auto) -CFG_GFX_AVAILABLE="linuxfb transformed qvfb vnc multiscreen" +CFG_GFX_AVAILABLE="linuxfb transformed qvfb vnc multiscreen directfb" CFG_GFX_ON="linuxfb multiscreen" CFG_GFX_PLUGIN_AVAILABLE= CFG_GFX_PLUGIN= -- cgit v0.12 From 26ad573f487a370a01ba640813c189e948eb8fd0 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Thu, 27 Aug 2009 07:47:35 -0700 Subject: Copy directfb.pro to src/gui/embedded/directfb.pri Reviewed-by: Thiago Macieira --- src/gui/embedded/directfb.pri | 38 ++++++++++++++++++++++++++++ src/plugins/gfxdrivers/directfb/directfb.pro | 38 +++------------------------- 2 files changed, 41 insertions(+), 35 deletions(-) create mode 100644 src/gui/embedded/directfb.pri diff --git a/src/gui/embedded/directfb.pri b/src/gui/embedded/directfb.pri new file mode 100644 index 0000000..e868252 --- /dev/null +++ b/src/gui/embedded/directfb.pri @@ -0,0 +1,38 @@ +# These defines might be necessary if your DirectFB driver doesn't +# support all of the DirectFB API. +# +#DEFINES += QT_DIRECTFB_WINDOW_AS_CURSOR +#DEFINES += QT_NO_DIRECTFB_IMAGEPROVIDER +#DEFINES += QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE +#DEFINES += QT_DIRECTFB_IMAGECACHE +#DEFINES += QT_NO_DIRECTFB_WM +#DEFINES += QT_NO_DIRECTFB_LAYER +#DEFINES += QT_NO_DIRECTFB_PALETTE +#DEFINES += QT_NO_DIRECTFB_PREALLOCATED +#DEFINES += QT_NO_DIRECTFB_MOUSE +#DEFINES += QT_NO_DIRECTFB_KEYBOARD +#DEFINES += QT_DIRECTFB_TIMING +#DEFINES += QT_NO_DIRECTFB_OPAQUE_DETECTION +#DIRECTFB_DRAWINGOPERATIONS=DRAW_RECTS|DRAW_LINES|DRAW_IMAGE|DRAW_PIXMAP|DRAW_TILED_PIXMAP|STROKE_PATH|DRAW_PATH|DRAW_POINTS|DRAW_ELLIPSE|DRAW_POLYGON|DRAW_TEXT|FILL_PATH|FILL_RECT|DRAW_COLORSPANS +#DEFINES += \"QT_DIRECTFB_WARN_ON_RASTERFALLBACKS=$$DIRECTFB_DRAWINGOPERATIONS\" +#DEFINES += \"QT_DIRECTFB_DISABLE_RASTERFALLBACKS=$$DIRECTFB_DRAWINGOPERATIONS\" + +HEADERS += $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h \ + $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h \ + $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h \ + $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h \ + $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h \ + $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.h \ + $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbmouse.h + +SOURCES += $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp \ + $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp \ + $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp \ + $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp \ + $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp \ + $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp \ + $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp + + +QMAKE_CXXFLAGS += $$QT_CFLAGS_DIRECTFB +LIBS += $$QT_LIBS_DIRECTFB diff --git a/src/plugins/gfxdrivers/directfb/directfb.pro b/src/plugins/gfxdrivers/directfb/directfb.pro index c5da3df..d397050 100644 --- a/src/plugins/gfxdrivers/directfb/directfb.pro +++ b/src/plugins/gfxdrivers/directfb/directfb.pro @@ -1,47 +1,15 @@ TARGET = qdirectfbscreen include(../../qpluginbase.pri) +include($$QT_SOURCE_TREE/src/gui/embedded/directfb.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/gfxdrivers -# These defines might be necessary if your DirectFB driver doesn't -# support all of the DirectFB API. -# -#DEFINES += QT_DIRECTFB_WINDOW_AS_CURSOR -#DEFINES += QT_NO_DIRECTFB_IMAGEPROVIDER -#DEFINES += QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE -#DEFINES += QT_DIRECTFB_IMAGECACHE -#DEFINES += QT_NO_DIRECTFB_WM -#DEFINES += QT_NO_DIRECTFB_LAYER -#DEFINES += QT_NO_DIRECTFB_PALETTE -#DEFINES += QT_NO_DIRECTFB_PREALLOCATED -#DEFINES += QT_NO_DIRECTFB_MOUSE -#DEFINES += QT_NO_DIRECTFB_KEYBOARD -#DEFINES += QT_DIRECTFB_TIMING -#DEFINES += QT_NO_DIRECTFB_OPAQUE_DETECTION -#DIRECTFB_DRAWINGOPERATIONS=DRAW_RECTS|DRAW_LINES|DRAW_IMAGE|DRAW_PIXMAP|DRAW_TILED_PIXMAP|STROKE_PATH|DRAW_PATH|DRAW_POINTS|DRAW_ELLIPSE|DRAW_POLYGON|DRAW_TEXT|FILL_PATH|FILL_RECT|DRAW_COLORSPANS -#DEFINES += \"QT_DIRECTFB_WARN_ON_RASTERFALLBACKS=$$DIRECTFB_DRAWINGOPERATIONS\" -#DEFINES += \"QT_DIRECTFB_DISABLE_RASTERFALLBACKS=$$DIRECTFB_DRAWINGOPERATIONS\" - target.path = $$[QT_INSTALL_PLUGINS]/gfxdrivers INSTALLS += target -HEADERS = qdirectfbscreen.h \ - qdirectfbwindowsurface.h \ - qdirectfbpaintengine.h \ - qdirectfbpaintdevice.h \ - qdirectfbpixmap.h \ - qdirectfbkeyboard.h \ - qdirectfbmouse.h - -SOURCES = qdirectfbscreen.cpp \ - qdirectfbscreenplugin.cpp \ - qdirectfbwindowsurface.cpp \ - qdirectfbpaintengine.cpp \ - qdirectfbpaintdevice.cpp \ - qdirectfbpixmap.cpp \ - qdirectfbkeyboard.cpp \ - qdirectfbmouse.cpp +SOURCES += qdirectfbscreenplugin.cpp QMAKE_CXXFLAGS += $$QT_CFLAGS_DIRECTFB LIBS += $$QT_LIBS_DIRECTFB DEFINES += $$QT_DEFINES_DIRECTFB +contains(gfx-plugins, directfb):DEFINES += QT_QWS_DIRECTFB -- cgit v0.12 From 5bbb30442772898a9af04a8986416e6d66cf1311 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Thu, 27 Aug 2009 07:57:30 -0700 Subject: Add directfb.pri to embedded.pri Reviewed-by: Thiago Macieira --- src/gui/embedded/embedded.pri | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/embedded/embedded.pri b/src/gui/embedded/embedded.pri index 255a504..eb13d8d 100644 --- a/src/gui/embedded/embedded.pri +++ b/src/gui/embedded/embedded.pri @@ -139,6 +139,10 @@ embedded { SOURCES += embedded/qscreentransformed_qws.cpp } + contains( gfx-drivers, directfb ) { + INCLUDEPATH += $$QT_SOURCE_TREE/src/plugins/gfxdrivers/directfb + include($$PWD/directfb.pri) + } # # Keyboard drivers # -- cgit v0.12 From d6c197aa263ba7e98d29376fee95ec10125b8cf2 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Mon, 31 Aug 2009 13:30:45 -0700 Subject: Add DirectFB to QScreenDriverFactory Reviewed-by: Donald Carr --- src/gui/embedded/qscreendriverfactory_qws.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/embedded/qscreendriverfactory_qws.cpp b/src/gui/embedded/qscreendriverfactory_qws.cpp index 21058af..99ee8f2 100644 --- a/src/gui/embedded/qscreendriverfactory_qws.cpp +++ b/src/gui/embedded/qscreendriverfactory_qws.cpp @@ -51,7 +51,9 @@ #include #include "private/qfactoryloader_p.h" #include "qscreendriverplugin_qws.h" - +#ifndef QT_NO_QWS_DIRECTFB +#include "qdirectfbscreen.h" +#endif #ifndef QT_NO_QWS_VNC #include "qscreenvnc_qws.h" #endif @@ -118,6 +120,10 @@ QScreen *QScreenDriverFactory::create(const QString& key, int displayId) if (driver == QLatin1String("linuxfb") || driver.isEmpty()) return new QLinuxFbScreen(displayId); #endif +#ifndef QT_NO_QWS_DIRECTFB + if (driver == QLatin1String("directfb") || driver.isEmpty()) + return new QDirectFBScreen(displayId); +#endif #ifndef QT_NO_QWS_TRANSFORMED if (driver == QLatin1String("transformed")) return new QTransformedScreen(displayId); @@ -130,7 +136,6 @@ QScreen *QScreenDriverFactory::create(const QString& key, int displayId) if (driver == QLatin1String("multi")) return new QMultiScreen(displayId); #endif - #if !defined(Q_OS_WIN32) || defined(QT_MAKEDLL) #ifndef QT_NO_LIBRARY -- cgit v0.12 From 913a21aae513714217be233c6cecfb39212a4be8 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Mon, 31 Aug 2009 12:40:19 -0700 Subject: Make DirectFB compile with Qt in a namespace Reviewed-by: Donald Carr --- src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp | 4 +-- .../gfxdrivers/directfb/qdirectfbpaintengine.cpp | 33 +++++++++++----------- .../gfxdrivers/directfb/qdirectfbpixmap.cpp | 4 +-- .../gfxdrivers/directfb/qdirectfbscreen.cpp | 16 +++++------ .../gfxdrivers/directfb/qdirectfbwindowsurface.cpp | 24 +++++++--------- 5 files changed, 38 insertions(+), 43 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp index 2fb1520..896f512 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp @@ -121,8 +121,8 @@ QDirectFBMouseHandlerPrivate::QDirectFBMouseHandlerPrivate(QDirectFBMouseHandler return; } - int flags = ::fcntl(fd, F_GETFL, 0); - ::fcntl(fd, F_SETFL, flags | O_NONBLOCK); + int flags = fcntl(fd, F_GETFL, 0); + fcntl(fd, F_SETFL, flags | O_NONBLOCK); // DirectFB seems to assume that the mouse always starts centered prevPoint = QPoint(screen->deviceWidth() / 2, screen->deviceHeight() / 2); diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 9a9553e..984b5c6 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -109,7 +109,7 @@ public: #endif void prepareForBlit(bool alpha); -private: + IDirectFBSurface *surface; bool antialiased; @@ -129,7 +129,6 @@ private: QRect currentClip; QDirectFBPaintEngine *q; - friend class QDirectFBPaintEngine; }; class SurfaceCache @@ -412,11 +411,11 @@ void QDirectFBPaintEngine::drawRects(const QRect *rects, int rectCount) d->unlock(); if (brush != Qt::NoBrush) { d->setDFBColor(brush.color()); - CLIPPED_PAINT(::fillRects(rects, rectCount, state()->matrix, d->surface)); + CLIPPED_PAINT(QT_PREPEND_NAMESPACE(fillRects)(rects, rectCount, state()->matrix, d->surface)); } if (pen != Qt::NoPen) { d->setDFBColor(pen.color()); - CLIPPED_PAINT(::drawRects(rects, rectCount, state()->matrix, d->surface)); + CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawRects)(rects, rectCount, state()->matrix, d->surface)); } } @@ -441,11 +440,11 @@ void QDirectFBPaintEngine::drawRects(const QRectF *rects, int rectCount) d->unlock(); if (brush != Qt::NoBrush) { d->setDFBColor(brush.color()); - CLIPPED_PAINT(::fillRects(rects, rectCount, state()->matrix, d->surface)); + CLIPPED_PAINT(fillRects(rects, rectCount, state()->matrix, d->surface)); } if (pen != Qt::NoPen) { d->setDFBColor(pen.color()); - CLIPPED_PAINT(::drawRects(rects, rectCount, state()->matrix, d->surface)); + CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawRects)(rects, rectCount, state()->matrix, d->surface)); } } @@ -466,7 +465,7 @@ void QDirectFBPaintEngine::drawLines(const QLine *lines, int lineCount) if (pen != Qt::NoPen) { d->unlock(); d->setDFBColor(pen.color()); - CLIPPED_PAINT(::drawLines(lines, lineCount, state()->matrix, d->surface)); + CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawLines)(lines, lineCount, state()->matrix, d->surface)); } } @@ -487,7 +486,7 @@ void QDirectFBPaintEngine::drawLines(const QLineF *lines, int lineCount) if (pen != Qt::NoPen) { d->unlock(); d->setDFBColor(pen.color()); - CLIPPED_PAINT(::drawLines(lines, lineCount, state()->matrix, d->surface)); + CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawLines)(lines, lineCount, state()->matrix, d->surface)); } } @@ -1040,8 +1039,8 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix offset.ry() *= transform.m22(); const QSizeF mappedSize(pixmapSize.width() * transform.m11(), pixmapSize.height() * transform.m22()); - qreal y = ::fixCoord(destinationRect.y(), mappedSize.height(), offset.y()); - const qreal startX = ::fixCoord(destinationRect.x(), mappedSize.width(), offset.x()); + qreal y = fixCoord(destinationRect.y(), mappedSize.height(), offset.y()); + const qreal startX = fixCoord(destinationRect.x(), mappedSize.width(), offset.x()); while (y <= destinationRect.bottom()) { qreal x = startX; while (x <= destinationRect.right()) { @@ -1052,8 +1051,8 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix y += mappedSize.height(); } } else { - qreal y = ::fixCoord(destinationRect.y(), pixmapSize.height(), offset.y()); - const qreal startX = ::fixCoord(destinationRect.x(), pixmapSize.width(), offset.x()); + qreal y = fixCoord(destinationRect.y(), pixmapSize.height(), offset.y()); + const qreal startX = fixCoord(destinationRect.x(), pixmapSize.width(), offset.x()); int horizontal = qMax(1, destinationRect.width() / pixmapSize.width()) + 1; if (startX != destinationRect.x()) ++horizontal; @@ -1165,12 +1164,12 @@ template static inline void drawLines(const T *lines, int n, const QTransform &transform, IDirectFBSurface *surface) { if (n == 1) { - const QLine l = ::map(transform, lines[0]); + const QLine l = map(transform, lines[0]); surface->DrawLine(surface, l.x1(), l.y1(), l.x2(), l.y2()); } else { QVarLengthArray lineArray(n); for (int i=0; i static inline void fillRects(const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface) { if (n == 1) { - const QRect r = ::mapRect(transform, rects[0]); + const QRect r = mapRect(transform, rects[0]); surface->FillRectangle(surface, r.x(), r.y(), r.width(), r.height()); } else { QVarLengthArray rectArray(n); for (int i=0; i static inline void drawRects(const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface) { for (int i=0; iDrawRectangle(surface, r.x(), r.y(), r.width(), r.height()); } } diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index 0717020..4da2f7c 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -167,7 +167,7 @@ static bool checkForAlphaPixels(const QImage &img) bool QDirectFBPixmapData::hasAlphaChannel(const QImage &img) { #ifndef QT_NO_DIRECTFB_OPAQUE_DETECTION - return ::checkForAlphaPixels(img); + return checkForAlphaPixels(img); #else return img.hasAlphaChannel(); #endif @@ -443,7 +443,7 @@ void QDirectFBPixmapData::fill(const QColor &color) alpha = (color.alpha() < 255); - if (alpha && ::isOpaqueFormat(imageFormat)) { + if (alpha && isOpaqueFormat(imageFormat)) { QSize size; dfbSurface->GetSize(dfbSurface, &size.rwidth(), &size.rheight()); screen->releaseDFBSurface(dfbSurface); diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 59fa191..c714989 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -999,9 +999,9 @@ static void printDirectFBInfo(IDirectFB *fb, IDirectFBSurface *primarySurface) dev.name, dev.vendor, dev.driver.name, dev.driver.major, dev.driver.minor, dev.driver.vendor, DFB_PIXELFORMAT_INDEX(pixelFormat), QDirectFBScreen::getImageFormat(primarySurface), dev.acceleration_mask, - ::flagDescriptions(dev.acceleration_mask, accelerationDescriptions).constData(), - dev.blitting_flags, ::flagDescriptions(dev.blitting_flags, blitDescriptions).constData(), - dev.drawing_flags, ::flagDescriptions(dev.drawing_flags, drawDescriptions).constData(), + flagDescriptions(dev.acceleration_mask, accelerationDescriptions).constData(), + dev.blitting_flags, flagDescriptions(dev.blitting_flags, blitDescriptions).constData(), + dev.drawing_flags, flagDescriptions(dev.drawing_flags, drawDescriptions).constData(), (dev.video_memory >> 10)); } #endif @@ -1067,7 +1067,7 @@ bool QDirectFBScreen::connect(const QString &displaySpec) #ifdef QT_DIRECTFB_IMAGECACHE int imageCacheSize = 4 * 1024 * 1024; // 4 MB - ::setIntOption(displayArgs, QLatin1String("imagecachesize"), &imageCacheSize); + setIntOption(displayArgs, QLatin1String("imagecachesize"), &imageCacheSize); QDirectFBPaintEngine::initImageCache(imageCacheSize); #endif @@ -1191,8 +1191,8 @@ bool QDirectFBScreen::connect(const QString &displaySpec) "Unable to get screen size!", result); return false; } - ::setIntOption(displayArgs, QLatin1String("width"), &w); - ::setIntOption(displayArgs, QLatin1String("height"), &h); + setIntOption(displayArgs, QLatin1String("width"), &w); + setIntOption(displayArgs, QLatin1String("height"), &h); dw = w; dh = h; @@ -1200,8 +1200,8 @@ bool QDirectFBScreen::connect(const QString &displaySpec) Q_ASSERT(dw != 0 && dh != 0); physWidth = physHeight = -1; - ::setIntOption(displayArgs, QLatin1String("mmWidth"), &physWidth); - ::setIntOption(displayArgs, QLatin1String("mmHeight"), &physHeight); + setIntOption(displayArgs, QLatin1String("mmWidth"), &physWidth); + setIntOption(displayArgs, QLatin1String("mmHeight"), &physHeight); const int dpi = 72; if (physWidth < 0) physWidth = qRound(dw * 25.4 / dpi); diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index 73a6dd7..816bd83 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -102,6 +102,11 @@ QDirectFBWindowSurface::~QDirectFBWindowSurface() { } +bool QDirectFBWindowSurface::isValid() const +{ + return true; +} + #ifdef QT_DIRECTFB_WM void QDirectFBWindowSurface::raise() { @@ -111,14 +116,7 @@ void QDirectFBWindowSurface::raise() sibling->raise(); } } -#endif - -bool QDirectFBWindowSurface::isValid() const -{ - return true; -} -#ifndef QT_NO_DIRECTFB_WM void QDirectFBWindowSurface::createWindow() { IDirectFBDisplayLayer *layer = screen->dfbDisplayLayer(); @@ -148,10 +146,8 @@ void QDirectFBWindowSurface::createWindow() dfbWindow->GetSurface(dfbWindow, &dfbSurface); updateFormat(); } -#endif // QT_NO_DIRECTFB_WM -#ifndef QT_NO_DIRECTFB_WM -static DFBResult setGeometry(IDirectFBWindow *dfbWindow, const QRect &old, const QRect &rect) +static DFBResult setWindowGeometry(IDirectFBWindow *dfbWindow, const QRect &old, const QRect &rect) { DFBResult result = DFB_OK; const bool isMove = old.isEmpty() || rect.topLeft() != old.topLeft(); @@ -178,7 +174,7 @@ static DFBResult setGeometry(IDirectFBWindow *dfbWindow, const QRect &old, const #endif return result; } -#endif +#endif // QT_NO_DIRECTFB_WM void QDirectFBWindowSurface::setGeometry(const QRect &rect) { @@ -209,7 +205,7 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect) #ifdef QT_DIRECTFB_WM if (!dfbWindow) createWindow(); - ::setGeometry(dfbWindow, oldRect, rect); + setWindowGeometry(dfbWindow, oldRect, rect); #else if (mode == Primary) { if (dfbSurface && dfbSurface != primarySurface) @@ -271,12 +267,12 @@ bool QDirectFBWindowSurface::scroll(const QRegion ®ion, int dx, int dy) return false; dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX); if (region.numRects() == 1) { - ::scrollSurface(dfbSurface, region.boundingRect(), dx, dy); + scrollSurface(dfbSurface, region.boundingRect(), dx, dy); } else { const QVector rects = region.rects(); const int n = rects.size(); for (int i=0; i Date: Thu, 27 Aug 2009 20:37:40 -0700 Subject: Rewrite of DirectFB locking mechanism DirectFB allows you to have a locked subSurface that remains valid while you paint on the unlocked "parent" surface. The only limitation is that when accessing the locked memory you might have to call DirectFB->WaitIdle() in case pending GPU operations aren't finished. After this we keep the locked surface around at all times (from the first time it's requested) until the surface dies. Previous calls to lock() will just call WaitIdle if necessary and previous calls to unlock now just mark the surface as dirty and in need of a WaitIdle if someone needs to access its pixel data. Reviewed-by: Donald Carr --- src/gui/embedded/directfb.pri | 1 + .../gfxdrivers/directfb/qdirectfbpaintdevice.cpp | 99 +++++++++++++++------- .../gfxdrivers/directfb/qdirectfbpaintdevice.h | 16 ++-- .../gfxdrivers/directfb/qdirectfbpaintengine.cpp | 68 ++++++++------- .../gfxdrivers/directfb/qdirectfbpixmap.cpp | 31 ++++--- src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h | 6 +- .../gfxdrivers/directfb/qdirectfbscreen.cpp | 39 ++++++++- src/plugins/gfxdrivers/directfb/qdirectfbscreen.h | 12 +++ .../gfxdrivers/directfb/qdirectfbwindowsurface.cpp | 5 +- 9 files changed, 185 insertions(+), 92 deletions(-) diff --git a/src/gui/embedded/directfb.pri b/src/gui/embedded/directfb.pri index e868252..7dae9d5 100644 --- a/src/gui/embedded/directfb.pri +++ b/src/gui/embedded/directfb.pri @@ -1,6 +1,7 @@ # These defines might be necessary if your DirectFB driver doesn't # support all of the DirectFB API. # +#DEFINES += QT_NO_DIRECTFB_SUBSURFACE #DEFINES += QT_DIRECTFB_WINDOW_AS_CURSOR #DEFINES += QT_NO_DIRECTFB_IMAGEPROVIDER #DEFINES += QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp index 106de0d..2e56b9a 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp @@ -48,14 +48,29 @@ QT_BEGIN_NAMESPACE QDirectFBPaintDevice::QDirectFBPaintDevice(QDirectFBScreen *scr) - : QCustomRasterPaintDevice(0), dfbSurface(0), lockedImage(0), screen(scr), - bpl(-1), lockFlgs(DFBSurfaceLockFlags(0)), mem(0), engine(0), - imageFormat(QImage::Format_Invalid) -{} + : QCustomRasterPaintDevice(0), dfbSurface(0), screen(scr), + bpl(-1), lockFlgs(DFBSurfaceLockFlags(0)), mem(0), engine(0), imageFormat(QImage::Format_Invalid) +{ +#ifdef QT_DIRECTFB_SUBSURFACE + subSurface = 0; + syncPending = false; +#endif +} QDirectFBPaintDevice::~QDirectFBPaintDevice() { - delete lockedImage; + unlockSurface(); + if (QDirectFBScreen::instance()) { + unlockSurface(); +#ifdef QT_DIRECTFB_SUBSURFACE + if (subSurface) { + screen->releaseDFBSurface(subSurface); + } +#endif + if (dfbSurface) { + screen->releaseDFBSurface(dfbSurface); + } + } delete engine; } @@ -64,30 +79,57 @@ IDirectFBSurface *QDirectFBPaintDevice::directFBSurface() const return dfbSurface; } -void QDirectFBPaintDevice::lockDirectFB(DFBSurfaceLockFlags flags) +bool QDirectFBPaintDevice::lockSurface(DFBSurfaceLockFlags lockFlags) { - if (!(lockFlgs & flags)) { - if (lockFlgs) - unlockDirectFB(); - mem = QDirectFBScreen::lockSurface(dfbSurface, flags, &bpl); + if (lockFlgs && (lockFlags & ~lockFlgs)) + unlockSurface(); + if (!mem) { + Q_ASSERT(dfbSurface); +#ifdef QT_DIRECTFB_SUBSURFACE + if (!subSurface) { + DFBResult result; + subSurface = screen->getSubSurface(dfbSurface, QRect(), QDirectFBScreen::TrackSurface, &result); + if (result != DFB_OK || !subSurface) { + DirectFBError("Couldn't create sub surface", result); + return false; + } + } + IDirectFBSurface *surface = subSurface; +#else + IDirectFBSurface *surface = dfbSurface; +#endif + Q_ASSERT(surface); + mem = QDirectFBScreen::lockSurface(surface, lockFlags, &bpl); + lockFlgs = lockFlags; Q_ASSERT(mem); + Q_ASSERT(bpl > 0); const QSize s = size(); - lockedImage = new QImage(mem, s.width(), s.height(), bpl, - QDirectFBScreen::getImageFormat(dfbSurface)); - lockFlgs = flags; + lockedImage = QImage(mem, s.width(), s.height(), bpl, + QDirectFBScreen::getImageFormat(dfbSurface)); + return true; + } +#ifdef QT_DIRECTFB_SUBSURFACE + if (syncPending) { + syncPending = false; + screen->waitIdle(); } +#endif + return false; } -void QDirectFBPaintDevice::unlockDirectFB() +void QDirectFBPaintDevice::unlockSurface() { - if (!lockedImage || !QDirectFBScreen::instance()) - return; - - dfbSurface->Unlock(dfbSurface); - delete lockedImage; - lockedImage = 0; - mem = 0; - lockFlgs = DFBSurfaceLockFlags(0); + if (QDirectFBScreen::instance() && lockFlgs) { +#ifdef QT_DIRECTFB_SUBSURFACE + IDirectFBSurface *surface = subSurface; +#else + IDirectFBSurface *surface = dfbSurface; +#endif + if (surface) { + surface->Unlock(surface); + lockFlgs = static_cast(0); + } + } } void *QDirectFBPaintDevice::memory() const @@ -102,17 +144,10 @@ QImage::Format QDirectFBPaintDevice::format() const int QDirectFBPaintDevice::bytesPerLine() const { - if (bpl == -1) { - // Can only get the stride when we lock the surface - Q_ASSERT(!lockedImage); - QDirectFBPaintDevice* that = const_cast(this); - that->lockDirectFB(DSLF_READ|DSLF_WRITE); - Q_ASSERT(bpl != -1); - } + Q_ASSERT(!mem || bpl != -1); return bpl; } - QSize QDirectFBPaintDevice::size() const { int w, h; @@ -142,8 +177,8 @@ int QDirectFBPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const case QPaintDevice::PdmDepth: return QDirectFBScreen::depth(imageFormat); case QPaintDevice::PdmNumColors: { - if (lockedImage) - return lockedImage->numColors(); + if (!lockedImage.isNull()) + return lockedImage.numColors(); DFBResult result; IDirectFBPalette *palette = 0; diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h index f5de44b..cdd2bea 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h @@ -62,8 +62,8 @@ public: virtual IDirectFBSurface *directFBSurface() const; - void lockDirectFB(DFBSurfaceLockFlags lock); - void unlockDirectFB(); + bool lockSurface(DFBSurfaceLockFlags lockFlags); + void unlockSurface(); // Reimplemented from QCustomRasterPaintDevice: void *memory() const; @@ -73,7 +73,6 @@ public: int metric(QPaintDevice::PaintDeviceMetric metric) const; DFBSurfaceLockFlags lockFlags() const { return lockFlgs; } QPaintEngine *paintEngine() const; - protected: QDirectFBPaintDevice(QDirectFBScreen *scr); inline int dotsPerMeterX() const @@ -84,17 +83,20 @@ protected: { return (screen->deviceHeight() * 1000) / screen->physicalHeight(); } -protected: + IDirectFBSurface *dfbSurface; - QImage *lockedImage; +#ifdef QT_DIRECTFB_SUBSURFACE + IDirectFBSurface *subSurface; + friend class QDirectFBPaintEnginePrivate; + bool syncPending; +#endif + QImage lockedImage; QDirectFBScreen *screen; int bpl; DFBSurfaceLockFlags lockFlgs; uchar *mem; QDirectFBPaintEngine *engine; QImage::Format imageFormat; -private: - Q_DISABLE_COPY(QDirectFBPaintDevice); }; QT_END_NAMESPACE diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 984b5c6..5bad4de 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -93,6 +93,7 @@ public: inline void lock(); inline void unlock(); + static inline void unlock(QDirectFBPaintDevice *device); inline bool isSimpleBrush(const QBrush &brush) const; @@ -221,6 +222,7 @@ template static inline void drawRects(const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface); #define CLIPPED_PAINT(operation) { \ + d->unlock(); \ DFBRegion clipRegion; \ switch (d->clipType) { \ case QDirectFBPaintEnginePrivate::NoClip: \ @@ -268,6 +270,7 @@ bool QDirectFBPaintEngine::begin(QPaintDevice *device) QPixmapData *data = static_cast(device)->pixmapData(); Q_ASSERT(data->classId() == QPixmapData::DirectFBClass); QDirectFBPixmapData *dfbPixmapData = static_cast(data); + QDirectFBPaintEnginePrivate::unlock(dfbPixmapData); d->dfbDevice = static_cast(dfbPixmapData); } @@ -408,7 +411,6 @@ void QDirectFBPaintEngine::drawRects(const QRect *rects, int rectCount) QRasterPaintEngine::drawRects(rects, rectCount); return; } - d->unlock(); if (brush != Qt::NoBrush) { d->setDFBColor(brush.color()); CLIPPED_PAINT(QT_PREPEND_NAMESPACE(fillRects)(rects, rectCount, state()->matrix, d->surface)); @@ -437,7 +439,6 @@ void QDirectFBPaintEngine::drawRects(const QRectF *rects, int rectCount) QRasterPaintEngine::drawRects(rects, rectCount); return; } - d->unlock(); if (brush != Qt::NoBrush) { d->setDFBColor(brush.color()); CLIPPED_PAINT(fillRects(rects, rectCount, state()->matrix, d->surface)); @@ -463,7 +464,6 @@ void QDirectFBPaintEngine::drawLines(const QLine *lines, int lineCount) const QPen &pen = state()->pen; if (pen != Qt::NoPen) { - d->unlock(); d->setDFBColor(pen.color()); CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawLines)(lines, lineCount, state()->matrix, d->surface)); } @@ -484,7 +484,6 @@ void QDirectFBPaintEngine::drawLines(const QLineF *lines, int lineCount) const QPen &pen = state()->pen; if (pen != Qt::NoPen) { - d->unlock(); d->setDFBColor(pen.color()); CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawLines)(lines, lineCount, state()->matrix, d->surface)); } @@ -532,7 +531,6 @@ void QDirectFBPaintEngine::drawImage(const QRectF &r, const QImage &image, return; } #if !defined QT_NO_DIRECTFB_PREALLOCATED || defined QT_DIRECTFB_IMAGECACHE - d->unlock(); bool release; IDirectFBSurface *imgSurface = d->getSurface(image, &release); d->prepareForBlit(QDirectFBScreen::hasAlphaChannel(imgSurface)); @@ -560,25 +558,25 @@ void QDirectFBPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap, RASTERFALLBACK(DRAW_PIXMAP, r, pixmap.size(), sr); d->lock(); QRasterPaintEngine::drawPixmap(r, pixmap, sr); - } else if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedBlits) - || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported) - || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip - || (state()->renderHints & QPainter::SmoothPixmapTransform - && state()->matrix.mapRect(r).size() != sr.size())) { - RASTERFALLBACK(DRAW_PIXMAP, r, pixmap.size(), sr); - const QImage *img = static_cast(pixmap.pixmapData())->buffer(DSLF_READ); - d->lock(); - QRasterPaintEngine::drawImage(r, *img, sr); } else { - d->unlock(); - d->prepareForBlit(pixmap.hasAlphaChannel()); QPixmapData *data = pixmap.pixmapData(); Q_ASSERT(data->classId() == QPixmapData::DirectFBClass); QDirectFBPixmapData *dfbData = static_cast(data); - dfbData->unlockDirectFB(); - IDirectFBSurface *s = dfbData->directFBSurface(); - - CLIPPED_PAINT(d->blit(r, s, sr)); + if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedBlits) + || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported) + || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip + || (state()->renderHints & QPainter::SmoothPixmapTransform + && state()->matrix.mapRect(r).size() != sr.size())) { + RASTERFALLBACK(DRAW_PIXMAP, r, pixmap.size(), sr); + const QImage *img = dfbData->buffer(); + d->lock(); + QRasterPaintEngine::drawImage(r, *img, sr); + } else { + QDirectFBPaintEnginePrivate::unlock(dfbData); + d->prepareForBlit(pixmap.hasAlphaChannel()); + IDirectFBSurface *s = dfbData->directFBSurface(); + CLIPPED_PAINT(d->blit(r, s, sr)); + } } } @@ -601,14 +599,16 @@ void QDirectFBPaintEngine::drawTiledPixmap(const QRectF &r, || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip || (state()->renderHints & QPainter::SmoothPixmapTransform && state()->matrix.isScaling())) { RASTERFALLBACK(DRAW_TILED_PIXMAP, r, pixmap.size(), offset); - const QImage *img = static_cast(pixmap.pixmapData())->buffer(DSLF_READ); + QPixmapData *pixmapData = pixmap.pixmapData(); + Q_ASSERT(pixmapData->classId() == QPixmapData::DirectFBClass); + QDirectFBPixmapData *dfbData = static_cast(pixmapData); + const QImage *img = dfbData->buffer(); d->lock(); QRasterPixmapData *data = new QRasterPixmapData(QPixmapData::PixmapType); data->fromImage(*img, Qt::AutoColor); const QPixmap pix(data); QRasterPaintEngine::drawTiledPixmap(r, pix, offset); } else { - d->unlock(); CLIPPED_PAINT(d->drawTiledPixmap(r, pixmap, offset)); } } @@ -707,7 +707,6 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush) const QColor color = brush.color(); if (!color.isValid()) return; - d->unlock(); d->setDFBColor(color); const QRect r = state()->matrix.mapRect(rect).toRect(); CLIPPED_PAINT(d->surface->FillRectangle(d->surface, r.x(), r.y(), r.width(), r.height())); @@ -724,7 +723,6 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush) if (texture.pixmapData()->classId() != QPixmapData::DirectFBClass) break; - d->unlock(); CLIPPED_PAINT(d->drawTiledPixmap(rect, texture, rect.topLeft() - state()->brushOrigin)); return; } default: @@ -748,7 +746,6 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QColor &color) d->lock(); QRasterPaintEngine::fillRect(rect, color); } else { - d->unlock(); d->setDFBColor(color); const QRect r = state()->matrix.mapRect(rect).toRect(); CLIPPED_PAINT(d->surface->FillRectangle(d->surface, r.x(), r.y(), r.width(), r.height())); @@ -810,8 +807,7 @@ void QDirectFBPaintEnginePrivate::lock() // lock so we need to call the base implementation of prepare so // it updates its rasterBuffer to point to the new buffer address. Q_ASSERT(dfbDevice); - if (dfbDevice->lockFlags() != (DSLF_WRITE|DSLF_READ)) { - dfbDevice->lockDirectFB(DSLF_READ|DSLF_WRITE); + if (dfbDevice->lockSurface(DSLF_READ|DSLF_WRITE)) { prepare(dfbDevice); } } @@ -819,7 +815,21 @@ void QDirectFBPaintEnginePrivate::lock() void QDirectFBPaintEnginePrivate::unlock() { Q_ASSERT(dfbDevice); - dfbDevice->unlockDirectFB(); +#ifdef QT_DIRECTFB_SUBSURFACE + dfbDevice->syncPending = true; +#else + QDirectFBPaintEnginePrivate::unlock(dfbDevice); +#endif +} + +void QDirectFBPaintEnginePrivate::unlock(QDirectFBPaintDevice *device) +{ +#ifdef QT_NO_DIRECTFB_SUBSURFACE + Q_ASSERT(device); + device->unlockSurface(); +#else + Q_UNUSED(device); +#endif } void QDirectFBPaintEnginePrivate::setTransform(const QTransform &transform) @@ -1030,7 +1040,7 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix QPixmapData *data = pixmap.pixmapData(); Q_ASSERT(data->classId() == QPixmapData::DirectFBClass); QDirectFBPixmapData *dfbData = static_cast(data); - dfbData->unlockDirectFB(); + QDirectFBPaintEnginePrivate::unlock(dfbData); const QSize pixmapSize = dfbData->size(); IDirectFBSurface *sourceSurface = dfbData->directFBSurface(); if (transform.isScaling()) { diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index 4da2f7c..6550683 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -64,9 +64,6 @@ QDirectFBPixmapData::QDirectFBPixmapData(QDirectFBScreen *screen, PixelType pixe QDirectFBPixmapData::~QDirectFBPixmapData() { - unlockDirectFB(); - if (dfbSurface && QDirectFBScreen::instance()) - screen->releaseDFBSurface(dfbSurface); } void QDirectFBPixmapData::resize(int width, int height) @@ -375,9 +372,13 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect) QPixmapData::copy(data, rect); return; } - unlockDirectFB(); const QDirectFBPixmapData *otherData = static_cast(data); +#ifdef QT_NO_DIRECTFB_SUBSURFACE + if (otherData->lockFlags()) { + const_cast(otherData)->unlockSurface(); + } +#endif IDirectFBSurface *src = otherData->directFBSurface(); alpha = data->hasAlphaChannel(); imageFormat = (alpha @@ -405,6 +406,7 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect) h = rect.height(); d = otherData->d; is_null = (w <= 0 || h <= 0); + unlockSurface(); DFBResult result = dfbSurface->Blit(dfbSurface, src, &blitRect, 0, 0); #if (Q_DIRECTFB_VERSION >= 0x010000) dfbSurface->ReleaseSource(dfbSurface); @@ -465,18 +467,21 @@ QPixmap QDirectFBPixmapData::transformed(const QTransform &transform, Qt::TransformationMode mode) const { QDirectFBPixmapData *that = const_cast(this); +#ifdef QT_NO_DIRECTFB_SUBSURFACE + if (lockFlags()) + that->unlockSurface(); +#endif + if (!dfbSurface || transform.type() != QTransform::TxScale || mode != Qt::FastTransformation) { const QImage *image = that->buffer(); Q_ASSERT(image); const QImage transformed = image->transformed(transform, mode); - that->unlockDirectFB(); QDirectFBPixmapData *data = new QDirectFBPixmapData(screen, QPixmapData::PixmapType); data->fromImage(transformed, Qt::AutoColor); return QPixmap(data); } - that->unlockDirectFB(); const QSize size = transform.mapRect(QRect(0, 0, w, h)).size(); if (size.isEmpty()) @@ -556,14 +561,12 @@ QPaintEngine *QDirectFBPixmapData::paintEngine() const QImage *QDirectFBPixmapData::buffer() { - lockDirectFB(DSLF_READ|DSLF_WRITE); - return lockedImage; -} - -QImage * QDirectFBPixmapData::buffer(DFBSurfaceLockFlags lockFlags) -{ - lockDirectFB(lockFlags); - return lockedImage; + if (!lockFlgs) { + lockSurface(DSLF_READ|DSLF_WRITE); + } + Q_ASSERT(lockFlgs); + Q_ASSERT(!lockedImage.isNull()); + return &lockedImage; } void QDirectFBPixmapData::invalidate() diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h index 7b4ae47..5d3a2f6 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.h @@ -81,11 +81,9 @@ public: virtual QImage toImage() const; virtual QPaintEngine *paintEngine() const; virtual QImage *buffer(); - virtual int metric(QPaintDevice::PaintDeviceMetric m) const {return QDirectFBPaintDevice::metric(m);} - - QImage *buffer(DFBSurfaceLockFlags lockFlags); - // Pure virtual in QPixmapData, so re-implement here and delegate to QDirectFBPaintDevice + virtual int metric(QPaintDevice::PaintDeviceMetric m) const { return QDirectFBPaintDevice::metric(m); } + inline QImage::Format pixelFormat() const { return imageFormat; } static bool hasAlphaChannel(const QImage &img); inline bool hasAlphaChannel() const { return alpha; } diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index c714989..599b2a9 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -319,14 +319,38 @@ IDirectFBSurface *QDirectFBScreen::createDFBSurface(DFBSurfaceDescription desc, if (options & TrackSurface) { d_ptr->allocatedSurfaces.insert(newSurface); - - //qDebug("Created a new DirectFB surface at %p. New count = %d", - // newSurface, d_ptr->allocatedSurfaces.count()); } return newSurface; } +#ifdef QT_DIRECTFB_SUBSURFACE +IDirectFBSurface *QDirectFBScreen::getSubSurface(IDirectFBSurface *surface, + const QRect &rect, + SurfaceCreationOptions options, + DFBResult *resultPtr) +{ + Q_ASSERT(!(options & NoPreallocated)); + Q_ASSERT(surface); + DFBResult res; + DFBResult &result = (resultPtr ? *resultPtr : res); + IDirectFBSurface *subSurface = 0; + if (rect.isNull()) { + result = surface->GetSubSurface(surface, 0, &subSurface); + } else { + const DFBRectangle subRect = { rect.x(), rect.y(), rect.width(), rect.height() }; + result = surface->GetSubSurface(surface, &subRect, &subSurface); + } + if (result != DFB_OK) { + DirectFBError("Can't get sub surface", result); + } else if (options & TrackSurface) { + d_ptr->allocatedSurfaces.insert(subSurface); + } + return subSurface; +} +#endif + + void QDirectFBScreen::releaseDFBSurface(IDirectFBSurface *surface) { Q_ASSERT(QDirectFBScreen::instance()); @@ -1527,6 +1551,11 @@ void QDirectFBScreen::setDirectFBImageProvider(IDirectFBImageProvider *provider) } #endif +void QDirectFBScreen::waitIdle() +{ + d_ptr->dfb->WaitIdle(d_ptr->dfb); +} + IDirectFBSurface * QDirectFBScreen::surfaceForWidget(const QWidget *widget, QRect *rect) const { Q_ASSERT(widget); @@ -1540,6 +1569,7 @@ IDirectFBSurface * QDirectFBScreen::surfaceForWidget(const QWidget *widget, QRec return 0; } +#ifdef QT_DIRECTFB_SUBSURFACE IDirectFBSurface *QDirectFBScreen::subSurfaceForWidget(const QWidget *widget, const QRect &area) const { Q_ASSERT(widget); @@ -1550,7 +1580,7 @@ IDirectFBSurface *QDirectFBScreen::subSurfaceForWidget(const QWidget *widget, co if (!area.isNull()) rect &= area.translated(widget->mapTo(widget->window(), QPoint(0, 0))); if (!rect.isNull()) { - const DFBRectangle subRect = {rect.x(), rect.y(), rect.width(), rect.height() }; + const DFBRectangle subRect = { rect.x(), rect.y(), rect.width(), rect.height() }; const DFBResult result = surface->GetSubSurface(surface, &subRect, &subSurface); if (result != DFB_OK) { DirectFBError("QDirectFBScreen::subSurface(): Can't get sub surface", result); @@ -1559,6 +1589,7 @@ IDirectFBSurface *QDirectFBScreen::subSurfaceForWidget(const QWidget *widget, co } return subSurface; } +#endif QT_END_NAMESPACE diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h index e74adb1..0ce7a53 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h @@ -54,6 +54,9 @@ QT_BEGIN_NAMESPACE QT_MODULE(Gui) +#if !defined QT_NO_DIRECTFB_SUBSURFACE && !defined QT_DIRECTFB_SUBSURFACE +#define QT_DIRECTFB_SUBSURFACE +#endif #if !defined QT_NO_DIRECTFB_LAYER && !defined QT_DIRECTFB_LAYER #define QT_DIRECTFB_LAYER #endif @@ -166,8 +169,11 @@ public: return static_cast(inst); } + void waitIdle(); IDirectFBSurface *surfaceForWidget(const QWidget *widget, QRect *rect) const; +#ifdef QT_DIRECTFB_SUBSURFACE IDirectFBSurface *subSurfaceForWidget(const QWidget *widget, const QRect &area = QRect()) const; +#endif IDirectFB *dfb(); #ifdef QT_NO_DIRECTFB_WM @@ -199,6 +205,12 @@ public: IDirectFBSurface *createDFBSurface(DFBSurfaceDescription desc, SurfaceCreationOptions options, DFBResult *result); +#ifdef QT_DIRECTFB_SUBSURFACE + IDirectFBSurface *getSubSurface(IDirectFBSurface *surface, + const QRect &rect, + SurfaceCreationOptions options, + DFBResult *result); +#endif void flipSurface(IDirectFBSurface *surface, DFBSurfaceFlipFlags flipFlags, const QRegion ®ion, const QPoint &offset); diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index 816bd83..e288199 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -201,7 +201,6 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect) const QRect oldRect = geometry(); DFBResult result = DFB_OK; // If we're in a resize, the surface shouldn't be locked - Q_ASSERT((lockedImage == 0) || (rect.size() == geometry().size())); #ifdef QT_DIRECTFB_WM if (!dfbWindow) createWindow(); @@ -416,7 +415,9 @@ void QDirectFBWindowSurface::beginPaint(const QRegion &) void QDirectFBWindowSurface::endPaint(const QRegion &) { - unlockDirectFB(); +#ifdef QT_NO_DIRECTFB_SUBSURFACE + unlockSurface(); +#endif } IDirectFBSurface *QDirectFBWindowSurface::directFBSurface() const -- cgit v0.12 From b1cdd3a160ea995f9c48eab9aeb02bd28d98f8c9 Mon Sep 17 00:00:00 2001 From: Stian Sandvik Thomassen Date: Wed, 2 Sep 2009 08:51:20 +1000 Subject: Made mouse wheel navigation skip disabled tabs Mouse wheel navigation should skip disabled tabs like keyboard navigation does. Task-number: 260568 Reviewed-by: Jens Bache-Wiig --- src/gui/widgets/qtabbar.cpp | 27 +++++++++++++++------------ src/gui/widgets/qtabbar_p.h | 1 + 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp index bf2c0bb..e749ce7 100644 --- a/src/gui/widgets/qtabbar.cpp +++ b/src/gui/widgets/qtabbar.cpp @@ -1913,13 +1913,8 @@ void QTabBar::keyPressEvent(QKeyEvent *event) event->ignore(); return; } - int dx = event->key() == (isRightToLeft() ? Qt::Key_Right : Qt::Key_Left) ? -1 : 1; - for (int index = d->currentIndex + dx; d->validIndex(index); index += dx) { - if (d->tabList.at(index).enabled) { - setCurrentIndex(index); - break; - } - } + int offset = event->key() == (isRightToLeft() ? Qt::Key_Right : Qt::Key_Left) ? -1 : 1; + d->setCurrentNextEnabledIndex(offset); } /*!\reimp @@ -1928,15 +1923,23 @@ void QTabBar::keyPressEvent(QKeyEvent *event) void QTabBar::wheelEvent(QWheelEvent *event) { Q_D(QTabBar); - int overIndex = d->indexAtPos(event->pos()); - if (overIndex != -1) { - int offset = event->delta() > 0 ? -1 : 1; - setCurrentIndex(currentIndex() + offset); - } + int offset = event->delta() > 0 ? -1 : 1; + d->setCurrentNextEnabledIndex(offset); QWidget::wheelEvent(event); } #endif //QT_NO_WHEELEVENT +void QTabBarPrivate::setCurrentNextEnabledIndex(int offset) +{ + Q_Q(QTabBar); + for (int index = currentIndex + offset; validIndex(index); index += offset) { + if (tabList.at(index).enabled) { + q->setCurrentIndex(index); + break; + } + } +} + /*!\reimp */ void QTabBar::changeEvent(QEvent *event) diff --git a/src/gui/widgets/qtabbar_p.h b/src/gui/widgets/qtabbar_p.h index d632753..2c4d625 100644 --- a/src/gui/widgets/qtabbar_p.h +++ b/src/gui/widgets/qtabbar_p.h @@ -144,6 +144,7 @@ public: int indexAtPos(const QPoint &p) const; inline bool validIndex(int index) const { return index >= 0 && index < tabList.count(); } + void setCurrentNextEnabledIndex(int offset); QSize minimumTabSizeHint(int index); -- cgit v0.12 From 235aea42924013625fc4b7714fba16ef7b1aee60 Mon Sep 17 00:00:00 2001 From: Bill King Date: Wed, 2 Sep 2009 10:18:38 +1000 Subject: Fixes mysql not knowing the difference between tables and views. Task-number: 176267 Reviewed-by: Justin McPherson --- src/sql/drivers/mysql/qsql_mysql.cpp | 47 ++++++++++++++++++---------- tests/auto/qsqldatabase/tst_qsqldatabase.cpp | 8 ----- 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp index fa79460..b29e742 100644 --- a/src/sql/drivers/mysql/qsql_mysql.cpp +++ b/src/sql/drivers/mysql/qsql_mysql.cpp @@ -1310,23 +1310,38 @@ QSqlResult *QMYSQLDriver::createResult() const QStringList QMYSQLDriver::tables(QSql::TableType type) const { QStringList tl; - if (!isOpen()) - return tl; - if (!(type & QSql::Tables)) - return tl; - - MYSQL_RES* tableRes = mysql_list_tables(d->mysql, NULL); - MYSQL_ROW row; - int i = 0; - while (tableRes) { - mysql_data_seek(tableRes, i); - row = mysql_fetch_row(tableRes); - if (!row) - break; - tl.append(toUnicode(d->tc, row[0])); - i++; + if( mysql_get_server_version(d->mysql) < 50000) + { + if (!isOpen()) + return tl; + if (!(type & QSql::Tables)) + return tl; + + MYSQL_RES* tableRes = mysql_list_tables(d->mysql, NULL); + MYSQL_ROW row; + int i = 0; + while (tableRes) { + mysql_data_seek(tableRes, i); + row = mysql_fetch_row(tableRes); + if (!row) + break; + tl.append(toUnicode(d->tc, row[0])); + i++; + } + mysql_free_result(tableRes); + } else { + QSqlQuery q(createResult()); + if(type & QSql::Tables) { + q.exec(QLatin1String("select table_name from information_schema.tables where table_type = 'BASE TABLE'")); + while(q.next()) + tl.append(q.value(0).toString()); + } + if(type & QSql::Views) { + q.exec(QLatin1String("select table_name from information_schema.tables where table_type = 'VIEW'")); + while(q.next()) + tl.append(q.value(0).toString()); + } } - mysql_free_result(tableRes); return tl; } diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp index e9a0670..a6d2c26 100644 --- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp @@ -513,10 +513,6 @@ void tst_QSqlDatabase::tables() QVERIFY(tables.contains(qTableName("qtest"), Qt::CaseInsensitive)); QVERIFY(!tables.contains("sql_features", Qt::CaseInsensitive)); //check for postgres 7.4 internal tables if (views) { - if (db.driverName().startsWith("QMYSQL")) - // MySQL doesn't differentiate between tables and views when calling QSqlDatabase::tables() - // May be fixable by doing a select on informational_schema.tables instead of using the client library api - QEXPECT_FAIL("", "MySQL driver thinks that views are tables", Continue); QVERIFY(!tables.contains(qTableName("qtest_view"), Qt::CaseInsensitive)); } if (tempTables) @@ -524,10 +520,6 @@ void tst_QSqlDatabase::tables() tables = db.tables(QSql::Views); if (views) { - if (db.driverName().startsWith("QMYSQL")) - // MySQL doesn't give back anything when calling QSqlDatabase::tables() with QSql::Views - // May be fixable by doing a select on informational_schema.views instead of using the client library api - QEXPECT_FAIL("", "MySQL driver thinks that views are tables", Continue); if(!tables.contains(qTableName("qtest_view"), Qt::CaseInsensitive)) qDebug() << "failed to find" << qTableName("qtest_view") << "in" << tables; QVERIFY(tables.contains(qTableName("qtest_view"), Qt::CaseInsensitive)); -- cgit v0.12 From a668f029ddf7570cbf29e9e2f36733867cef62b1 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 2 Sep 2009 13:21:44 +1000 Subject: Missing version number fixes Reviewed-by: Trust Me --- src/plugins/qpluginbase.pri | 2 +- tests/auto/mediaobject/dummy/dummy.pro | 2 +- tools/assistant/tools/assistant/doc/assistant.qdocconf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/qpluginbase.pri b/src/plugins/qpluginbase.pri index 10563c1..a3abc98 100644 --- a/src/plugins/qpluginbase.pri +++ b/src/plugins/qpluginbase.pri @@ -1,6 +1,6 @@ TEMPLATE = lib isEmpty(QT_MAJOR_VERSION) { - VERSION=4.5.3 + VERSION=4.6.0 } else { VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} } diff --git a/tests/auto/mediaobject/dummy/dummy.pro b/tests/auto/mediaobject/dummy/dummy.pro index b4f6109..9febde7 100644 --- a/tests/auto/mediaobject/dummy/dummy.pro +++ b/tests/auto/mediaobject/dummy/dummy.pro @@ -1,7 +1,7 @@ TEMPLATE = lib isEmpty(QT_MAJOR_VERSION) { - VERSION=4.5.2 + VERSION=4.6.0 } else { VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} } diff --git a/tools/assistant/tools/assistant/doc/assistant.qdocconf b/tools/assistant/tools/assistant/doc/assistant.qdocconf index 9566e90..161d34f 100644 --- a/tools/assistant/tools/assistant/doc/assistant.qdocconf +++ b/tools/assistant/tools/assistant/doc/assistant.qdocconf @@ -12,5 +12,5 @@ HTML.footer = "


\n" \ "\n" \ "\n" \ "\n" \ - "\n" \ + "\n" \ "
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt 4.5.3
Qt 4.6.0
" -- cgit v0.12 From 441fcb027ddbe4a34c67af8cfbda14b9edafbcfd Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 2 Sep 2009 13:46:57 +1000 Subject: Fix license header. Reviewed-by: Trust Me --- .../tst_qgraphicsanchorlayout.cpp | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp index e419bae..986ceb6 100644 --- a/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp +++ b/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp @@ -3,14 +3,14 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtOpenGL module of the Qt Toolkit. +** This file is part of the documentation 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. +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -21,20 +21,20 @@ ** 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 +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this ** package. ** -** 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 have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** ** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ -- cgit v0.12 From fb530ac0a12b90527b9792b31e08043518dd8bd7 Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Wed, 2 Sep 2009 15:39:39 +1000 Subject: Copy ctor and assignment operator for QAudioFormatPrivate (QSharedData derived class). Reviewed-by: bill king --- src/multimedia/audio/qaudioformat.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/multimedia/audio/qaudioformat.cpp b/src/multimedia/audio/qaudioformat.cpp index 71bbf83..6ae230f 100644 --- a/src/multimedia/audio/qaudioformat.cpp +++ b/src/multimedia/audio/qaudioformat.cpp @@ -57,10 +57,32 @@ public: sampleType = QAudioFormat::Unknown; } + QAudioFormatPrivate(const QAudioFormatPrivate &other): + QSharedData(other), + codec(other.codec), + byteOrder(other.byteOrder), + sampleType(other.sampleType), + frequency(other.frequency), + channels(other.channels), + sampleSize(other.sampleSize) + { + } + + QAudioFormatPrivate& operator=(const QAudioFormatPrivate &other) + { + codec = other.codec; + byteOrder = other.byteOrder; + sampleType = other.sampleType; + frequency = other.frequency; + channels = other.channels; + sampleSize = other.sampleSize; + + return *this; + } + QString codec; QAudioFormat::Endian byteOrder; QAudioFormat::SampleType sampleType; - int frequency; int channels; int sampleSize; -- cgit v0.12 From 7578f43d0f1358b2ed52b3a5d2b853f26e63aec0 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Wed, 2 Sep 2009 06:53:49 +0200 Subject: CSS parsing speed-up: reserve CSS symbols prior to parsing. Let us be optimistic here and reserve some space in the CSS symbols array before parsing starts. This gives 3% speed-up when loading tiger.svg (tests/benchmarks/qsvgrenderer). Reviewed-by: Olivier Goffart --- src/gui/text/qcssparser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index 6978b45..f252444 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -2126,6 +2126,7 @@ void Parser::init(const QString &css, bool isFile) hasEscapeSequences = false; symbols.resize(0); + symbols.reserve(8); Scanner::scan(Scanner::preprocess(styleSheet, &hasEscapeSequences), &symbols); index = 0; errorIndex = -1; -- cgit v0.12 From 584129c518719df51bc4812cc30773ab81e3f3cd Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 2 Sep 2009 10:54:28 +0300 Subject: Removed stale fixed_stdlib.h file. Reviewed-by: TrustMe --- mkspecs/common/symbian/fixed_stdlib.h | 64 ----------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 mkspecs/common/symbian/fixed_stdlib.h diff --git a/mkspecs/common/symbian/fixed_stdlib.h b/mkspecs/common/symbian/fixed_stdlib.h deleted file mode 100644 index 8b9c68e..0000000 --- a/mkspecs/common/symbian/fixed_stdlib.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the makespecs of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef FIXED_STDLIB_H -#define FIXED_STDLIB_H - -// This hack fixes defect in Symbian stdlib.h. The original file -// does not work correctly when intermixing C and C++ (STL). Remove the hack -// when Open C / C++ team has fixed the defect. - -// If _WCHAR_T_DECLARED is defined, undef it and store information that we -// need to revert the _WCHAR_T_DECLARED define after include -# ifdef _WCHAR_T_DECLARED -# define QT_REVERT_WCHAR_T_DECLARED -# undef _WCHAR_T_DECLARED -# endif //_WCHAR_T_DECLARED - -#include - -// Revert _WCHAR_T_DECLARED if necessary -# ifdef QT_REVERT_WCHAR_T_DECLARED -# define _WCHAR_T_DECLARED -# undef QT_REVERT_WCHAR_T_DECLARED -# endif //QT_REVERT_WCHAR_T_DECLARED - -#endif -- cgit v0.12 From 00fa3f364fe9657317cb14191167aa9991c1758e Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 2 Sep 2009 17:57:45 +1000 Subject: Assorted license header fixes. Reviewed-by: Trust Me --- doc/src/examples/complexpingpong.qdoc | 2 +- doc/src/examples/dbus-pingpong.qdoc | 43 +++++++++++++++++++++- doc/src/examples/fetchmore.qdoc | 41 +++++++++++++++++++++ doc/src/examples/hellogl_es.qdoc | 41 +++++++++++++++++++++ doc/src/gallery-gtk.qdoc | 41 +++++++++++++++++++++ doc/src/qdbusadaptors.qdoc | 40 -------------------- doc/src/qmsdev.qdoc | 37 +++++++++++++++++-- doc/src/qtdbus.qdoc | 40 -------------------- doc/src/qtmac-as-native.qdoc | 43 ---------------------- doc/src/snippets/complexpingpong-example.qdoc | 4 -- doc/src/snippets/complexpingpong-example.txt | 4 ++ doc/src/snippets/dbus-pingpong-example.qdoc | 3 -- doc/src/snippets/dbus-pingpong-example.txt | 3 ++ doc/src/snippets/qmacnativewidget/main.mm | 41 +++++++++++++++++++++ .../qfontdialog/tst_qfontdialog_mac_helpers.mm | 41 +++++++++++++++++++++ tests/auto/qlibrary/lib/mylib.c | 41 +++++++++++++++++++++ tests/auto/qlibrary/lib2/mylib.c | 41 +++++++++++++++++++++ tests/auto/qpluginloader/lib/mylib.c | 41 +++++++++++++++++++++ tests/auto/qurl/idna-test.c | 41 +++++++++++++++++++++ tests/auto/qwidget/tst_qwidget_mac_helpers.mm | 41 +++++++++++++++++++++ tools/assistant/tools/assistant/doc/assistant.qdoc | 41 +++++++++++++++++++++ util/qlalr/doc/src/qlalr.qdoc | 41 +++++++++++++++++++++ 22 files changed, 575 insertions(+), 136 deletions(-) delete mode 100644 doc/src/snippets/complexpingpong-example.qdoc create mode 100644 doc/src/snippets/complexpingpong-example.txt delete mode 100644 doc/src/snippets/dbus-pingpong-example.qdoc create mode 100644 doc/src/snippets/dbus-pingpong-example.txt diff --git a/doc/src/examples/complexpingpong.qdoc b/doc/src/examples/complexpingpong.qdoc index 22e9bc4..52266a5 100644 --- a/doc/src/examples/complexpingpong.qdoc +++ b/doc/src/examples/complexpingpong.qdoc @@ -46,5 +46,5 @@ The Complex Ping Pong example improves on the \l{D-Bus Ping Pong Example} by providing a more useful demonstration of D-Bus interfaces. - \quotefile doc/src/snippets/complexpingpong-example.qdoc + \quotefile doc/src/snippets/complexpingpong-example.txt */ diff --git a/doc/src/examples/dbus-pingpong.qdoc b/doc/src/examples/dbus-pingpong.qdoc index 6b15978..1451fac 100644 --- a/doc/src/examples/dbus-pingpong.qdoc +++ b/doc/src/examples/dbus-pingpong.qdoc @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + /*! \example dbus/pingpong \title D-Bus Ping Pong Example @@ -5,5 +46,5 @@ The D-Bus Ping Pong example provides a basic demonstration of D-Bus interfaces. - \quotefile doc/src/snippets/dbus-pingpong-example.qdoc + \quotefile doc/src/snippets/dbus-pingpong-example.txt */ diff --git a/doc/src/examples/fetchmore.qdoc b/doc/src/examples/fetchmore.qdoc index 5434098..d561706 100644 --- a/doc/src/examples/fetchmore.qdoc +++ b/doc/src/examples/fetchmore.qdoc @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + /*! \example itemviews/fetchmore \title Fetch More Example diff --git a/doc/src/examples/hellogl_es.qdoc b/doc/src/examples/hellogl_es.qdoc index 0293584..5659d7c 100644 --- a/doc/src/examples/hellogl_es.qdoc +++ b/doc/src/examples/hellogl_es.qdoc @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + /*! \example opengl/hellogl_es \title Hello GL ES Example diff --git a/doc/src/gallery-gtk.qdoc b/doc/src/gallery-gtk.qdoc index 8251f04..2eb5f52 100644 --- a/doc/src/gallery-gtk.qdoc +++ b/doc/src/gallery-gtk.qdoc @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + /*! \page gallery-gtk.html diff --git a/doc/src/qdbusadaptors.qdoc b/doc/src/qdbusadaptors.qdoc index bf012e8..7b6f598 100644 --- a/doc/src/qdbusadaptors.qdoc +++ b/doc/src/qdbusadaptors.qdoc @@ -39,46 +39,6 @@ ** ****************************************************************************/ -/** -*- mode: C++ -*- -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - /*! \page usingadaptors.html \title Using QtDBus Adaptors diff --git a/doc/src/qmsdev.qdoc b/doc/src/qmsdev.qdoc index 67de746..0612e95 100644 --- a/doc/src/qmsdev.qdoc +++ b/doc/src/qmsdev.qdoc @@ -1,12 +1,41 @@ /**************************************************************************** ** -** Documentation of Visual Studio Integration Plugin. -** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the Qt GUI Toolkit. -** EDITIONS: FREE, PROFESSIONAL, ENTERPRISE +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/doc/src/qtdbus.qdoc b/doc/src/qtdbus.qdoc index de355cb..96f80b5 100644 --- a/doc/src/qtdbus.qdoc +++ b/doc/src/qtdbus.qdoc @@ -39,46 +39,6 @@ ** ****************************************************************************/ -/** -*- mode: C++ -*- -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - /*! \module QtDBus \title QtDBus module diff --git a/doc/src/qtmac-as-native.qdoc b/doc/src/qtmac-as-native.qdoc index 6b5ff2c..31f3c1d 100644 --- a/doc/src/qtmac-as-native.qdoc +++ b/doc/src/qtmac-as-native.qdoc @@ -39,49 +39,6 @@ ** ****************************************************************************/ -/**************************************************************************** -** -** Qt for Mac OS X documentation -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -**********************************************************************/ - /*! \page qtmac-as-native.html \title Qt is Mac OS X Native diff --git a/doc/src/snippets/complexpingpong-example.qdoc b/doc/src/snippets/complexpingpong-example.qdoc deleted file mode 100644 index 257f702..0000000 --- a/doc/src/snippets/complexpingpong-example.qdoc +++ /dev/null @@ -1,4 +0,0 @@ -Ask your question: When is the next Qt release? -Reply was: Sorry, I don't know the answer -Ask your question: What is the answer to life, the universe and everything? -Reply was: 42 diff --git a/doc/src/snippets/complexpingpong-example.txt b/doc/src/snippets/complexpingpong-example.txt new file mode 100644 index 0000000..257f702 --- /dev/null +++ b/doc/src/snippets/complexpingpong-example.txt @@ -0,0 +1,4 @@ +Ask your question: When is the next Qt release? +Reply was: Sorry, I don't know the answer +Ask your question: What is the answer to life, the universe and everything? +Reply was: 42 diff --git a/doc/src/snippets/dbus-pingpong-example.qdoc b/doc/src/snippets/dbus-pingpong-example.qdoc deleted file mode 100644 index 13a34a8..0000000 --- a/doc/src/snippets/dbus-pingpong-example.qdoc +++ /dev/null @@ -1,3 +0,0 @@ -$ ./pong & -$ ./ping Hello -Reply was: ping("Hello") got called diff --git a/doc/src/snippets/dbus-pingpong-example.txt b/doc/src/snippets/dbus-pingpong-example.txt new file mode 100644 index 0000000..13a34a8 --- /dev/null +++ b/doc/src/snippets/dbus-pingpong-example.txt @@ -0,0 +1,3 @@ +$ ./pong & +$ ./ping Hello +Reply was: ping("Hello") got called diff --git a/doc/src/snippets/qmacnativewidget/main.mm b/doc/src/snippets/qmacnativewidget/main.mm index 66c6fbf..c074c2c 100644 --- a/doc/src/snippets/qmacnativewidget/main.mm +++ b/doc/src/snippets/qmacnativewidget/main.mm @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include #include #ifdef QT_MAC_USE_COCOA diff --git a/tests/auto/qfontdialog/tst_qfontdialog_mac_helpers.mm b/tests/auto/qfontdialog/tst_qfontdialog_mac_helpers.mm index fbd6817..6d70aab 100644 --- a/tests/auto/qfontdialog/tst_qfontdialog_mac_helpers.mm +++ b/tests/auto/qfontdialog/tst_qfontdialog_mac_helpers.mm @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include #include diff --git a/tests/auto/qlibrary/lib/mylib.c b/tests/auto/qlibrary/lib/mylib.c index 1366b7c..2892013 100644 --- a/tests/auto/qlibrary/lib/mylib.c +++ b/tests/auto/qlibrary/lib/mylib.c @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include #if defined(Q_CC_MSVC) || defined(Q_CC_MSVC_NET) || defined(Q_CC_BOR) diff --git a/tests/auto/qlibrary/lib2/mylib.c b/tests/auto/qlibrary/lib2/mylib.c index dd90f04..e726f1f 100644 --- a/tests/auto/qlibrary/lib2/mylib.c +++ b/tests/auto/qlibrary/lib2/mylib.c @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include #if defined(Q_CC_MSVC) || defined(Q_CC_MSVC_NET) || defined(Q_CC_BOR) diff --git a/tests/auto/qpluginloader/lib/mylib.c b/tests/auto/qpluginloader/lib/mylib.c index 1366b7c..2892013 100644 --- a/tests/auto/qpluginloader/lib/mylib.c +++ b/tests/auto/qpluginloader/lib/mylib.c @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include #if defined(Q_CC_MSVC) || defined(Q_CC_MSVC_NET) || defined(Q_CC_BOR) diff --git a/tests/auto/qurl/idna-test.c b/tests/auto/qurl/idna-test.c index 2c24118..6bc6381 100644 --- a/tests/auto/qurl/idna-test.c +++ b/tests/auto/qurl/idna-test.c @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + struct idna { char *name; diff --git a/tests/auto/qwidget/tst_qwidget_mac_helpers.mm b/tests/auto/qwidget/tst_qwidget_mac_helpers.mm index 8a437df..95bad23 100644 --- a/tests/auto/qwidget/tst_qwidget_mac_helpers.mm +++ b/tests/auto/qwidget/tst_qwidget_mac_helpers.mm @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "tst_qwidget_mac_helpers.h" #include #include diff --git a/tools/assistant/tools/assistant/doc/assistant.qdoc b/tools/assistant/tools/assistant/doc/assistant.qdoc index 0d13490..4cc21ec 100644 --- a/tools/assistant/tools/assistant/doc/assistant.qdoc +++ b/tools/assistant/tools/assistant/doc/assistant.qdoc @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + /*! \page assistant.html \title Qt Assistant diff --git a/util/qlalr/doc/src/qlalr.qdoc b/util/qlalr/doc/src/qlalr.qdoc index 313c7a4..d95b065 100644 --- a/util/qlalr/doc/src/qlalr.qdoc +++ b/util/qlalr/doc/src/qlalr.qdoc @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + /*! \page qlalr.html \title qlalr -- cgit v0.12 From 0b5a81dd9aa153f6cd3a3929ee7ed82ca48f45a5 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 1 Sep 2009 22:05:57 +0200 Subject: Optimize QScriptClass Do not convert JSC::Identifier to QString to convert it later to JSC::Identivier again Reviewed-by: Kent Hansen --- src/script/api/qscriptengine.cpp | 4 +--- src/script/api/qscriptengine_p.h | 10 ++++++++++ src/script/api/qscriptstring.cpp | 10 ---------- src/script/api/qscriptstring.h | 1 + src/script/api/qscriptstring_p.h | 2 -- src/script/bridge/qscriptclassobject.cpp | 12 ++++-------- 6 files changed, 16 insertions(+), 23 deletions(-) diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index d467250..3ffc9c5 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -3622,9 +3622,7 @@ QScriptEngineAgent *QScriptEngine::agent() const QScriptString QScriptEngine::toStringHandle(const QString &str) { Q_D(QScriptEngine); - QScriptString ss; - QScriptStringPrivate::init(ss, this, JSC::Identifier(d->currentFrame, str)); - return ss; + return d->scriptStringFromJSCIdentifier(JSC::Identifier(d->currentFrame, str)); } /*! diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h index f06f717..f8eee87 100644 --- a/src/script/api/qscriptengine_p.h +++ b/src/script/api/qscriptengine_p.h @@ -58,6 +58,7 @@ #include #include #include "qscriptvalue_p.h" +#include "qscriptstring_p.h" #include "RefPtr.h" #include "Structure.h" @@ -122,6 +123,7 @@ public: inline QScriptValue scriptValueFromJSCValue(JSC::JSValue value); inline JSC::JSValue scriptValueToJSCValue(const QScriptValue &value); + inline QScriptString scriptStringFromJSCIdentifier(const JSC::Identifier &id); QScriptValue scriptValueFromVariant(const QVariant &value); QVariant scriptValueToVariant(const QScriptValue &value, int targetType); @@ -362,6 +364,14 @@ inline QScriptValue QScriptValuePrivate::property(const QString &name, int resol return property(JSC::Identifier(exec, name), resolveMode); } +inline QScriptString QScriptEnginePrivate::scriptStringFromJSCIdentifier(const JSC::Identifier &id) +{ + QScriptString q; + q.d_ptr = new QScriptStringPrivate(q_func(), id); + return q; +} + + QT_END_NAMESPACE #endif diff --git a/src/script/api/qscriptstring.cpp b/src/script/api/qscriptstring.cpp index 58a7c2b..6de1d88 100644 --- a/src/script/api/qscriptstring.cpp +++ b/src/script/api/qscriptstring.cpp @@ -86,16 +86,6 @@ QScriptStringPrivate::~QScriptStringPrivate() } /*! - \internal -*/ -void QScriptStringPrivate::init(QScriptString &q, QScriptEngine *engine, - const JSC::Identifier &value) -{ - Q_ASSERT(!q.isValid()); - q.d_ptr = new QScriptStringPrivate(engine, value); -} - -/*! Constructs an invalid QScriptString. */ QScriptString::QScriptString() diff --git a/src/script/api/qscriptstring.h b/src/script/api/qscriptstring.h index 30e6856..e6224a2 100644 --- a/src/script/api/qscriptstring.h +++ b/src/script/api/qscriptstring.h @@ -76,6 +76,7 @@ public: private: QExplicitlySharedDataPointer d_ptr; friend class QScriptValue; + friend class QScriptEnginePrivate; Q_DECLARE_PRIVATE(QScriptString) }; diff --git a/src/script/api/qscriptstring_p.h b/src/script/api/qscriptstring_p.h index 8f76648..bba4b58 100644 --- a/src/script/api/qscriptstring_p.h +++ b/src/script/api/qscriptstring_p.h @@ -72,8 +72,6 @@ public: QScriptStringPrivate(QScriptEngine *engine, const JSC::Identifier &id); ~QScriptStringPrivate(); - static void init(QScriptString &q, QScriptEngine *engine, const JSC::Identifier &id); - QBasicAtomicInt ref; #ifndef QT_NO_QOBJECT QPointer engine; diff --git a/src/script/bridge/qscriptclassobject.cpp b/src/script/bridge/qscriptclassobject.cpp index c8633ab..fcd0124 100644 --- a/src/script/bridge/qscriptclassobject.cpp +++ b/src/script/bridge/qscriptclassobject.cpp @@ -97,8 +97,7 @@ bool ClassObjectDelegate::getOwnPropertySlot(QScriptObject* object, QScriptEnginePrivate *engine = scriptEngineFromExec(exec); QScriptValue scriptObject = engine->scriptValueFromJSCValue(object); - QString name(propertyName.ustring()); - QScriptString scriptName = QScriptEnginePrivate::get(engine)->toStringHandle(name); + QScriptString scriptName = engine->scriptStringFromJSCIdentifier(propertyName); uint id = 0; QScriptClass::QueryFlags flags = m_scriptClass->queryProperty( scriptObject, scriptName, QScriptClass::HandlesReadAccess, &id); @@ -116,8 +115,7 @@ void ClassObjectDelegate::put(QScriptObject* object, JSC::ExecState *exec, { QScriptEnginePrivate *engine = scriptEngineFromExec(exec); QScriptValue scriptObject = engine->scriptValueFromJSCValue(object); - QString name(propertyName.ustring()); - QScriptString scriptName = QScriptEnginePrivate::get(engine)->toStringHandle(name); + QScriptString scriptName = engine->scriptStringFromJSCIdentifier(propertyName); uint id = 0; QScriptClass::QueryFlags flags = m_scriptClass->queryProperty( scriptObject, scriptName, QScriptClass::HandlesWriteAccess, &id); @@ -135,8 +133,7 @@ bool ClassObjectDelegate::deleteProperty(QScriptObject* object, JSC::ExecState * // ### avoid duplication of put() QScriptEnginePrivate *engine = scriptEngineFromExec(exec); QScriptValue scriptObject = engine->scriptValueFromJSCValue(object); - QString name(propertyName.ustring()); - QScriptString scriptName = QScriptEnginePrivate::get(engine)->toStringHandle(name); + QScriptString scriptName = engine->scriptStringFromJSCIdentifier(propertyName); uint id = 0; QScriptClass::QueryFlags flags = m_scriptClass->queryProperty( scriptObject, scriptName, QScriptClass::HandlesWriteAccess, &id); @@ -155,8 +152,7 @@ bool ClassObjectDelegate::getPropertyAttributes(const QScriptObject* object, JSC { QScriptEnginePrivate *engine = scriptEngineFromExec(exec); QScriptValue scriptObject = engine->scriptValueFromJSCValue(object); - QString name(propertyName.ustring()); - QScriptString scriptName = QScriptEnginePrivate::get(engine)->toStringHandle(name); + QScriptString scriptName = engine->scriptStringFromJSCIdentifier(propertyName); uint id = 0; QScriptClass::QueryFlags flags = m_scriptClass->queryProperty( scriptObject, scriptName, QScriptClass::HandlesReadAccess, &id); -- cgit v0.12 From 94cb0a3f798942ebcf57625d40ac5e2877b643e3 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 2 Sep 2009 18:17:52 +1000 Subject: Remove obsolete copies of GPL. Reviewed-by: Trust Me --- src/gui/accessible/qaccessible_mac_cocoa.mm | 41 ++++ tools/assistant/compat/LICENSE.GPL | 280 ---------------------------- tools/linguist/LICENSE.GPL | 280 ---------------------------- tools/qconfig/LICENSE.GPL | 280 ---------------------------- tools/qconfig/main.cpp | 8 - tools/qtconfig/LICENSE.GPL | 280 ---------------------------- tools/qvfb/LICENSE.GPL | 280 ---------------------------- 7 files changed, 41 insertions(+), 1408 deletions(-) delete mode 100644 tools/assistant/compat/LICENSE.GPL delete mode 100644 tools/linguist/LICENSE.GPL delete mode 100644 tools/qconfig/LICENSE.GPL delete mode 100644 tools/qtconfig/LICENSE.GPL delete mode 100644 tools/qvfb/LICENSE.GPL diff --git a/src/gui/accessible/qaccessible_mac_cocoa.mm b/src/gui/accessible/qaccessible_mac_cocoa.mm index e69de29..c41b1a8 100644 --- a/src/gui/accessible/qaccessible_mac_cocoa.mm +++ b/src/gui/accessible/qaccessible_mac_cocoa.mm @@ -0,0 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + diff --git a/tools/assistant/compat/LICENSE.GPL b/tools/assistant/compat/LICENSE.GPL deleted file mode 100644 index b6e1c33..0000000 --- a/tools/assistant/compat/LICENSE.GPL +++ /dev/null @@ -1,280 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/tools/linguist/LICENSE.GPL b/tools/linguist/LICENSE.GPL deleted file mode 100644 index b6e1c33..0000000 --- a/tools/linguist/LICENSE.GPL +++ /dev/null @@ -1,280 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/tools/qconfig/LICENSE.GPL b/tools/qconfig/LICENSE.GPL deleted file mode 100644 index b6e1c33..0000000 --- a/tools/qconfig/LICENSE.GPL +++ /dev/null @@ -1,280 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/tools/qconfig/main.cpp b/tools/qconfig/main.cpp index a408018..4612ceb 100644 --- a/tools/qconfig/main.cpp +++ b/tools/qconfig/main.cpp @@ -507,14 +507,6 @@ void Main::about() "

Version 2.0

" "

Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).

" "

" - "

This program is licensed to you under the terms of the GNU General " - "Public License Version 2 as published by the Free Software Foundation. This " - "gives you legal permission to copy, distribute and/or modify this software " - "under certain conditions. For details, see the file 'LICENSE.GPL' that came with " - "this software distribution. If you did not get the file, send email to " - "qt-info@nokia.com.

\n\n

The program is provided AS IS with NO WARRANTY " - "OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS " - "FOR A PARTICULAR PURPOSE.

" ); } diff --git a/tools/qtconfig/LICENSE.GPL b/tools/qtconfig/LICENSE.GPL deleted file mode 100644 index b6e1c33..0000000 --- a/tools/qtconfig/LICENSE.GPL +++ /dev/null @@ -1,280 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/tools/qvfb/LICENSE.GPL b/tools/qvfb/LICENSE.GPL deleted file mode 100644 index b6e1c33..0000000 --- a/tools/qvfb/LICENSE.GPL +++ /dev/null @@ -1,280 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS -- cgit v0.12 From fea27783e811263931544c54d76d92e8136e65df Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 2 Sep 2009 18:20:48 +1000 Subject: Rename misnamed qdoc file. Reviewed-by: Trust Me --- demos/textedit/textedit.doc | 18 ------------------ demos/textedit/textedit.qdoc | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 demos/textedit/textedit.doc create mode 100644 demos/textedit/textedit.qdoc diff --git a/demos/textedit/textedit.doc b/demos/textedit/textedit.doc deleted file mode 100644 index 53279b9..0000000 --- a/demos/textedit/textedit.doc +++ /dev/null @@ -1,18 +0,0 @@ -/*! \page textedit-example.html - - \ingroup examples - \title Text Edit Example - - This example displays a text editor with the user interface written - in pure C++. - - A similar example which uses \link designer-manual.book Qt - Designer\endlink to produce the user interface is in the \link - designer-manual.book Qt Designer manual\endlink. - - - See \c{$QTDIR/examples/textedit} for the source code. - -*/ - - diff --git a/demos/textedit/textedit.qdoc b/demos/textedit/textedit.qdoc new file mode 100644 index 0000000..53279b9 --- /dev/null +++ b/demos/textedit/textedit.qdoc @@ -0,0 +1,18 @@ +/*! \page textedit-example.html + + \ingroup examples + \title Text Edit Example + + This example displays a text editor with the user interface written + in pure C++. + + A similar example which uses \link designer-manual.book Qt + Designer\endlink to produce the user interface is in the \link + designer-manual.book Qt Designer manual\endlink. + + + See \c{$QTDIR/examples/textedit} for the source code. + +*/ + + -- cgit v0.12 From 6a7e6d47e307b4a181812b1bd5cfb57903ea7f76 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 2 Sep 2009 10:21:24 +0200 Subject: Fail in tst_QGraphicsView::task259503_scrollingArtifacts is expected. Adding QEXPECTED_FAIL. See commit 54226926faa44ec532efd0745e0ff64781202844 for more information. Reviewed-by: trustme --- tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index bdb6e98..d9b5efb 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -3698,6 +3698,7 @@ void tst_QGraphicsView::task259503_scrollingArtifacts() { qDebug() << event->region(); qDebug() << updateRegion; + QEXPECT_FAIL("", "", Continue); QCOMPARE(event->region(), updateRegion); } } -- cgit v0.12 From 05e30a4aa7ae5ea552c459fc7d64c8270ec34105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 2 Sep 2009 10:28:46 +0200 Subject: Fix DirectFB driver when comipled with NO_WM Reviewed-by: Tom --- src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp | 4 ++++ src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 599b2a9..179936d 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -1209,7 +1209,11 @@ bool QDirectFBScreen::connect(const QString &displaySpec) "Unable to get screen!", result); return false; } +#ifdef QT_NO_DIRECTFB_WM + result = d_ptr->primarySurface->GetSize(d_ptr->primarySurface, &w, &h); +#else result = d_ptr->dfbScreen->GetSize(d_ptr->dfbScreen, &w, &h); +#endif if (result != DFB_OK) { DirectFBError("QDirectFBScreen::connect: " "Unable to get screen size!", result); diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index e288199..9a966a1 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -431,11 +431,13 @@ IDirectFBSurface *QDirectFBWindowSurface::directFBSurface() const IDirectFBSurface *QDirectFBWindowSurface::surfaceForWidget(const QWidget *widget, QRect *rect) const { Q_ASSERT(widget); +#ifndef QT_NO_DIRECTFB_WM if (!dfbSurface) { if (sibling && (!sibling->sibling || sibling->dfbSurface)) return sibling->surfaceForWidget(widget, rect); return 0; } +#endif QWidget *win = window(); Q_ASSERT(win); if (rect) { -- cgit v0.12 From b0214670579bfabfa8f02647f579d3834968802c Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 2 Sep 2009 10:41:28 +0200 Subject: QMainWindow doesn't respect the sizehint of the dockwidgets It used to compress it because in the layout we were never picking the sizeHint. Now we do. Task-number: 260483 --- src/gui/widgets/qdockarealayout.cpp | 8 ++++---- tests/auto/qmainwindow/tst_qmainwindow.cpp | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/gui/widgets/qdockarealayout.cpp b/src/gui/widgets/qdockarealayout.cpp index 3d1d3b1..3920ae9 100644 --- a/src/gui/widgets/qdockarealayout.cpp +++ b/src/gui/widgets/qdockarealayout.cpp @@ -2601,28 +2601,28 @@ void QDockAreaLayout::getGrid(QVector *_ver_struct_list, center_rect.setBottom(rect.bottom() - docks[QInternal::BottomDock].rect.height() - sep); QSize left_hint = docks[QInternal::LeftDock].size(); - if (!left_hint.isValid()) + if (left_hint.isNull()) left_hint = docks[QInternal::LeftDock].sizeHint(); QSize left_min = docks[QInternal::LeftDock].minimumSize(); QSize left_max = docks[QInternal::LeftDock].maximumSize(); left_hint = left_hint.boundedTo(left_max).expandedTo(left_min); QSize right_hint = docks[QInternal::RightDock].size(); - if (!right_hint.isValid()) + if (right_hint.isNull()) right_hint = docks[QInternal::RightDock].sizeHint(); QSize right_min = docks[QInternal::RightDock].minimumSize(); QSize right_max = docks[QInternal::RightDock].maximumSize(); right_hint = right_hint.boundedTo(right_max).expandedTo(right_min); QSize top_hint = docks[QInternal::TopDock].size(); - if (!top_hint.isValid()) + if (top_hint.isNull()) top_hint = docks[QInternal::TopDock].sizeHint(); QSize top_min = docks[QInternal::TopDock].minimumSize(); QSize top_max = docks[QInternal::TopDock].maximumSize(); top_hint = top_hint.boundedTo(top_max).expandedTo(top_min); QSize bottom_hint = docks[QInternal::BottomDock].size(); - if (!bottom_hint.isValid()) + if (bottom_hint.isNull()) bottom_hint = docks[QInternal::BottomDock].sizeHint(); QSize bottom_min = docks[QInternal::BottomDock].minimumSize(); QSize bottom_max = docks[QInternal::BottomDock].maximumSize(); diff --git a/tests/auto/qmainwindow/tst_qmainwindow.cpp b/tests/auto/qmainwindow/tst_qmainwindow.cpp index ffa5853..0049c8d 100644 --- a/tests/auto/qmainwindow/tst_qmainwindow.cpp +++ b/tests/auto/qmainwindow/tst_qmainwindow.cpp @@ -107,6 +107,7 @@ private slots: void setCursor(); void addToolbarAfterShow(); void centralWidgetSize(); + void dockWidgetSize(); }; // Testing get/set functions @@ -1677,6 +1678,24 @@ void tst_QMainWindow::centralWidgetSize() QCOMPARE(widget.size(), widget.sizeHint()); } +void tst_QMainWindow::dockWidgetSize() +{ + QMainWindow mainWindow; + mainWindow.menuBar()->addMenu("menu"); + + MyWidget widget; + mainWindow.setCentralWidget(&widget); + + QDockWidget dock; + dock.setWidget(new MyWidget); + mainWindow.addDockWidget(Qt::TopDockWidgetArea, &dock); + + mainWindow.show(); + QTest::qWait(100); + QCOMPARE(widget.size(), widget.sizeHint()); + QCOMPARE(dock.widget()->size(), dock.widget()->sizeHint()); +} + QTEST_MAIN(tst_QMainWindow) #include "tst_qmainwindow.moc" -- cgit v0.12 From cd84cbc19df1f6ea02119ca89107645803e9c630 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 2 Sep 2009 11:49:03 +0300 Subject: Fixes pointer events when using popups and/or modal dialogs. This commit also adds initial support for fading behind modal dialogs. Avoid unnecessary local/global capturing since when having global capture enabled we cannot for example tap icons on statusbar. The logic how pointer events for popups and modal dialogs shall work: - Modal dialogs: * Shall not close when outside dlg is clicked * Shall not allow usage or underlying control with mouse * Achieved with SetGloballyCapturing and SetPointerCapture in enterModal_sys / leaveModal_sys - Popups * Shall close when the outside popup is clicked * Achieved with enabling the SetPointerCapture only for topmost popup and canceling it for all underlyuing ones. * In addition long tap timer needs to be canceled for underlying widgets when opening a pop-up. Otherwise theu get longtap event whcih causes unexpected behaviour. TODOs: - Fading does not work correctly when more than two levels of modal dialogs are opened. - Fading does not work correctly when switching away from app and back to it with fast swap window (using menu works) - Check if fading should be implemented with MAknFadedComponent and TAknPopupFader, in order to support cross-application fading - Should popups closes when application loses the focus? Reviewed-by: Janne Koskinen --- src/gui/kernel/qapplication_s60.cpp | 67 +++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 21 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 1bbf332..4260fd9 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -347,21 +347,21 @@ void QSymbianControl::HandleLongTapEventL( const TPoint& aPenEventLocation, cons QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons | Qt::RightButton; QMouseEvent mEvent(QEvent::MouseButtonPress, alienWidget->mapFrom(qwidget, widgetPos), globalPos, Qt::RightButton, QApplicationPrivate::mouse_buttons, Qt::NoModifier); - + bool res = sendMouseEvent(alienWidget, &mEvent); #if !defined(QT_NO_CONTEXTMENU) QContextMenuEvent contextMenuEvent(QContextMenuEvent::Mouse, widgetPos, globalPos, mEvent.modifiers()); qt_sendSpontaneousEvent(alienWidget, &contextMenuEvent); -#endif - +#endif + m_previousEventLongTap = true; } void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent) { m_longTapDetector->PointerEventL(pEvent); - QT_TRYCATCH_LEAVING(HandlePointerEvent(pEvent)); + QT_TRYCATCH_LEAVING(HandlePointerEvent(pEvent)); } void QSymbianControl::HandlePointerEvent(const TPointerEvent& pEvent) @@ -396,15 +396,6 @@ void QSymbianControl::HandlePointerEvent(const TPointerEvent& pEvent) if (!alienWidget) alienWidget = qwidget; S60->mousePressTarget = alienWidget; - //pointer grab - SetGloballyCapturing(ETrue); - SetPointerCapture(ETrue); - } - else if (type == QEvent::MouseButtonRelease) - { - //release pointer grab - SetGloballyCapturing(EFalse); - SetPointerCapture(EFalse); } alienWidget = S60->mousePressTarget; @@ -801,14 +792,27 @@ bool QApplicationPrivate::modalState() void QApplicationPrivate::enterModal_sys(QWidget *widget) { + if (widget) { + widget->effectiveWinId()->DrawableWindow()->FadeBehind(ETrue); + // Modal partial screen dialogs (like queries) capture pointer events. + // ### FixMe: Add specialized behaviour for fullscreen modal dialogs + widget->effectiveWinId()->SetGloballyCapturing(ETrue); + widget->effectiveWinId()->SetPointerCapture(ETrue); + } if (!qt_modal_stack) qt_modal_stack = new QWidgetList; qt_modal_stack->insert(0, widget); - app_do_modal = true; + app_do_modal = true; } void QApplicationPrivate::leaveModal_sys(QWidget *widget) { + if (widget) { + widget->effectiveWinId()->DrawableWindow()->FadeBehind(EFalse); + // ### FixMe: Add specialized behaviour for fullscreen modal dialogs + widget->effectiveWinId()->SetGloballyCapturing(EFalse); + widget->effectiveWinId()->SetPointerCapture(EFalse); + } if (qt_modal_stack && qt_modal_stack->removeAll(widget)) { if (qt_modal_stack->isEmpty()) { delete qt_modal_stack; @@ -824,18 +828,31 @@ void QApplicationPrivate::openPopup(QWidget *popup) QApplicationPrivate::popupWidgets = new QWidgetList; QApplicationPrivate::popupWidgets->append(popup); - if (QApplicationPrivate::popupWidgets->count() == 1 && !qt_nograb()) { + + // Cancel focus widget pointer capture and long tap timer + if (QApplication::focusWidget()) { + static_cast(QApplication::focusWidget()->effectiveWinId())->CancelLongTapTimer(); + QApplication::focusWidget()->effectiveWinId()->SetPointerCapture(false); + } + + if (!qt_nograb()) { + // Cancel pointer capture and long tap timer for earlier popup + int popupCount = QApplicationPrivate::popupWidgets->count(); + if (popupCount > 1) { + QWidget* prevPopup = QApplicationPrivate::popupWidgets->at(popupCount-2); + static_cast(prevPopup->effectiveWinId())->CancelLongTapTimer(); + prevPopup->effectiveWinId()->SetPointerCapture(false); + } + + // Enable pointer capture for this (topmost) popup Q_ASSERT(popup->testAttribute(Qt::WA_WState_Created)); WId id = popup->effectiveWinId(); id->SetPointerCapture(true); - id->SetGloballyCapturing(true); } // popups are not focus-handled by the window system (the first // popup grabbed the keyboard), so we have to do that manually: A // new popup gets the focus - if (QApplication::focusWidget()) - static_cast(QApplication::focusWidget()->effectiveWinId())->CancelLongTapTimer(); QWidget *fw = popup->focusWidget(); if (fw) { fw->setFocus(Qt::PopupFocusReason); @@ -854,14 +871,16 @@ void QApplicationPrivate::closePopup(QWidget *popup) return; QApplicationPrivate::popupWidgets->removeAll(popup); + // Cancel pointer capture and long tap for this popup + WId id = popup->effectiveWinId(); + id->SetPointerCapture(false); + static_cast(id)->CancelLongTapTimer(); + if (QApplicationPrivate::popupWidgets->isEmpty()) { // this was the last popup delete QApplicationPrivate::popupWidgets; QApplicationPrivate::popupWidgets = 0; if (!qt_nograb()) { // grabbing not disabled Q_ASSERT(popup->testAttribute(Qt::WA_WState_Created)); - WId id = popup->effectiveWinId(); - id->SetPointerCapture(false); - id->SetGloballyCapturing(false); if (QWidgetPrivate::mouseGrabber != 0) QWidgetPrivate::mouseGrabber->grabMouse(); @@ -880,6 +899,7 @@ void QApplicationPrivate::closePopup(QWidget *popup) } } } else { + // popups are not focus-handled by the window system (the // first popup grabbed the keyboard), so we have to do that // manually: A popup was closed, so the previous popup gets @@ -889,6 +909,11 @@ void QApplicationPrivate::closePopup(QWidget *popup) QFocusEvent e(QEvent::FocusOut, Qt::PopupFocusReason); q_func()->sendEvent(fw, &e); } + + // Enable pointer capture for previous popup + if (aw) { + aw->effectiveWinId()->SetPointerCapture(true); + } } } -- cgit v0.12 From dc37538a832dc9381714e384ba40531aee279ad2 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 2 Sep 2009 10:43:43 +0200 Subject: Added comment to QEXPECTED_FAIL. See commit 54226926faa44ec532efd0745e0ff64781202844 for more information. Reviewed-by: ogoffart --- tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index d9b5efb..fd9d2a1 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -3696,9 +3696,9 @@ void tst_QGraphicsView::task259503_scrollingArtifacts() if (itSTimeToTest) { - qDebug() << event->region(); - qDebug() << updateRegion; - QEXPECT_FAIL("", "", Continue); +// qDebug() << event->region(); +// qDebug() << updateRegion; + QEXPECT_FAIL("", "The event region doesn't include the original item position region. See task #259503.", Continue); QCOMPARE(event->region(), updateRegion); } } -- cgit v0.12 From 99655d5cd5b7543377d9c56ba953b07946ccbf74 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 2 Sep 2009 18:52:11 +1000 Subject: Add license header to perl scripts. Reviewed-by: Trust Me --- src/gui/painting/makepsheader.pl | 40 ++++++++++++++++++++++ tests/auto/linguist/lconvert/data/makeplurals.pl | 42 +++++++++++++++++++++++- tests/auto/test.pl | 41 +++++++++++++++++++++++ tools/activeqt/testcon/scripts/perlscript.pl | 41 +++++++++++++++++++++++ 4 files changed, 163 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/makepsheader.pl b/src/gui/painting/makepsheader.pl index 30a5eea..de13209 100755 --- a/src/gui/painting/makepsheader.pl +++ b/src/gui/painting/makepsheader.pl @@ -1,4 +1,44 @@ #!/usr/bin/perl +############################################################################# +## +## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +## Contact: Nokia Corporation (qt-info@nokia.com) +## +## This file is part of the QtGui module of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:LGPL$ +## No Commercial Usage +## This file contains pre-release code and may not be distributed. +## You may use this file in accordance with the terms and conditions +## contained in the Technology Preview License Agreement accompanying +## this package. +## +## GNU Lesser General Public License Usage +## Alternatively, this file may be used under the terms of the GNU Lesser +## General Public License version 2.1 as published by the Free Software +## Foundation and appearing in the file LICENSE.LGPL included in the +## packaging of this file. Please review the following information to +## ensure the GNU Lesser General Public License version 2.1 requirements +## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## In addition, as a special exception, Nokia gives you certain +## additional rights. These rights are described in the Nokia Qt LGPL +## Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +## package. +## +## If you have questions regarding the use of this file, please contact +## Nokia at qt-info@nokia.com. +## +## +## +## +## +## +## +## +## $QT_END_LICENSE$ +## +############################################################################# open(INPUT, 'qpsprinter.ps') or die "Can't open qpsprinter.ps"; diff --git a/tests/auto/linguist/lconvert/data/makeplurals.pl b/tests/auto/linguist/lconvert/data/makeplurals.pl index 19bffe0..614399d 100755 --- a/tests/auto/linguist/lconvert/data/makeplurals.pl +++ b/tests/auto/linguist/lconvert/data/makeplurals.pl @@ -1,4 +1,44 @@ -#! /usr/bin/env perl +#!/usr/bin/env perl +############################################################################# +## +## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +## Contact: Nokia Corporation (qt-info@nokia.com) +## +## This file is part of the test suite of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:LGPL$ +## No Commercial Usage +## This file contains pre-release code and may not be distributed. +## You may use this file in accordance with the terms and conditions +## contained in the Technology Preview License Agreement accompanying +## this package. +## +## GNU Lesser General Public License Usage +## Alternatively, this file may be used under the terms of the GNU Lesser +## General Public License version 2.1 as published by the Free Software +## Foundation and appearing in the file LICENSE.LGPL included in the +## packaging of this file. Please review the following information to +## ensure the GNU Lesser General Public License version 2.1 requirements +## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## In addition, as a special exception, Nokia gives you certain +## additional rights. These rights are described in the Nokia Qt LGPL +## Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +## package. +## +## If you have questions regarding the use of this file, please contact +## Nokia at qt-info@nokia.com. +## +## +## +## +## +## +## +## +## $QT_END_LICENSE$ +## +############################################################################# sub makeit2($$$) { diff --git a/tests/auto/test.pl b/tests/auto/test.pl index f2a1fe4..f7a53ca 100755 --- a/tests/auto/test.pl +++ b/tests/auto/test.pl @@ -1,4 +1,45 @@ #!/usr/bin/perl +############################################################################# +## +## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +## Contact: Nokia Corporation (qt-info@nokia.com) +## +## This file is part of the test suite of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:LGPL$ +## No Commercial Usage +## This file contains pre-release code and may not be distributed. +## You may use this file in accordance with the terms and conditions +## contained in the Technology Preview License Agreement accompanying +## this package. +## +## GNU Lesser General Public License Usage +## Alternatively, this file may be used under the terms of the GNU Lesser +## General Public License version 2.1 as published by the Free Software +## Foundation and appearing in the file LICENSE.LGPL included in the +## packaging of this file. Please review the following information to +## ensure the GNU Lesser General Public License version 2.1 requirements +## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## In addition, as a special exception, Nokia gives you certain +## additional rights. These rights are described in the Nokia Qt LGPL +## Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +## package. +## +## If you have questions regarding the use of this file, please contact +## Nokia at qt-info@nokia.com. +## +## +## +## +## +## +## +## +## $QT_END_LICENSE$ +## +############################################################################# + use strict; use Cwd; diff --git a/tools/activeqt/testcon/scripts/perlscript.pl b/tools/activeqt/testcon/scripts/perlscript.pl index 029bdc2..2802f65 100644 --- a/tools/activeqt/testcon/scripts/perlscript.pl +++ b/tools/activeqt/testcon/scripts/perlscript.pl @@ -1,3 +1,44 @@ +############################################################################# +## +## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +## Contact: Nokia Corporation (qt-info@nokia.com) +## +## This file is part of the ActiveQt module of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:LGPL$ +## No Commercial Usage +## This file contains pre-release code and may not be distributed. +## You may use this file in accordance with the terms and conditions +## contained in the Technology Preview License Agreement accompanying +## this package. +## +## GNU Lesser General Public License Usage +## Alternatively, this file may be used under the terms of the GNU Lesser +## General Public License version 2.1 as published by the Free Software +## Foundation and appearing in the file LICENSE.LGPL included in the +## packaging of this file. Please review the following information to +## ensure the GNU Lesser General Public License version 2.1 requirements +## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## In addition, as a special exception, Nokia gives you certain +## additional rights. These rights are described in the Nokia Qt LGPL +## Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +## package. +## +## If you have questions regarding the use of this file, please contact +## Nokia at qt-info@nokia.com. +## +## +## +## +## +## +## +## +## $QT_END_LICENSE$ +## +############################################################################# + sub QAxWidget2_Click { $QAxWidget2->{'lineWidth'} = $QAxWidget2->{'lineWidth'} + 1; $MainWindow->logMacro(0, "Hello from Perl: QAxWidget2_Click", 0, ""); -- cgit v0.12 From f21518960ba0c4a21e89c9fddb7310e5ba96fea5 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 2 Sep 2009 19:07:57 +1000 Subject: Update license text. Reviewed-by: Trust Me --- util/scripts/make_qfeatures_dot_h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/util/scripts/make_qfeatures_dot_h b/util/scripts/make_qfeatures_dot_h index 95fbec1..d925d15 100755 --- a/util/scripts/make_qfeatures_dot_h +++ b/util/scripts/make_qfeatures_dot_h @@ -94,8 +94,8 @@ print OUT ** 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. +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -106,20 +106,20 @@ print OUT ** 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 +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this ** package. ** -** 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 have questions regarding the use of this file, please contact +** Nokia at qt-info\@nokia.com. +** +** +** +** +** +** +** ** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. ** \$QT_END_LICENSE\$ ** ****************************************************************************/ -- cgit v0.12 From f193953ffad7ebcc0692424286b1ac413bc9b643 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 2 Sep 2009 19:13:39 +1000 Subject: Add missing license header. Reviewed-by: Trust Me --- demos/textedit/textedit.qdoc | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/demos/textedit/textedit.qdoc b/demos/textedit/textedit.qdoc index 53279b9..c9b06e8 100644 --- a/demos/textedit/textedit.qdoc +++ b/demos/textedit/textedit.qdoc @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + /*! \page textedit-example.html \ingroup examples -- cgit v0.12 From 473662ce30874155841a992f2f3096a4f1633b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Wed, 2 Sep 2009 10:42:47 +0200 Subject: Add some more tests for anchor layout --- .../tst_qgraphicsanchorlayout.cpp | 165 ++++++++++++++++++++- 1 file changed, 164 insertions(+), 1 deletion(-) diff --git a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp index e54f95c..59016b9 100644 --- a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp +++ b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp @@ -50,6 +50,8 @@ class tst_QGraphicsAnchorLayout : public QObject { private slots: void simple(); + void simple_center(); + void simple_semifloat(); void diagonal(); void parallel(); void parallel2(); @@ -60,7 +62,7 @@ private slots: void proportionalPreferred(); void example(); void setSpacing(); - + void hardComplexS60(); }; class RectWidget : public QGraphicsWidget @@ -91,6 +93,17 @@ static QGraphicsWidget *createItem(const QSizeF &minimum = QSizeF(100.0, 100.0), return w; } +static void setAnchor(QGraphicsAnchorLayout *l, + QGraphicsLayoutItem *firstItem, + Qt::AnchorPoint firstEdge, + QGraphicsLayoutItem *secondItem, + Qt::AnchorPoint secondEdge, + qreal spacing) +{ + l->addAnchor(firstItem, firstEdge, secondItem, secondEdge); + l->setAnchorSpacing(firstItem, firstEdge, secondItem, secondEdge, spacing); +} + void tst_QGraphicsAnchorLayout::simple() { QGraphicsWidget *w1 = createItem(); @@ -106,6 +119,92 @@ void tst_QGraphicsAnchorLayout::simple() QCOMPARE(l->count(), 2); } +void tst_QGraphicsAnchorLayout::simple_center() +{ + QSizeF min(10, 10); + QSizeF pref(50, 10); + QSizeF max(100, 10); + + QGraphicsWidget *a = createItem(min, pref, max, "a"); + QGraphicsWidget *b = createItem(min, pref, max, "b"); + QGraphicsWidget *c = createItem(min, pref, max, "c"); + + QGraphicsAnchorLayout *l = new QGraphicsAnchorLayout; + l->setContentsMargins(0, 0, 0, 0); + // horizontal + setAnchor(l, l, Qt::AnchorLeft, a, Qt::AnchorLeft, 0); + setAnchor(l, a, Qt::AnchorRight, b, Qt::AnchorLeft, 0); + setAnchor(l, b, Qt::AnchorRight, l, Qt::AnchorRight, 0); + setAnchor(l, a, Qt::AnchorHorizontalCenter, c, Qt::AnchorLeft, 0); + setAnchor(l, c, Qt::AnchorRight, b, Qt::AnchorHorizontalCenter, 0); + + // vertical + setAnchor(l, l, Qt::AnchorTop, a, Qt::AnchorTop, 0); + setAnchor(l, l, Qt::AnchorTop, b, Qt::AnchorTop, 0); + setAnchor(l, a, Qt::AnchorBottom, c, Qt::AnchorTop, 0); + setAnchor(l, b, Qt::AnchorBottom, c, Qt::AnchorTop, 0); + setAnchor(l, c, Qt::AnchorBottom, l, Qt::AnchorBottom, 0); + + QCOMPARE(l->count(), 3); + + QGraphicsWidget *p = new QGraphicsWidget(0, Qt::Window); + p->setLayout(l); + + QSizeF layoutMinimumSize = l->effectiveSizeHint(Qt::MinimumSize); + QCOMPARE(layoutMinimumSize, QSizeF(20, 20)); + + QSizeF layoutMaximumSize = l->effectiveSizeHint(Qt::MaximumSize); + QCOMPARE(layoutMaximumSize, QSizeF(200, 20)); +} + +void tst_QGraphicsAnchorLayout::simple_semifloat() +{ + // Useful for testing simplification between A_left and B_left. + // Unfortunately the only way to really test that now is to manually inspect the + // simplified graph. + QSizeF min(10, 10); + QSizeF pref(50, 10); + QSizeF max(100, 10); + + QGraphicsWidget *A = createItem(min, pref, max, "A"); + QGraphicsWidget *B = createItem(min, pref, max, "B"); + QGraphicsWidget *a = createItem(min, pref, max, "a"); + QGraphicsWidget *b = createItem(min, pref, max, "b"); + + QGraphicsAnchorLayout *l = new QGraphicsAnchorLayout; + l->setContentsMargins(0, 0, 0, 0); + + // horizontal + setAnchor(l, l, Qt::AnchorLeft, A, Qt::AnchorLeft, 0); + setAnchor(l, A, Qt::AnchorRight, B, Qt::AnchorLeft, 0); + setAnchor(l, B, Qt::AnchorRight, l, Qt::AnchorRight, 0); + + setAnchor(l, A, Qt::AnchorLeft, a, Qt::AnchorLeft, 0); + setAnchor(l, B, Qt::AnchorLeft, b, Qt::AnchorLeft, 0); + + // vertical + setAnchor(l, l, Qt::AnchorTop, A, Qt::AnchorTop, 0); + setAnchor(l, l, Qt::AnchorTop, B, Qt::AnchorTop, 0); + setAnchor(l, A, Qt::AnchorBottom, a, Qt::AnchorTop, 0); + setAnchor(l, B, Qt::AnchorBottom, b, Qt::AnchorTop, 0); + setAnchor(l, a, Qt::AnchorBottom, l, Qt::AnchorBottom, 0); + setAnchor(l, b, Qt::AnchorBottom, l, Qt::AnchorBottom, 0); + + QCOMPARE(l->count(), 4); + + QGraphicsWidget *p = new QGraphicsWidget(0, Qt::Window); + p->setLayout(l); + + QSizeF layoutMinimumSize = l->effectiveSizeHint(Qt::MinimumSize); + QCOMPARE(layoutMinimumSize, QSizeF(20, 20)); + + QCOMPARE(l->effectiveSizeHint(Qt::PreferredSize), QSizeF(100, 20)); + + QSizeF layoutMaximumSize = l->effectiveSizeHint(Qt::MaximumSize); + QCOMPARE(layoutMaximumSize, QSizeF(200, 20)); +} + + void tst_QGraphicsAnchorLayout::diagonal() { QSizeF min(10, 100); @@ -905,5 +1004,69 @@ void tst_QGraphicsAnchorLayout::setSpacing() } +void tst_QGraphicsAnchorLayout::hardComplexS60() +{ + // Test for "hard" complex case, taken from wiki + // https://cwiki.nokia.com/S60QTUI/AnchorLayoutComplexCases + QSizeF min(0, 10); + QSizeF pref(50, 10); + QSizeF max(100, 10); + + QGraphicsWidget *a = createItem(min, pref, max, "a"); + QGraphicsWidget *b = createItem(min, pref, max, "b"); + QGraphicsWidget *c = createItem(min, pref, max, "c"); + QGraphicsWidget *d = createItem(min, pref, max, "d"); + QGraphicsWidget *e = createItem(min, pref, max, "e"); + QGraphicsWidget *f = createItem(min, pref, max, "f"); + QGraphicsWidget *g = createItem(min, pref, max, "g"); + + QGraphicsAnchorLayout *l = new QGraphicsAnchorLayout; + l->setContentsMargins(0, 0, 0, 0); + + // + setAnchor(l, l, Qt::AnchorLeft, a, Qt::AnchorLeft, 10); + setAnchor(l, a, Qt::AnchorRight, b, Qt::AnchorLeft, 10); + setAnchor(l, b, Qt::AnchorRight, c, Qt::AnchorLeft, 10); + setAnchor(l, c, Qt::AnchorRight, d, Qt::AnchorLeft, 10); + setAnchor(l, d, Qt::AnchorRight, l, Qt::AnchorRight, 10); + + // + setAnchor(l, b, Qt::AnchorLeft, e, Qt::AnchorLeft, 10); + setAnchor(l, e, Qt::AnchorRight, d, Qt::AnchorLeft, 10); + + // + setAnchor(l, a, Qt::AnchorHorizontalCenter, g, Qt::AnchorLeft, 10); + setAnchor(l, g, Qt::AnchorRight, f, Qt::AnchorHorizontalCenter, 10); + setAnchor(l, c, Qt::AnchorLeft, f, Qt::AnchorLeft, 10); + setAnchor(l, f, Qt::AnchorRight, d, Qt::AnchorRight, 10); + + // + setAnchor(l, l, Qt::AnchorTop, e, Qt::AnchorTop, 0); + setAnchor(l, e, Qt::AnchorBottom, a, Qt::AnchorTop, 0); + setAnchor(l, e, Qt::AnchorBottom, b, Qt::AnchorTop, 0); + setAnchor(l, e, Qt::AnchorBottom, c, Qt::AnchorTop, 0); + setAnchor(l, e, Qt::AnchorBottom, d, Qt::AnchorTop, 0); + setAnchor(l, a, Qt::AnchorBottom, f, Qt::AnchorTop, 0); + setAnchor(l, a, Qt::AnchorBottom, b, Qt::AnchorBottom, 0); + setAnchor(l, a, Qt::AnchorBottom, c, Qt::AnchorBottom, 0); + setAnchor(l, a, Qt::AnchorBottom, d, Qt::AnchorBottom, 0); + setAnchor(l, f, Qt::AnchorBottom, g, Qt::AnchorTop, 0); + setAnchor(l, g, Qt::AnchorBottom, l, Qt::AnchorBottom, 0); + + QCOMPARE(l->count(), 7); + + QGraphicsWidget *p = new QGraphicsWidget(0, Qt::Window); + p->setLayout(l); + + QSizeF layoutMinimumSize = l->effectiveSizeHint(Qt::MinimumSize); + QCOMPARE(layoutMinimumSize, QSizeF(60, 40)); + // expected preferred might be wrong, (haven't manually verified it) + QSizeF layoutPreferredSize = l->effectiveSizeHint(Qt::PreferredSize); + QCOMPARE(layoutPreferredSize, QSizeF(220, 40)); + QSizeF layoutMaximumSize = l->effectiveSizeHint(Qt::MaximumSize); + QCOMPARE(layoutMaximumSize, QSizeF(240, 40)); + +} + QTEST_MAIN(tst_QGraphicsAnchorLayout) #include "tst_qgraphicsanchorlayout.moc" -- cgit v0.12 From 17b2b77713b5e2b1f85e231ca67c7dc378f86fa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Wed, 2 Sep 2009 10:44:28 +0200 Subject: Fix the issue where the simplification did not simplify 2 anchors. (It had to be minimum three anchors.) --- src/gui/graphicsview/qgraphicsanchorlayout_p.cpp | 85 ++++++++++++++---------- 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp index 8065526..871f009 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp @@ -525,23 +525,33 @@ bool QGraphicsAnchorLayoutPrivate::simplifyGraphIteration(QGraphicsAnchorLayoutP endOfSequence = true; } } - if (endOfSequence && candidates.count() >= 2) { + if (endOfSequence && candidates.count() >= 1) { int i; AnchorVertex *afterSequence= 0; - QList adjacentOfSecondLastVertex = g.adjacentVertices(candidates.last()); - Q_ASSERT(adjacentOfSecondLastVertex.count() == 2); - if (adjacentOfSecondLastVertex.first() == candidates.at(candidates.count() - 2)) - afterSequence = adjacentOfSecondLastVertex.last(); - else - afterSequence = adjacentOfSecondLastVertex.first(); - AnchorVertex *beforeSequence = 0; - QList adjacentOfSecondVertex = g.adjacentVertices(candidates.first()); - Q_ASSERT(adjacentOfSecondVertex.count() == 2); - if (adjacentOfSecondVertex.first() == candidates.at(1)) - beforeSequence = adjacentOfSecondVertex.last(); - else - beforeSequence = adjacentOfSecondVertex.first(); + // find the items before and after the valid sequence + if (candidates.count() == 1) { + QList beforeAndAfterVertices = g.adjacentVertices(candidates.at(0)); + Q_ASSERT(beforeAndAfterVertices.count() == 2); + // Since we only have one vertex, we can pick + // any of the two vertices to become before/after. + afterSequence = beforeAndAfterVertices.last(); + beforeSequence = beforeAndAfterVertices.first(); + } else { + QList adjacentOfSecondLastVertex = g.adjacentVertices(candidates.last()); + Q_ASSERT(adjacentOfSecondLastVertex.count() == 2); + if (adjacentOfSecondLastVertex.first() == candidates.at(candidates.count() - 2)) + afterSequence = adjacentOfSecondLastVertex.last(); + else + afterSequence = adjacentOfSecondLastVertex.first(); + + QList adjacentOfSecondVertex = g.adjacentVertices(candidates.first()); + Q_ASSERT(adjacentOfSecondVertex.count() == 2); + if (adjacentOfSecondVertex.first() == candidates.at(1)) + beforeSequence = adjacentOfSecondVertex.last(); + else + beforeSequence = adjacentOfSecondVertex.first(); + } // The complete path of the sequence to simplify is: beforeSequence, , afterSequence // where beforeSequence and afterSequence are the endpoints where the anchor is inserted // between. @@ -583,34 +593,37 @@ bool QGraphicsAnchorLayoutPrivate::simplifyGraphIteration(QGraphicsAnchorLayoutP // start and the end of the sequence. We never want to simplify internal // center anchors where there is an external anchor connected to the center. AnchorVertex *intervalVertexFrom = intervalFrom == 0 ? beforeSequence : candidates.at(intervalFrom - 1); + int effectiveIntervalFrom = intervalFrom; if (intervalVertexFrom->m_edge == centerEdge - && intervalVertexFrom->m_item == candidates.at(intervalFrom)->m_item) { - ++intervalFrom; - intervalVertexFrom = candidates.at(intervalFrom - 1); + && intervalVertexFrom->m_item == candidates.at(effectiveIntervalFrom)->m_item) { + ++effectiveIntervalFrom; + intervalVertexFrom = candidates.at(effectiveIntervalFrom - 1); } AnchorVertex *intervalVertexTo = intervalTo <= candidates.count() ? candidates.at(intervalTo - 1) : afterSequence; + int effectiveIntervalTo = intervalTo; if (intervalVertexTo->m_edge == centerEdge - && intervalVertexTo->m_item == candidates.at(intervalTo - 2)->m_item) { - --intervalTo; - intervalVertexTo = candidates.at(intervalTo - 1); - } - - QVector subCandidates; - if (forward) { - subCandidates = candidates.mid(intervalFrom, intervalTo - intervalFrom - 1); - } else { - // reverse the order of the candidates. - qSwap(intervalVertexFrom, intervalVertexTo); - do { - ++intervalFrom; - subCandidates.prepend(candidates.at(intervalFrom - 1)); - } while (intervalFrom < intervalTo - 1); + && intervalVertexTo->m_item == candidates.at(effectiveIntervalTo - 2)->m_item) { + --effectiveIntervalTo; + intervalVertexTo = candidates.at(effectiveIntervalTo - 1); } - if (simplifySequentialChunk(&g, intervalVertexFrom, subCandidates, intervalVertexTo)) { - dirty = true; - break; + if (effectiveIntervalTo - effectiveIntervalFrom >= 2) { + QVector subCandidates; + if (forward) { + subCandidates = candidates.mid(effectiveIntervalFrom, effectiveIntervalTo - effectiveIntervalFrom - 1); + } else { + // reverse the order of the candidates. + qSwap(intervalVertexFrom, intervalVertexTo); + do { + ++effectiveIntervalFrom; + subCandidates.prepend(candidates.at(effectiveIntervalFrom - 1)); + } while (effectiveIntervalFrom < effectiveIntervalTo - 1); + } + if (simplifySequentialChunk(&g, intervalVertexFrom, subCandidates, intervalVertexTo)) { + dirty = true; + break; + } + // finished simplification of chunk with same direction } - // finished simplification of chunk with same direction } if (forward == (prev == data->from)) --intervalTo; -- cgit v0.12 From 68827cde1a3464330d200c0916cf78ae240f24ad Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Mon, 31 Aug 2009 18:28:49 +0200 Subject: add .make.cache files to .gitignore Reviewed-By: Iain --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 14b25f3..282c8bc 100644 --- a/.gitignore +++ b/.gitignore @@ -198,6 +198,7 @@ plugin_commonU.def # --------------------- .project .cproject +.make.cache qtc-debugging-helper src/corelib/lib -- cgit v0.12 From 604877e60dc11fe5cd44d9c4123ca05bcec39fd7 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 2 Sep 2009 19:21:06 +1000 Subject: Add missing license headers Reviewed-by: Trust Me --- bin/setcepaths.bat | 43 +++++++++++++++++++++++++++++++++++++++++++ bin/syncqt.bat | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) diff --git a/bin/setcepaths.bat b/bin/setcepaths.bat index 5e04526..93b28d3 100755 --- a/bin/setcepaths.bat +++ b/bin/setcepaths.bat @@ -1,3 +1,46 @@ +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: +:: Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +:: Contact: Nokia Corporation (qt-info@nokia.com) +:: +:: This file is part of the tools applications of the Qt Toolkit. +:: +:: $QT_BEGIN_LICENSE:LGPL$ +:: No Commercial Usage +:: This file contains pre-release code and may not be distributed. +:: You may use this file in accordance with the terms and conditions +:: contained in the Technology Preview License Agreement accompanying +:: this package. +:: +:: GNU Lesser General Public License Usage +:: Alternatively, this file may be used under the terms of the GNU Lesser +:: General Public License version 2.1 as published by the Free Software +:: Foundation and appearing in the file LICENSE.LGPL included in the +:: packaging of this file. Please review the following information to +:: ensure the GNU Lesser General Public License version 2.1 requirements +:: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +:: +:: In addition, as a special exception, Nokia gives you certain +:: additional rights. These rights are described in the Nokia Qt LGPL +:: Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +:: package. +:: +:: If you have questions regarding the use of this file, please contact +:: Nokia at qt-info@nokia.com. +:: +:: +:: +:: +:: +:: +:: +:: +:: $QT_END_LICENSE$ +:: +:: This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +:: WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +:: +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: @echo off IF "%1" EQU "wincewm50pocket-msvc2005" ( checksdk.exe -sdk "Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" -script tmp_created_script_setup.bat 1>NUL diff --git a/bin/syncqt.bat b/bin/syncqt.bat index 579844f..f5c34ea 100755 --- a/bin/syncqt.bat +++ b/bin/syncqt.bat @@ -1,2 +1,45 @@ +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: +:: Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +:: Contact: Nokia Corporation (qt-info@nokia.com) +:: +:: This file is part of the tools applications of the Qt Toolkit. +:: +:: $QT_BEGIN_LICENSE:LGPL$ +:: No Commercial Usage +:: This file contains pre-release code and may not be distributed. +:: You may use this file in accordance with the terms and conditions +:: contained in the Technology Preview License Agreement accompanying +:: this package. +:: +:: GNU Lesser General Public License Usage +:: Alternatively, this file may be used under the terms of the GNU Lesser +:: General Public License version 2.1 as published by the Free Software +:: Foundation and appearing in the file LICENSE.LGPL included in the +:: packaging of this file. Please review the following information to +:: ensure the GNU Lesser General Public License version 2.1 requirements +:: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +:: +:: In addition, as a special exception, Nokia gives you certain +:: additional rights. These rights are described in the Nokia Qt LGPL +:: Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +:: package. +:: +:: If you have questions regarding the use of this file, please contact +:: Nokia at qt-info@nokia.com. +:: +:: +:: +:: +:: +:: +:: +:: +:: $QT_END_LICENSE$ +:: +:: This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +:: WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +:: +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: @rem ***** This assumes PERL is in the PATH ***** @perl.exe -S syncqt %* -- cgit v0.12 From 0da575d9e8b391a378007bbf097b936b9ab82931 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 2 Sep 2009 10:46:58 +0200 Subject: QTextStreamPrivate: Removed unnecessary condition --- src/corelib/io/qtextstream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index 72388b5..c70804a 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -937,7 +937,7 @@ inline bool QTextStreamPrivate::putString(const QString &s, bool number) // handle padding int padSize = fieldWidth - s.size(); if (padSize > 0) { - QString pad(padSize > 0 ? padSize : 0, padChar); + QString pad(padSize, padChar); if (fieldAlignment == QTextStream::AlignLeft) { tmp.append(QString(padSize, padChar)); } else if (fieldAlignment == QTextStream::AlignRight -- cgit v0.12 From c4bc2e09e06c4b3ecca1efccd3c3272e8410d4f9 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 2 Sep 2009 10:51:45 +0200 Subject: QTextStreamPrivate: Initialization in constructor missing --- src/corelib/io/qtextstream.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qtextstream.h b/src/corelib/io/qtextstream.h index c922833..d83455a 100644 --- a/src/corelib/io/qtextstream.h +++ b/src/corelib/io/qtextstream.h @@ -274,7 +274,7 @@ class Q_CORE_EXPORT QTextStreamManipulator { public: QTextStreamManipulator(QTSMFI m, int a) { mf = m; mc = 0; arg = a; } - QTextStreamManipulator(QTSMFC m, QChar c) { mf = 0; mc = m; ch = c; } + QTextStreamManipulator(QTSMFC m, QChar c) { mf = 0; mc = m; ch = c; arg = -1; } void exec(QTextStream &s) { if (mf) { (s.*mf)(arg); } else { (s.*mc)(ch); } } private: -- cgit v0.12 From 456feb3c8ecbf5d2349a747f19e742052ecd9762 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 2 Sep 2009 11:14:18 +0200 Subject: QCache: Variable initialization was missing --- src/corelib/tools/qcache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qcache.h b/src/corelib/tools/qcache.h index b369e53..8621908 100644 --- a/src/corelib/tools/qcache.h +++ b/src/corelib/tools/qcache.h @@ -131,7 +131,7 @@ private: template inline QCache::QCache(int amaxCost) - : f(0), l(0), mx(amaxCost), total(0) {} + : f(0), l(0), unused(0), mx(amaxCost), total(0) {} template inline void QCache::clear() -- cgit v0.12 From 1bce9d21d72a30cc7a17ae646d8fefd71a37c525 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 2 Sep 2009 12:08:08 +0200 Subject: QCompleter could crash when setting the completion prefix This fixes the autotest that was crashing Task-number: 246056 Reviewed-by: ogoffart --- src/gui/util/qcompleter.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp index 6196f0f..87dab42 100644 --- a/src/gui/util/qcompleter.cpp +++ b/src/gui/util/qcompleter.cpp @@ -823,12 +823,11 @@ void QCompleterPrivate::_q_complete(QModelIndex index, bool highlighted) Q_Q(QCompleter); QString completion; - if (!(index.flags() & Qt::ItemIsEnabled)) - return; - if (!index.isValid() || (!proxy->showAll && (index.row() >= proxy->engine->matchCount()))) { completion = prefix; } else { + if (!(index.flags() & Qt::ItemIsEnabled)) + return; QModelIndex si = proxy->mapToSource(index); si = si.sibling(si.row(), column); // for clicked() completion = q->pathFromIndex(si); -- cgit v0.12 From 6965249d336c31768d7592efb0630727c1b8631e Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 2 Sep 2009 12:12:51 +0200 Subject: QApplication: Small comment --- src/gui/kernel/qapplication.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index f049a58..511c797 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -3625,6 +3625,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) case QEvent::MouseButtonRelease: case QEvent::MouseButtonDblClick: d->toolTipFallAsleep.stop(); + // fall-through case QEvent::Leave: d->toolTipWakeUp.stop(); default: -- cgit v0.12 From 66fc43343b06575a97b84ad44d70fd3082a6140e Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 2 Sep 2009 12:34:29 +0200 Subject: doc: Fixed several qdoc errors. That's the last of them... for now. --- doc/src/platforms/emb-deployment.qdoc | 4 ++-- doc/src/platforms/emb-running.qdoc | 2 +- doc/src/platforms/qt-embedded-linux.qdoc | 2 +- src/corelib/global/qglobal.cpp | 1 + src/corelib/global/qnamespace.qdoc | 6 ++++++ src/corelib/io/qprocess.cpp | 2 +- src/corelib/tools/qbytearray.cpp | 4 ++++ src/corelib/tools/qlocale.cpp | 3 +++ src/corelib/tools/qscopedpointer.cpp | 4 ++++ src/gui/effects/qgraphicseffect.cpp | 3 ++- src/gui/image/qbitmap.cpp | 4 +++- src/gui/image/qicon.cpp | 18 +++++++++--------- src/gui/inputmethod/qinputcontext.cpp | 2 +- src/gui/kernel/qaction.cpp | 20 ++++++++++++++++++++ src/gui/kernel/qgesture.cpp | 23 ++++++++++++----------- src/gui/styles/qstyle.cpp | 2 +- src/script/api/qscriptengine.cpp | 19 +++++++++---------- 17 files changed, 80 insertions(+), 39 deletions(-) diff --git a/doc/src/platforms/emb-deployment.qdoc b/doc/src/platforms/emb-deployment.qdoc index a6fb978..57df026 100644 --- a/doc/src/platforms/emb-deployment.qdoc +++ b/doc/src/platforms/emb-deployment.qdoc @@ -71,8 +71,8 @@ Note that the application will look for the \c /lib/fonts/ directory relative to the path set using the \c -prefix parameter when running the \c configure script; ensure that this is a - sensible path in the target device environment. See the \l - {Installing Qt for Embedded Linux#Step 3: Building the + sensible path in the target device environment. See the + \l {Installing Qt on Embedded Linux#Step 3: Building the Library}{installation} documentation for more details. \section1 Environment Variables diff --git a/doc/src/platforms/emb-running.qdoc b/doc/src/platforms/emb-running.qdoc index 67c9283..8f56a3b 100644 --- a/doc/src/platforms/emb-running.qdoc +++ b/doc/src/platforms/emb-running.qdoc @@ -77,7 +77,7 @@ \row \o Provided that the environment variables are adjusted properly - during the \l {Installing Qt for Embedded Linux}{installation process}, you + during the \l {Installing Qt on Embedded Linux}{installation process}, you should see the \l {Text Edit} demo appear. It might be that the hardware drivers must be specified explicitly diff --git a/doc/src/platforms/qt-embedded-linux.qdoc b/doc/src/platforms/qt-embedded-linux.qdoc index 0bb2f7d..be98e43 100644 --- a/doc/src/platforms/qt-embedded-linux.qdoc +++ b/doc/src/platforms/qt-embedded-linux.qdoc @@ -81,7 +81,7 @@ \o \list \o \l {Qt for Embedded Linux Architecture}{Architecture Overview} - \o \l {Installing Qt for Embedded Linux}{Installation} + \o \l {Installing Qt on Embedded Linux}{Installation} \o \l {Running Qt for Embedded Linux Applications}{Running Applications} \o \l {Qt for Embedded Linux Examples}{Examples} \endlist diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 935c99b..787eba7 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1189,6 +1189,7 @@ bool qSharedBuild() \value SV_S60_3_2 S60 3rd Edition Feature Pack 2 \value SV_S60_5_0 S60 5th Edition \value SV_S60_Unknown An unknown and currently unsupported platform + \omitvalue SV_S60_None \sa SymbianVersion, WinVersion, MacVersion */ diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index ace70ff..1a0b3e6 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -612,6 +612,12 @@ */ /*! + \enum Qt::CoordinateSystem + \value DeviceCoordinates + \value LogicalCoordinates + */ + +/*! \enum Qt::CaseSensitivity \value CaseInsensitive diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index 5b6830c..1e3b6eb 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -1572,7 +1572,7 @@ void QProcess::setProcessEnvironment(const QProcessEnvironment &environment) \note The environment settings are ignored on Windows CE, as there is no concept of an environment. - \sa setProcessEnvironment(), setEnvironment(), QProcessEnvironment::isValid() + \sa setProcessEnvironment(), setEnvironment(), QProcessEnvironment::isEmpty() */ QProcessEnvironment QProcess::processEnvironment() const { diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 840f6a5..611fc58 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -4099,6 +4099,10 @@ QByteArray QByteArray::toPercentEncoding(const QByteArray &exclude, const QByteA \internal */ +/*! \typedef QByteArray::value_type + \internal + */ + /*! \fn QByteArray::QByteArray(int size) diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index ded36c2..623d63e 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -636,6 +636,9 @@ static QString winSystemPMText() return QString(); } +/*! + Returns the fallback locale obtained from the system. + */ QLocale QSystemLocale::fallbackLocale() const { return QLocale(QString::fromLatin1(getWinLocaleName())); diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp index 44238a8..7dcac71 100644 --- a/src/corelib/tools/qscopedpointer.cpp +++ b/src/corelib/tools/qscopedpointer.cpp @@ -219,4 +219,8 @@ QT_BEGIN_NAMESPACE \sa isNull() */ +/*! \fn void QScopedPointer::swap(QScopedPointer &other) + Swap this pointer with \a other. + */ + QT_END_NAMESPACE diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index f60e80e..6629a6d 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -256,7 +256,8 @@ QPixmap QGraphicsEffectSource::pixmap(Qt::CoordinateSystem system, QPoint *offse } /*! - Constructs a new QGraphicsEffect instance. + Constructs a new QGraphicsEffect instance having the + specified \a parent. */ QGraphicsEffect::QGraphicsEffect(QObject *parent) : QObject(*new QGraphicsEffectPrivate, parent) diff --git a/src/gui/image/qbitmap.cpp b/src/gui/image/qbitmap.cpp index 8c3b9be..b5ffeed 100644 --- a/src/gui/image/qbitmap.cpp +++ b/src/gui/image/qbitmap.cpp @@ -92,13 +92,15 @@ QT_BEGIN_NAMESPACE \sa QPixmap, QImage, QImageReader, QImageWriter */ +/*! \typedef QBitmap::DataPtr + \internal + */ /*! Constructs a null bitmap. \sa QPixmap::isNull() */ - QBitmap::QBitmap() : QPixmap(QSize(0, 0), QPixmapData::BitmapType) { diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index e23677f..1140cd8 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -879,20 +879,20 @@ void QIcon::setThemeSearchPaths(const QStringList &paths) } /*! - \since 4.6 + \since 4.6 - Returns the search paths for icon themes. + Returns the search paths for icon themes. - The default value will depend on the platform: + The default value will depend on the platform: - On X11, the search path will use the XDG_DATA_DIRS environment - variable if available. + On X11, the search path will use the XDG_DATA_DIRS environment + variable if available. - By default all platforms will have the resource directory - ":\icons" as their fallback. You can use "rcc -project" - to generate a resource file from your icon theme. + By default all platforms will have the resource directory + \c{:\icons} as a fallback. You can use "rcc -project" to generate a + resource file from your icon theme. - \sa setThemeSearchPaths(), fromTheme(), setThemeName() + \sa setThemeSearchPaths(), fromTheme(), setThemeName() */ QStringList QIcon::themeSearchPaths() { diff --git a/src/gui/inputmethod/qinputcontext.cpp b/src/gui/inputmethod/qinputcontext.cpp index 2422355..ed30810 100644 --- a/src/gui/inputmethod/qinputcontext.cpp +++ b/src/gui/inputmethod/qinputcontext.cpp @@ -176,7 +176,7 @@ QWidget *QInputContext::focusWidget() const /*! - Sets the widget that has an input focus for this input context. + Sets the \a widget that has an input focus for this input context. \warning Ordinary input methods must not call this function directly. diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp index d2a25fd..2a28c71 100644 --- a/src/gui/kernel/qaction.cpp +++ b/src/gui/kernel/qaction.cpp @@ -269,6 +269,26 @@ void QActionPrivate::setShortcutEnabled(bool enable, QShortcutMap &map) MenuRole for the actions in that submenu have no effect. They will never be moved. */ +/*! \enum QAction::SoftKeyRole + \value OptionsSoftKey + \value SelectSoftKey + \value BackSoftKey + \value NextSoftKey + \value PreviousSoftKey + \value OkSoftKey + \value CancelSoftKey + \value EditSoftKey + \value ViewSoftKey + \value BackSpaceSoftKey + \value EndEditSoftKey + \value RevertEditSoftKey + \value DeselectSoftKey + \value FinishSoftKey + \value MenuSoftKey + \value ContextMenuSoftKey + \value ExitSoftKey + */ + /*! Constructs an action with \a parent. If \a parent is an action group the action will be automatically inserted into the group. diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp index d5e7167..bd37f68 100644 --- a/src/gui/kernel/qgesture.cpp +++ b/src/gui/kernel/qgesture.cpp @@ -133,21 +133,22 @@ private: /*! \fn void QGesture::cancelled() - The signal is emitted when the gesture is cancelled, for example the reset() - function is called while the gesture was in the process of emitting a - triggered() signal. Extended information about the gesture is contained in - the sender object. + The signal is emitted when the gesture is cancelled, for example the + reset() function is called while the gesture was in the process of + emitting a triggered() signal. Extended information about the + gesture is contained in the sender object. */ - /*! - Creates a new gesture handler object and marks it as a child of \a parent. + Creates a new gesture handler object and marks it as a child of \a + parent. \a gestureTarget is the object that the gesture will watch + for events. - The \a parent object is also the default event source for the gesture, - meaning that the gesture installs itself as an event filter for the \a - parent. + The \a parent object is also the default event source for the + gesture, meaning that the gesture installs itself as an event filter + for the \a parent. - \sa setGraphicsItem() + \sa setGraphicsItem() */ QGesture::QGesture(QObject *gestureTarget, QObject *parent) : QObject(*new QGesturePrivate, parent) @@ -173,7 +174,7 @@ QGesture::~QGesture() /*! \property QGesture::gestureTarget - Gesture target is the object that the gesture will observe for events. + Gesture target is the object that the gesture will watch for events. Typically this means that the gesture installs an event filter on the target object. */ diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp index 0500bff..a5d524c 100644 --- a/src/gui/styles/qstyle.cpp +++ b/src/gui/styles/qstyle.cpp @@ -1897,7 +1897,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, Returns an integer representing the specified style \a hint for the given \a widget described by the provided style \a option. - \c returnData is used when the querying widget needs more detailed data than + \a returnData is used when the querying widget needs more detailed data than the integer that styleHint() returns. See the QStyleHintReturn class description for details. */ diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index 3ffc9c5..359d1e6 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -3236,11 +3236,10 @@ QStringList QScriptEngine::importedExtensions() const The \c Container type must provide a \c const_iterator class to enable the contents of the container to be copied into the array. - Additionally, the type of each element in the sequence should be suitable - for conversion to a QScriptValue. - See \l{QtScript Module#Conversion Between QtScript and C++ Types} - {Conversion Between QtScript and C++ Types} for more information about the - restrictions on types that can be used with QScriptValue. + Additionally, the type of each element in the sequence should be + suitable for conversion to a QScriptValue. See + \l{Conversion Between QtScript and C++ Types} for more information + about the restrictions on types that can be used with QScriptValue. \sa qScriptValueFromValue() */ @@ -3257,11 +3256,11 @@ QStringList QScriptEngine::importedExtensions() const as long as it provides a \c length property describing how many elements it contains. - Additionally, the type of each element in the sequence must be suitable - for conversion to a C++ type from a QScriptValue. - See \l{QtScript Module#Conversion Between QtScript and C++ Types} - {Conversion Between QtScript and C++ Types} for more information about the - restrictions on types that can be used with QScriptValue. + Additionally, the type of each element in the sequence must be + suitable for conversion to a C++ type from a QScriptValue. See + \l{Conversion Between QtScript and C++ Types} for more information + about the restrictions on types that can be used with + QScriptValue. \sa qscriptvalue_cast() */ -- cgit v0.12 From e008ce19585bf607ff652ab95391a890a9523076 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Wed, 2 Sep 2009 12:56:51 +0200 Subject: Respect "menus_have_icons" property in GTK+ The default value is planned to be changed in the next minor update to Gtk+ (2.28), hence we need to read this dynamically now. We also added a helper-function to easily read a gconf bool. Note, as a bonus feature I also added support for "buttons_have_icons". Task-number: 260684 Reviewed-by: joao --- src/gui/kernel/qapplication_x11.cpp | 7 +++++++ src/gui/styles/gtksymbols.cpp | 19 +++++++++++++++++++ src/gui/styles/gtksymbols_p.h | 3 +++ src/gui/styles/qgtkstyle.cpp | 5 +++++ 4 files changed, 34 insertions(+) diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 0056b9e..a7a6504 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -79,6 +79,7 @@ #include #include #include +#include #include "qstyle.h" #include "qmetaobject.h" #include "qtimer.h" @@ -2287,6 +2288,12 @@ void qt_init(QApplicationPrivate *priv, int, if (X11->desktopEnvironment == DE_KDE) X11->desktopVersion = QString::fromLocal8Bit(qgetenv("KDE_SESSION_VERSION")).toInt(); +#if !defined(QT_NO_STYLE_GTK) + if (X11->desktopEnvironment == DE_GNOME) { + static bool menusHaveIcons = QGtk::getGConfBool(QLatin1String("/desktop/gnome/interface/menus_have_icons"), true); + QApplication::setAttribute(Qt::AA_DontShowIconsInMenus, !menusHaveIcons); + } +#endif qt_set_input_encoding(); qt_set_x11_resources(appFont, appFGCol, appBGCol, appBTNCol); diff --git a/src/gui/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp index 0d34c77..b61675b 100644 --- a/src/gui/styles/gtksymbols.cpp +++ b/src/gui/styles/gtksymbols.cpp @@ -194,6 +194,7 @@ Ptr_gdk_x11_drawable_get_xdisplay QGtk::gdk_x11_drawable_get_xdisplay = 0; Ptr_gconf_client_get_default QGtk::gconf_client_get_default = 0; Ptr_gconf_client_get_string QGtk::gconf_client_get_string = 0; +Ptr_gconf_client_get_bool QGtk::gconf_client_get_bool = 0; static QString classPath(GtkWidget *widget) { @@ -336,6 +337,7 @@ static bool resolveGConf() if (!QGtk::gconf_client_get_default) { QGtk::gconf_client_get_default = (Ptr_gconf_client_get_default)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_default"); QGtk::gconf_client_get_string = (Ptr_gconf_client_get_string)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_string"); + QGtk::gconf_client_get_bool = (Ptr_gconf_client_get_bool)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_bool"); } return (QGtk::gconf_client_get_default !=0); } @@ -361,6 +363,23 @@ QString QGtk::getGConfString(const QString &value, const QString &fallback) return retVal; } +bool QGtk::getGConfBool(const QString &key, bool fallback) +{ + bool retVal = fallback; + if (resolveGConf()) { + g_type_init(); + GConfClient* client = QGtk::gconf_client_get_default(); + GError *err = 0; + bool result = QGtk::gconf_client_get_bool(client, qPrintable(key), &err); + g_object_unref(client); + if (!err) + retVal = result; + else + g_error_free (err); + } + return retVal; +} + static QString getThemeName() { QString themeName; diff --git a/src/gui/styles/gtksymbols_p.h b/src/gui/styles/gtksymbols_p.h index 596a312..fb9d129 100644 --- a/src/gui/styles/gtksymbols_p.h +++ b/src/gui/styles/gtksymbols_p.h @@ -77,6 +77,7 @@ class GConfClient; typedef GConfClient* (*Ptr_gconf_client_get_default)(); typedef char* (*Ptr_gconf_client_get_string)(GConfClient*, const char*, GError **); +typedef bool (*Ptr_gconf_client_get_bool)(GConfClient*, const char*, GError **); typedef void (*Ptr_gtk_init)(int *, char ***); typedef GtkWidget* (*Ptr_gtk_window_new) (GtkWindowType); @@ -217,6 +218,7 @@ public: static QStringList openFilenames(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options); static QString getGConfString(const QString &key, const QString &fallback = QString()); + static bool getGConfBool(const QString &key, bool fallback = 0); static Ptr_gtk_container_forall gtk_container_forall; static Ptr_gtk_init gtk_init; @@ -330,6 +332,7 @@ public: static Ptr_gconf_client_get_default gconf_client_get_default; static Ptr_gconf_client_get_string gconf_client_get_string; + static Ptr_gconf_client_get_bool gconf_client_get_bool; }; // Helper to ensure that we have polished all our gtk widgets diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index 87fa322..0ccf219 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -656,6 +656,11 @@ int QGtkStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidg return !scrollbars_within_bevel; } + case SH_DialogButtonBox_ButtonsHaveIcons: { + static bool buttonsHaveIcons = QGtk::getGConfBool(QLS("/desktop/gnome/interface/buttons_have_icons")); + return buttonsHaveIcons; + } + default: return QCleanlooksStyle::styleHint(hint, option, widget, returnData); } -- cgit v0.12 From 5cbfc76f607caaefe59489e4985cbac37d5c714d Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Wed, 2 Sep 2009 10:07:11 +0200 Subject: Simplify SVG color parsing when the color is opaque. Reviewed-by: Kim --- src/svg/qsvghandler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index 9683efd..9e46048 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -2158,8 +2158,8 @@ static bool parseAnimateColorNode(QSvgNode *parent, QList colors; if (valuesStr.isEmpty()) { QColor startColor, endColor; - constructColor(fromStr, QString(), startColor, handler); - constructColor(toStr, QString(), endColor, handler); + resolveColor(fromStr, startColor, handler); + resolveColor(toStr, endColor, handler); colors.append(startColor); colors.append(endColor); } else { @@ -2167,7 +2167,7 @@ static bool parseAnimateColorNode(QSvgNode *parent, QStringList::const_iterator itr; for (itr = str.constBegin(); itr != str.constEnd(); ++itr) { QColor color; - constructColor(*itr, QString(), color, handler); + resolveColor(*itr, color, handler); colors.append(color); } } -- cgit v0.12 From b9759ebf04618c311004ee4fd975b7fa7e47ed5e Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Wed, 2 Sep 2009 10:11:20 +0200 Subject: Use QStringRef when parsing SVG color opacity. Reviewed-by: Kim --- src/svg/qsvghandler.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index 9e46048..28a96de 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -742,7 +742,7 @@ static bool resolveColor(const QString &colorStr, QColor &color, QSvgHandler *ha return color.isValid(); } -static bool constructColor(const QString &colorStr, const QString &opacity, +static bool constructColor(const QString &colorStr, const QStringRef &opacity, QColor &color, QSvgHandler *handler) { if (!resolveColor(colorStr, color, handler)) @@ -856,9 +856,8 @@ static void parseColor(QSvgNode *, QSvgHandler *handler) { QString colorStr = attributes.color.toString(); - QString opacity = attributes.colorOpacity.toString(); QColor color; - if (constructColor(colorStr, opacity, color, handler)) { + if (constructColor(colorStr, attributes.colorOpacity, color, handler)) { handler->pushColor(color); } } @@ -2903,10 +2902,10 @@ static QSvgStyleProperty *createSolidColorNode(QSvgNode *parent, { Q_UNUSED(parent); Q_UNUSED(attributes); QString solidColorStr = attributes.value(QLatin1String("solid-color")).toString(); - QString solidOpacityStr = attributes.value(QLatin1String("solid-opacity")).toString(); + QStringRef solidOpacityStr = attributes.value(QLatin1String("solid-opacity")); if (solidOpacityStr.isEmpty()) - solidOpacityStr = attributes.value(QLatin1String("opacity")).toString(); + solidOpacityStr = attributes.value(QLatin1String("opacity")); QColor color; if (!constructColor(solidColorStr, solidOpacityStr, color, handler)) @@ -2958,7 +2957,6 @@ static bool parseStopNode(QSvgStyleProperty *parent, static_cast(parent); QString offsetStr = attrs.offset.toString(); QString colorStr = attrs.stopColor.toString(); - QString opacityStr = attrs.stopOpacity.toString(); QColor color; bool ok = true; @@ -2969,7 +2967,7 @@ static bool parseStopNode(QSvgStyleProperty *parent, colorStr = QLatin1String("#000000"); } - constructColor(colorStr, opacityStr, color, handler); + constructColor(colorStr, attrs.stopOpacity, color, handler); QGradient *grad = style->qgradient(); -- cgit v0.12 From 13bcc92274d52fa6df2d636c78cf6ea457d670aa Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Wed, 2 Sep 2009 10:19:35 +0200 Subject: Optimize SVG color decoding. We try to use QStringRef as much as possible. Loading tiger.svg (tests/benchmarks/qsvgrenderer) enjoys 1.2% speed-up. Reviewed-by: Kim --- src/svg/qsvghandler.cpp | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index 28a96de..9459af6 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -711,16 +711,18 @@ static inline QStringRef trimRef(const QStringRef &str) * returns true when successfuly set the color. false signifies * that the color should be inherited */ -static bool resolveColor(const QString &colorStr, QColor &color, QSvgHandler *handler) +static bool resolveColor(const QStringRef &colorStr, QColor &color, QSvgHandler *handler) { - QString colorStrTr = colorStr.trimmed(); - if (colorStr.startsWith(QLatin1String("rgb("))) { - const QChar *s = colorStr.constData() + 4; + QStringRef colorStrTr = trimRef(colorStr); + if (colorStrTr.isEmpty()) + return false; + if (colorStrTr == QLatin1String("rgb(")) { + const QChar *s = colorStrTr.constData() + 4; QVector compo = parseNumbersList(s); //1 means that it failed after reaching non-parsable //character which is going to be "%" if (compo.size() == 1) { - const QChar *s = colorStr.constData() + 4; + const QChar *s = colorStrTr.constData() + 4; compo = parsePercentageList(s); compo[0] *= (qreal)2.55; compo[1] *= (qreal)2.55; @@ -731,18 +733,18 @@ static bool resolveColor(const QString &colorStr, QColor &color, QSvgHandler *ha int(compo[1]), int(compo[2])); return true; - } else if (colorStr == QT_INHERIT) { + } else if (colorStrTr == QT_INHERIT) { return false; - } else if (colorStr == QLatin1String("currentColor")) { + } else if (colorStrTr == QLatin1String("currentColor")) { color = handler->currentColor(); return true; } - color = QColor(colorStrTr); + color = QColor(colorStrTr.toString()); return color.isValid(); } -static bool constructColor(const QString &colorStr, const QStringRef &opacity, +static bool constructColor(const QStringRef &colorStr, const QStringRef &opacity, QColor &color, QSvgHandler *handler) { if (!resolveColor(colorStr, color, handler)) @@ -855,9 +857,8 @@ static void parseColor(QSvgNode *, const QSvgAttributes &attributes, QSvgHandler *handler) { - QString colorStr = attributes.color.toString(); QColor color; - if (constructColor(colorStr, attributes.colorOpacity, color, handler)) { + if (constructColor(attributes.color, attributes.colorOpacity, color, handler)) { handler->pushColor(color); } } @@ -912,7 +913,7 @@ static void parseBrush(QSvgNode *node, } } else if (attributes.fill != QLatin1String("none")) { QColor color; - if (resolveColor(attributes.fill.toString(), color, handler)) + if (resolveColor(attributes.fill, color, handler)) prop->setBrush(QBrush(color)); } else { prop->setBrush(QBrush(Qt::NoBrush)); @@ -1085,7 +1086,7 @@ static void parsePen(QSvgNode *node, } } else if (attributes.stroke != QLatin1String("none")) { QColor color; - if (resolveColor(attributes.stroke.toString(), color, handler)) + if (resolveColor(attributes.stroke, color, handler)) prop->setStroke(QBrush(color)); } else { prop->setStroke(QBrush(Qt::NoBrush)); @@ -2145,8 +2146,8 @@ static bool parseAnimateColorNode(QSvgNode *parent, QSvgHandler *handler) { QString typeStr = attributes.value(QLatin1String("type")).toString(); - QString fromStr = attributes.value(QLatin1String("from")).toString(); - QString toStr = attributes.value(QLatin1String("to")).toString(); + QStringRef fromStr = attributes.value(QLatin1String("from")); + QStringRef toStr = attributes.value(QLatin1String("to")); QString valuesStr = attributes.value(QLatin1String("values")).toString(); QString beginStr = attributes.value(QLatin1String("begin")).toString(); QString durStr = attributes.value(QLatin1String("dur")).toString(); @@ -2166,7 +2167,8 @@ static bool parseAnimateColorNode(QSvgNode *parent, QStringList::const_iterator itr; for (itr = str.constBegin(); itr != str.constEnd(); ++itr) { QColor color; - resolveColor(*itr, color, handler); + QString str = *itr; + resolveColor(QStringRef(&str), color, handler); colors.append(color); } } @@ -2901,7 +2903,7 @@ static QSvgStyleProperty *createSolidColorNode(QSvgNode *parent, QSvgHandler *handler) { Q_UNUSED(parent); Q_UNUSED(attributes); - QString solidColorStr = attributes.value(QLatin1String("solid-color")).toString(); + QStringRef solidColorStr = attributes.value(QLatin1String("solid-color")); QStringRef solidOpacityStr = attributes.value(QLatin1String("solid-opacity")); if (solidOpacityStr.isEmpty()) @@ -2956,15 +2958,16 @@ static bool parseStopNode(QSvgStyleProperty *parent, QSvgGradientStyle *style = static_cast(parent); QString offsetStr = attrs.offset.toString(); - QString colorStr = attrs.stopColor.toString(); + QStringRef colorStr = attrs.stopColor; QColor color; bool ok = true; qreal offset = convertToNumber(offsetStr, handler, &ok); if (!ok) offset = 0.0; + QString black = QString::fromLatin1("#000000"); if (colorStr.isEmpty()) { - colorStr = QLatin1String("#000000"); + colorStr = QStringRef(&black); } constructColor(colorStr, attrs.stopOpacity, color, handler); -- cgit v0.12 From f8bd803e6eac2d5c25fec9cb50b54128c57b6725 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Wed, 2 Sep 2009 11:05:02 +0200 Subject: Minor speed-up when parsing SVG color. Loading tiger.svg (tests/benchmarks/qsvgrenderer) enjoys 1% speed-up. Reviewed-by: Kim --- src/svg/qsvghandler.cpp | 54 +++++++++++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index 9459af6..6620707 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -716,28 +716,42 @@ static bool resolveColor(const QStringRef &colorStr, QColor &color, QSvgHandler QStringRef colorStrTr = trimRef(colorStr); if (colorStrTr.isEmpty()) return false; - if (colorStrTr == QLatin1String("rgb(")) { - const QChar *s = colorStrTr.constData() + 4; - QVector compo = parseNumbersList(s); - //1 means that it failed after reaching non-parsable - //character which is going to be "%" - if (compo.size() == 1) { + + switch(colorStrTr.at(0).unicode()) { + case 'r': { + // starts with "rgb(" + if (colorStrTr == QLatin1String("rgb(")) { const QChar *s = colorStrTr.constData() + 4; - compo = parsePercentageList(s); - compo[0] *= (qreal)2.55; - compo[1] *= (qreal)2.55; - compo[2] *= (qreal)2.55; - } + QVector compo = parseNumbersList(s); + //1 means that it failed after reaching non-parsable + //character which is going to be "%" + if (compo.size() == 1) { + const QChar *s = colorStrTr.constData() + 4; + compo = parsePercentageList(s); + compo[0] *= (qreal)2.55; + compo[1] *= (qreal)2.55; + compo[2] *= (qreal)2.55; + } - color = QColor(int(compo[0]), - int(compo[1]), - int(compo[2])); - return true; - } else if (colorStrTr == QT_INHERIT) { - return false; - } else if (colorStrTr == QLatin1String("currentColor")) { - color = handler->currentColor(); - return true; + color = QColor(int(compo[0]), + int(compo[1]), + int(compo[2])); + return true; + } + } + break; + case 'c': + if (colorStrTr == QLatin1String("currentColor")) { + color = handler->currentColor(); + return true; + } + break; + case 'i': + if (colorStrTr == QT_INHERIT) + return false; + break; + default: + break; } color = QColor(colorStrTr.toString()); -- cgit v0.12 From 4fd28ba87492f2f4725e48f1a3e30ed8cd099081 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Wed, 2 Sep 2009 11:50:45 +0200 Subject: Faster SVG color parsing by tackling the #rrggbb color early. If the color starts with '#', let's parse it ourselves rather than waiting for the (fall-back) QColor-from-QString which even requires us to create a QString out of the QStringRef. All widely used illustration programs output SVG with #rrggbb format to specify the color. Loading tiger.svg (tests/benchmarks/qsvgrenderer) enjoys 2.4% speed-up. Reviewed-by: Kim --- src/svg/qsvghandler.cpp | 78 +++++++++++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 31 deletions(-) diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index 6620707..38ffe3e 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -65,6 +65,7 @@ #include "qmath.h" #include "qnumeric.h" #include "qvarlengtharray.h" +#include "private/qcolor_p.h" #include "private/qmath_p.h" #include "float.h" @@ -718,40 +719,55 @@ static bool resolveColor(const QStringRef &colorStr, QColor &color, QSvgHandler return false; switch(colorStrTr.at(0).unicode()) { - case 'r': { - // starts with "rgb(" - if (colorStrTr == QLatin1String("rgb(")) { - const QChar *s = colorStrTr.constData() + 4; - QVector compo = parseNumbersList(s); - //1 means that it failed after reaching non-parsable - //character which is going to be "%" - if (compo.size() == 1) { - const QChar *s = colorStrTr.constData() + 4; - compo = parsePercentageList(s); - compo[0] *= (qreal)2.55; - compo[1] *= (qreal)2.55; - compo[2] *= (qreal)2.55; + + case '#': + { + // #rrggbb is very very common, so let's tackle it here + // rather than falling back to QColor + QRgb rgb; + bool ok = qt_get_hex_rgb(colorStrTr.unicode(), colorStrTr.length(), &rgb); + if (ok) + color.setRgb(rgb); + return ok; } + break; + + case 'r': + { + // starts with "rgb(" + if (colorStrTr == QLatin1String("rgb(")) { + const QChar *s = colorStrTr.constData() + 4; + QVector compo = parseNumbersList(s); + //1 means that it failed after reaching non-parsable + //character which is going to be "%" + if (compo.size() == 1) { + const QChar *s = colorStrTr.constData() + 4; + compo = parsePercentageList(s); + compo[0] *= (qreal)2.55; + compo[1] *= (qreal)2.55; + compo[2] *= (qreal)2.55; + } - color = QColor(int(compo[0]), - int(compo[1]), - int(compo[2])); - return true; + color = QColor(int(compo[0]), + int(compo[1]), + int(compo[2])); + return true; + } } - } - break; - case 'c': - if (colorStrTr == QLatin1String("currentColor")) { - color = handler->currentColor(); - return true; - } - break; - case 'i': - if (colorStrTr == QT_INHERIT) - return false; - break; - default: - break; + break; + + case 'c': + if (colorStrTr == QLatin1String("currentColor")) { + color = handler->currentColor(); + return true; + } + break; + case 'i': + if (colorStrTr == QT_INHERIT) + return false; + break; + default: + break; } color = QColor(colorStrTr.toString()); -- cgit v0.12 From b40fa8468af9015af8181dc67c79db4877437d33 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Wed, 2 Sep 2009 12:49:19 +0200 Subject: Speed-up id look-up for SVG node. Since we are iterating all the XML attributes, we find and locate the id while we are inside the loop. Thus, no need to retrieve the id via QXmlStreamAttributes::value(). Also, get rid of someId(QSvgAttributes) function and use the 'id' member variable directly. Loading tiger.svg (tests/benchmarks/qsvgrenderer) enjoys 1.2% speed-up. Reviewed-by: Kim --- src/svg/qsvghandler.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index 38ffe3e..1bfd260 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -127,7 +127,6 @@ struct QSvgAttributes QSvgAttributes::QSvgAttributes(const QXmlStreamAttributes &xmlAttributes, QSvgHandler *handler) { - id = someId(xmlAttributes); QStringRef style = xmlAttributes.value(QLatin1String("style")); if (!style.isEmpty()) { handler->parseCSStoXMLAttrs(style.toString(), &m_cssAttributes); @@ -268,6 +267,11 @@ QSvgAttributes::QSvgAttributes(const QXmlStreamAttributes &xmlAttributes, QSvgHa fontVariant = value; break; + case 'i': + if (name == QLatin1String("id")) + id = value.toString(); + break; + case 'o': if (name == QLatin1String("opacity")) opacity = value; @@ -315,6 +319,11 @@ QSvgAttributes::QSvgAttributes(const QXmlStreamAttributes &xmlAttributes, QSvgHa visibility = value; break; + case 'x': + if (name == QLatin1String("xml:id") && id.isEmpty()) + id = value.toString(); + break; + default: break; } @@ -322,9 +331,6 @@ QSvgAttributes::QSvgAttributes(const QXmlStreamAttributes &xmlAttributes, QSvgHa } -static inline QString someId(const QSvgAttributes &attributes) -{ return attributes.id; } - static const char * QSvgStyleSelector_nodeString[] = { "svg", "g", @@ -949,7 +955,7 @@ static void parseBrush(QSvgNode *node, prop->setBrush(QBrush(Qt::NoBrush)); } } - node->appendStyleProperty(prop, someId(attributes)); + node->appendStyleProperty(prop, attributes.id); } } @@ -1185,7 +1191,7 @@ static void parsePen(QSvgNode *node, if (!attributes.strokeOpacity.isEmpty() && attributes.strokeOpacity != QT_INHERIT) prop->setOpacity(qMin(qreal(1.0), qMax(qreal(0.0), toDouble(attributes.strokeOpacity)))); - node->appendStyleProperty(prop, someId(attributes)); + node->appendStyleProperty(prop, attributes.id); } } @@ -1259,7 +1265,7 @@ static void parseFont(QSvgNode *node, fontStyle->setTextAnchor(Qt::AlignRight); } - node->appendStyleProperty(fontStyle, someId(attributes)); + node->appendStyleProperty(fontStyle, attributes.id); } static void parseTransform(QSvgNode *node, @@ -1271,7 +1277,7 @@ static void parseTransform(QSvgNode *node, QMatrix matrix = parseTransformationMatrix(trimRef(attributes.transform)); if (!matrix.isIdentity()) { - node->appendStyleProperty(new QSvgTransformStyle(QTransform(matrix)), someId(attributes)); + node->appendStyleProperty(new QSvgTransformStyle(QTransform(matrix)), attributes.id); } } @@ -1974,7 +1980,7 @@ static void parseOpacity(QSvgNode *node, if (ok) { QSvgOpacityStyle *opacity = new QSvgOpacityStyle(qBound(qreal(0.0), op, qreal(1.0))); - node->appendStyleProperty(opacity, someId(attributes)); + node->appendStyleProperty(opacity, attributes.id); } } @@ -2046,7 +2052,7 @@ static void parseCompOp(QSvgNode *node, if (!value.isEmpty()) { QSvgCompOpStyle *compop = new QSvgCompOpStyle(svgToQtCompositionMode(value)); - node->appendStyleProperty(compop, someId(attributes)); + node->appendStyleProperty(compop, attributes.id); } } -- cgit v0.12 From bd16db2c8b402c1faa2b03bb249f8aa7a44a8602 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 2 Sep 2009 21:17:23 +1000 Subject: Update license headers. Reviewed-by: Trust Me --- bin/setcepaths.bat | 3 - bin/syncqt.bat | 3 - configure | 49 +++++++++++--- src/corelib/xml/qxmlstream.g | 3 - src/gui/dialogs/qfiledialog_wince.ui | 3 - src/gui/kernel/qcocoaapplication_mac.mm | 3 - src/gui/kernel/qcocoaapplicationdelegate_mac.mm | 3 - src/gui/kernel/qcocoamenuloader_mac.mm | 3 - src/gui/kernel/qcocoawindow_mac.mm | 3 - src/gui/kernel/qcocoawindowdelegate_mac.mm | 3 - src/gui/widgets/qcocoamenu_mac.mm | 3 - src/gui/widgets/qmaccocoaviewcontainer_mac.mm | 3 - src/gui/widgets/qmacnativewidget_mac.mm | 3 - src/gui/widgets/qmainwindowlayout_mac.mm | 3 - src/script/qscript.g | 3 - .../testdata/good/merge_versions/project.ui | 38 +++++++++-- .../lupdate/testdata/good/mergeui/project.ui | 38 +++++++++-- .../lupdate/testdata/good/parseui/project.ui | 38 +++++++++-- tests/auto/uic/baseline/batchtranslation.ui | 59 ++++++++--------- tests/auto/uic/baseline/batchtranslation.ui.h | 75 +++++++++++----------- tests/auto/uic/baseline/config.ui | 59 ++++++++--------- tests/auto/uic/baseline/config.ui.h | 65 +++++++++---------- tests/auto/uic/baseline/finddialog.ui | 59 ++++++++--------- tests/auto/uic/baseline/finddialog.ui.h | 75 +++++++++++----------- tests/auto/uic/baseline/formwindowsettings.ui | 59 ++++++++--------- tests/auto/uic/baseline/formwindowsettings.ui.h | 65 +++++++++---------- tests/auto/uic/baseline/helpdialog.ui | 59 ++++++++--------- tests/auto/uic/baseline/helpdialog.ui.h | 65 +++++++++---------- tests/auto/uic/baseline/listwidgeteditor.ui | 59 ++++++++--------- tests/auto/uic/baseline/listwidgeteditor.ui.h | 75 +++++++++++----------- tests/auto/uic/baseline/mainwindowbase.ui | 59 ++++++++--------- tests/auto/uic/baseline/mainwindowbase.ui.h | 65 +++++++++---------- tests/auto/uic/baseline/newactiondialog.ui | 59 ++++++++--------- tests/auto/uic/baseline/newactiondialog.ui.h | 75 +++++++++++----------- tests/auto/uic/baseline/newform.ui | 59 ++++++++--------- tests/auto/uic/baseline/newform.ui.h | 75 +++++++++++----------- tests/auto/uic/baseline/orderdialog.ui | 59 ++++++++--------- tests/auto/uic/baseline/orderdialog.ui.h | 75 +++++++++++----------- tests/auto/uic/baseline/paletteeditor.ui | 59 ++++++++--------- tests/auto/uic/baseline/paletteeditor.ui.h | 75 +++++++++++----------- .../auto/uic/baseline/paletteeditoradvancedbase.ui | 59 ++++++++--------- .../uic/baseline/paletteeditoradvancedbase.ui.h | 65 +++++++++---------- tests/auto/uic/baseline/phrasebookbox.ui | 59 ++++++++--------- tests/auto/uic/baseline/phrasebookbox.ui.h | 75 +++++++++++----------- tests/auto/uic/baseline/plugindialog.ui | 59 ++++++++--------- tests/auto/uic/baseline/plugindialog.ui.h | 75 +++++++++++----------- tests/auto/uic/baseline/previewwidget.ui | 59 ++++++++--------- tests/auto/uic/baseline/previewwidget.ui.h | 65 +++++++++---------- tests/auto/uic/baseline/previewwidgetbase.ui | 59 ++++++++--------- tests/auto/uic/baseline/previewwidgetbase.ui.h | 65 +++++++++---------- tests/auto/uic/baseline/qfiledialog.ui | 59 ++++++++--------- tests/auto/uic/baseline/qfiledialog.ui.h | 65 +++++++++---------- tests/auto/uic/baseline/qtgradientdialog.ui | 59 ++++++++--------- tests/auto/uic/baseline/qtgradientdialog.ui.h | 75 +++++++++++----------- tests/auto/uic/baseline/qtgradienteditor.ui | 59 ++++++++--------- tests/auto/uic/baseline/qtgradienteditor.ui.h | 65 +++++++++---------- tests/auto/uic/baseline/qtgradientviewdialog.ui | 59 ++++++++--------- tests/auto/uic/baseline/qtgradientviewdialog.ui.h | 75 +++++++++++----------- tests/auto/uic/baseline/saveformastemplate.ui | 59 ++++++++--------- tests/auto/uic/baseline/saveformastemplate.ui.h | 75 +++++++++++----------- tests/auto/uic/baseline/statistics.ui | 59 ++++++++--------- tests/auto/uic/baseline/statistics.ui.h | 75 +++++++++++----------- tests/auto/uic/baseline/stringlisteditor.ui | 59 ++++++++--------- tests/auto/uic/baseline/stringlisteditor.ui.h | 65 +++++++++---------- tests/auto/uic/baseline/tabbedbrowser.ui | 59 ++++++++--------- tests/auto/uic/baseline/tabbedbrowser.ui.h | 75 +++++++++++----------- tests/auto/uic/baseline/tablewidgeteditor.ui | 59 ++++++++--------- tests/auto/uic/baseline/tablewidgeteditor.ui.h | 65 +++++++++---------- tests/auto/uic/baseline/translatedialog.ui | 59 ++++++++--------- tests/auto/uic/baseline/translatedialog.ui.h | 65 +++++++++---------- tests/auto/uic/baseline/treewidgeteditor.ui | 59 ++++++++--------- tests/auto/uic/baseline/treewidgeteditor.ui.h | 65 +++++++++---------- tests/auto/uic/baseline/trpreviewtool.ui | 59 ++++++++--------- tests/auto/uic/baseline/trpreviewtool.ui.h | 75 +++++++++++----------- tests/auto/uic3/baseline/about.ui | 56 +++++++++------- tests/auto/uic3/baseline/about.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/actioneditor.ui | 56 +++++++++------- tests/auto/uic3/baseline/actioneditor.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/config.ui | 56 +++++++++------- tests/auto/uic3/baseline/config.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/configtoolboxdialog.ui | 56 +++++++++------- tests/auto/uic3/baseline/configtoolboxdialog.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/connectiondialog.ui | 56 +++++++++------- tests/auto/uic3/baseline/connectiondialog.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/createtemplate.ui | 56 +++++++++------- tests/auto/uic3/baseline/createtemplate.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/customwidgeteditor.ui | 56 +++++++++------- tests/auto/uic3/baseline/customwidgeteditor.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/dbconnection.ui | 56 +++++++++------- tests/auto/uic3/baseline/dbconnection.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/dbconnectioneditor.ui | 56 +++++++++------- tests/auto/uic3/baseline/dbconnectioneditor.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/dbconnections.ui | 56 +++++++++------- tests/auto/uic3/baseline/dbconnections.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/editfunctions.ui | 56 +++++++++------- tests/auto/uic3/baseline/editfunctions.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/finddialog.ui | 56 +++++++++------- tests/auto/uic3/baseline/finddialog.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/formsettings.ui | 56 +++++++++------- tests/auto/uic3/baseline/formsettings.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/gotolinedialog.ui | 56 +++++++++------- tests/auto/uic3/baseline/gotolinedialog.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/helpdialog.ui | 56 +++++++++------- tests/auto/uic3/baseline/helpdialog.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/iconvieweditor.ui | 56 +++++++++------- tests/auto/uic3/baseline/iconvieweditor.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/listboxeditor.ui | 56 +++++++++------- tests/auto/uic3/baseline/listboxeditor.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/listeditor.ui | 56 +++++++++------- tests/auto/uic3/baseline/listeditor.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/listvieweditor.ui | 56 +++++++++------- tests/auto/uic3/baseline/listvieweditor.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/mainfilesettings.ui | 56 +++++++++------- tests/auto/uic3/baseline/mainfilesettings.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/mainwindowbase.ui | 56 +++++++++------- tests/auto/uic3/baseline/mainwindowbase.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/mainwindowwizard.ui | 56 +++++++++------- tests/auto/uic3/baseline/mainwindowwizard.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/multilineeditor.ui | 56 +++++++++------- tests/auto/uic3/baseline/multilineeditor.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/newform.ui | 56 +++++++++------- tests/auto/uic3/baseline/newform.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/paletteeditor.ui | 62 ++++++++++-------- tests/auto/uic3/baseline/paletteeditor.ui.4 | 62 ++++++++++-------- tests/auto/uic3/baseline/paletteeditoradvanced.ui | 56 +++++++++------- .../auto/uic3/baseline/paletteeditoradvanced.ui.4 | 56 +++++++++------- .../uic3/baseline/paletteeditoradvancedbase.ui | 56 +++++++++------- .../uic3/baseline/paletteeditoradvancedbase.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/pixmapcollectioneditor.ui | 56 +++++++++------- .../auto/uic3/baseline/pixmapcollectioneditor.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/pixmapfunction.ui | 56 +++++++++------- tests/auto/uic3/baseline/pixmapfunction.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/preferences.ui | 56 +++++++++------- tests/auto/uic3/baseline/preferences.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/previewwidget.ui | 56 +++++++++------- tests/auto/uic3/baseline/previewwidget.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/previewwidgetbase.ui | 56 +++++++++------- tests/auto/uic3/baseline/previewwidgetbase.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/projectsettings.ui | 56 +++++++++------- tests/auto/uic3/baseline/projectsettings.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/replacedialog.ui | 56 +++++++++------- tests/auto/uic3/baseline/replacedialog.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/richtextfontdialog.ui | 56 +++++++++------- tests/auto/uic3/baseline/richtextfontdialog.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/settingsdialog.ui | 56 +++++++++------- tests/auto/uic3/baseline/settingsdialog.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/sqlformwizard.ui | 56 +++++++++------- tests/auto/uic3/baseline/sqlformwizard.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/startdialog.ui | 56 +++++++++------- tests/auto/uic3/baseline/startdialog.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/statistics.ui | 56 +++++++++------- tests/auto/uic3/baseline/statistics.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/tabbedbrowser.ui | 56 +++++++++------- tests/auto/uic3/baseline/tabbedbrowser.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/tableeditor.ui | 56 +++++++++------- tests/auto/uic3/baseline/tableeditor.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/topicchooser.ui | 56 +++++++++------- tests/auto/uic3/baseline/topicchooser.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/variabledialog.ui | 56 +++++++++------- tests/auto/uic3/baseline/variabledialog.ui.4 | 56 +++++++++------- tests/auto/uic3/baseline/wizardeditor.ui | 56 +++++++++------- tests/auto/uic3/baseline/wizardeditor.ui.4 | 56 +++++++++------- tests/auto/uiloader/baseline/batchtranslation.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/config.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/finddialog.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/formwindowsettings.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/helpdialog.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/listwidgeteditor.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/mainwindowbase.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/newactiondialog.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/newform.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/orderdialog.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/paletteeditor.ui | 59 ++++++++--------- .../uiloader/baseline/paletteeditoradvancedbase.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/phrasebookbox.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/plugindialog.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/previewwidget.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/previewwidgetbase.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/qfiledialog.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/qtgradientdialog.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/qtgradienteditor.ui | 59 ++++++++--------- .../auto/uiloader/baseline/qtgradientviewdialog.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/saveformastemplate.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/statistics.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/stringlisteditor.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/tabbedbrowser.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/tablewidgeteditor.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/translatedialog.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/treewidgeteditor.ui | 59 ++++++++--------- tests/auto/uiloader/baseline/trpreviewtool.ui | 59 ++++++++--------- tools/assistant/compat/mainwindow.cpp | 5 +- tools/assistant/compat/mainwindow.ui | 4 +- tools/assistant/tools/assistant/mainwindow.cpp | 5 +- tools/designer/src/designer/versiondialog.cpp | 4 +- tools/designer/src/lib/shared/qlayout_widget.cpp | 3 - tools/installer/batch/build.bat | 3 - tools/installer/batch/copy.bat | 3 - tools/installer/batch/delete.bat | 3 - tools/installer/batch/env.bat | 3 - tools/installer/batch/extract.bat | 3 - tools/installer/batch/installer.bat | 3 - tools/installer/batch/log.bat | 3 - tools/installer/batch/toupper.bat | 3 - tools/installer/config/config.default.sample | 3 - tools/installer/config/mingw-opensource.conf | 3 - tools/installer/iwmake.bat | 3 - tools/installer/nsis/confirmpage.ini | 3 - tools/installer/nsis/gwdownload.ini | 3 - tools/installer/nsis/gwmirror.ini | 3 - tools/installer/nsis/includes/global.nsh | 5 +- tools/installer/nsis/includes/instdir.nsh | 5 +- tools/installer/nsis/includes/list.nsh | 5 +- tools/installer/nsis/includes/qtcommon.nsh | 5 +- tools/installer/nsis/includes/qtenv.nsh | 3 - tools/installer/nsis/includes/system.nsh | 5 +- tools/installer/nsis/installer.nsi | 3 - tools/installer/nsis/modules/environment.nsh | 3 - tools/installer/nsis/modules/mingw.nsh | 3 - tools/installer/nsis/modules/opensource.nsh | 4 -- tools/installer/nsis/modules/registeruiext.nsh | 3 - tools/installer/nsis/opensource.ini | 3 - tools/linguist/linguist/mainwindow.cpp | 4 +- tools/linguist/shared/qscript.g | 3 - tools/qdbus/qdbusviewer/qdbusviewer.cpp | 5 +- tools/qtconfig/mainwindow.cpp | 5 +- tools/xmlpatterns/main.h | 4 -- tools/xmlpatterns/qcoloringmessagehandler_p.h | 4 -- tools/xmlpatterns/qcoloroutput.cpp | 3 - tools/xmlpatterns/qcoloroutput_p.h | 4 -- util/qlalr/lalr.g | 3 - 230 files changed, 5624 insertions(+), 4940 deletions(-) diff --git a/bin/setcepaths.bat b/bin/setcepaths.bat index 93b28d3..ebed731 100755 --- a/bin/setcepaths.bat +++ b/bin/setcepaths.bat @@ -37,9 +37,6 @@ :: :: $QT_END_LICENSE$ :: -:: This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -:: WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -:: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: @echo off IF "%1" EQU "wincewm50pocket-msvc2005" ( diff --git a/bin/syncqt.bat b/bin/syncqt.bat index f5c34ea..a619b92 100755 --- a/bin/syncqt.bat +++ b/bin/syncqt.bat @@ -37,9 +37,6 @@ :: :: $QT_END_LICENSE$ :: -:: This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -:: WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -:: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: @rem ***** This assumes PERL is in the PATH ***** @perl.exe -S syncqt %* diff --git a/configure b/configure index c519ab1..af8c209 100755 --- a/configure +++ b/configure @@ -1,13 +1,44 @@ #!/bin/sh -# -# Configures to build the Qt library -# -# Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -# Contact: Nokia Corporation (qt-info@nokia.com) -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# +############################################################################# +## +## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +## Contact: Nokia Corporation (qt-info@nokia.com) +## +## This file is the build configuration utility of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:LGPL$ +## No Commercial Usage +## This file contains pre-release code and may not be distributed. +## You may use this file in accordance with the terms and conditions +## contained in the Technology Preview License Agreement accompanying +## this package. +## +## GNU Lesser General Public License Usage +## Alternatively, this file may be used under the terms of the GNU Lesser +## General Public License version 2.1 as published by the Free Software +## Foundation and appearing in the file LICENSE.LGPL included in the +## packaging of this file. Please review the following information to +## ensure the GNU Lesser General Public License version 2.1 requirements +## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## In addition, as a special exception, Nokia gives you certain +## additional rights. These rights are described in the Nokia Qt LGPL +## Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +## package. +## +## If you have questions regarding the use of this file, please contact +## Nokia at qt-info@nokia.com. +## +## +## +## +## +## +## +## +## $QT_END_LICENSE$ +## +############################################################################# #------------------------------------------------------------------------------- # script initialization diff --git a/src/corelib/xml/qxmlstream.g b/src/corelib/xml/qxmlstream.g index d957a1c..8e2f3fd 100644 --- a/src/corelib/xml/qxmlstream.g +++ b/src/corelib/xml/qxmlstream.g @@ -37,9 +37,6 @@ -- -- $QT_END_LICENSE$ -- --- This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE --- WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. --- ---------------------------------------------------------------------------- %parser QXmlStreamReader_Table diff --git a/src/gui/dialogs/qfiledialog_wince.ui b/src/gui/dialogs/qfiledialog_wince.ui index 454af4b..1bd189e 100644 --- a/src/gui/dialogs/qfiledialog_wince.ui +++ b/src/gui/dialogs/qfiledialog_wince.ui @@ -37,9 +37,6 @@ ** ** $QT_END_LICENSE$ ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** ********************************************************************* QFileDialog diff --git a/src/gui/kernel/qcocoaapplication_mac.mm b/src/gui/kernel/qcocoaapplication_mac.mm index ed62d02..2f1d88d 100644 --- a/src/gui/kernel/qcocoaapplication_mac.mm +++ b/src/gui/kernel/qcocoaapplication_mac.mm @@ -37,9 +37,6 @@ ** ** $QT_END_LICENSE$ ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** ****************************************************************************/ /**************************************************************************** diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm index ac66d40..2d4b3b8 100644 --- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm +++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm @@ -37,9 +37,6 @@ ** ** $QT_END_LICENSE$ ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** ****************************************************************************/ /**************************************************************************** diff --git a/src/gui/kernel/qcocoamenuloader_mac.mm b/src/gui/kernel/qcocoamenuloader_mac.mm index 1bdb123..14e4510 100644 --- a/src/gui/kernel/qcocoamenuloader_mac.mm +++ b/src/gui/kernel/qcocoamenuloader_mac.mm @@ -37,9 +37,6 @@ ** ** $QT_END_LICENSE$ ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** ****************************************************************************/ #include "qmacdefines_mac.h" diff --git a/src/gui/kernel/qcocoawindow_mac.mm b/src/gui/kernel/qcocoawindow_mac.mm index 7674e60..523ee0d 100644 --- a/src/gui/kernel/qcocoawindow_mac.mm +++ b/src/gui/kernel/qcocoawindow_mac.mm @@ -37,9 +37,6 @@ ** ** $QT_END_LICENSE$ ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** ****************************************************************************/ #include "qmacdefines_mac.h" diff --git a/src/gui/kernel/qcocoawindowdelegate_mac.mm b/src/gui/kernel/qcocoawindowdelegate_mac.mm index 0a7a00f..6704fda 100644 --- a/src/gui/kernel/qcocoawindowdelegate_mac.mm +++ b/src/gui/kernel/qcocoawindowdelegate_mac.mm @@ -37,9 +37,6 @@ ** ** $QT_END_LICENSE$ ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** ****************************************************************************/ #import "private/qcocoawindowdelegate_mac_p.h" diff --git a/src/gui/widgets/qcocoamenu_mac.mm b/src/gui/widgets/qcocoamenu_mac.mm index be0feab..e258524 100644 --- a/src/gui/widgets/qcocoamenu_mac.mm +++ b/src/gui/widgets/qcocoamenu_mac.mm @@ -37,9 +37,6 @@ ** ** $QT_END_LICENSE$ ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** ****************************************************************************/ #include "qmacdefines_mac.h" diff --git a/src/gui/widgets/qmaccocoaviewcontainer_mac.mm b/src/gui/widgets/qmaccocoaviewcontainer_mac.mm index 2ed2e5f..a45d992 100644 --- a/src/gui/widgets/qmaccocoaviewcontainer_mac.mm +++ b/src/gui/widgets/qmaccocoaviewcontainer_mac.mm @@ -37,9 +37,6 @@ ** ** $QT_END_LICENSE$ ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** ****************************************************************************/ #import diff --git a/src/gui/widgets/qmacnativewidget_mac.mm b/src/gui/widgets/qmacnativewidget_mac.mm index 28fa1ec..224a51f 100644 --- a/src/gui/widgets/qmacnativewidget_mac.mm +++ b/src/gui/widgets/qmacnativewidget_mac.mm @@ -37,9 +37,6 @@ ** ** $QT_END_LICENSE$ ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** ****************************************************************************/ #import diff --git a/src/gui/widgets/qmainwindowlayout_mac.mm b/src/gui/widgets/qmainwindowlayout_mac.mm index f093165..429a479 100644 --- a/src/gui/widgets/qmainwindowlayout_mac.mm +++ b/src/gui/widgets/qmainwindowlayout_mac.mm @@ -37,9 +37,6 @@ ** ** $QT_END_LICENSE$ ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** ****************************************************************************/ #include diff --git a/src/script/qscript.g b/src/script/qscript.g index bf5a65c..32ab1de 100644 --- a/src/script/qscript.g +++ b/src/script/qscript.g @@ -37,9 +37,6 @@ -- -- $QT_END_LICENSE$ -- --- This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE --- WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. --- ---------------------------------------------------------------------------- %parser QScriptGrammar diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_versions/project.ui b/tests/auto/linguist/lupdate/testdata/good/merge_versions/project.ui index 7adb650..536bb2b 100644 --- a/tests/auto/linguist/lupdate/testdata/good/merge_versions/project.ui +++ b/tests/auto/linguist/lupdate/testdata/good/merge_versions/project.ui @@ -2,14 +2,42 @@ ********************************************************************* ** -** Copyright (C) 1992-$THISYEAR$ Trolltech AS. All rights reserved. +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the test suite of the Qt Toolkit. ** -** $LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ ** ********************************************************************* diff --git a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui index c10545d..bd24711 100644 --- a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui +++ b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui @@ -2,14 +2,42 @@ ********************************************************************* ** -** Copyright (C) 1992-$THISYEAR$ Trolltech AS. All rights reserved. +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the test suite of the Qt Toolkit. ** -** $LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ ** ********************************************************************* diff --git a/tests/auto/linguist/lupdate/testdata/good/parseui/project.ui b/tests/auto/linguist/lupdate/testdata/good/parseui/project.ui index 19fcaf5..e9f46aa 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parseui/project.ui +++ b/tests/auto/linguist/lupdate/testdata/good/parseui/project.ui @@ -2,14 +2,42 @@ ********************************************************************* ** -** Copyright (C) 1992-$THISYEAR$ Trolltech AS. All rights reserved. +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the test suite of the Qt Toolkit. ** -** $LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ ** ********************************************************************* diff --git a/tests/auto/uic/baseline/batchtranslation.ui b/tests/auto/uic/baseline/batchtranslation.ui index f8a8121..c158876 100644 --- a/tests/auto/uic/baseline/batchtranslation.ui +++ b/tests/auto/uic/baseline/batchtranslation.ui @@ -3,40 +3,41 @@ ********************************************************************* ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the Qt Linguist of the Qt Toolkit. +** This file is part of the test suite of the Qt Toolkit. ** -** This file may be used under the terms of the GNU General Public -** License versions 2.0 or 3.0 as published by the Free Software -** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Alternatively you may (at -** your option) use any later version of the GNU General Public -** License if such license has been publicly approved by Nokia Corporation and/or its subsidiary(-ies) -** (or its successors, if any) and the KDE Free Qt Foundation. In -** addition, as a special exception, Trolltech gives you certain -** additional rights. These rights are described in the Trolltech GPL -** Exception version 1.2, which can be found at -** http://qt.nokia.com/products/qt/gplexception/ and in the file -** GPL_EXCEPTION.txt in this package. +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. ** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. If -** you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. +** 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, Trolltech, as the sole -** copyright holder for Qt Designer, grants users of the Qt/Eclipse -** Integration plug-in the right for the Qt/Eclipse Integration to -** link to functionality provided by Qt Designer and its related -** libraries. +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. ** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly -** granted herein. +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ ** ********************************************************************* diff --git a/tests/auto/uic/baseline/batchtranslation.ui.h b/tests/auto/uic/baseline/batchtranslation.ui.h index 89eb8ab..82739a6 100644 --- a/tests/auto/uic/baseline/batchtranslation.ui.h +++ b/tests/auto/uic/baseline/batchtranslation.ui.h @@ -1,44 +1,43 @@ -/* -********************************************************************* +/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the Qt Linguist of the Qt Toolkit. -** -** This file may be used under the terms of the GNU General Public -** License versions 2.0 or 3.0 as published by the Free Software -** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Alternatively you may (at -** your option) use any later version of the GNU General Public -** License if such license has been publicly approved by Nokia Corporation and/or its subsidiary(-ies) -** (or its successors, if any) and the KDE Free Qt Foundation. In -** addition, as a special exception, Trolltech gives you certain -** additional rights. These rights are described in the Trolltech GPL -** Exception version 1.2, which can be found at -** http://qt.nokia.com/products/qt/gplexception/ and in the file -** GPL_EXCEPTION.txt in this package. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. If -** you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** In addition, as a special exception, Trolltech, as the sole -** copyright holder for Qt Designer, grants users of the Qt/Ecli