From e4b6d83ae9c060805d630f94f97447655b2e78ed Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Fri, 25 Sep 2009 12:11:57 +0200 Subject: QHostAddress: Clarification about DNS Task-number: QT-1683 --- src/network/kernel/qhostaddress.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp index 40ec14a..8b98630 100644 --- a/src/network/kernel/qhostaddress.cpp +++ b/src/network/kernel/qhostaddress.cpp @@ -432,6 +432,9 @@ void QNetmaskAddress::setPrefixLength(QAbstractSocket::NetworkLayerProtocol prot using isIPv4Address() or isIPv6Address(), and retrieved with toIPv4Address(), toIPv6Address(), or toString(). + \note Please note that QHostAddress does not do DNS lookups. + QHostInfo is needed for that. + The class also supports common predefined addresses: \l Null, \l LocalHost, \l LocalHostIPv6, \l Broadcast, and \l Any. -- cgit v0.12 From 101af7f0dc2eb8554a911ccb4c80ad0966db5780 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Fri, 25 Sep 2009 13:02:34 +0200 Subject: Change log update Reviewed-by: Trust me --- dist/changes-4.5.3 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.5.3 b/dist/changes-4.5.3 index df282b0..f6aecb8 100644 --- a/dist/changes-4.5.3 +++ b/dist/changes-4.5.3 @@ -53,7 +53,16 @@ Qt for Windows Qt for Mac OS X --------------- - +[252088] Drag and drop events will now consider the WA_TransparentForMouseEvents + in Cocoa port. +[255428] Fixed an an issue when Calling QWidget::raise() on hidden windows making + them visible in Cocoa port. +[256269] Window resize events triggered from QWidget::adjustSize() will now + be sent as non-spontaneous event in the Cocoa port. +[258822] Fixed a crash when inserting the same menu twice in a menubar in Cocoa port. + +- Fixed the wizard background images for Snow Leopard. + Qt for Embedded Linux --------------------- -- cgit v0.12 From c5acc6ee80d9f429fc8f4d9dd3cca51f3efdf6d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 3 Jun 2009 12:04:56 +0200 Subject: Fixes a crash in QDoubleSpinBox Removing dubious intermediate detection code that also had a buffer overflow. The results were inconsistent and not dependable on. Processing was inefficient and end value to user experience dubious. Test cases that abused the former behaviour were changed to consider input in an Intermediate where it was previously considered Invalid. With this change, user input will mostly be considered in an intermediate state, until it is effectively validated. Task-number: 255019 Reviewed-by: Anders Bakken --- src/gui/widgets/qspinbox.cpp | 214 +---------------------- tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp | 45 ++++- tests/auto/qspinbox/tst_qspinbox.cpp | 8 +- 3 files changed, 45 insertions(+), 222 deletions(-) diff --git a/src/gui/widgets/qspinbox.cpp b/src/gui/widgets/qspinbox.cpp index a2e4c15..8d21f3f 100644 --- a/src/gui/widgets/qspinbox.cpp +++ b/src/gui/widgets/qspinbox.cpp @@ -60,8 +60,6 @@ QT_BEGIN_NAMESPACE # define QSBDEBUG if (false) qDebug #endif -static bool isIntermediateValueHelper(qint64 num, qint64 minimum, qint64 maximum, qint64 *match = 0); - class QSpinBoxPrivate : public QAbstractSpinBoxPrivate { Q_DECLARE_PUBLIC(QSpinBox) @@ -73,7 +71,6 @@ public: virtual QString textFromValue(const QVariant &n) const; QVariant validateAndInterpret(QString &input, int &pos, QValidator::State &state) const; - bool isIntermediateValue(const QString &str) const; QChar thousand; inline void init() { @@ -87,7 +84,6 @@ class QDoubleSpinBoxPrivate : public QAbstractSpinBoxPrivate public: QDoubleSpinBoxPrivate(QWidget *parent = 0); void emitSignals(EmitPolicy ep, const QVariant &); - bool isIntermediateValue(const QString &str) const; virtual QVariant valueFromText(const QString &n) const; virtual QString textFromValue(const QVariant &n) const; @@ -975,51 +971,6 @@ QVariant QSpinBoxPrivate::valueFromText(const QString &text) const /*! - \internal - - Return true if str can become a number which is between minimum and - maximum or false if this is not possible. -*/ - -bool QSpinBoxPrivate::isIntermediateValue(const QString &str) const -{ - const int num = q_func()->locale().toInt(str, 0, 10); - const int min = minimum.toInt(); - const int max = maximum.toInt(); - - int numDigits = 0; - int digits[10]; - int tmp = num; - if (tmp == 0) { - numDigits = 1; - digits[0] = 0; - } else { - tmp = num; - for (int i=0; tmp != 0; ++i) { - digits[numDigits++] = qAbs(tmp % 10); - tmp /= 10; - } - } - - int failures = 0; - for (int number=min; /*number<=max*/; ++number) { - tmp = number; - for (int i=0; tmp != 0;) { - if (digits[i] == qAbs(tmp % 10)) { - if (++i == numDigits) - return true; - } - tmp /= 10; - } - if (failures++ == 500000) //upper bound - return true; - if (number == max) // needed for INT_MAX - break; - } - return false; -} - -/*! \internal Multi purpose function that parses input, sets state to the appropriate state and returns the value it will be interpreted as. @@ -1073,9 +1024,8 @@ QVariant QSpinBoxPrivate::validateAndInterpret(QString &input, int &pos, state = QValidator::Invalid; QSBDEBUG() << __FILE__ << __LINE__<< "state is set to Invalid"; } else { - state = isIntermediateValue(copy) ? QValidator::Intermediate : QValidator::Invalid; - QSBDEBUG() << __FILE__ << __LINE__<< "state is set to " - << (state == QValidator::Intermediate ? "Intermediate" : "Acceptable"); + state = QValidator::Intermediate; + QSBDEBUG() << __FILE__ << __LINE__<< "state is set to Intermediate"; } } } @@ -1135,105 +1085,6 @@ void QDoubleSpinBoxPrivate::emitSignals(EmitPolicy ep, const QVariant &old) } -bool QDoubleSpinBoxPrivate::isIntermediateValue(const QString &str) const -{ - QSBDEBUG() << "input is" << str << minimum << maximum; - qint64 dec = 1; - for (int i=0; i= 0 && max_left < 0 && !str.startsWith(QLatin1Char('-'))) || (left < 0 && min_left >= 0)) { - QSBDEBUG("returns false 0"); - return false; - } - - qint64 match = min_left; - if (doleft && !isIntermediateValueHelper(left, min_left, max_left, &match)) { - QSBDEBUG() << __FILE__ << __LINE__ << "returns false"; - return false; - } - if (doright) { - QSBDEBUG("match %lld min_left %lld max_left %lld", match, min_left, max_left); - if (!doleft) { - if (min_left == max_left) { - const bool ret = isIntermediateValueHelper(qAbs(left), - negative ? max_right : min_right, - negative ? min_right : max_right); - QSBDEBUG() << __FILE__ << __LINE__ << "returns" << ret; - return ret; - } else if (qAbs(max_left - min_left) == 1) { - const bool ret = isIntermediateValueHelper(qAbs(left), min_right, negative ? 0 : dec) - || isIntermediateValueHelper(qAbs(left), negative ? dec : 0, max_right); - QSBDEBUG() << __FILE__ << __LINE__ << "returns" << ret; - return ret; - } else { - const bool ret = isIntermediateValueHelper(qAbs(left), 0, dec); - QSBDEBUG() << __FILE__ << __LINE__ << "returns" << ret; - return ret; - } - } - if (match != min_left) { - min_right = negative ? dec : 0; - } - if (match != max_left) { - max_right = negative ? 0 : dec; - } - qint64 tmpl = negative ? max_right : min_right; - qint64 tmpr = negative ? min_right : max_right; - const bool ret = isIntermediateValueHelper(right, tmpl, tmpr); - QSBDEBUG() << __FILE__ << __LINE__ << "returns" << ret; - return ret; - } - QSBDEBUG() << __FILE__ << __LINE__ << "returns true"; - return true; -} - /*! \internal \reimp @@ -1402,9 +1253,8 @@ QVariant QDoubleSpinBoxPrivate::validateAndInterpret(QString &input, int &pos, state = QValidator::Invalid; QSBDEBUG() << __FILE__ << __LINE__<< "state is set to Invalid"; } else { - state = isIntermediateValue(copy) ? QValidator::Intermediate : QValidator::Invalid; - QSBDEBUG() << __FILE__ << __LINE__<< "state is set to " - << (state == QValidator::Intermediate ? "Intermediate" : "Acceptable"); + state = QValidator::Intermediate; + QSBDEBUG() << __FILE__ << __LINE__<< "state is set to Intermediate"; } } } @@ -1462,62 +1312,6 @@ QString QDoubleSpinBoxPrivate::textFromValue(const QVariant &f) const Use minimum() instead. */ -/*! - \internal Returns whether \a str is a string which value cannot be - parsed but still might turn into something valid. -*/ - -static bool isIntermediateValueHelper(qint64 num, qint64 min, qint64 max, qint64 *match) -{ - QSBDEBUG("%lld %lld %lld", num, min, max); - - if (num >= min && num <= max) { - if (match) - *match = num; - QSBDEBUG("returns true 0"); - return true; - } - qint64 tmp = num; - - int numDigits = 0; - int digits[10]; - if (tmp == 0) { - numDigits = 1; - digits[0] = 0; - } else { - tmp = qAbs(num); - for (int i=0; tmp > 0; ++i) { - digits[numDigits++] = tmp % 10; - tmp /= 10; - } - } - - int failures = 0; - qint64 number; - for (number=max; number>=min; --number) { - tmp = qAbs(number); - for (int i=0; tmp > 0;) { - if (digits[i] == (tmp % 10)) { - if (++i == numDigits) { - if (match) - *match = number; - QSBDEBUG("returns true 1"); - return true; - } - } - tmp /= 10; - } - if (failures++ == 500000) { //upper bound - if (match) - *match = num; - QSBDEBUG("returns true 2"); - return true; - } - } - QSBDEBUG("returns false"); - return false; -} - /*! \reimp */ bool QSpinBox::event(QEvent *event) { diff --git a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp index dada015..1fb0e1e 100644 --- a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp +++ b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp @@ -52,6 +52,9 @@ #include #include + +#include "../../shared/util.h" + //TESTED_CLASS= //TESTED_FILES=gui/widgets/qspinbox.h gui/widgets/qspinbox.cpp gui/widgets/qabstractspinbox.cpp gui/widgets/qabstractspinbox_p.h gui/widgets/qabstractspinbox.h @@ -142,6 +145,7 @@ private slots: void task224497_fltMax(); void task221221(); + void task255471_decimalsValidation(); public slots: void valueChangedHelper(const QString &); @@ -665,7 +669,7 @@ void tst_QDoubleSpinBox::valueFromTextAndValidate_data() QTest::addColumn("language"); QTest::addColumn("expectedText"); // if empty we don't check - QTest::newRow("data0") << QString("2.2") << Invalid << 3.0 << 5.0 << (int)QLocale::C << QString(); + QTest::newRow("data0") << QString("2.2") << Intermediate << 3.0 << 5.0 << (int)QLocale::C << QString(); QTest::newRow("data1") << QString() << Intermediate << 0.0 << 100.0 << (int)QLocale::C << QString(); QTest::newRow("data2") << QString("asd") << Invalid << 0.0 << 100.0 << (int)QLocale::C << QString(); QTest::newRow("data3") << QString("2.2") << Acceptable << 0.0 << 100.0 << (int)QLocale::C << QString(); @@ -682,20 +686,20 @@ void tst_QDoubleSpinBox::valueFromTextAndValidate_data() QTest::newRow("data14") << QString("1, ") << Acceptable << 0.0 << 100.0 << (int)QLocale::Norwegian << QString("1,"); QTest::newRow("data15") << QString("1, ") << Invalid << 0.0 << 100.0 << (int)QLocale::C << QString(); QTest::newRow("data16") << QString("2") << Intermediate << 100.0 << 102.0 << (int)QLocale::C << QString(); - QTest::newRow("data17") << QString("22.0") << Invalid << 100.0 << 102.0 << (int)QLocale::C << QString(); + QTest::newRow("data17") << QString("22.0") << Intermediate << 100.0 << 102.0 << (int)QLocale::C << QString(); QTest::newRow("data18") << QString("12.0") << Intermediate << 100.0 << 102.0 << (int)QLocale::C << QString(); - QTest::newRow("data19") << QString("12.2") << Invalid << 100. << 102.0 << (int)QLocale::C << QString(); - QTest::newRow("data20") << QString("21.") << Invalid << 100.0 << 102.0 << (int)QLocale::C << QString(); - QTest::newRow("data21") << QString("-21.") << Invalid << -102.0 << -100.0 << (int)QLocale::C << QString(); + QTest::newRow("data19") << QString("12.2") << Intermediate << 100. << 102.0 << (int)QLocale::C << QString(); + QTest::newRow("data20") << QString("21.") << Intermediate << 100.0 << 102.0 << (int)QLocale::C << QString(); + QTest::newRow("data21") << QString("-21.") << Intermediate << -102.0 << -100.0 << (int)QLocale::C << QString(); QTest::newRow("data22") << QString("-12.") << Intermediate << -102.0 << -100.0 << (int)QLocale::C << QString(); - QTest::newRow("data23") << QString("-11.11") << Invalid << -102.0 << -101.2 << (int)QLocale::C << QString(); + QTest::newRow("data23") << QString("-11.11") << Intermediate << -102.0 << -101.2 << (int)QLocale::C << QString(); QTest::newRow("data24") << QString("-11.4") << Intermediate << -102.0 << -101.3 << (int)QLocale::C << QString(); QTest::newRow("data25") << QString("11.400") << Invalid << 0.0 << 100.0 << (int)QLocale::C << QString(); QTest::newRow("data26") << QString(".4") << Intermediate << 0.45 << 0.5 << (int)QLocale::C << QString(); QTest::newRow("data27") << QString("+.4") << Intermediate << 0.45 << 0.5 << (int)QLocale::C << QString(); QTest::newRow("data28") << QString("-.4") << Intermediate << -0.5 << -0.45 << (int)QLocale::C << QString(); QTest::newRow("data29") << QString(".4") << Intermediate << 1.0 << 2.4 << (int)QLocale::C << QString(); - QTest::newRow("data30") << QString("-.4") << Invalid << -2.3 << -1.9 << (int)QLocale::C << QString(); + QTest::newRow("data30") << QString("-.4") << Intermediate << -2.3 << -1.9 << (int)QLocale::C << QString(); QTest::newRow("data31") << QString("-42") << Invalid << -2.43 << -1.0 << (int)QLocale::C << QString(); QTest::newRow("data32") << QString("-4") << Invalid << -1.4 << -1.0 << (int)QLocale::C << QString(); QTest::newRow("data33") << QString("-42") << Invalid << -1.4 << -1.0 << (int)QLocale::C << QString(); @@ -709,7 +713,7 @@ void tst_QDoubleSpinBox::valueFromTextAndValidate_data() QTest::newRow("data41") << QString("103.") << Invalid << -102.0 << 11.0 << (int)QLocale::C << QString(); QTest::newRow("data42") << QString("122") << Invalid << 10.0 << 12.2 << (int)QLocale::C << QString(); QTest::newRow("data43") << QString("-2.2") << Intermediate << -12.2 << -3.2 << (int)QLocale::C << QString(); - QTest::newRow("data44") << QString("-2.20") << Invalid << -12.1 << -3.2 << (int)QLocale::C << QString(); + QTest::newRow("data44") << QString("-2.20") << Intermediate << -12.1 << -3.2 << (int)QLocale::C << QString(); QTest::newRow("data45") << QString("200,2") << Invalid << 0.0 << 1000.0 << (int)QLocale::C << QString(); QTest::newRow("data46") << QString("200,2") << Acceptable << 0.0 << 1000.0 << (int)QLocale::German << QString(); QTest::newRow("data47") << QString("2.2") << Acceptable << 0.0 << 1000.0 << (int)QLocale::C << QString(); @@ -1003,6 +1007,31 @@ void tst_QDoubleSpinBox::task221221() QCOMPARE(spin.text(), QLatin1String("1")); } +void tst_QDoubleSpinBox::task255471_decimalsValidation() +{ + // QDoubleSpinBox shouldn't crash with large numbers of decimals. Even if + // the results are useless ;-) + for (int i = 0; i < 32; ++i) + { + QDoubleSpinBox spinBox; + spinBox.setDecimals(i); + spinBox.setMinimum(0.3); + spinBox.setMaximum(12); + + spinBox.show(); + QTRY_VERIFY(spinBox.isVisible()); + spinBox.setFocus(); + QTRY_VERIFY(spinBox.hasFocus()); + + QTest::keyPress(&spinBox, Qt::Key_Right); + QTest::keyPress(&spinBox, Qt::Key_Right); + QTest::keyPress(&spinBox, Qt::Key_Delete); + + // Don't crash! + QTest::keyPress(&spinBox, Qt::Key_2); + } +} + QTEST_MAIN(tst_QDoubleSpinBox) #include "tst_qdoublespinbox.moc" diff --git a/tests/auto/qspinbox/tst_qspinbox.cpp b/tests/auto/qspinbox/tst_qspinbox.cpp index 9f00be6..79e3ca7 100644 --- a/tests/auto/qspinbox/tst_qspinbox.cpp +++ b/tests/auto/qspinbox/tst_qspinbox.cpp @@ -643,21 +643,21 @@ void tst_QSpinBox::valueFromTextAndValidate_data() QTest::addColumn("maxi"); QTest::addColumn("expectedText"); // if empty we don't check - QTest::newRow("data0") << QString("2") << Invalid << 3 << 5 << QString(); + QTest::newRow("data0") << QString("2") << Intermediate << 3 << 5 << QString(); QTest::newRow("data1") << QString() << Intermediate << 0 << 100 << QString(); QTest::newRow("data2") << QString("asd") << Invalid << 0 << 100 << QString(); QTest::newRow("data3") << QString("2") << Acceptable << 0 << 100 << QString(); QTest::newRow("data4") << QString() << Intermediate << 0 << 1 << QString(); QTest::newRow("data5") << QString() << Invalid << 0 << 0 << QString(); QTest::newRow("data5") << QString("5") << Intermediate << 2004 << 2005 << QString(); - QTest::newRow("data6") << QString("50") << Invalid << 2004 << 2005 << QString(); + QTest::newRow("data6") << QString("50") << Intermediate << 2004 << 2005 << QString(); QTest::newRow("data7") << QString("205") << Intermediate << 2004 << 2005 << QString(); QTest::newRow("data8") << QString("2005") << Acceptable << 2004 << 2005 << QString(); - QTest::newRow("data9") << QString("3") << Invalid << 2004 << 2005 << QString(); + QTest::newRow("data9") << QString("3") << Intermediate << 2004 << 2005 << QString(); QTest::newRow("data10") << QString("-") << Intermediate << -20 << -10 << QString(); QTest::newRow("data11") << QString("-1") << Intermediate << -20 << -10 << QString(); QTest::newRow("data12") << QString("-5") << Intermediate << -20 << -10 << QString(); - QTest::newRow("data13") << QString("-5") << Invalid << -20 << -16 << QString(); + QTest::newRow("data13") << QString("-5") << Intermediate << -20 << -16 << QString(); QTest::newRow("data14") << QString("-2") << Intermediate << -20 << -16 << QString(); QTest::newRow("data15") << QString("2") << Invalid << -20 << -16 << QString(); QTest::newRow("data16") << QString() << Intermediate << -20 << -16 << QString(); -- cgit v0.12 From 8c3169c487fc863c59b58699b3c570cde3a37bd9 Mon Sep 17 00:00:00 2001 From: Bill King Date: Mon, 28 Sep 2009 10:03:56 +1000 Subject: Update dist/changes-4.5.3 for sql changes. --- dist/changes-4.5.3 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.5.3 b/dist/changes-4.5.3 index f6aecb8..bb6c165 100644 --- a/dist/changes-4.5.3 +++ b/dist/changes-4.5.3 @@ -37,7 +37,20 @@ Third party components **************************************************************************** * Database Drivers * **************************************************************************** - +- [QT-353] (ODBC) Fixed issue of forward only datasets failing when not + explicitly set so. +- [222678] Fixed QSqlTableModel: trying to delete the wrong row. +- (Interbase) Fixed crash when calling numRows on unknown query type. +- Fixed several database autotests. +- Fixed determination of end of odbc string on deficient driver. +- Fixed formatting of date strings in psql driver. +- Fixed mysql queries automatically getting prepared. Now have to explicitly + prepare them if you want that functionality. +- Fixed failure when QSqlTableModel has null fields to update. +- Fixed missing isnan/isinf on some platforms (needed for postgres driver) +- Fixed ::record for dialect 3 named tables in interbase/firebird. +- Fixed invalid length for numeric fields in oracle. +- (ODBC) Fixed non-unicode strings should be strings, not bytearrays. **************************************************************************** * Platform Specific Changes * -- cgit v0.12 From 3e23d922c6547f7295c425b28a9c9fc0791dbfa5 Mon Sep 17 00:00:00 2001 From: Stian Sandvik Thomassen Date: Mon, 28 Sep 2009 12:49:53 +1000 Subject: Added test for QTBUG-4595. QDomDocument::toString() should not cause an assertion if the document specifies an encoding that is not supported by QTextCodec. Task-number: QTBUG-4595 --- tests/auto/qdom/tst_qdom.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp index 0cad45e..e06ef21 100644 --- a/tests/auto/qdom/tst_qdom.cpp +++ b/tests/auto/qdom/tst_qdom.cpp @@ -126,6 +126,8 @@ private slots: void setContentWhitespace() const; void setContentWhitespace_data() const; + void taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() const; + void cleanupTestCase() const; private: @@ -1893,5 +1895,18 @@ void tst_QDom::setContentWhitespace_data() const QTest::newRow("") << QString::fromLatin1("\t\t\t\t") << false; } +void tst_QDom::taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() const +{ + QString xmlWithUnknownEncoding("" + "" + " How will this sentence be handled?" + ""); + QDomDocument d; + QVERIFY(d.setContent(xmlWithUnknownEncoding)); + + QString dontAssert = d.toString(); // this should not assert + QVERIFY(true); +} + QTEST_MAIN(tst_QDom) #include "tst_qdom.moc" -- cgit v0.12 From 75e19e6165229db5465704bf14d8e938c3f0c36d Mon Sep 17 00:00:00 2001 From: Bill King Date: Mon, 28 Sep 2009 13:11:44 +1000 Subject: Fixes: better wording. --- tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp b/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp index f043248..9f4ebcb 100644 --- a/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp +++ b/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp @@ -644,7 +644,7 @@ void tst_Q3SqlCursor::select() } #ifdef QT_DEBUG - // for people too stupid to read docs we had to insert this debugging message. + // Ignore debugging message advising users of a potential pitfall. QTest::ignoreMessage(QtDebugMsg, "Q3SqlCursor::setValue(): This will not affect actual database values. Use primeInsert(), primeUpdate() or primeDelete()."); #endif cur4.setValue( "id", 1 ); -- cgit v0.12 From c2f946034bb68b7dbf508ac640d692066821a400 Mon Sep 17 00:00:00 2001 From: Stian Sandvik Thomassen Date: Mon, 28 Sep 2009 13:49:54 +1000 Subject: Doc: fixed typo in QTabBar::tabRect() docs --- src/gui/widgets/qtabbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp index 6df5c5c..06a075d 100644 --- a/src/gui/widgets/qtabbar.cpp +++ b/src/gui/widgets/qtabbar.cpp @@ -1097,7 +1097,7 @@ QVariant QTabBar::tabData(int index) const } /*! - Returns the visual rectangle of the of the tab at position \a + Returns the visual rectangle of the tab at position \a index, or a null rectangle if \a index is out of range. */ QRect QTabBar::tabRect(int index) const -- cgit v0.12 From 60bc4d037a6b4b667f08f1d36e868b454723909f Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 28 Sep 2009 10:49:12 +0300 Subject: Fixed qeasingcurve autotest compilation for other than WINCE platforms. Reviewed-by: TrustMe --- tests/auto/qeasingcurve/tst_qeasingcurve.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp index 8e0d37d..52ffcb5 100644 --- a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp +++ b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp @@ -417,18 +417,18 @@ void tst_QEasingCurve::valueForProgress() // the least significant digit it is still subject to rounding errors qreal error = easeConv - ex; + qreal errorbound = 0.00001; #ifdef Q_OS_WINCE // exception values for WINCE(this test should be rewritten, as it only freezes the status quo of QEasingCurve // The failing (2) values are explicitly excepted here: // The source values for the comparison table should remain untruncated double and the // error bound checking function dynamic. Also the source values should come from a "trusted" source and not // from QEasingCurve itself. - qreal errorbound = 0.00001; if ((type == int(QEasingCurve::InOutBounce) && (i == 8 || i == 6) ) || (type == int(QEasingCurve::OutExpo) && i == 2)) - errorbound = 0.0002; -#endif // accept the potential rounding error in the least significant digit - - QVERIFY(error <= errorbound ); + errorbound = 0.0002; +#endif + // accept the potential rounding error in the least significant digit + QVERIFY(error <= errorbound ); } #endif } -- cgit v0.12 From 632462a8d4148c8fad312a08c274d6dc05950d8d Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 28 Sep 2009 11:00:46 +0300 Subject: Enabled WINCE workaround for S60 in QEasingCurve::valueForProgress test. See: 82275b4c03a0. This workaround applies also for Symbian. Reviewed-by: TrustMe --- tests/auto/qeasingcurve/tst_qeasingcurve.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp index 52ffcb5..8cf686e 100644 --- a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp +++ b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp @@ -418,7 +418,7 @@ void tst_QEasingCurve::valueForProgress() // the least significant digit it is still subject to rounding errors qreal error = easeConv - ex; qreal errorbound = 0.00001; -#ifdef Q_OS_WINCE +#if defined( Q_OS_WINCE ) || defined( Q_OS_SYMBIAN ) // exception values for WINCE(this test should be rewritten, as it only freezes the status quo of QEasingCurve // The failing (2) values are explicitly excepted here: // The source values for the comparison table should remain untruncated double and the @@ -427,7 +427,7 @@ void tst_QEasingCurve::valueForProgress() if ((type == int(QEasingCurve::InOutBounce) && (i == 8 || i == 6) ) || (type == int(QEasingCurve::OutExpo) && i == 2)) errorbound = 0.0002; #endif - // accept the potential rounding error in the least significant digit + // accept the potential rounding error in the least significant digit QVERIFY(error <= errorbound ); } #endif -- cgit v0.12 From 8a9b2acacecd4e998944d567c4a5c064c40dc999 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 28 Sep 2009 10:28:34 +0200 Subject: testBatFiles removed from qprocess.pro autotest Reviewed-by: paul --- tests/auto/qprocess/qprocess.pro | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/qprocess/qprocess.pro b/tests/auto/qprocess/qprocess.pro index 892686d..77cfc82 100644 --- a/tests/auto/qprocess/qprocess.pro +++ b/tests/auto/qprocess/qprocess.pro @@ -1,7 +1,6 @@ TEMPLATE = subdirs SUBDIRS = \ - testBatFiles \ testProcessCrash \ testProcessEcho \ testProcessEcho2 \ -- cgit v0.12 From 003d454ce8350cc279c2de53848c7a4533dc939d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Mon, 28 Sep 2009 10:41:51 +0200 Subject: Updated change log for 4.5.3 --- dist/changes-4.5.3 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dist/changes-4.5.3 b/dist/changes-4.5.3 index bb6c165..2b4906d 100644 --- a/dist/changes-4.5.3 +++ b/dist/changes-4.5.3 @@ -33,6 +33,16 @@ Third party components * Library * **************************************************************************** +- QDirIterator + * [258230] Fixed inconsistencies in value returned from + QDirIterator::next(). + +- QDoubleSpinBox + * [255019] Fixed a crash when using large value for decimals. + +- QTemporaryFile + * [260165] Fixed a bug where temporary files would be left behind when + copying a file to a non-existing directory. **************************************************************************** * Database Drivers * @@ -59,6 +69,10 @@ Third party components Qt for Linux/X11 ---------------- +- Fixed a bug where an empty KDEDIRS variable would bring /share into the icon + search path. +- [KDE 191759] Plasma spinning in endless loop. + Qt for Windows -------------- -- cgit v0.12 From ce94e9575a9f623f599a16d69051480a94300b7e Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 28 Sep 2009 10:43:10 +0200 Subject: Cocoa: Fix build cocoa port with namespace This fix just fixes up coding bugs here and there Reviewed-by: Brad --- examples/webkit/fancybrowser/mainwindow.h | 2 +- src/gui/painting/qdrawhelper_mmx.cpp | 2 +- src/gui/painting/qdrawhelper_mmx3dnow.cpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/webkit/fancybrowser/mainwindow.h b/examples/webkit/fancybrowser/mainwindow.h index 3764f72..33fd8f5 100644 --- a/examples/webkit/fancybrowser/mainwindow.h +++ b/examples/webkit/fancybrowser/mainwindow.h @@ -41,8 +41,8 @@ #include -QT_BEGIN_NAMESPACE class QWebView; +QT_BEGIN_NAMESPACE class QLineEdit; QT_END_NAMESPACE diff --git a/src/gui/painting/qdrawhelper_mmx.cpp b/src/gui/painting/qdrawhelper_mmx.cpp index 0dcc3dd..d81e2a9 100644 --- a/src/gui/painting/qdrawhelper_mmx.cpp +++ b/src/gui/painting/qdrawhelper_mmx.cpp @@ -128,7 +128,7 @@ void qt_blend_rgb32_on_rgb32_mmx(uchar *destPixels, int dbpl, } } +QT_END_NAMESPACE #endif // QT_HAVE_MMX -QT_END_NAMESPACE diff --git a/src/gui/painting/qdrawhelper_mmx3dnow.cpp b/src/gui/painting/qdrawhelper_mmx3dnow.cpp index 0db89f0..2d40ae3 100644 --- a/src/gui/painting/qdrawhelper_mmx3dnow.cpp +++ b/src/gui/painting/qdrawhelper_mmx3dnow.cpp @@ -101,6 +101,7 @@ void qt_blend_color_argb_mmx3dnow(int count, const QSpan *spans, void *userData) (CompositionFunctionSolid*)qt_functionForModeSolid_MMX3DNOW); } +QT_END_NAMESPACE + #endif // QT_HAVE_3DNOW -QT_END_NAMESPACE -- cgit v0.12 From 50764a0609bb9ea7e14e33456e77dd14c447f7e3 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 28 Sep 2009 10:40:47 +0200 Subject: JavaScriptCore compile fix for Windows CE on ARM Reviewed-by: Simon Hausmann --- src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h index cc40336..39cafab 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h @@ -257,7 +257,8 @@ #define WTF_PLATFORM_MIDDLE_ENDIAN 1 #endif #define ARM_ARCH_VERSION 3 -#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) +#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || defined(ARMV4I) \ + || defined(_ARMV4I_) || defined(armv4i) #undef ARM_ARCH_VERSION #define ARM_ARCH_VERSION 4 #endif -- cgit v0.12 From e393fe2c336e7c287892e3d1ba32b505a63e9e3a Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 28 Sep 2009 11:56:59 +0300 Subject: Removed RVCT workarounds for QFileSystemWatcher autotest. The test passes without these workarounds in 5800 XpressMusic and emulator Reviewed-by: TrustMe --- tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index 88bf229..7735f30 100644 --- a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -318,9 +318,6 @@ void tst_QFileSystemWatcher::watchDirectory() #ifdef Q_OS_WINCE QEXPECT_FAIL("poller", "Directory does not get updated on file removal(See #137910)", Abort); -#elif defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT) - // Since native watcher is always used in real devices, this poller issue is irrelevant - QEXPECT_FAIL("poller", "Poller doesn't detect directory removal in RVCT builds", Abort); #endif QCOMPARE(changedSpy.count(), 2); QCOMPARE(changedSpy.at(0).count(), 1); @@ -490,11 +487,6 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory() #ifdef Q_OS_WINCE QEXPECT_FAIL("poller", "Directory does not get updated on file removal(See #137910)", Abort); #endif -#if defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT) - // Since native watcher is always used in real devices, this poller issue is irrelevant - // Symbian file system does not change modification time on a directory when a file inside is changed - QEXPECT_FAIL("poller", "Poller doesn't detect directory changes in RVCT builds", Abort); -#endif QCOMPARE(dirChangedSpy.count(), 1); dirChangedSpy.clear(); -- cgit v0.12 From 8f1f29432e274fcad2deae4ff19e2e738672b7cd Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 28 Sep 2009 10:40:47 +0200 Subject: JavaScriptCore compile fix for Windows CE on ARM Reviewed-by: Simon Hausmann --- src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h index e508f77..bd82d8f 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h @@ -238,7 +238,8 @@ #define WTF_PLATFORM_MIDDLE_ENDIAN 1 #endif #define ARM_ARCH_VERSION 3 -#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) +#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || defined(ARMV4I) \ + || defined(_ARMV4I_) || defined(armv4i) #undef ARM_ARCH_VERSION #define ARM_ARCH_VERSION 4 #endif -- cgit v0.12 From a49ca92bc343e58ec21dd52a933b23f43ecfc0a6 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 28 Sep 2009 11:24:05 +0200 Subject: Make sure signal handlers are installed on QWS QWS already installs message handlers, and this would cause testlib not to install its own handler, causing lots of extra test failures if there is a crash. The proper way would be to make testlib invoke previous handlers, but the quick and easy fix is just to forget about the old ones. The rationale is that the worst thing that can happen is that it will cause a crash, and that was going to happen anyway. Reviewed-by: Jeremy --- src/testlib/qtestcase.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 3392ed7..7e7bcd1 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1517,10 +1517,14 @@ FatalSignalHandler::FatalSignalHandler() for (int i = 0; fatalSignals[i]; ++i) { sigaction(fatalSignals[i], &act, &oldact); +#ifndef Q_WS_QWS // Don't overwrite any non-default handlers + // however, we need to replace the default QWS handlers if (oldact.sa_flags & SA_SIGINFO || oldact.sa_handler != SIG_DFL) { sigaction(fatalSignals[i], &oldact, 0); - } else { + } else +#endif + { sigaddset(&handledSignals, fatalSignals[i]); } } -- cgit v0.12 From b4a9925dfd3298bae65887dbad767c4a2211310c Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Mon, 28 Sep 2009 19:35:36 +1000 Subject: Fix qdoc errors. Reviewed-by: Trust Me --- src/gui/image/qpixmap_s60.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index cab6116..d5ba589 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -64,13 +64,13 @@ const uchar qt_pixmap_bit_mask[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; - /*! + \class QSymbianFbsClient \since 4.6 - Symbian Font And Bitmap server client that is - used to lock the global bitmap heap. Only used in - S60 v3.1 and S60 v3.2. + Symbian Font And Bitmap server client that is + used to lock the global bitmap heap. Only used in + S60 v3.1 and S60 v3.2. */ class QSymbianFbsClient { @@ -145,6 +145,7 @@ void QSymbianFbsHeapLock::relock() } /*! + \class QSymbianBitmapDataAccess \since 4.6 Data access class that is used to locks/unlocks pixel data @@ -297,7 +298,7 @@ QPixmap QPixmap::grabWindow(WId winId, int x, int y, int w, int h) } /*! - \fn CFbsBitmap *QPixmap::toSymbianCFbsBitmap() + \fn CFbsBitmap *QPixmap::toSymbianCFbsBitmap() const \since 4.6 Creates a \c CFbsBitmap that is equivalent to the QPixmap. Internally this -- cgit v0.12 From a8ef13fa6feafc63ef4d571c95287ac66afc5825 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 28 Sep 2009 11:41:17 +0200 Subject: my changes for 4.5.3 added --- dist/changes-4.5.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/changes-4.5.3 b/dist/changes-4.5.3 index 2b4906d..831106a 100644 --- a/dist/changes-4.5.3 +++ b/dist/changes-4.5.3 @@ -97,7 +97,7 @@ Qt for Embedded Linux Qt for Windows CE ----------------- - +[260702] Fixed restoring of minimized Windows. **************************************************************************** * Compiler Specific Changes * -- cgit v0.12 From ce6f58a54ccbf6c83cb2b4d725efb8fc5e1f261f Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Mon, 28 Sep 2009 19:42:54 +1000 Subject: Fix qdoc error. Reviewed-by: Trust Me --- src/testlib/qtestcase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 7e7bcd1..1768fe6 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -734,7 +734,7 @@ QT_BEGIN_NAMESPACE \sa QTest::qSleep() */ -/*! \fn void QTest::qWaitForWindowManager(QWidget *window) +/*! \fn void QTest::qWaitForWindowShown(QWidget *window) Waits until the window is shown in the screen. This is mainly useful for asynchronous systems like X11, where a window will be mapped to screen some -- cgit v0.12 From 3cb2def34c32efe1155e6938eca65706dcc97aac Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 25 Sep 2009 20:22:31 +0200 Subject: Stabilize some more tests --- tests/auto/qcombobox/tst_qcombobox.cpp | 4 +++- tests/auto/qlabel/tst_qlabel.cpp | 15 +++++++----- tests/auto/qmdiarea/tst_qmdiarea.cpp | 30 ++++++------------------ tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp | 6 ++--- tests/auto/qtableview/tst_qtableview.cpp | 1 + tests/auto/qwidget/tst_qwidget.cpp | 20 +++++++++------- tests/auto/qwindowsurface/tst_qwindowsurface.cpp | 2 +- 7 files changed, 35 insertions(+), 43 deletions(-) diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp index be1cb98..61aabaa 100644 --- a/tests/auto/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/qcombobox/tst_qcombobox.cpp @@ -2125,15 +2125,17 @@ void tst_QComboBox::task248169_popupWithMinimalSize() comboBox.setGeometry(desktopSize.width() - (desktopSize.width() / 4), (desktopSize.width() / 4), (desktopSize.width() / 2), (desktopSize.width() / 4)); comboBox.show(); + QTest::qWaitForWindowShown(&comboBox); QTRY_VERIFY(comboBox.isVisible()); comboBox.showPopup(); QTRY_VERIFY(comboBox.view()); + QTest::qWaitForWindowShown(comboBox.view()); QTRY_VERIFY(comboBox.view()->isVisible()); #ifdef QT_BUILD_INTERNAL QFrame *container = qFindChild(&comboBox); QVERIFY(container); - QVERIFY(desktop.screenGeometry(container).contains(container->geometry())); + QTRY_VERIFY(desktop.screenGeometry(container).contains(container->geometry())); #endif } diff --git a/tests/auto/qlabel/tst_qlabel.cpp b/tests/auto/qlabel/tst_qlabel.cpp index 8a5e344..dd03ef3 100644 --- a/tests/auto/qlabel/tst_qlabel.cpp +++ b/tests/auto/qlabel/tst_qlabel.cpp @@ -57,6 +57,8 @@ # define SRCDIR "" #endif +#include "../../shared/util.h" + class Widget : public QWidget { public: @@ -102,11 +104,11 @@ private slots: void eventPropagation_data(); void eventPropagation(); void focusPolicy(); - + void task190318_sizes(); void sizeHint(); - + void task226479_movieResize(); void emptyPixmap(); @@ -413,16 +415,17 @@ void tst_QLabel::task226479_movieResize() paintedRegion += e->region(); QLabel::paintEvent(e); } - + public: QRegion paintedRegion; }; - + Label label; label.resize(350,350); label.show(); QMovie *movie = new QMovie( &label ); label.setMovie(movie); + QTest::qWaitForWindowShown(&label); movie->setFileName(SRCDIR "red.png"); movie->start(); QTest::qWait(50); @@ -431,8 +434,8 @@ void tst_QLabel::task226479_movieResize() movie->setFileName(SRCDIR "green.png"); movie->start(); QTest::qWait(50); - - QCOMPARE(label.paintedRegion , QRegion(label.rect()) ); + + QTRY_COMPARE(label.paintedRegion , QRegion(label.rect()) ); } void tst_QLabel::emptyPixmap() diff --git a/tests/auto/qmdiarea/tst_qmdiarea.cpp b/tests/auto/qmdiarea/tst_qmdiarea.cpp index 65f1937..b110114 100644 --- a/tests/auto/qmdiarea/tst_qmdiarea.cpp +++ b/tests/auto/qmdiarea/tst_qmdiarea.cpp @@ -639,9 +639,7 @@ void tst_QMdiArea::changeWindowTitle() mw->setCentralWidget( ws ); mw->menuBar(); mw->show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(mw); -#endif + QTest::qWaitForWindowShown(mw); QWidget *widget = new QWidget( ws ); widget->setWindowTitle( wc ); @@ -655,22 +653,17 @@ void tst_QMdiArea::changeWindowTitle() widget->setWindowState(Qt::WindowMaximized); #endif #if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) - QCOMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) ); + QTRY_COMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) ); #endif mw->hide(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(mw); -#endif qApp->processEvents(); mw->show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(mw); -#endif qApp->processEvents(); + QTest::qWaitForWindowShown(mw); #if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) - QCOMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) ); + QTRY_COMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) ); #endif #ifdef USE_SHOW @@ -688,7 +681,7 @@ void tst_QMdiArea::changeWindowTitle() #endif qApp->processEvents(); #if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE) - QCOMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) ); + QTRY_COMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) ); widget->setWindowTitle( wc2 ); QCOMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc2) ); mw->setWindowTitle( mwc2 ); @@ -1697,11 +1690,8 @@ void tst_QMdiArea::tileSubWindows() workspace.setActiveSubWindow(windows.at(5)); workspace.resize(workspace.size() - QSize(10, 10)); workspace.setActiveSubWindow(0); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&workspace); -#endif QTest::qWait(250); // delayed re-arrange of minimized windows - QCOMPARE(workspace.viewport()->childrenRect(), workspace.viewport()->rect()); + QTRY_COMPARE(workspace.viewport()->childrenRect(), workspace.viewport()->rect()); // Add another window and verify that the views are not tiled anymore. workspace.addSubWindow(new QPushButton(QLatin1String("I'd like to mess up tiled views")))->show(); @@ -1732,9 +1722,6 @@ void tst_QMdiArea::tileSubWindows() // Verify that we try to resize the area such that all sub-windows are visible. // It's important that tiled windows are NOT overlapping. workspace.resize(350, 150); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&workspace); -#endif qApp->processEvents(); QTRY_COMPARE(workspace.size(), QSize(350, 150)); @@ -1761,13 +1748,10 @@ void tst_QMdiArea::tileSubWindows() #ifdef Q_OS_WINCE QSKIP("Not fixed yet! See task 197453", SkipAll); #endif - QCOMPARE(workspace.viewport()->rect().size(), expectedViewportSize); + QTRY_COMPARE(workspace.viewport()->rect().size(), expectedViewportSize); // Not enough space for all sub-windows to be visible -> provide scroll bars. workspace.resize(150, 150); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&workspace); -#endif qApp->processEvents(); QTRY_COMPARE(workspace.size(), QSize(150, 150)); diff --git a/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp index d5d125a..b897d8f 100644 --- a/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp +++ b/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp @@ -1648,9 +1648,9 @@ void tst_QMdiSubWindow::resizeTimer() QMdiArea mdiArea; QMdiSubWindow *subWindow = mdiArea.addSubWindow(new QWidget); mdiArea.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&mdiArea); -#endif + QTest::qWaitForWindowShown(&mdiArea); + QTest::qWait(250); + EventSpy timerEventSpy(subWindow, QEvent::Timer); QCOMPARE(timerEventSpy.count(), 0); diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp index f5d5040..71218a3 100644 --- a/tests/auto/qtableview/tst_qtableview.cpp +++ b/tests/auto/qtableview/tst_qtableview.cpp @@ -2339,6 +2339,7 @@ void tst_QTableView::scrollTo() // resizing to this size will ensure that there can ONLY_BE_ONE_CELL inside the view. QSize forcedSize(columnWidth * 2, rowHeight * 2); view.resize(forcedSize); + QTest::qWaitForWindowShown(&view); QTest::qWait(0); QTRY_COMPARE(view.size(), forcedSize); diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 4536ed7..a9fa9bc 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -1756,11 +1756,11 @@ void tst_QWidget::setTabOrder() container.show(); container.activateWindow(); + qApp->setActiveWindow(&container); #ifdef Q_WS_X11 QTest::qWaitForWindowShown(&container); QTest::qWait(50); #endif - qApp->setActiveWindow(&container); QTest::qWait(100); @@ -2316,8 +2316,9 @@ void tst_QWidget::showMinimizedKeepsFocus() QTRY_COMPARE(qApp->focusWidget(), static_cast(0)); window.showNormal(); - QTest::qWait(30); qApp->setActiveWindow(&window); + QTest::qWaitForWindowShown(&window); + QTest::qWait(30); #ifdef Q_WS_MAC if (!macHasAccessToWindowsServer()) QEXPECT_FAIL("", "When not having WindowServer access, we lose focus.", Continue); @@ -3116,7 +3117,7 @@ void tst_QWidget::saveRestoreGeometry() widget.resize(size); widget.show(); QTest::qWaitForWindowShown(&widget); - QTest::qWait(100); + QTest::qWait(200); QTRY_COMPARE(widget.geometry().size(), size); QRect geom; @@ -3126,15 +3127,15 @@ void tst_QWidget::saveRestoreGeometry() geom = widget.geometry(); widget.setWindowState(widget.windowState() | Qt::WindowFullScreen); QTRY_VERIFY((widget.windowState() & Qt::WindowFullScreen)); - QTest::qWait(100); + QTest::qWait(200); QVERIFY(widget.restoreGeometry(savedGeometry)); - QTest::qWait(20); + QTest::qWait(120); QTRY_VERIFY(!(widget.windowState() & Qt::WindowFullScreen)); QTRY_COMPARE(widget.geometry(), geom); //Restore to full screen widget.setWindowState(widget.windowState() | Qt::WindowFullScreen); - QTest::qWait(20); + QTest::qWait(120); QTRY_VERIFY((widget.windowState() & Qt::WindowFullScreen)); QTest::qWait(200); savedGeometry = widget.saveGeometry(); @@ -3165,7 +3166,7 @@ void tst_QWidget::saveRestoreGeometry() QTest::qWait(20); QTRY_VERIFY((widget.windowState() & Qt::WindowMaximized)); QTRY_VERIFY(widget.geometry() != geom); - QTest::qWait(100); + QTest::qWait(200); QVERIFY(widget.restoreGeometry(savedGeometry)); QTest::qWait(20); QTRY_COMPARE(widget.geometry(), geom); @@ -5388,7 +5389,7 @@ void tst_QWidget::showAndMoveChild() child.move(desktopDimensions.width()/2, desktopDimensions.height()/2); qApp->processEvents(); - verifyColor(child.geometry().translated(tlwOffset), Qt::blue); + verifyColor(child.geometry().translated(tlwOffset), Qt::blue); verifyColor(QRegion(parent.geometry()) - child.geometry().translated(tlwOffset), Qt::red); } @@ -6407,7 +6408,7 @@ void tst_QWidget::render() qApp->processEvents(); qApp->sendPostedEvents(); - QTest::qWait(100); + QTest::qWait(250); QImage sourceImage = QPixmap::grabWidget(&source).toImage(); qApp->processEvents(); @@ -6513,6 +6514,7 @@ void tst_QWidget::renderInvisible() dummyFocusWidget.show(); QTest::qWaitForWindowShown(&dummyFocusWidget); qApp->processEvents(); + QTest::qWait(100); // Create normal reference image. const QSize calendarSize = calendar->size(); diff --git a/tests/auto/qwindowsurface/tst_qwindowsurface.cpp b/tests/auto/qwindowsurface/tst_qwindowsurface.cpp index 2c5ba72..0a6b7ad 100644 --- a/tests/auto/qwindowsurface/tst_qwindowsurface.cpp +++ b/tests/auto/qwindowsurface/tst_qwindowsurface.cpp @@ -230,7 +230,7 @@ void tst_QWindowSurface::grabWidget() parentWidget.show(); QTest::qWaitForWindowShown(&parentWidget); - QTest::qWait(20); + QTest::qWait(120); QPixmap parentPixmap = parentWidget.windowSurface()->grabWidget(&parentWidget); QPixmap childPixmap = childWidget.windowSurface()->grabWidget(&childWidget); -- cgit v0.12 From b445a770d39889000021ebdd8f25286e81282c58 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Mon, 28 Sep 2009 19:55:57 +1000 Subject: Fix qdoc error. Reviewed-by: Trust Me --- src/gui/image/qpixmap_s60.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index d5ba589..123777c 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -725,7 +725,7 @@ void QS60PixmapData::endDataAccess(bool readOnly) const /*! \since 4.6 - Returns a QPixmap that wraps given \c RSgImage \a graphics resource. + Returns a QPixmap that wraps given \a sgImage graphics resource. The data should be valid even when original RSgImage handle has been closed. -- cgit v0.12 From 3e8592661f7607542c5a0df4c5f735716a0ec09d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Fri, 18 Sep 2009 13:44:05 +0200 Subject: doc: Fixed three /sa that should be \sa --- src/gui/text/qtextobject.cpp | 2 +- src/multimedia/audio/qaudioinput.cpp | 2 +- src/multimedia/audio/qaudiooutput.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp index b6ff39f..d9438fd 100644 --- a/src/gui/text/qtextobject.cpp +++ b/src/gui/text/qtextobject.cpp @@ -1370,7 +1370,7 @@ int QTextBlock::firstLineNumber() const Sets the line count to \a count. -/sa lineCount() +\sa lineCount() */ void QTextBlock::setLineCount(int count) { diff --git a/src/multimedia/audio/qaudioinput.cpp b/src/multimedia/audio/qaudioinput.cpp index 858846f..7a3be23 100644 --- a/src/multimedia/audio/qaudioinput.cpp +++ b/src/multimedia/audio/qaudioinput.cpp @@ -184,7 +184,7 @@ QAudioInput::~QAudioInput() Passing a QIODevice allows the data to be transfered without any extra code. All that is required is to open the QIODevice. - /sa QIODevice + \sa QIODevice */ QIODevice* QAudioInput::start(QIODevice* device) diff --git a/src/multimedia/audio/qaudiooutput.cpp b/src/multimedia/audio/qaudiooutput.cpp index 3d3f5f5..81b9496 100644 --- a/src/multimedia/audio/qaudiooutput.cpp +++ b/src/multimedia/audio/qaudiooutput.cpp @@ -195,7 +195,7 @@ QAudioFormat QAudioOutput::format() const Passing a QIODevice allows the data to be transfered without any extra code. All that is required is to open the QIODevice. - /sa QIODevice + \sa QIODevice */ QIODevice* QAudioOutput::start(QIODevice* device) -- cgit v0.12 From fcb270e961b0edd2f2fa33954e20f9a284048e4a Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 28 Sep 2009 13:01:37 +0300 Subject: Fixed style dependent failures for S60 in QGraphicsLinearLayout test. Since S60 does not compile QPlastiqueStyle, we use QWindowsStyle Reviewed-by: TrustMe --- tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp index 9c58b24..4e46819 100644 --- a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp +++ b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp @@ -143,9 +143,11 @@ public: // It is only called once. void tst_QGraphicsLinearLayout::initTestCase() { -#ifndef Q_WS_S60 // since the style will influence the results, we have to ensure // that the tests are run using the same style on all platforms +#ifdef Q_WS_S60 + QApplication::setStyle(new QWindowsStyle); +#else QApplication::setStyle(new QPlastiqueStyle); #endif } -- cgit v0.12 From c912b0234ead0e35a969b5600a61c77b60e18aa6 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Mon, 28 Sep 2009 11:54:06 +0200 Subject: Make sure the correct soft key is triggered. In cases where there are both softkey actions as well as "normal" actions, we need to be sure to skip over the none softkey actions since they should not be a part of the softkey framework and the 'index' will be out of sync. Reviewed-by: Sami Merila --- src/gui/kernel/qsoftkeymanager.cpp | 12 ++++++-- tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp | 36 ++++++++++++++++++++++ 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 45ecb5a..7874622 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -247,9 +247,15 @@ bool QSoftKeyManager::handleCommand(int command) if (command >= s60CommandStart && QSoftKeyManagerPrivate::softKeySource) { int index = command - s60CommandStart; const QList& softKeys = QSoftKeyManagerPrivate::softKeySource->actions(); - if (index < softKeys.count()) { - softKeys.at(index)->activate(QAction::Trigger); - return true; + for (int i = 0, j = 0; i < softKeys.count(); ++i) { + QAction *action = softKeys.at(i); + if (action->softKeyRole() != QAction::NoSoftKey) { + if (j == index) { + action->activate(QAction::Trigger); + return true; + } + j++; + } } } diff --git a/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp b/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp index 81ef498..8788117 100644 --- a/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp +++ b/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp @@ -42,6 +42,8 @@ #include #include "qevent.h" +#include "qdialog.h" +#include "qdialogbuttonbox.h" #include "private/qsoftkeymanager_p.h" class tst_QSoftKeyManager : public QObject @@ -59,6 +61,7 @@ public slots: void cleanup(); private slots: void updateSoftKeysCompressed(); + void handleCommand(); }; class EventListener : public QObject @@ -133,6 +136,39 @@ void tst_QSoftKeyManager::updateSoftKeysCompressed() QVERIFY(listener.numUpdateSoftKeys == 1); } +/* + This tests that when the S60 environment sends us a command + that it actually gets mapped to the correct action. +*/ +void tst_QSoftKeyManager::handleCommand() +{ + QDialog w; + QDialogButtonBox *buttons = new QDialogButtonBox( + QDialogButtonBox::Ok | QDialogButtonBox::Cancel, + Qt::Horizontal, + &w); + + w.show(); + QApplication::processEvents(); + + QCOMPARE(w.actions().count(), 2); + + QSignalSpy spy0(w.actions()[0], SIGNAL(triggered())); + QSignalSpy spy1(w.actions()[1], SIGNAL(triggered())); + + // These should work eventually, but do not yet +// QTest::keyPress(&w, Qt::Key_Context1); +// QTest::keyPress(&w, Qt::Key_Context2); + + qApp->symbianHandleCommand(6000); + qApp->symbianHandleCommand(6001); + + QApplication::processEvents(); + + QCOMPARE(spy0.count(), 1); + QCOMPARE(spy1.count(), 1); +} + QTEST_MAIN(tst_QSoftKeyManager) #include "tst_qsoftkeymanager.moc" -- cgit v0.12 From 994daec967ea0e3db2fa6093efe1274f9a79d2ff Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 28 Sep 2009 10:46:29 +0200 Subject: compile fix with namespace Reviewed-by: sroedal --- src/gui/painting/qpaintbuffer.cpp | 5 +++++ src/gui/painting/qpaintbuffer_p.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/gui/painting/qpaintbuffer.cpp b/src/gui/painting/qpaintbuffer.cpp index 1038f74..57e7cd0 100644 --- a/src/gui/painting/qpaintbuffer.cpp +++ b/src/gui/painting/qpaintbuffer.cpp @@ -49,6 +49,8 @@ //#define QPAINTBUFFER_DEBUG_DRAW +QT_BEGIN_NAMESPACE + extern int qt_defaultDpiX(); extern int qt_defaultDpiY(); extern void qt_format_text(const QFont &font, @@ -1740,7 +1742,9 @@ struct QPaintBufferCacheEntry QVariant::Type type; quint64 cacheKey; }; +QT_END_NAMESPACE Q_DECLARE_METATYPE(QPaintBufferCacheEntry) +QT_BEGIN_NAMESPACE QDataStream &operator<<(QDataStream &stream, const QPaintBufferCacheEntry &entry) { @@ -1832,3 +1836,4 @@ QDataStream &operator>>(QDataStream &stream, QPaintBuffer &buffer) return stream; } +QT_END_NAMESPACE diff --git a/src/gui/painting/qpaintbuffer_p.h b/src/gui/painting/qpaintbuffer_p.h index a80fa8d..6a7ac73 100644 --- a/src/gui/painting/qpaintbuffer_p.h +++ b/src/gui/painting/qpaintbuffer_p.h @@ -59,6 +59,8 @@ #include #include +QT_BEGIN_NAMESPACE + class QPaintBufferPrivate; class QPaintBufferPlayback; @@ -440,4 +442,6 @@ private: FreeFunc free; }; +QT_END_NAMESPACE + #endif // QPAINTBUFFER_P_H -- cgit v0.12 From 857a77fe62b9ad3165cf67a5c2e869e5e7dd9e36 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 28 Sep 2009 12:05:54 +0200 Subject: compile fix with namespaced qt Reviewed-by: Simon Hausmann --- src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h | 5 +++-- .../javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp | 3 ++- src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp | 4 ++-- src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h | 4 +++- src/script/bridge/qscriptactivationobject.cpp | 2 +- src/script/bridge/qscriptfunction.cpp | 4 ++-- src/script/bridge/qscriptobject.cpp | 4 ++-- 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h index 8072162..811818d 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h @@ -43,11 +43,12 @@ namespace JSC { #if PLATFORM(QT) #ifdef QT_BUILD_SCRIPT_LIB - virtual void scriptUnload(qint64 id) + virtual void scriptUnload(QT_PREPEND_NAMESPACE(qint64) id) { UNUSED_PARAM(id); }; - virtual void scriptLoad(qint64 id, const UString &program, + virtual void scriptLoad(QT_PREPEND_NAMESPACE(qint64) id, + const UString &program, const UString &fileName, int baseLineNumber) { UNUSED_PARAM(id); diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp index 7d3a84d..ec242cc 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp @@ -3469,7 +3469,8 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi structure = callDataScopeChain->globalObject()->emptyObjectStructure(); #ifdef QT_BUILD_SCRIPT_LIB // ### world-class hack - QScriptObject* newObject = new (globalData) QScriptObject(structure); + QT_PREPEND_NAMESPACE(QScriptObject)* newObject + = new (globalData) QT_PREPEND_NAMESPACE(QScriptObject)(structure); #else JSObject* newObject = new (globalData) JSObject(structure); #endif diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp index a110dcd..0b147df 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp @@ -1777,7 +1777,7 @@ DEFINE_STUB_FUNCTION(JSObject*, op_construct_JSConstruct) else structure = constructor->scope().node()->globalObject()->emptyObjectStructure(); #ifdef QT_BUILD_SCRIPT_LIB - return new (stackFrame.globalData) QScriptObject(structure); + return new (stackFrame.globalData) QT_PREPEND_NAMESPACE(QScriptObject)(structure); #else return new (stackFrame.globalData) JSObject(structure); #endif @@ -3108,4 +3108,4 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, vm_throw) } // namespace JSC -#endif // ENABLE(JIT) + #endif // ENABLE(JIT) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h index b7af4f8..4d327cc 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h @@ -20,10 +20,12 @@ #ifndef QWEBINSPECTOR_P_H #define QWEBINSPECTOR_P_H +QT_BEGIN_NAMESPACE class QSize; +class QWidget; +QT_END_NAMESPACE class QWebInspector; class QWebPage; -class QWidget; class QWebInspectorPrivate { public: diff --git a/src/script/bridge/qscriptactivationobject.cpp b/src/script/bridge/qscriptactivationobject.cpp index 7982982..edccb3e 100644 --- a/src/script/bridge/qscriptactivationobject.cpp +++ b/src/script/bridge/qscriptactivationobject.cpp @@ -46,7 +46,7 @@ namespace JSC { - ASSERT_CLASS_FITS_IN_CELL(QScript::QScriptActivationObject); + ASSERT_CLASS_FITS_IN_CELL(QT_PREPEND_NAMESPACE(QScript::QScriptActivationObject)); } QT_BEGIN_NAMESPACE diff --git a/src/script/bridge/qscriptfunction.cpp b/src/script/bridge/qscriptfunction.cpp index 5f419ff..d3767bf 100644 --- a/src/script/bridge/qscriptfunction.cpp +++ b/src/script/bridge/qscriptfunction.cpp @@ -55,8 +55,8 @@ namespace JSC { -ASSERT_CLASS_FITS_IN_CELL(QScript::FunctionWrapper); -ASSERT_CLASS_FITS_IN_CELL(QScript::FunctionWithArgWrapper); +ASSERT_CLASS_FITS_IN_CELL(QT_PREPEND_NAMESPACE(QScript::FunctionWrapper)); +ASSERT_CLASS_FITS_IN_CELL(QT_PREPEND_NAMESPACE(QScript::FunctionWithArgWrapper)); } QT_BEGIN_NAMESPACE diff --git a/src/script/bridge/qscriptobject.cpp b/src/script/bridge/qscriptobject.cpp index 0d899f8..55644fe 100644 --- a/src/script/bridge/qscriptobject.cpp +++ b/src/script/bridge/qscriptobject.cpp @@ -46,8 +46,8 @@ namespace JSC { //QT_USE_NAMESPACE -ASSERT_CLASS_FITS_IN_CELL(QScriptObject); -ASSERT_CLASS_FITS_IN_CELL(QScriptObjectPrototype); +ASSERT_CLASS_FITS_IN_CELL(QT_PREPEND_NAMESPACE(QScriptObject)); +ASSERT_CLASS_FITS_IN_CELL(QT_PREPEND_NAMESPACE(QScriptObjectPrototype)); } QT_BEGIN_NAMESPACE -- cgit v0.12 From 0d781e36b1fecac919cb4ade55fd03e0f63b87c6 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 28 Sep 2009 13:19:00 +0300 Subject: Fixed qsharedmemory autotest compile break for Symbian OS Reviewed-by: TrustMe --- tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro | 4 ++-- tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro b/tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro index 2628f19..e232443 100644 --- a/tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro +++ b/tests/auto/qsharedmemory/qsystemlock/qsystemlock.pro @@ -5,9 +5,9 @@ include(../src/src.pri) win32: CONFIG += console mac:CONFIG -= app_bundle -wince*|symbian { +wince* { DEFINES += SRCDIR=\\\"\\\" -} else { +} else:!symbian { DEFINES += SRCDIR=\\\"$$PWD\\\" } diff --git a/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp b/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp index 87fc3ee..35f05d1 100644 --- a/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp +++ b/tests/auto/qsharedmemory/qsystemlock/tst_qsystemlock.cpp @@ -46,6 +46,13 @@ //TESTED_CLASS= //TESTED_FILES= +#ifdef Q_OS_SYMBIAN +// In Symbian OS test data is located in applications private dir +// And underlying Open C have application private dir in default search path +#define SRCDIR "" +#endif + + #define EXISTING_SHARE "existing" class tst_QSystemLock : public QObject @@ -223,7 +230,7 @@ void tst_QSystemLock::processes() QCOMPARE(consumers.first()->exitCode(), 0); delete consumers.takeFirst(); } - QCOMPARE(failedProcesses, unsigned int(0)); + QCOMPARE(failedProcesses, (unsigned int)(0)); } QTEST_MAIN(tst_QSystemLock) -- cgit v0.12 From fe4dc49c8f4f201f7286027adb2ba21ffebc14cc Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 28 Sep 2009 13:29:43 +0300 Subject: Fixed qsharedpointer auto test build break for Symbian OS. RVCT has problems with scoping, the similar workaround has been used in qhash.h also. Reviewed-by: Janne Koskinen --- src/corelib/tools/qsharedpointer_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index 4f05eda..2acbf17 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -478,7 +478,7 @@ public: { BaseClass::internalSet(other.d, other.value); return *this; } inline void swap(QSharedPointer &other) - { internalSwap(other); } + { QSharedPointer::internalSwap(other); } template QSharedPointer staticCast() const -- cgit v0.12 From 196ca2202d74538ab8d34e47ec8966d4b0a0b8e2 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Mon, 28 Sep 2009 12:19:10 +0200 Subject: QEventLoop::ExcludeUserInputEvents should not allow the user to close the window These types of input events are not handled by the normal mouse and key event handlers on X11 and Windows. Add special cases for them to make sure that they are not delivered while ExcludeUserInputEvents is set. Task-number: QTBUG-4242 Reviewed-by: Simon Hausmann --- src/corelib/kernel/qeventdispatcher_win.cpp | 3 ++- src/gui/kernel/qeventdispatcher_x11.cpp | 2 +- src/gui/kernel/qguieventdispatcher_glib.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index 83114dc..0474bf3 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -678,7 +678,8 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags) || (msg.message >= WM_MOUSEFIRST && msg.message <= WM_MOUSELAST) || msg.message == WM_MOUSEWHEEL - || msg.message == WM_MOUSEHWHEEL)) { + || msg.message == WM_MOUSEHWHEEL + || msg.message == WM_CLOSE)) { // queue user input events for later processing haveMessage = false; d->queuedUserInputEvents.append(msg); diff --git a/src/gui/kernel/qeventdispatcher_x11.cpp b/src/gui/kernel/qeventdispatcher_x11.cpp index ce1a11f..59977ec 100644 --- a/src/gui/kernel/qeventdispatcher_x11.cpp +++ b/src/gui/kernel/qeventdispatcher_x11.cpp @@ -105,7 +105,7 @@ bool QEventDispatcherX11::processEvents(QEventLoop::ProcessEventsFlags flags) // _qt_scrolldone protocols, queue all other // client messages if (event.xclient.format == 32) { - if (event.xclient.message_type == ATOM(WM_PROTOCOLS) || + if (event.xclient.message_type == ATOM(WM_PROTOCOLS) && (Atom) event.xclient.data.l[0] == ATOM(WM_TAKE_FOCUS)) { break; } else if (event.xclient.message_type == ATOM(_QT_SCROLL_DONE)) { diff --git a/src/gui/kernel/qguieventdispatcher_glib.cpp b/src/gui/kernel/qguieventdispatcher_glib.cpp index 6e98428..f8a638c 100644 --- a/src/gui/kernel/qguieventdispatcher_glib.cpp +++ b/src/gui/kernel/qguieventdispatcher_glib.cpp @@ -120,7 +120,7 @@ static gboolean x11EventSourceDispatch(GSource *s, GSourceFunc callback, gpointe // _qt_scrolldone protocols, queue all other // client messages if (event.xclient.format == 32) { - if (event.xclient.message_type == ATOM(WM_PROTOCOLS) || + if (event.xclient.message_type == ATOM(WM_PROTOCOLS) && (Atom) event.xclient.data.l[0] == ATOM(WM_TAKE_FOCUS)) { break; } else if (event.xclient.message_type == ATOM(_QT_SCROLL_DONE)) { -- cgit v0.12 From f85545a53bae8cbfbc0192d4730d181d7525a65d Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 28 Sep 2009 12:46:00 +0200 Subject: Some of my 4.5.3 changes Reviewed-by: TrustMe --- dist/changes-4.5.3 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dist/changes-4.5.3 b/dist/changes-4.5.3 index 831106a..d797b4c 100644 --- a/dist/changes-4.5.3 +++ b/dist/changes-4.5.3 @@ -37,9 +37,24 @@ Third party components * [258230] Fixed inconsistencies in value returned from QDirIterator::next(). +- QColorDialog + * [256164] Fixed the setting of alpha values in QColorDialog. + - QDoubleSpinBox * [255019] Fixed a crash when using large value for decimals. +- QInputDialog + * [255502] Fixed bug in getDouble() + +- QNetworkAccessManager + * [256240] Proper handling of HTTP redirect in AlwaysCache mode. + * [257662] Fix timing issues that could trigger double sending of an + HTTP request. + * [256630] Fix usage of QProgressDialog together with QNetworkReply. + +- QSslCertificate + * [256066] Fix loading of a PEM when the length was a multiple of 64. + - QTemporaryFile * [260165] Fixed a bug where temporary files would be left behind when copying a file to a non-existing directory. -- cgit v0.12 From 76494c76c482edfe89639491317d008ea3e2a9d0 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Mon, 28 Sep 2009 12:49:10 +0200 Subject: Remove doc warning about UpdateSoftKeys. qdoc was giving attitude about this undocumented event type so mark it as omitted in the documentation. Task-number: QTBUG-4601 Reviewed-by: TrustMe --- src/corelib/kernel/qcoreevent.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 746474c..a7a3b5d 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -271,6 +271,7 @@ QT_BEGIN_NAMESPACE \omitvalue CocoaRequestModal \omitvalue Signal \omitvalue SymbianDeferredFocusChanged + \omitvalue UpdateSoftKeys \omitvalue NativeGesture */ -- cgit v0.12 From 9021dd294b4d998192ed9b06ce86be6ed8ffddf2 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Mon, 28 Sep 2009 12:09:02 +0200 Subject: Fixed unwanted recursion when calling openGLVersionFlags(). Reviewed-by: Gunnar --- src/gui/kernel/qwidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 53ef682..2397793 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -10145,7 +10145,8 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) "QWidgetPrivate::high_attributes[] too small to contain all attributes in WidgetAttribute"); #ifdef Q_WS_WIN - if (attribute == Qt::WA_PaintOnScreen && on) { + // ### Don't use PaintOnScreen+paintEngine() to do native painting in 5.0 + if (attribute == Qt::WA_PaintOnScreen && on && !inherits("QGLWidget")) { // see qwidget_win.cpp, ::paintEngine for details paintEngine(); if (d->noPaintOnScreen) -- cgit v0.12 From 587c004ce82844980c679547f86109174cbe6202 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Mon, 28 Sep 2009 13:13:47 +0200 Subject: Make QSignalEvent and QWrappedEvent inner classes of QStateMachine Those two classes are specific to the state machine framework, but their names were so generic that we felt they were polluting the Q-namespace. They are now QStateMachine::SignalEvent and QStateMachine::WrappedEvent. Reviewed-by: Eskil Abrahamsen Blomfeldt --- demos/sub-attaq/states.cpp | 5 +- doc/src/examples/rogue.qdoc | 2 +- doc/src/frameworks-technologies/statemachine.qdoc | 6 +- doc/src/snippets/statemachine/eventtest.cpp | 2 +- examples/animation/stickman/lifecycle.cpp | 2 +- examples/statemachine/factorial/main.cpp | 6 +- examples/statemachine/rogue/movementtransition.h | 6 +- src/corelib/kernel/qcoreevent.cpp | 4 +- src/corelib/statemachine/qeventtransition.cpp | 12 ++-- src/corelib/statemachine/qsignalevent.h | 83 ----------------------- src/corelib/statemachine/qsignaltransition.cpp | 15 ++-- src/corelib/statemachine/qstatemachine.cpp | 49 +++++++------ src/corelib/statemachine/qstatemachine.h | 36 +++++++++- src/corelib/statemachine/qwrappedevent.h | 80 ---------------------- src/corelib/statemachine/statemachine.pri | 4 +- src/gui/statemachine/qkeyeventtransition.cpp | 4 +- src/gui/statemachine/qmouseeventtransition.cpp | 4 +- tests/auto/qstatemachine/tst_qstatemachine.cpp | 4 +- 18 files changed, 94 insertions(+), 230 deletions(-) delete mode 100644 src/corelib/statemachine/qsignalevent.h delete mode 100644 src/corelib/statemachine/qwrappedevent.h diff --git a/demos/sub-attaq/states.cpp b/demos/sub-attaq/states.cpp index 4a9d845..10c173e 100644 --- a/demos/sub-attaq/states.cpp +++ b/demos/sub-attaq/states.cpp @@ -54,7 +54,6 @@ #include #include #include -#include #include PlayState::PlayState(GraphicsScene *scene, QState *parent) @@ -295,7 +294,7 @@ bool UpdateScoreTransition::eventTest(QEvent *event) if (!QSignalTransition::eventTest(event)) return false; else { - QSignalEvent *se = static_cast(event); + QStateMachine::SignalEvent *se = static_cast(event); game->score += se->arguments().at(0).toInt(); scene->progressItem->setScore(game->score); return true; @@ -315,7 +314,7 @@ bool WinTransition::eventTest(QEvent *event) if (!QSignalTransition::eventTest(event)) return false; else { - QSignalEvent *se = static_cast(event); + QStateMachine::SignalEvent *se = static_cast(event); game->score += se->arguments().at(0).toInt(); scene->progressItem->setScore(game->score); return true; diff --git a/doc/src/examples/rogue.qdoc b/doc/src/examples/rogue.qdoc index 3eb9249..4f9dc3f 100644 --- a/doc/src/examples/rogue.qdoc +++ b/doc/src/examples/rogue.qdoc @@ -194,7 +194,7 @@ \snippet examples/statemachine/rogue/movementtransition.h 1 - The KeyPress events come wrapped in \l{QWrappedEvent}s. \c event + The KeyPress events come wrapped in \l{QStateMachine::WrappedEvent}s. \c event must be confirmed to be a wrapped event because Qt uses other events internally. After that, it is simply a matter of checking which key has been pressed. diff --git a/doc/src/frameworks-technologies/statemachine.qdoc b/doc/src/frameworks-technologies/statemachine.qdoc index 904b551..2b137dd 100644 --- a/doc/src/frameworks-technologies/statemachine.qdoc +++ b/doc/src/frameworks-technologies/statemachine.qdoc @@ -308,9 +308,9 @@ A QStateMachine runs its own event loop. For signal transitions (QSignalTransition objects), QStateMachine automatically posts a - QSignalEvent to itself when it intercepts the corresponding signal; - similarly, for QObject event transitions (QEventTransition objects) a - QWrappedEvent is posted. + QStateMachine::SignalEvent to itself when it intercepts the corresponding + signal; similarly, for QObject event transitions (QEventTransition objects) + a QStateMachine::WrappedEvent is posted. You can post your own events to the state machine using QStateMachine::postEvent(). diff --git a/doc/src/snippets/statemachine/eventtest.cpp b/doc/src/snippets/statemachine/eventtest.cpp index b6397ba..817dbfc 100644 --- a/doc/src/snippets/statemachine/eventtest.cpp +++ b/doc/src/snippets/statemachine/eventtest.cpp @@ -52,7 +52,7 @@ protected: bool eventTest(QEvent *event) { if (event->type() == QEvent::Wrapped) { - QEvent *wrappedEvent = static_cast(event)->event(); + QEvent *wrappedEvent = static_cast(event)->event(); if (wrappedEvent->type() == QEvent::KeyPress) { QKeyEvent *keyEvent = static_cast(wrappedEvent); // Do your event test diff --git a/examples/animation/stickman/lifecycle.cpp b/examples/animation/stickman/lifecycle.cpp index f5dca74..250fb85 100644 --- a/examples/animation/stickman/lifecycle.cpp +++ b/examples/animation/stickman/lifecycle.cpp @@ -64,7 +64,7 @@ public: virtual bool eventTest(QEvent *e) { if (QSignalTransition::eventTest(e)) { - QVariant key = static_cast(e)->arguments().at(0); + QVariant key = static_cast(e)->arguments().at(0); return (key.toInt() == int(m_key)); } diff --git a/examples/statemachine/factorial/main.cpp b/examples/statemachine/factorial/main.cpp index 54f4ec0..018b84f 100644 --- a/examples/statemachine/factorial/main.cpp +++ b/examples/statemachine/factorial/main.cpp @@ -98,13 +98,13 @@ public: { if (!QSignalTransition::eventTest(e)) return false; - QSignalEvent *se = static_cast(e); + QStateMachine::SignalEvent *se = static_cast(e); return se->arguments().at(0).toInt() > 1; } virtual void onTransition(QEvent *e) { - QSignalEvent *se = static_cast(e); + QStateMachine::SignalEvent *se = static_cast(e); int x = se->arguments().at(0).toInt(); int fac = m_fact->property("fac").toInt(); m_fact->setProperty("fac", x * fac); @@ -128,7 +128,7 @@ public: { if (!QSignalTransition::eventTest(e)) return false; - QSignalEvent *se = static_cast(e); + QStateMachine::SignalEvent *se = static_cast(e); return se->arguments().at(0).toInt() <= 1; } diff --git a/examples/statemachine/rogue/movementtransition.h b/examples/statemachine/rogue/movementtransition.h index dbaf8d9..b919360 100644 --- a/examples/statemachine/rogue/movementtransition.h +++ b/examples/statemachine/rogue/movementtransition.h @@ -62,8 +62,8 @@ public: protected: bool eventTest(QEvent *event) { if (event->type() == QEvent::Wrapped && - static_cast(event)->event()->type() == QEvent::KeyPress) { - QEvent *wrappedEvent = static_cast(event)->event(); + static_cast(event)->event()->type() == QEvent::KeyPress) { + QEvent *wrappedEvent = static_cast(event)->event(); QKeyEvent *keyEvent = static_cast(wrappedEvent); int key = keyEvent->key(); @@ -78,7 +78,7 @@ protected: //![2] void onTransition(QEvent *event) { QKeyEvent *keyEvent = static_cast( - static_cast(event)->event()); + static_cast(event)->event()); int key = keyEvent->key(); switch (key) { diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index a7a3b5d..185c305 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -192,6 +192,7 @@ QT_BEGIN_NAMESPACE \value ShortcutOverride Key press in child, for overriding shortcut key handling (QKeyEvent). \value Show Widget was shown on screen (QShowEvent). \value ShowToParent A child widget has been shown. + \value Signal A signal delivered to a state machine (QStateMachine::SignalEvent). \value SockAct Socket activated, used to implement QSocketNotifier. \value StatusTip A status tip is requested (QStatusTipEvent). \value StyleChange Widget's style has been changed. @@ -220,7 +221,7 @@ QT_BEGIN_NAMESPACE \value WindowStateChange The \l{QWidget::windowState()}{window's state} (minimized, maximized or full-screen) has changed (QWindowStateChangeEvent). \value WindowTitleChange The window title has changed. \value WindowUnblocked The window is unblocked after a modal dialog exited. - \value Wrapped The event is a wrapper for, i.e., contains, another event (QWrappedEvent). + \value Wrapped The event is a wrapper for, i.e., contains, another event (QStateMachine::WrappedEvent). \value ZOrderChange The widget's z-order has changed. This event is never sent to top level windows. \value KeyboardLayoutChange The keyboard layout has changed. \value DynamicPropertyChange A dynamic property was added, changed or removed from the object. @@ -269,7 +270,6 @@ QT_BEGIN_NAMESPACE \omitvalue NetworkReplyUpdated \omitvalue FutureCallOut \omitvalue CocoaRequestModal - \omitvalue Signal \omitvalue SymbianDeferredFocusChanged \omitvalue UpdateSoftKeys \omitvalue NativeGesture diff --git a/src/corelib/statemachine/qeventtransition.cpp b/src/corelib/statemachine/qeventtransition.cpp index 2ce7b4a..f278371 100644 --- a/src/corelib/statemachine/qeventtransition.cpp +++ b/src/corelib/statemachine/qeventtransition.cpp @@ -44,7 +44,6 @@ #ifndef QT_NO_STATEMACHINE #include "qeventtransition_p.h" -#include "qwrappedevent.h" #include "qstate.h" #include "qstate_p.h" #include "qstatemachine.h" @@ -83,10 +82,11 @@ QT_BEGIN_NAMESPACE \section1 Subclassing When reimplementing the eventTest() function, you should first call the base - implementation to verify that the event is a QWrappedEvent for the proper - object and event type. You may then cast the event to a QWrappedEvent and - get the original event by calling QWrappedEvent::event(), and perform - additional checks on that object. + implementation to verify that the event is a QStateMachine::WrappedEvent for + the proper object and event type. You may then cast the event to a + QStateMachine::WrappedEvent and get the original event by calling + QStateMachine::WrappedEvent::event(), and perform additional checks on that + object. \sa QState::addTransition() */ @@ -232,7 +232,7 @@ bool QEventTransition::eventTest(QEvent *event) { Q_D(const QEventTransition); if (event->type() == QEvent::Wrapped) { - QWrappedEvent *we = static_cast(event); + QStateMachine::WrappedEvent *we = static_cast(event); return (we->object() == d->object) && (we->event()->type() == d->eventType); } diff --git a/src/corelib/statemachine/qsignalevent.h b/src/corelib/statemachine/qsignalevent.h deleted file mode 100644 index 6d2bd63..0000000 --- a/src/corelib/statemachine/qsignalevent.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** 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 QSIGNALEVENT_H -#define QSIGNALEVENT_H - -#include - -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Core) - -#ifndef QT_NO_STATEMACHINE - -class Q_CORE_EXPORT QSignalEvent : public QEvent -{ -public: - QSignalEvent(QObject *sender, int signalIndex, - const QList &arguments); - ~QSignalEvent(); - - inline QObject *sender() const { return m_sender; } - inline int signalIndex() const { return m_signalIndex; } - inline QList arguments() const { return m_arguments; } - -private: - QObject *m_sender; - int m_signalIndex; - QList m_arguments; - - friend class QSignalTransitionPrivate; -}; - -#endif //QT_NO_STATEMACHINE - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/corelib/statemachine/qsignaltransition.cpp b/src/corelib/statemachine/qsignaltransition.cpp index 74655e6..9811725 100644 --- a/src/corelib/statemachine/qsignaltransition.cpp +++ b/src/corelib/statemachine/qsignaltransition.cpp @@ -44,7 +44,6 @@ #ifndef QT_NO_STATEMACHINE #include "qsignaltransition_p.h" -#include "qsignalevent.h" #include "qstate.h" #include "qstate_p.h" #include "qstatemachine.h" @@ -68,7 +67,7 @@ QT_BEGIN_NAMESPACE You can subclass QSignalTransition and reimplement eventTest() to make a signal transition conditional; the event object passed to eventTest() will - be a QSignalEvent object. Example: + be a QStateMachine::SignalEvent object. Example: \code class CheckedTransition : public QSignalTransition @@ -80,7 +79,7 @@ QT_BEGIN_NAMESPACE bool eventTest(QEvent *e) const { if (!QSignalTransition::eventTest(e)) return false; - QSignalEvent *se = static_cast(e); + QStateMachine::SignalEvent *se = static_cast(e); return (se->arguments().at(0).toInt() == Qt::Checked); } }; @@ -212,9 +211,9 @@ void QSignalTransition::setSignal(const QByteArray &signal) /*! \reimp - The \a event is a QSignalEvent object. The default implementation returns - true if the event's sender and signal index match this transition, and - returns false otherwise. + The default implementation returns true if the \a event is a + QStateMachine::SignalEvent object and the event's sender and signal index + match this transition, and returns false otherwise. */ bool QSignalTransition::eventTest(QEvent *event) { @@ -222,7 +221,7 @@ bool QSignalTransition::eventTest(QEvent *event) if (event->type() == QEvent::Signal) { if (d->signalIndex == -1) return false; - QSignalEvent *se = static_cast(event); + QStateMachine::SignalEvent *se = static_cast(event); return (se->sender() == d->sender) && (se->signalIndex() == d->signalIndex); } @@ -250,7 +249,7 @@ void QSignalTransitionPrivate::callOnTransition(QEvent *e) Q_Q(QSignalTransition); if (e->type() == QEvent::Signal) { - QSignalEvent *se = static_cast(e); + QStateMachine::SignalEvent *se = static_cast(e); int savedSignalIndex = se->m_signalIndex; se->m_signalIndex = originalSignalIndex; q->onTransition(e); diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index 7876d43..503eec0 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -50,7 +50,6 @@ #include "qabstracttransition_p.h" #include "qsignaltransition.h" #include "qsignaltransition_p.h" -#include "qsignalevent.h" #include "qsignaleventgenerator_p.h" #include "qabstractstate.h" #include "qabstractstate_p.h" @@ -63,7 +62,6 @@ #ifndef QT_NO_STATEMACHINE_EVENTFILTER #include "qeventtransition.h" #include "qeventtransition_p.h" -#include "qwrappedevent.h" #endif #ifndef QT_NO_ANIMATION @@ -1534,7 +1532,7 @@ void QStateMachinePrivate::handleTransitionSignal(QObject *sender, int signalInd qDebug() << q_func() << ": sending signal event ( sender =" << sender << ", signal =" << sender->metaObject()->method(signalIndex).signature() << ')'; #endif - internalEventQueue.append(new QSignalEvent(sender, signalIndex, vargs)); + internalEventQueue.append(new QStateMachine::SignalEvent(sender, signalIndex, vargs)); scheduleProcess(); } @@ -1880,7 +1878,7 @@ bool QStateMachine::eventFilter(QObject *watched, QEvent *event) Q_D(QStateMachine); Q_ASSERT(d->qobjectEvents.contains(watched)); if (d->qobjectEvents[watched].contains(event->type())) - postEvent(new QWrappedEvent(watched, d->handler->cloneEvent(event))); + postEvent(new QStateMachine::WrappedEvent(watched, d->handler->cloneEvent(event))); return false; } #endif @@ -2076,16 +2074,16 @@ QSignalEventGenerator::QSignalEventGenerator(QStateMachine *parent) } /*! - \class QSignalEvent + \class QStateMachine::SignalEvent - \brief The QSignalEvent class represents a Qt signal event. + \brief The SignalEvent class represents a Qt signal event. \since 4.6 \ingroup statemachine A signal event is generated by a QStateMachine in response to a Qt signal. The QSignalTransition class provides a transition associated with a - signal event. QSignalEvent is part of \l{The State Machine Framework}. + signal event. QStateMachine::SignalEvent is part of \l{The State Machine Framework}. The sender() function returns the object that generated the signal. The signalIndex() function returns the index of the signal. The arguments() @@ -2097,25 +2095,25 @@ QSignalEventGenerator::QSignalEventGenerator(QStateMachine *parent) /*! \internal - Constructs a new QSignalEvent object with the given \a sender, \a + Constructs a new SignalEvent object with the given \a sender, \a signalIndex and \a arguments. */ -QSignalEvent::QSignalEvent(QObject *sender, int signalIndex, - const QList &arguments) +QStateMachine::SignalEvent::SignalEvent(QObject *sender, int signalIndex, + const QList &arguments) : QEvent(QEvent::Signal), m_sender(sender), m_signalIndex(signalIndex), m_arguments(arguments) { } /*! - Destroys this QSignalEvent. + Destroys this SignalEvent. */ -QSignalEvent::~QSignalEvent() +QStateMachine::SignalEvent::~SignalEvent() { } /*! - \fn QSignalEvent::sender() const + \fn QStateMachine::SignalEvent::sender() const Returns the object that emitted the signal. @@ -2123,7 +2121,7 @@ QSignalEvent::~QSignalEvent() */ /*! - \fn QSignalEvent::signalIndex() const + \fn QStateMachine::SignalEvent::signalIndex() const Returns the index of the signal. @@ -2131,23 +2129,24 @@ QSignalEvent::~QSignalEvent() */ /*! - \fn QSignalEvent::arguments() const + \fn QStateMachine::SignalEvent::arguments() const Returns the arguments of the signal. */ /*! - \class QWrappedEvent + \class QStateMachine::WrappedEvent - \brief The QWrappedEvent class holds a clone of an event associated with a QObject. + \brief The WrappedEvent class holds a clone of an event associated with a QObject. \since 4.6 \ingroup statemachine A wrapped event is generated by a QStateMachine in response to a Qt event. The QEventTransition class provides a transition associated with a - such an event. QWrappedEvent is part of \l{The State Machine Framework}. + such an event. QStateMachine::WrappedEvent is part of \l{The State Machine + Framework}. The object() function returns the object that generated the event. The event() function returns a clone of the original event. @@ -2158,32 +2157,32 @@ QSignalEvent::~QSignalEvent() /*! \internal - Constructs a new QWrappedEvent object with the given \a object + Constructs a new WrappedEvent object with the given \a object and \a event. - The QWrappedEvent object takes ownership of \a event. + The WrappedEvent object takes ownership of \a event. */ -QWrappedEvent::QWrappedEvent(QObject *object, QEvent *event) +QStateMachine::WrappedEvent::WrappedEvent(QObject *object, QEvent *event) : QEvent(QEvent::Wrapped), m_object(object), m_event(event) { } /*! - Destroys this QWrappedEvent. + Destroys this WrappedEvent. */ -QWrappedEvent::~QWrappedEvent() +QStateMachine::WrappedEvent::~WrappedEvent() { delete m_event; } /*! - \fn QWrappedEvent::object() const + \fn QStateMachine::WrappedEvent::object() const Returns the object that the event is associated with. */ /*! - \fn QWrappedEvent::event() const + \fn QStateMachine::WrappedEvent::event() const Returns a clone of the original event. */ diff --git a/src/corelib/statemachine/qstatemachine.h b/src/corelib/statemachine/qstatemachine.h index dd524dd..a0b2b14 100644 --- a/src/corelib/statemachine/qstatemachine.h +++ b/src/corelib/statemachine/qstatemachine.h @@ -44,6 +44,7 @@ #include +#include #include #include #include @@ -56,8 +57,6 @@ QT_MODULE(Core) #ifndef QT_NO_STATEMACHINE -class QEvent; - class QStateMachinePrivate; class QAbstractAnimation; class Q_CORE_EXPORT QStateMachine : public QState @@ -70,6 +69,39 @@ class Q_CORE_EXPORT QStateMachine : public QState Q_PROPERTY(bool animationsEnabled READ animationsEnabled WRITE setAnimationsEnabled) #endif public: + class SignalEvent : public QEvent + { + public: + SignalEvent(QObject *sender, int signalIndex, + const QList &arguments); + ~SignalEvent(); + + inline QObject *sender() const { return m_sender; } + inline int signalIndex() const { return m_signalIndex; } + inline QList arguments() const { return m_arguments; } + + private: + QObject *m_sender; + int m_signalIndex; + QList m_arguments; + + friend class QSignalTransitionPrivate; + }; + + class WrappedEvent : public QEvent + { + public: + WrappedEvent(QObject *object, QEvent *event); + ~WrappedEvent(); + + inline QObject *object() const { return m_object; } + inline QEvent *event() const { return m_event; } + + private: + QObject *m_object; + QEvent *m_event; + }; + enum RestorePolicy { DoNotRestoreProperties, RestoreProperties diff --git a/src/corelib/statemachine/qwrappedevent.h b/src/corelib/statemachine/qwrappedevent.h deleted file mode 100644 index e0a131b..0000000 --- a/src/corelib/statemachine/qwrappedevent.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** 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 QWRAPPEDEVENT_H -#define QWRAPPEDEVENT_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Core) - -#ifndef QT_NO_STATEMACHINE - -class QObject; - -class Q_CORE_EXPORT QWrappedEvent : public QEvent -{ -public: - QWrappedEvent(QObject *object, QEvent *event); - ~QWrappedEvent(); - - inline QObject *object() const { return m_object; } - inline QEvent *event() const { return m_event; } - -private: - QObject *m_object; - QEvent *m_event; - -private: - Q_DISABLE_COPY(QWrappedEvent) -}; - -#endif //QT_NO_STATEMACHINE - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/corelib/statemachine/statemachine.pri b/src/corelib/statemachine/statemachine.pri index 5b19bc1..910cf5e 100644 --- a/src/corelib/statemachine/statemachine.pri +++ b/src/corelib/statemachine/statemachine.pri @@ -10,7 +10,6 @@ HEADERS += $$PWD/qstatemachine.h \ $$PWD/qhistorystate_p.h \ $$PWD/qabstracttransition.h \ $$PWD/qabstracttransition_p.h \ - $$PWD/qsignalevent.h \ $$PWD/qsignaltransition.h \ $$PWD/qsignaltransition_p.h @@ -23,8 +22,7 @@ SOURCES += $$PWD/qstatemachine.cpp \ $$PWD/qsignaltransition.cpp !contains(DEFINES, QT_NO_STATEMACHINE_EVENTFILTER) { -HEADERS += $$PWD/qwrappedevent.h \ - $$PWD/qeventtransition.h \ +HEADERS += $$PWD/qeventtransition.h \ $$PWD/qeventtransition_p.h SOURCES += $$PWD/qeventtransition.cpp } diff --git a/src/gui/statemachine/qkeyeventtransition.cpp b/src/gui/statemachine/qkeyeventtransition.cpp index 825b2ec..dee3168 100644 --- a/src/gui/statemachine/qkeyeventtransition.cpp +++ b/src/gui/statemachine/qkeyeventtransition.cpp @@ -44,7 +44,7 @@ #ifndef QT_NO_STATEMACHINE #include "qbasickeyeventtransition_p.h" -#include +#include #include QT_BEGIN_NAMESPACE @@ -160,7 +160,7 @@ bool QKeyEventTransition::eventTest(QEvent *event) Q_D(const QKeyEventTransition); if (!QEventTransition::eventTest(event)) return false; - QWrappedEvent *we = static_cast(event); + QStateMachine::WrappedEvent *we = static_cast(event); d->transition->setEventType(we->event()->type()); return QAbstractTransitionPrivate::get(d->transition)->callEventTest(we->event()); } diff --git a/src/gui/statemachine/qmouseeventtransition.cpp b/src/gui/statemachine/qmouseeventtransition.cpp index 564c8d2..86cacf7 100644 --- a/src/gui/statemachine/qmouseeventtransition.cpp +++ b/src/gui/statemachine/qmouseeventtransition.cpp @@ -44,7 +44,7 @@ #ifndef QT_NO_STATEMACHINE #include "qbasicmouseeventtransition_p.h" -#include +#include #include #include @@ -188,7 +188,7 @@ bool QMouseEventTransition::eventTest(QEvent *event) Q_D(const QMouseEventTransition); if (!QEventTransition::eventTest(event)) return false; - QWrappedEvent *we = static_cast(event); + QStateMachine::WrappedEvent *we = static_cast(event); d->transition->setEventType(we->event()->type()); return QAbstractTransitionPrivate::get(d->transition)->callEventTest(we->event()); } diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index a3f2f54..1fae92b 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -1754,7 +1754,7 @@ protected: bool eventTest(QEvent *e) { if (!QSignalTransition::eventTest(e)) return false; - QSignalEvent *se = static_cast(e); + QStateMachine::SignalEvent *se = static_cast(e); const_cast(this)->m_args = se->arguments(); return true; } @@ -3954,7 +3954,7 @@ public: void onTransition(QEvent *e) { QSignalTransition::onTransition(e); - QSignalEvent *se = static_cast(e); + QStateMachine::SignalEvent *se = static_cast(e); eventSignalIndex = se->signalIndex(); } -- cgit v0.12 From db032c025f56d2137b96e49fd817cae35dd5c8a3 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 28 Sep 2009 13:25:41 +0200 Subject: Deep copy QImage based on non-owned data so we can safely store them Reviewed-by: Samuel --- src/gui/painting/qpaintbuffer.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qpaintbuffer.cpp b/src/gui/painting/qpaintbuffer.cpp index 57e7cd0..6b9d77c 100644 --- a/src/gui/painting/qpaintbuffer.cpp +++ b/src/gui/painting/qpaintbuffer.cpp @@ -44,6 +44,7 @@ //#include #include #include +#include #include @@ -892,6 +893,12 @@ void QPaintBufferEngine::drawPixmap(const QPointF &pos, const QPixmap &pm) buffer->updateBoundingRect(QRectF(pos, pm.size())); } +static inline QImage qpaintbuffer_storable_image(const QImage &src) +{ + QImageData *d = const_cast(src).data_ptr(); + return d->own_data ? src : src.copy(); +} + void QPaintBufferEngine::drawImage(const QRectF &r, const QImage &image, const QRectF &sr, Qt::ImageConversionFlags /*flags */) { @@ -899,7 +906,8 @@ void QPaintBufferEngine::drawImage(const QRectF &r, const QImage &image, const Q qDebug() << "QPaintBufferEngine: drawImage: src/dest rects " << r << sr; #endif QPaintBufferCommand *cmd = - buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPixmapRect, QVariant(image)); + buffer->addCommand(QPaintBufferPrivate::Cmd_DrawImageRect, + QVariant(qpaintbuffer_storable_image(image))); cmd->extra = buffer->addData((qreal *) &r, 4); buffer->addData((qreal *) &sr, 4); // ### flags... @@ -913,7 +921,8 @@ void QPaintBufferEngine::drawImage(const QPointF &pos, const QImage &image) qDebug() << "QPaintBufferEngine: drawImage: pos:" << pos; #endif QPaintBufferCommand *cmd = - buffer->addCommand(QPaintBufferPrivate::Cmd_DrawImagePos, QVariant(image)); + buffer->addCommand(QPaintBufferPrivate::Cmd_DrawImagePos, + QVariant(qpaintbuffer_storable_image(image))); cmd->extra = buffer->addData((qreal *) &pos, 2); if (buffer->calculateBoundingRect) buffer->updateBoundingRect(QRectF(pos, image.size())); -- cgit v0.12 From e1c95146e889a33108a4b3013ba64a4d15414e87 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Mon, 28 Sep 2009 14:52:38 +0300 Subject: Webcore build break on Symbian fix Prepending adds epoc32\include too early into generated systeminclude path search order causing Webcore build to break due to wrong animation.h header getting included. Reviewed-by: Jason Barron --- mkspecs/features/qt_functions.prf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 645aa3a..243a829 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -47,8 +47,7 @@ defineTest(qtAddLibrary) { } symbian*:isEqual(LIB_NAME, QtGui) { # Needed for #include because qs60mainapplication.h includes aknapp.h - INCLUDEPATH -= $$MW_LAYER_SYSTEMINCLUDE - INCLUDEPATH = $$MW_LAYER_SYSTEMINCLUDE $$INCLUDEPATH + INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE } isEmpty(LINKAGE) { CONFIG(debug, debug|release) { -- cgit v0.12 From a6e987c07b790493c44c970d99b9822d0fcff85c Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 28 Sep 2009 13:56:24 +0200 Subject: Make the test pass on both large and small screens. Reviewed-by: Joerg --- tests/auto/qwidget/tst_qwidget.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index a9fa9bc..4cf9e8f 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -9154,38 +9154,38 @@ void tst_QWidget::destroyBackingStore() void tst_QWidget::rectOutsideCoordinatesLimit_task144779() { - QWidget main; + QApplication::setOverrideCursor(Qt::BlankCursor); //keep the cursor out of screen grabs + QWidget main(0,0,Qt::FramelessWindowHint); //don't get confused by the size of the window frame QPalette palette; palette.setColor(QPalette::Window, Qt::red); main.setPalette(palette); + QDesktopWidget desktop; QRect desktopDimensions = desktop.availableGeometry(&main); - main.setGeometry(desktopDimensions); + QSize mainSize(400, 400); + mainSize = mainSize.boundedTo(desktopDimensions.size()); + main.resize(mainSize); QWidget *offsetWidget = new QWidget(&main); - offsetWidget->setGeometry(0, -14600, desktopDimensions.width(), 15000); + offsetWidget->setGeometry(0, -(15000 - mainSize.height()), mainSize.width(), 15000); // big widget is too big for the coordinates, it must be limited by wrect // if wrect is not at the right position because of offsetWidget, bigwidget // is not painted correctly QWidget *bigWidget = new QWidget(offsetWidget); - - bigWidget->setGeometry(0, 0, desktopDimensions.width(), 50000); + bigWidget->setGeometry(0, 0, mainSize.width(), 50000); palette.setColor(QPalette::Window, Qt::green); bigWidget->setPalette(palette); bigWidget->setAutoFillBackground(true); main.show(); QTest::qWaitForWindowShown(&main); - QTest::qWait(50); - QCursor::setPos(main.pos()); //get the cursor out of the picture - QTest::qWait(50); QPixmap correct(main.size()); correct.fill(Qt::green); - QRect center(desktopDimensions.width()/4,desktopDimensions.width()/4, desktopDimensions.width()/2, desktopDimensions.width()/2); // to avoid the decorations - QTRY_COMPARE(QPixmap::grabWindow(main.winId()).toImage().copy(center), correct.toImage().copy(center)); + QTRY_COMPARE(QPixmap::grabWindow(main.winId()).toImage(), correct.toImage()); + QApplication::restoreOverrideCursor(); } void tst_QWidget::inputFocus_task257832() -- cgit v0.12 From dcc6bf72843689dbe02404fc642641a3ba58106a Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Mon, 28 Sep 2009 13:40:13 +0200 Subject: Document that scope unix is true for Symbian platform. Task-number: QTBUG-2989 Reviewed-by: Jason Barron --- doc/src/development/qmake-manual.qdoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index 861c772..f2cae5b 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -4056,6 +4056,8 @@ You can test for any other platform-compiler combination as long as a specification exists for it in the \c mkspecs directory. + The scope \c unix is true for the Symbian platform. + \section1 Variables Many of the variables used in project files are special variables that -- cgit v0.12 From d1f4f443dac3329a1068f9a857d41999d0bcf1d4 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Mon, 28 Sep 2009 22:28:49 +1000 Subject: Fix qdoc error. Reviewed-by: Trust Me --- doc/src/development/designer-manual.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/development/designer-manual.qdoc b/doc/src/development/designer-manual.qdoc index 0c5bf83..4f4db85 100644 --- a/doc/src/development/designer-manual.qdoc +++ b/doc/src/development/designer-manual.qdoc @@ -61,8 +61,8 @@ \l{Getting To Know Qt Designer} document. For a quick tutorial on how to use \QD, refer to \l{A Quick Start to Qt Designer}. - Qt Designer 4.5 boasts a long list of improvements. For a detailed list of - what is new, refer \l{What's New in Qt Designer 4.5}. + Qt Designer 4.6 boasts a long list of improvements. For a detailed list of + what is new, refer \l{What's New in Qt Designer 4.6}. \image designer-multiple-screenshot.png -- cgit v0.12 From f9d6862d13ae38c59ec4a58092c8126620801e0b Mon Sep 17 00:00:00 2001 From: Andreas Aardal Hanssen Date: Mon, 28 Sep 2009 14:24:38 +0200 Subject: QGraphicsItem with parent flag ItemClipsChildrenToShape not visible Regression against Qt 4.4. Children of items with ItemClipsChildrenToShape would only be discovered if the view's expose region contained the outer bounding rect of all items, _if_ there was at least one item in the scene that enabled ItemIgnoresTransformations. The reason for this bug is that the presence of an untransformable item causes the item lookups to go through a different path (QGraphicsViewPrivate::itemsInArea()). This function had the bug that it didn't correctly discover children of clip-items. Because of this, in the provided test case you could "work around" the bug by either removing the clip flag, or the transformation flag. Task-number: QTBUG-4151 Reviewed-by: Alexis --- src/gui/graphicsview/qgraphicsview.cpp | 2 +- tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 48 ++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 3d0df1b..64af6c7 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -2229,7 +2229,7 @@ QList QGraphicsViewPrivate::itemsInArea(const QPainterPath &pat // First build a (potentially large) list of all items in the vicinity // that might be untransformable. - QList allCandidates = scene->d_func()->estimateItemsInRect(adjustedRect); + QList allCandidates = scene->d_func()->items_helper(adjustedRect, mode, Qt::AscendingOrder); // Then find the minimal list of items that are inside \a path, and // convert it to a set. diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index cae8e56..5237963 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -63,6 +63,7 @@ #include #include #include +#include "../../shared/util.h" //TESTED_CLASS= //TESTED_FILES= @@ -201,6 +202,8 @@ private slots: void task239047_fitInViewSmallViewport(); void task245469_itemsAtPointWithClip(); void task253415_reconnectUpdateSceneOnSceneChanged(); + void QTBUG_4151_clipAndIgnore_data(); + void QTBUG_4151_clipAndIgnore(); }; void tst_QGraphicsView::initTestCase() @@ -3068,5 +3071,50 @@ void tst_QGraphicsView::task253415_reconnectUpdateSceneOnSceneChanged() QVERIFY(wasConnected2); } +void tst_QGraphicsView::QTBUG_4151_clipAndIgnore_data() +{ + QTest::addColumn("clip"); + QTest::addColumn("ignoreTransformations"); + QTest::addColumn("numItems"); + + QTest::newRow("none") << false << false << 3; + QTest::newRow("clip") << true << false << 3; + QTest::newRow("ignore") << false << true << 3; + QTest::newRow("clip+ignore") << true << true << 3; +} + +void tst_QGraphicsView::QTBUG_4151_clipAndIgnore() +{ + QFETCH(bool, clip); + QFETCH(bool, ignoreTransformations); + QFETCH(int, numItems); + + QGraphicsScene scene; + + QGraphicsRectItem *parent = new QGraphicsRectItem(QRectF(0, 0, 50, 50), 0); + QGraphicsRectItem *child = new QGraphicsRectItem(QRectF(-10, -10, 40, 40), parent); + QGraphicsRectItem *ignore = new QGraphicsRectItem(QRectF(60, 60, 50, 50), 0); + + if (clip) + parent->setFlags(QGraphicsItem::ItemClipsChildrenToShape); + if (ignoreTransformations) + ignore->setFlag(QGraphicsItem::ItemIgnoresTransformations); + + parent->setBrush(Qt::red); + child->setBrush(QColor(0, 0, 255, 128)); + ignore->setBrush(Qt::green); + + scene.addItem(parent); + scene.addItem(ignore); + + QGraphicsView view(&scene); + view.setFrameStyle(0); + view.resize(75, 75); + view.show(); + QTRY_COMPARE(QApplication::activeWindow(), (QWidget *)&view); + + QCOMPARE(view.items(view.rect()).size(), numItems); +} + QTEST_MAIN(tst_QGraphicsView) #include "tst_qgraphicsview.moc" -- cgit v0.12 From 09d61361ff84b4f47f8a6fcda258957c93d552f9 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Mon, 28 Sep 2009 14:26:37 +0200 Subject: add a test for custom QEventTransition Test that the event has the right attributes. Also improve the custom QSignalTransition test to cover all attributes. --- tests/auto/qstatemachine/tst_qstatemachine.cpp | 77 +++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 3 deletions(-) diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index 1fae92b..7244d72 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -1742,11 +1742,18 @@ class TestSignalTransition : public QSignalTransition { public: TestSignalTransition(QState *sourceState = 0) - : QSignalTransition(sourceState) {} + : QSignalTransition(sourceState), m_sender(0) + {} TestSignalTransition(QObject *sender, const char *signal, QAbstractState *target) - : QSignalTransition(sender, signal) + : QSignalTransition(sender, signal), m_sender(0) { setTargetState(target); } + QObject *senderReceived() const { + return m_sender; + } + int signalIndexReceived() const { + return m_signalIndex; + } QVariantList argumentsReceived() const { return m_args; } @@ -1755,10 +1762,14 @@ protected: if (!QSignalTransition::eventTest(e)) return false; QStateMachine::SignalEvent *se = static_cast(e); - const_cast(this)->m_args = se->arguments(); + m_sender = se->sender(); + m_signalIndex = se->signalIndex(); + m_args = se->arguments(); return true; } private: + QObject *m_sender; + int m_signalIndex; QVariantList m_args; }; @@ -1870,6 +1881,8 @@ void tst_QStateMachine::signalTransitions() emitter.emitSignalWithIntArg(123); QTRY_COMPARE(finishedSpy.count(), 1); + QCOMPARE(trans->senderReceived(), (QObject*)&emitter); + QCOMPARE(trans->signalIndexReceived(), emitter.metaObject()->indexOfSignal("signalWithIntArg(int)")); QCOMPARE(trans->argumentsReceived().size(), 1); QCOMPARE(trans->argumentsReceived().at(0).toInt(), 123); } @@ -1890,6 +1903,8 @@ void tst_QStateMachine::signalTransitions() emitter.emitSignalWithStringArg(testString); QTRY_COMPARE(finishedSpy.count(), 1); + QCOMPARE(trans->senderReceived(), (QObject*)&emitter); + QCOMPARE(trans->signalIndexReceived(), emitter.metaObject()->indexOfSignal("signalWithStringArg(QString)")); QCOMPARE(trans->argumentsReceived().size(), 1); QCOMPARE(trans->argumentsReceived().at(0).toString(), testString); } @@ -2028,6 +2043,38 @@ void tst_QStateMachine::signalTransitions() } } +class TestEventTransition : public QEventTransition +{ +public: + TestEventTransition(QState *sourceState = 0) + : QEventTransition(sourceState), + m_eventSource(0), m_eventType(QEvent::None) + {} + TestEventTransition(QObject *object, QEvent::Type type, + QAbstractState *target) + : QEventTransition(object, type), + m_eventSource(0), m_eventType(QEvent::None) + { setTargetState(target); } + QObject *eventSourceReceived() const { + return m_eventSource; + } + QEvent::Type eventTypeReceived() const { + return m_eventType; + } +protected: + bool eventTest(QEvent *e) { + if (!QEventTransition::eventTest(e)) + return false; + QStateMachine::WrappedEvent *we = static_cast(e); + m_eventSource = we->object(); + m_eventType = we->event()->type(); + return true; + } +private: + QObject *m_eventSource; + QEvent::Type m_eventType; +}; + void tst_QStateMachine::eventTransitions() { QPushButton button; @@ -2274,6 +2321,30 @@ void tst_QStateMachine::eventTransitions() QTest::ignoreMessage(QtWarningMsg, "QObject event transitions are not supported for custom types"); QTRY_COMPARE(startedSpy.count(), 1); } + // custom transition + { + QStateMachine machine; + QState *s0 = new QState(&machine); + QFinalState *s1 = new QFinalState(&machine); + + TestEventTransition *trans = new TestEventTransition(&button, QEvent::MouseButtonPress, s1); + s0->addTransition(trans); + QCOMPARE(trans->eventSourceReceived(), (QObject*)0); + QCOMPARE(trans->eventTypeReceived(), QEvent::None); + + QSignalSpy finishedSpy(&machine, SIGNAL(finished())); + machine.setInitialState(s0); + machine.start(); + QCoreApplication::processEvents(); + + QTest::mousePress(&button, Qt::LeftButton); + QCoreApplication::processEvents(); + + QTRY_COMPARE(finishedSpy.count(), 1); + + QCOMPARE(trans->eventSourceReceived(), (QObject*)&button); + QCOMPARE(trans->eventTypeReceived(), QEvent::MouseButtonPress); + } } void tst_QStateMachine::historyStates() -- cgit v0.12 From b0885663f2192eb5eb27f8a8032e7e05b19e3736 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Mon, 28 Sep 2009 14:34:18 +0200 Subject: Updated JavaScriptCore from /home/khansen/dev/qtwebkit to jsc-for-qtscript-4.6-staging-28092009 ( b98dec961e9389ddd5e10d7c4086de9a297cb984 ) --- .../javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp | 4 ++-- src/3rdparty/javascriptcore/VERSION | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp index ec242cc..c31216b 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp @@ -435,7 +435,7 @@ void Interpreter::dumpRegisters(CallFrame* callFrame) printf("[ReturnPC] | %10p | %p \n", it, (*it).vPC()); ++it; printf("[ReturnValueRegister] | %10p | %d \n", it, (*it).i()); ++it; printf("[ArgumentCount] | %10p | %d \n", it, (*it).i()); ++it; - printf("[Callee] | %10p | %p \n", it, (*it).function()); ++it; + printf("[Callee] | %10p | %p \n", it, (*it).object()); ++it; printf("[OptionalCalleeArguments] | %10p | %p \n", it, (*it).arguments()); ++it; printf("-----------------------------------------------------------------------------\n"); @@ -3113,7 +3113,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi exceptionValue = createStackOverflowError(callFrame); goto vm_throw; } - ASSERT(!callFrame->callee()->isHostFunction()); + ASSERT(!asFunction(callFrame->callee())->isHostFunction()); int32_t expectedParams = static_cast(callFrame->callee())->jsExecutable()->parameterCount(); int32_t inplaceArgs = min(argCount, expectedParams); int32_t i = 0; diff --git a/src/3rdparty/javascriptcore/VERSION b/src/3rdparty/javascriptcore/VERSION index 6160986..ae70d26 100644 --- a/src/3rdparty/javascriptcore/VERSION +++ b/src/3rdparty/javascriptcore/VERSION @@ -4,8 +4,8 @@ This is a snapshot of JavaScriptCore from The commit imported was from the - jsc-for-qtscript-4.6-staging-24092009 branch/tag + jsc-for-qtscript-4.6-staging-28092009 branch/tag and has the sha1 checksum - 6906f46c84e6b20612db58018334cb6823d0a18a + b98dec961e9389ddd5e10d7c4086de9a297cb984 -- cgit v0.12 From 8694efe1973296c9245b18e1efc00f658fb3486e Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Mon, 28 Sep 2009 22:44:16 +1000 Subject: Fix qdoc errors Reviewed-by: Trust Me --- src/gui/image/qpixmap_s60.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index 123777c..dccc691 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -67,6 +67,7 @@ const uchar qt_pixmap_bit_mask[] = { 0x01, 0x02, 0x04, 0x08, /*! \class QSymbianFbsClient \since 4.6 + \internal Symbian Font And Bitmap server client that is used to lock the global bitmap heap. Only used in @@ -147,6 +148,7 @@ void QSymbianFbsHeapLock::relock() /*! \class QSymbianBitmapDataAccess \since 4.6 + \internal Data access class that is used to locks/unlocks pixel data when drawing or modifying CFbsBitmap pixel data. -- cgit v0.12 From 760b3ad2b7049b5258936094bbf653d121cf8e79 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Mon, 28 Sep 2009 22:46:19 +1000 Subject: Fix qdoc error Reviewed-by: Trust Me --- src/testlib/qtestcase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 1768fe6..a2f0179 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -736,7 +736,7 @@ QT_BEGIN_NAMESPACE /*! \fn void QTest::qWaitForWindowShown(QWidget *window) - Waits until the window is shown in the screen. This is mainly useful for + Waits until the \a window is shown in the screen. This is mainly useful for asynchronous systems like X11, where a window will be mapped to screen some time after being asked to show itself on the screen. -- cgit v0.12 From 0123cde833c2dd5ab9306baca52e3ad4b1ef4010 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Mon, 28 Sep 2009 22:50:06 +1000 Subject: Fix qdoc error. Reviewed-by: Trust Me --- doc/src/qt4-intro.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index 0177d35..03d9b29 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -784,7 +784,7 @@ these settings when you edit forms. More information about these improvements can be found in the - \l{What's New in Qt Designer 4.5} overview. + \l{What's New in Qt Designer 4.6} overview. \section1 Qt Linguist Improvements -- cgit v0.12 From c9efa5704ba89736e90d7a28e07687a826874232 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 28 Sep 2009 16:07:58 +0300 Subject: Fixed QMessageBox::updateSize test case for S60. In S60 message boxes are always in portrait mode located on the bottom of screen and they occypy the whole sreen width. In addition messageboxes in S60 does not have their own buttons, but the buttons are located in system softkey area. That's why adding standard buttons for message box in S60 does not change the dialog size. Reviewed-by: Sami Merila --- tests/auto/qmessagebox/tst_qmessagebox.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/auto/qmessagebox/tst_qmessagebox.cpp b/tests/auto/qmessagebox/tst_qmessagebox.cpp index 64e5a9c..5607fbd 100644 --- a/tests/auto/qmessagebox/tst_qmessagebox.cpp +++ b/tests/auto/qmessagebox/tst_qmessagebox.cpp @@ -130,7 +130,7 @@ private slots: void testSymbols(); void incorrectDefaultButton(); void updateSize(); - + void setInformativeText(); void iconPixmap(); @@ -683,7 +683,13 @@ void tst_QMessageBox::incorrectDefaultButton() void tst_QMessageBox::updateSize() { QMessageBox box; +#ifdef Q_WS_S60 + // In S60 messagebox is always occupies maximum width, i.e. screen width + // so we need to have long enough text to split over several line + box.setText("This is awesome long text"); +#else box.setText("This is awesome"); +#endif box.show(); QSize oldSize = box.size(); QString longText; @@ -693,9 +699,12 @@ void tst_QMessageBox::updateSize() QVERIFY(box.size() != oldSize); // should have grown QVERIFY(box.width() > oldSize.width() || box.height() > oldSize.height()); oldSize = box.size(); +#ifndef Q_WS_S60 + // In S60 dialogs buttons are in softkey area -> message box size does not change box.setStandardButtons(QMessageBox::StandardButtons(0xFFFF)); QVERIFY(box.size() != oldSize); // should have grown QVERIFY(box.width() > oldSize.width() || box.height() > oldSize.height()); +#endif } void tst_QMessageBox::setInformativeText() -- cgit v0.12 From 6e5c9afdb16e44d55683794442e66681f60d373b Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 28 Sep 2009 15:13:57 +0200 Subject: Impossible to interact with the year on QCalendarWidget on GraphicsView The problem is that it is using mapToGlobal to translate a mouse position andthat doesn't work well when the widget is mebedded inside graphics view. Task-number: QT-2218 Reviewed-by: Bjoern Erik Nilsen --- src/gui/widgets/qcalendarwidget.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/gui/widgets/qcalendarwidget.cpp b/src/gui/widgets/qcalendarwidget.cpp index 71588c4..08ed7f6 100644 --- a/src/gui/widgets/qcalendarwidget.cpp +++ b/src/gui/widgets/qcalendarwidget.cpp @@ -3022,11 +3022,21 @@ bool QCalendarWidget::event(QEvent *event) bool QCalendarWidget::eventFilter(QObject *watched, QEvent *event) { Q_D(QCalendarWidget); - if (event->type() == QEvent::MouseButtonPress && d->yearEdit->hasFocus() && !QRect(d->yearEdit->mapToGlobal(QPoint(0, 0)), d->yearEdit->size()).contains(static_cast(event)->globalPos())) { - event->accept(); - d->_q_yearEditingFinished(); - setFocus(); - return true; + if (event->type() == QEvent::MouseButtonPress && d->yearEdit->hasFocus()) { + QWidget *tlw = window(); + QWidget *widget = static_cast(watched); + //as we have a event filter on the whole application we first make sure that the top level widget + //of both this and the watched widget are the same to decide if we should finish the year edition. + if (widget->window() == tlw) { + QPoint mousePos = widget->mapTo(tlw, static_cast(event)->pos()); + QRect geom = QRect(d->yearEdit->mapTo(tlw, QPoint(0, 0)), d->yearEdit->size()); + if (!geom.contains(mousePos)) { + event->accept(); + d->_q_yearEditingFinished(); + setFocus(); + return true; + } + } } return QWidget::eventFilter(watched, event); } -- cgit v0.12 From 3a52aeb622da3f7d4171ea64df7896fa5d2d7d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Mon, 28 Sep 2009 16:24:48 +0300 Subject: Triggering softkey action for disbled widget causes a crash. Softkey actions need to copy enable state from action widget to prevent crash when action is triggered and action widget is disabled. OPEN: dynamically setting enable state for softkey actions. Task-number: QT-2117 Reviewed-by: Jason Barron --- src/gui/kernel/qsoftkeymanager.cpp | 7 +++++-- src/gui/widgets/qdialogbuttonbox.cpp | 1 + tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 7874622..91f4163 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -125,6 +125,7 @@ QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *act break; } action->setSoftKeyRole(softKeyRole); + action->setEnabled(actionWidget->isEnabled()); return action; } @@ -251,8 +252,10 @@ bool QSoftKeyManager::handleCommand(int command) QAction *action = softKeys.at(i); if (action->softKeyRole() != QAction::NoSoftKey) { if (j == index) { - action->activate(QAction::Trigger); - return true; + if (action->isEnabled()) { + action->activate(QAction::Trigger); + return true; + } } j++; } diff --git a/src/gui/widgets/qdialogbuttonbox.cpp b/src/gui/widgets/qdialogbuttonbox.cpp index 39566ef..6cc720d 100644 --- a/src/gui/widgets/qdialogbuttonbox.cpp +++ b/src/gui/widgets/qdialogbuttonbox.cpp @@ -593,6 +593,7 @@ QAction* QDialogButtonBoxPrivate::createSoftKey(QAbstractButton *button, QDialog } QObject::connect(action, SIGNAL(triggered()), button, SIGNAL(clicked())); action->setSoftKeyRole(softkeyRole); + action->setEnabled(button->isEnabled()); return action; } #endif diff --git a/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp b/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp index 8788117..832605e 100644 --- a/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp +++ b/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp @@ -62,6 +62,7 @@ public slots: private slots: void updateSoftKeysCompressed(); void handleCommand(); + void checkSoftkeyEnableStates(); }; class EventListener : public QObject @@ -169,6 +170,23 @@ void tst_QSoftKeyManager::handleCommand() QCOMPARE(spy1.count(), 1); } +/* + This tests that softkey enable state follows the state of widget that owns the action + to which the softkey is related to. +*/ +void tst_QSoftKeyManager::checkSoftkeyEnableStates() +{ + QWidget w1, w2; + w1.setEnabled(false); + w2.setEnabled(true); + + QAction *disabledAction = QSoftKeyManager::createAction(QSoftKeyManager::OkSoftKey, &w1); + QAction *enabledAction = QSoftKeyManager::createAction(QSoftKeyManager::OkSoftKey, &w2); + + QVERIFY(disabledAction->isEnabled()==false); + QVERIFY(enabledAction->isEnabled()==true); +} + QTEST_MAIN(tst_QSoftKeyManager) #include "tst_qsoftkeymanager.moc" -- cgit v0.12 From e131a4653ec13e9a680a4b41094e78f2cc929f4d Mon Sep 17 00:00:00 2001 From: mae Date: Mon, 28 Sep 2009 15:09:29 +0200 Subject: Fix tst_QTextDocument::cursorPositionChangedOnSetText The test was introduced to make sure that the cursor position changed signal was not emitted excessively on setPlainText or on setHtml. The original fix however still included one superfluous emission for a temporary QTextCursor object. This was fixed by change 930ba91ec1e630, this change adjusts the auto test accordingly. Reviewed-by: Simon Hausmann --- tests/auto/qtextdocument/tst_qtextdocument.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/auto/qtextdocument/tst_qtextdocument.cpp b/tests/auto/qtextdocument/tst_qtextdocument.cpp index c0d7ed3..f393393 100644 --- a/tests/auto/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/qtextdocument/tst_qtextdocument.cpp @@ -1787,21 +1787,17 @@ void tst_QTextDocument::cursorPositionChangedOnSetText() { CursorPosSignalSpy spy(doc); - cursor = QTextCursor(); + // doc has one QTextCursor stored in the + // cursor member variable, thus the signal + // gets emitted once. doc->setPlainText("Foo\nBar\nBaz\nBlub\nBlah"); - // the signal should still be emitted once for the QTextCursor that - // QTextDocument::setPlainText creates temporarily. But the signal - // should not be emitted more often. QCOMPARE(spy.calls, 1); spy.calls = 0; doc->setHtml("

Foo

Bar

Baz

Blah"); - // the signal should still be emitted once for the QTextCursor that - // QTextDocument::setPlainText creates temporarily. But the signal - // should not be emitted more often. QCOMPARE(spy.calls, 1); } -- cgit v0.12 From 7626109da40a91cb38fbe3f23e08b50a04d2194a Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 28 Sep 2009 15:52:32 +0200 Subject: Animations: updateCurrentTime now receives the currentTime as paramater Reviewed-by: Leo --- examples/animation/easing/animation.h | 6 +++--- src/corelib/animation/qabstractanimation.cpp | 4 ++-- src/corelib/animation/qabstractanimation.h | 2 +- src/corelib/animation/qparallelanimationgroup.cpp | 14 +++++++------- src/corelib/animation/qparallelanimationgroup.h | 2 +- src/corelib/animation/qpauseanimation.cpp | 2 +- src/corelib/animation/qpauseanimation.h | 2 +- src/corelib/animation/qsequentialanimationgroup.cpp | 4 ++-- src/corelib/animation/qsequentialanimationgroup.h | 2 +- src/corelib/animation/qvariantanimation.cpp | 2 +- src/corelib/animation/qvariantanimation.h | 2 +- tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp | 6 +++--- .../tst_qsequentialanimationgroup.cpp | 6 +++--- tests/benchmarks/qanimation/rectanimation.cpp | 4 ++-- tests/benchmarks/qanimation/rectanimation.h | 2 +- 15 files changed, 30 insertions(+), 30 deletions(-) diff --git a/examples/animation/easing/animation.h b/examples/animation/easing/animation.h index 78fdc14..bd58be0 100644 --- a/examples/animation/easing/animation.h +++ b/examples/animation/easing/animation.h @@ -68,7 +68,7 @@ public: m_path = QPainterPath(); } - void updateCurrentTime() + void updateCurrentTime(int currentTime) { if (m_pathType == CirclePath) { if (m_path.isEmpty()) { @@ -78,7 +78,7 @@ public: m_path.addEllipse(QRectF(from, to)); } int dura = duration(); - const qreal progress = ((dura == 0) ? 1 : ((((currentTime() - 1) % dura) + 1) / qreal(dura))); + const qreal progress = ((dura == 0) ? 1 : ((((currentTime - 1) % dura) + 1) / qreal(dura))); qreal easedProgress = easingCurve().valueForProgress(progress); if (easedProgress > 1.0) { @@ -90,7 +90,7 @@ public: updateCurrentValue(pt); emit valueChanged(pt); } else { - QPropertyAnimation::updateCurrentTime(); + QPropertyAnimation::updateCurrentTime(currentTime); } } diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 9027be0..6489cdc 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -604,7 +604,7 @@ void QAbstractAnimation::setCurrentTime(int msecs) } } - updateCurrentTime(); + updateCurrentTime(d->currentTime); if (d->currentLoop != oldLoop) emit currentLoopChanged(d->currentLoop); @@ -705,7 +705,7 @@ bool QAbstractAnimation::event(QEvent *event) } /*! - \fn virtual void QAbstractAnimation::updateCurrentTime() = 0; + \fn virtual void QAbstractAnimation::updateCurrentTime(int currentTime) = 0; This pure virtual function is called every time the animation's current time changes. diff --git a/src/corelib/animation/qabstractanimation.h b/src/corelib/animation/qabstractanimation.h index 516f5e9..50b07d7 100644 --- a/src/corelib/animation/qabstractanimation.h +++ b/src/corelib/animation/qabstractanimation.h @@ -119,7 +119,7 @@ protected: QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent = 0); bool event(QEvent *event); - virtual void updateCurrentTime() = 0; + virtual void updateCurrentTime(int currentTime) = 0; virtual void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState); virtual void updateDirection(QAbstractAnimation::Direction direction); diff --git a/src/corelib/animation/qparallelanimationgroup.cpp b/src/corelib/animation/qparallelanimationgroup.cpp index 82d5224..5b7fd22 100644 --- a/src/corelib/animation/qparallelanimationgroup.cpp +++ b/src/corelib/animation/qparallelanimationgroup.cpp @@ -125,7 +125,7 @@ int QParallelAnimationGroup::duration() const /*! \reimp */ -void QParallelAnimationGroup::updateCurrentTime() +void QParallelAnimationGroup::updateCurrentTime(int currentTime) { Q_D(QParallelAnimationGroup); if (d->animations.isEmpty()) @@ -148,7 +148,7 @@ void QParallelAnimationGroup::updateCurrentTime() } } - bool timeFwd = ((d->currentLoop == d->lastLoop && d->currentTime >= d->lastCurrentTime) + bool timeFwd = ((d->currentLoop == d->lastLoop && currentTime >= d->lastCurrentTime) || d->currentLoop > d->lastLoop); #ifdef QANIMATION_DEBUG qDebug("QParallellAnimationGroup %5d: setCurrentTime(%d), loop:%d, last:%d, timeFwd:%d, lastcurrent:%d, %d", @@ -160,7 +160,7 @@ void QParallelAnimationGroup::updateCurrentTime() const int dura = animation->totalDuration(); if (dura == -1 && d->isUncontrolledAnimationFinished(animation)) continue; - if (dura == -1 || (d->currentTime <= dura && dura != 0) + if (dura == -1 || (currentTime <= dura && dura != 0) || (dura == 0 && d->currentLoop != d->lastLoop)) { switch (state()) { case Running: @@ -177,18 +177,18 @@ void QParallelAnimationGroup::updateCurrentTime() if (dura <= 0) { if (dura == -1) - animation->setCurrentTime(d->currentTime); + animation->setCurrentTime(currentTime); continue; } if ((timeFwd && d->lastCurrentTime <= dura) || (!timeFwd && d->currentTime <= dura)) - animation->setCurrentTime(d->currentTime); - if (d->currentTime > dura) + animation->setCurrentTime(currentTime); + if (currentTime > dura) animation->stop(); } d->lastLoop = d->currentLoop; - d->lastCurrentTime = d->currentTime; + d->lastCurrentTime = currentTime; } /*! diff --git a/src/corelib/animation/qparallelanimationgroup.h b/src/corelib/animation/qparallelanimationgroup.h index 6afe4a7..1cab91e 100644 --- a/src/corelib/animation/qparallelanimationgroup.h +++ b/src/corelib/animation/qparallelanimationgroup.h @@ -67,7 +67,7 @@ protected: QParallelAnimationGroup(QParallelAnimationGroupPrivate &dd, QObject *parent); bool event(QEvent *event); - void updateCurrentTime(); + void updateCurrentTime(int currentTime); void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState); void updateDirection(QAbstractAnimation::Direction direction); diff --git a/src/corelib/animation/qpauseanimation.cpp b/src/corelib/animation/qpauseanimation.cpp index c382b19..2fd12aa 100644 --- a/src/corelib/animation/qpauseanimation.cpp +++ b/src/corelib/animation/qpauseanimation.cpp @@ -141,7 +141,7 @@ bool QPauseAnimation::event(QEvent *e) /*! \reimp */ -void QPauseAnimation::updateCurrentTime() +void QPauseAnimation::updateCurrentTime(int) { } diff --git a/src/corelib/animation/qpauseanimation.h b/src/corelib/animation/qpauseanimation.h index caac9e9..1b81472 100644 --- a/src/corelib/animation/qpauseanimation.h +++ b/src/corelib/animation/qpauseanimation.h @@ -68,7 +68,7 @@ public: protected: bool event(QEvent *e); - void updateCurrentTime(); + void updateCurrentTime(int); private: Q_DISABLE_COPY(QPauseAnimation) diff --git a/src/corelib/animation/qsequentialanimationgroup.cpp b/src/corelib/animation/qsequentialanimationgroup.cpp index 9ad433f..5ca560a 100644 --- a/src/corelib/animation/qsequentialanimationgroup.cpp +++ b/src/corelib/animation/qsequentialanimationgroup.cpp @@ -334,7 +334,7 @@ int QSequentialAnimationGroup::duration() const /*! \reimp */ -void QSequentialAnimationGroup::updateCurrentTime() +void QSequentialAnimationGroup::updateCurrentTime(int currentTime) { Q_D(QSequentialAnimationGroup); if (!d->currentAnimation) @@ -359,7 +359,7 @@ void QSequentialAnimationGroup::updateCurrentTime() d->setCurrentAnimation(newAnimationIndex.index); - const int newCurrentTime = d->currentTime - newAnimationIndex.timeOffset; + const int newCurrentTime = currentTime - newAnimationIndex.timeOffset; if (d->currentAnimation) { d->currentAnimation->setCurrentTime(newCurrentTime); diff --git a/src/corelib/animation/qsequentialanimationgroup.h b/src/corelib/animation/qsequentialanimationgroup.h index 1c9e4cc..f30f851 100644 --- a/src/corelib/animation/qsequentialanimationgroup.h +++ b/src/corelib/animation/qsequentialanimationgroup.h @@ -77,7 +77,7 @@ protected: QSequentialAnimationGroup(QSequentialAnimationGroupPrivate &dd, QObject *parent); bool event(QEvent *event); - void updateCurrentTime(); + void updateCurrentTime(int); void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState); void updateDirection(QAbstractAnimation::Direction direction); diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp index ae8bf2f..de8185b 100644 --- a/src/corelib/animation/qvariantanimation.cpp +++ b/src/corelib/animation/qvariantanimation.cpp @@ -656,7 +656,7 @@ QVariant QVariantAnimation::interpolated(const QVariant &from, const QVariant &t /*! \reimp */ -void QVariantAnimation::updateCurrentTime() +void QVariantAnimation::updateCurrentTime(int) { d_func()->recalculateCurrentInterval(); } diff --git a/src/corelib/animation/qvariantanimation.h b/src/corelib/animation/qvariantanimation.h index 98c1aec..bc57b1c 100644 --- a/src/corelib/animation/qvariantanimation.h +++ b/src/corelib/animation/qvariantanimation.h @@ -102,7 +102,7 @@ protected: QVariantAnimation(QVariantAnimationPrivate &dd, QObject *parent = 0); bool event(QEvent *event); - void updateCurrentTime(); + void updateCurrentTime(int); void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState); virtual void updateCurrentValue(const QVariant &value) = 0; diff --git a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp index f86e81d..51ef2da 100644 --- a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp +++ b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp @@ -55,10 +55,10 @@ public: int duration() const { return -1; /* not time driven */ } protected: - void updateCurrentTime() + void updateCurrentTime(int currentTime) { - QPropertyAnimation::updateCurrentTime(); - if (currentTime() >= QPropertyAnimation::duration() || currentLoop() >= 1) + QPropertyAnimation::updateCurrentTime(currentTime); + if (currentTime >= QPropertyAnimation::duration() || currentLoop() >= 1) stop(); } }; diff --git a/tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp b/tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp index b14d6f8..aa6801a 100644 --- a/tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp +++ b/tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp @@ -169,10 +169,10 @@ public: int duration() const { return -1; /* not time driven */ } protected: - void updateCurrentTime() + void updateCurrentTime(int currentTime) { - QPropertyAnimation::updateCurrentTime(); - if (currentTime() >= QPropertyAnimation::duration()) + QPropertyAnimation::updateCurrentTime(currentTime); + if (currentTime >= QPropertyAnimation::duration()) stop(); } }; diff --git a/tests/benchmarks/qanimation/rectanimation.cpp b/tests/benchmarks/qanimation/rectanimation.cpp index 5522847..ab381f4 100644 --- a/tests/benchmarks/qanimation/rectanimation.cpp +++ b/tests/benchmarks/qanimation/rectanimation.cpp @@ -73,9 +73,9 @@ int RectAnimation::duration() const } -void RectAnimation::updateCurrentTime() +void RectAnimation::updateCurrentTime(int currentTime) { - qreal progress = m_easing.valueForProgress( currentTime() / qreal(m_dura) ); + qreal progress = m_easing.valueForProgress( currentTime / qreal(m_dura) ); QRect now; now.setCoords(interpolateInteger(m_start.left(), m_end.left(), progress), interpolateInteger(m_start.top(), m_end.top(), progress), diff --git a/tests/benchmarks/qanimation/rectanimation.h b/tests/benchmarks/qanimation/rectanimation.h index 995becb..ea1f804 100644 --- a/tests/benchmarks/qanimation/rectanimation.h +++ b/tests/benchmarks/qanimation/rectanimation.h @@ -58,7 +58,7 @@ public: void setDuration(int d); int duration() const; - virtual void updateCurrentTime(); + virtual void updateCurrentTime(int currentTime); virtual void updateState(QAbstractAnimation::State state); private: -- cgit v0.12 From afa49a5f3fac7233362512dd3b1e5fdd45b99404 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Mon, 28 Sep 2009 23:54:04 +1000 Subject: Fixed compile failure when running make with large -j. `ld: library not found for -lQtOpenGL' ... in opengl graphicssystem. Must build QtOpenGL before the GL graphicssystem plugin. Reviewed-by: brad --- src/src.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/src/src.pro b/src/src.pro index 240e1f7..238f534 100644 --- a/src/src.pro +++ b/src/src.pro @@ -129,6 +129,7 @@ src_webkit.target = sub-webkit src_plugins.depends += src_dbus src_phonon.depends += src_dbus } + contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2): src_plugins.depends += src_opengl } !symbian { -- cgit v0.12 From bce856612cfdd41915c4e8702be78833b3a94e33 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Mon, 28 Sep 2009 16:12:40 +0200 Subject: Correct the formextractor which was using removed QWebElement API Reviewed-by: Kent Hansen --- examples/webkit/formextractor/formextractor.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/webkit/formextractor/formextractor.cpp b/examples/webkit/formextractor/formextractor.cpp index 10bd9af..4b181e8 100644 --- a/examples/webkit/formextractor/formextractor.cpp +++ b/examples/webkit/formextractor/formextractor.cpp @@ -67,15 +67,15 @@ void FormExtractor::submit() QWebElement femaleGender = frame->findFirstElement("#genderFemale"); QWebElement updates = frame->findFirstElement("#updates"); - ui.firstNameEdit->setText(firstName.scriptableProperty("value").toString()); - ui.lastNameEdit->setText(lastName.scriptableProperty("value").toString()); + ui.firstNameEdit->setText(firstName.evaluateJavaScript("this.value").toString()); + ui.lastNameEdit->setText(lastName.evaluateJavaScript("this.value").toString()); - if (maleGender.scriptableProperty("checked").toBool()) - ui.genderEdit->setText(maleGender.scriptableProperty("value").toString()); - else if (femaleGender.scriptableProperty("checked").toBool()) - ui.genderEdit->setText(femaleGender.scriptableProperty("value").toString()); + if (maleGender.evaluateJavaScript("this.checked").toBool()) + ui.genderEdit->setText(maleGender.evaluateJavaScript("this.value").toString()); + else if (femaleGender.evaluateJavaScript("this.checked").toBool()) + ui.genderEdit->setText(femaleGender.evaluateJavaScript("this.value").toString()); - if (updates.scriptableProperty("checked").toBool()) + if (updates.evaluateJavaScript("this.checked").toBool()) ui.updatesEdit->setText("Yes"); else ui.updatesEdit->setText("No"); -- cgit v0.12 From 86f5a63b01844125fb4a4e5adc23d6539dd8564e Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Mon, 28 Sep 2009 16:21:46 +0200 Subject: Refactor of timer verification in QAbstractAnimation Reviewed-by: thierry --- src/corelib/animation/qabstractanimation.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 6489cdc..b585fe3 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -194,12 +194,6 @@ QUnifiedTimer *QUnifiedTimer::instance() void QUnifiedTimer::timerEvent(QTimerEvent *event) { - //this is simply the time we last received a tick - const int oldLastTick = lastTick; - if (time.isValid()) - lastTick = consistentTiming ? oldLastTick + timingInterval : time.elapsed(); - - if (event->timerId() == startStopAnimationTimer.timerId()) { startStopAnimationTimer.stop(); //we transfer the waiting animations into the "really running" state @@ -214,6 +208,10 @@ void QUnifiedTimer::timerEvent(QTimerEvent *event) time.start(); } } else if (event->timerId() == animationTimer.timerId()) { + //this is simply the time we last received a tick + const int oldLastTick = lastTick; + lastTick = consistentTiming ? oldLastTick + timingInterval : time.elapsed(); + //we make sure we only call update time if the time has actually changed //it might happen in some cases that the time doesn't change because events are delayed //when the CPU load is high -- cgit v0.12 From 2d1f2ceb7cd00db6e6cc72f614222d66dca6e23a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Mon, 28 Sep 2009 15:48:48 +0200 Subject: Fixing the autotest for other platforms, hopefully... Reviewed-by: Joerg Bornemann --- tests/auto/qcombobox/tst_qcombobox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp index 61aabaa..6984a88 100644 --- a/tests/auto/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/qcombobox/tst_qcombobox.cpp @@ -2120,7 +2120,7 @@ void tst_QComboBox::task248169_popupWithMinimalSize() comboBox.addItems(initialContent); QDesktopWidget desktop; QRect desktopSize = desktop.availableGeometry(); - comboBox.view()->setMinimumWidth(desktopSize.width() - 1); + comboBox.view()->setMinimumWidth(desktopSize.width() / 2); comboBox.setGeometry(desktopSize.width() - (desktopSize.width() / 4), (desktopSize.width() / 4), (desktopSize.width() / 2), (desktopSize.width() / 4)); -- cgit v0.12 From b5d8b253b194f3261bf790362d80eacb97ff30b5 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 28 Sep 2009 16:32:32 +0200 Subject: getMacPreferredLanguageAndCountry: Fix possible crash getMacPreferredLanguageAndCountry can crash when called e.g. as a root user because CFPreferencesCopyValue will return 0. Reviewed-by: denis Task-number: 261664 --- src/corelib/tools/qlocale.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 136bafa..dc61adb 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -1156,7 +1156,7 @@ static void getMacPreferredLanguageAndCountry(QString *language, QString *countr kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost); - if (CFArrayGetCount(languages) > 0) { + if (languages && CFArrayGetCount(languages) > 0) { QCFType locale = CFLocaleCreate(kCFAllocatorDefault, CFStringRef(CFArrayGetValueAtIndex(languages, 0))); if (language) -- cgit v0.12 From 00ee879628e392ad46daf9cabe7c760c09afb6b7 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Mon, 28 Sep 2009 16:50:35 +0200 Subject: Removed unused line in QAbstractAnimation This line was a left-over from commit 86f5a63b018441 Reviewed-by: thierry --- src/corelib/animation/qabstractanimation.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index b585fe3..d6ef95b 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -201,7 +201,6 @@ void QUnifiedTimer::timerEvent(QTimerEvent *event) animationsToStart.clear(); if (animations.isEmpty()) { animationTimer.stop(); - time = QTime(); } else if (!animationTimer.isActive()) { animationTimer.start(timingInterval, this); lastTick = 0; -- cgit v0.12 From 14a896cf6b8b67a8d83a6204737249afa9ecd220 Mon Sep 17 00:00:00 2001 From: Trond Kjernaasen Date: Mon, 28 Sep 2009 16:52:04 +0200 Subject: Fixed a crash in the boxes demo when using -graphicssystem opengl. Several problems: 1. The demo leaked the scene contents, which caused cleanup problems. 2. The QGLContext::currentContext() could be changed behind Qt's back under Windows (the temp contexts never reset the current context). 3. QGLFormat::openGLVersionFlags() function would return uninitialized flags if the QGLWidget constructor happened to call qt_gl_preferGL2Engine(). Reviewed-by: Kim --- demos/boxes/main.cpp | 7 ++++--- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 2 +- src/opengl/qgl.cpp | 2 +- src/opengl/qgl_win.cpp | 6 ++++++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/demos/boxes/main.cpp b/demos/boxes/main.cpp index 557afc9..957f183 100644 --- a/demos/boxes/main.cpp +++ b/demos/boxes/main.cpp @@ -68,7 +68,7 @@ protected: inline bool matchString(const char *extensionString, const char *subString) { int subStringLength = strlen(subString); - return (strncmp(extensionString, subString, subStringLength) == 0) + return (strncmp(extensionString, subString, subStringLength) == 0) && ((extensionString[subStringLength] == ' ') || (extensionString[subStringLength] == '\0')); } @@ -137,11 +137,12 @@ int main(int argc, char **argv) "This demo can be GPU and CPU intensive and may\n" "work poorly or not at all on your system."); + widget->makeCurrent(); // The current context must be set before calling Scene's constructor + Scene scene(1024, 768, maxTextureSize); GraphicsView view; view.setViewport(widget); view.setViewportUpdateMode(QGraphicsView::FullViewportUpdate); - widget->makeCurrent(); // The current context must be set before calling Scene's constructor - view.setScene(new Scene(1024, 768, maxTextureSize)); + view.setScene(&scene); view.show(); return app.exec(); diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 119c89d..7e45fd9 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -129,7 +129,7 @@ public Q_SLOTS: // since the context holding the texture is shared, and // about to be destroyed, we have to transfer ownership // of the texture to one of the share contexts - ctx = const_cast(shares.at(0)); + ctx = const_cast((ctx == shares.at(0)) ? shares.at(1) : shares.at(0)); } } } diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 97a4a73..0ad6772 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1245,11 +1245,11 @@ QGLFormat::OpenGLVersionFlags QGLFormat::openGLVersionFlags() if (cachedDefault) { return defaultVersionFlags; } else { - cachedDefault = true; if (!hasOpenGL()) return defaultVersionFlags; dummy = new QGLWidget; dummy->makeCurrent(); // glGetString() needs a current context + cachedDefault = true; } } diff --git a/src/opengl/qgl_win.cpp b/src/opengl/qgl_win.cpp index 2f9e225..5b5820a 100644 --- a/src/opengl/qgl_win.cpp +++ b/src/opengl/qgl_win.cpp @@ -660,6 +660,8 @@ public: int dmy_pf = ChoosePixelFormat(dmy_pdc, &dmy_pfd); SetPixelFormat(dmy_pdc, dmy_pf, &dmy_pfd); dmy_rc = wglCreateContext(dmy_pdc); + old_dc = wglGetCurrentDC(); + old_context = wglGetCurrentContext(); wglMakeCurrent(dmy_pdc, dmy_rc); } @@ -668,10 +670,14 @@ public: wglDeleteContext(dmy_rc); ReleaseDC(dmy_id, dmy_pdc); DestroyWindow(dmy_id); + if (old_dc && old_context) + wglMakeCurrent(old_dc, old_context); } HDC dmy_pdc; HGLRC dmy_rc; + HDC old_dc; + HGLRC old_context; WId dmy_id; }; -- cgit v0.12 From e433f472a765d738238a6b380060ce15c4910148 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Mon, 28 Sep 2009 17:27:19 +0200 Subject: Fix QWebHistory autotest crashes https://bugs.webkit.org/show_bug.cgi?id=29803 Reviewed-by: Simon Hausmann Cherry-picked-by: Simon Hausmann --- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index a6942a4..af27788 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -1491,9 +1491,11 @@ QWebPage::QWebPage(QObject *parent) */ QWebPage::~QWebPage() { - FrameLoader *loader = d->mainFrame->d->frame->loader(); - if (loader) - loader->detachFromParent(); + if (d->mainFrame) { + FrameLoader *loader = d->mainFrame->d->frame->loader(); + if (loader) + loader->detachFromParent(); + } if (d->inspector) d->inspector->setPage(0); delete d; @@ -1520,6 +1522,7 @@ QWebFrame *QWebPage::mainFrame() const */ QWebFrame *QWebPage::currentFrame() const { + d->createMainFrame(); return static_cast(d->page->focusController()->focusedOrMainFrame()->loader()->client())->webFrame(); } @@ -1545,6 +1548,7 @@ QWebFrame* QWebPage::frameAt(const QPoint& pos) const */ QWebHistory *QWebPage::history() const { + d->createMainFrame(); return &d->history; } -- cgit v0.12 From 4efaf156223cd12f799164a479929f78a9b5db95 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Mon, 28 Sep 2009 17:28:57 +0200 Subject: fixed a typo in the doc. Reviewed-by: trustme --- src/gui/inputmethod/qinputcontext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/inputmethod/qinputcontext.cpp b/src/gui/inputmethod/qinputcontext.cpp index 620880a..81cc3b8 100644 --- a/src/gui/inputmethod/qinputcontext.cpp +++ b/src/gui/inputmethod/qinputcontext.cpp @@ -295,7 +295,7 @@ void QInputContext::sendEvent(const QInputMethodEvent &event) The \a event parameter is the event that was sent to the editor widget. The event type is QEvent::MouseButtonPress, QEvent::MouseButtonRelease, QEvent::MouseButtonDblClick or - QEvent::MouseButtonMove. The event's button and state indicate + QEvent::MouseMove. The event's button and state indicate the kind of operation that was performed. */ void QInputContext::mouseHandler(int /*x*/, QMouseEvent *event) -- cgit v0.12 From ffeb75fe970dadbf2b5e5a96bc63ba0a53fb6be5 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 28 Sep 2009 16:28:36 +0200 Subject: QScript: Fix strange bugs and crashes. I was assuming that the default return value register was always set to 0 for native calls. But this is not the case. So we must ensure this. Also be consistend in the way the stackframe grow and shrink. This expose another bug in the way the call frame is created in JSC Reviewed-by: Kent Hansen --- .../JavaScriptCore/interpreter/Interpreter.cpp | 14 +++++++++++- src/script/api/qscriptengine.cpp | 17 +++++++++------ src/script/api/qscriptengine_p.h | 3 ++- tests/auto/qscriptcontext/tst_qscriptcontext.cpp | 25 ++++++++++++++++++++++ 4 files changed, 50 insertions(+), 9 deletions(-) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp index c31216b..bfb0307 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp @@ -3071,8 +3071,11 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi if (callType == CallTypeHost) { ScopeChainNode* scopeChain = callFrame->scopeChain(); CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset); +#ifdef QT_BUILD_SCRIPT_LIB //we need the returnValue to be 0 as it is used as flags + newCallFrame->init(0, vPC + 5, scopeChain, callFrame, 0, argCount, asObject(v)); +#else newCallFrame->init(0, vPC + 5, scopeChain, callFrame, dst, argCount, asObject(v)); - +#endif Register* thisRegister = newCallFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount; ArgList args(thisRegister + 1, argCount - 1); @@ -3225,7 +3228,12 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi if (callType == CallTypeHost) { ScopeChainNode* scopeChain = callFrame->scopeChain(); CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset); +#ifdef QT_BUILD_SCRIPT_LIB //we need the returnValue to be 0 as it is used as flags + newCallFrame->init(0, vPC + 5, scopeChain, callFrame, 0, argCount, asObject(v)); +#else newCallFrame->init(0, vPC + 5, scopeChain, callFrame, dst, argCount, asObject(v)); +#endif + Register* thisRegister = newCallFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount; ArgList args(thisRegister + 1, argCount - 1); @@ -3501,7 +3509,11 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi ScopeChainNode* scopeChain = callFrame->scopeChain(); CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset); +#ifdef QT_BUILD_SCRIPT_LIB //we need the returnValue to be 0 as it is used as flags + newCallFrame->init(0, vPC + 7, scopeChain, callFrame, 0, argCount, asObject(v)); +#else newCallFrame->init(0, vPC + 7, scopeChain, callFrame, dst, argCount, asObject(v)); +#endif JSValue returnValue; { diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index 78bbf5f..b27d1be 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -2353,23 +2353,25 @@ JSC::CallFrame *QScriptEnginePrivate::pushContext(JSC::CallFrame *exec, JSC::JSV //build a frame JSC::CallFrame *newCallFrame = exec; if (callee == 0 //called from public QScriptEngine::pushContext - || exec->returnPC() == 0 || (contextFlags(exec) & NativeContext) //called from native-native call + || exec->returnPC() == 0 || (contextFlags(exec) & NativeContext) //called from native-native call || (exec->codeBlock() && exec->callee() != callee)) { //the interpreter did not build a frame for us. //We need to check if the Interpreter might have already created a frame for function called from JS. JSC::Interpreter *interp = exec->interpreter(); JSC::Register *oldEnd = interp->registerFile().end(); int argc = args.size() + 1; //add "this" JSC::Register *newEnd = oldEnd + argc + JSC::RegisterFile::CallFrameHeaderSize; - if (!interp->registerFile().grow(newEnd)) + //Without + argc + JSC::RegisterFile::CallFrameHeaderSize, it crashes. + //It seems that JSC is not consistant with the way the callframe is crated + if (!interp->registerFile().grow(newEnd + argc + JSC::RegisterFile::CallFrameHeaderSize)) return 0; //### Stack overflow - newCallFrame = JSC::CallFrame::create(oldEnd); + newCallFrame = JSC::CallFrame::create(newEnd); newCallFrame[0] = thisObject; int dst = 0; JSC::ArgList::const_iterator it; for (it = args.begin(); it != args.end(); ++it) newCallFrame[++dst] = *it; newCallFrame += argc + JSC::RegisterFile::CallFrameHeaderSize; - newCallFrame->init(0, /*vPC=*/0, exec->scopeChain(), exec, flags, argc, callee); + newCallFrame->init(0, /*vPC=*/0, exec->scopeChain(), exec, flags | ShouldRestoreCallFrame, argc, callee); } else { setContextFlags(newCallFrame, flags); #if ENABLE(JIT) @@ -2411,18 +2413,19 @@ void QScriptEngine::popContext() */ void QScriptEnginePrivate::popContext() { - bool hasScope = contextFlags(currentFrame) & HasScopeContext; - if (currentFrame->returnPC() == 0) { //normal case + uint flags = contextFlags(currentFrame); + bool hasScope = flags & HasScopeContext; + if (flags & ShouldRestoreCallFrame) { //normal case JSC::RegisterFile ®isterFile = currentFrame->interpreter()->registerFile(); JSC::Register *const newEnd = currentFrame->registers() - JSC::RegisterFile::CallFrameHeaderSize - currentFrame->argumentCount(); if (hasScope) currentFrame->scopeChain()->pop()->deref(); - currentFrame = currentFrame->callerFrame(); registerFile.shrink(newEnd); } else if(hasScope) { //the stack frame was created by the Interpreter, we don't need to rewind it. currentFrame->setScopeChain(currentFrame->scopeChain()->pop()); currentFrame->scopeChain()->deref(); } + currentFrame = currentFrame->callerFrame(); } /*! diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h index c43ca61..b8b805e 100644 --- a/src/script/api/qscriptengine_p.h +++ b/src/script/api/qscriptengine_p.h @@ -170,7 +170,8 @@ public: enum ContextFlags { NativeContext = 1, CalledAsConstructorContext = 2, - HasScopeContext = 4 + HasScopeContext = 4, // Specifies that the is a QScriptActivationObject + ShouldRestoreCallFrame = 8 }; static uint contextFlags(JSC::ExecState *); static void setContextFlags(JSC::ExecState *, uint); diff --git a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp index 063075d..461c994 100644 --- a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp +++ b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp @@ -724,6 +724,31 @@ void tst_QScriptContext::backtrace_data() QTest::newRow("call native") << source << expected; } + + { + QLatin1String func( "function f1() {\n" + " eval('var q = 4');\n" + " return custom_call(bt, 22);\n" + "}"); + + QString source = QString::fromLatin1("\n" + "function f2() {\n" + " func = %1\n" + " return custom_call(func, 12);\n" + "}\n" + "f2();\n").arg(func); + + QStringList expected; + expected << "(22) at -1" + << "(function () {\n [native code]\n}, 22) at -1" + << "f1(12) at testfile:5" + << QString::fromLatin1("(%1, 12) at -1").arg(func) + << "f2() at testfile:7" + << "() at testfile:9"; + + + QTest::newRow("calls with closures") << source << expected; + } } -- cgit v0.12 From f46e5fe39e9c6e87313d2ae60324119b870afccb Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 28 Sep 2009 17:21:13 +0200 Subject: QScript: Add test for getting backtrace of recursive functions --- tests/auto/qscriptcontext/tst_qscriptcontext.cpp | 66 ++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp index 461c994..b193d67 100644 --- a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp +++ b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp @@ -568,6 +568,19 @@ static QScriptValue custom_call(QScriptContext *ctx, QScriptEngine *) return ctx->argumentsObject().property(0).call(QScriptValue(), QScriptValueList() << ctx->argumentsObject().property(1)); } +static QScriptValue native_recurse(QScriptContext *ctx, QScriptEngine *eng) +{ + QScriptValue func = ctx->argumentsObject().property(0); + QScriptValue n = ctx->argumentsObject().property(1); + + if(n.toUInt32() <= 1) { + return func.call(QScriptValue(), QScriptValueList()); + } else { + return eng->evaluate("native_recurse").call(QScriptValue(), + QScriptValueList() << func << QScriptValue(n.toUInt32() - 1)); + } +} + void tst_QScriptContext::backtrace_data() { QTest::addColumn("code"); @@ -749,6 +762,58 @@ void tst_QScriptContext::backtrace_data() QTest::newRow("calls with closures") << source << expected; } + + { + QLatin1String func( "function js_bt() {\n" + " return bt();\n" + "}"); + + QString source = QString::fromLatin1("\n" + "%1\n" + "function f() {\n" + " return native_recurse(js_bt, 12);\n" + "}\n" + "f();\n").arg(func); + + QStringList expected; + expected << "() at -1" << "js_bt() at testfile:3"; + for(int n = 1; n <= 12; n++) { + expected << QString::fromLatin1("(%1, %2) at -1") + .arg(func).arg(n); + } + expected << "f() at testfile:6"; + expected << "() at testfile:8"; + + QTest::newRow("native recursive") << source << expected; + } + + { + QString source = QString::fromLatin1("\n" + "function finish() {\n" + " return bt();\n" + "}\n" + "function rec(n) {\n" + " if(n <= 1)\n" + " return finish();\n" + " else\n" + " return rec (n - 1);\n" + "}\n" + "function f() {\n" + " return rec(12);\n" + "}\n" + "f();\n"); + + QStringList expected; + expected << "() at -1" << "finish() at testfile:3"; + for(int n = 1; n <= 12; n++) { + expected << QString::fromLatin1("rec(n = %1) at testfile:%2") + .arg(n).arg((n==1) ? 7 : 9); + } + expected << "f() at testfile:12"; + expected << "() at testfile:14"; + + QTest::newRow("js recursive") << source << expected; + } } @@ -761,6 +826,7 @@ void tst_QScriptContext::backtrace() eng.globalObject().setProperty("bt", eng.newFunction(getBacktrace)); eng.globalObject().setProperty("custom_eval", eng.newFunction(custom_eval)); eng.globalObject().setProperty("custom_call", eng.newFunction(custom_call)); + eng.globalObject().setProperty("native_recurse", eng.newFunction(native_recurse)); QString fileName = "testfile"; QScriptValue ret = eng.evaluate(code, fileName); -- cgit v0.12 From 398a5ccbc7067c29d7ca7502c21f6c88cd3f98e5 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 28 Sep 2009 18:11:39 +0200 Subject: Fix to Q3PopupMenu autotest on windows 100ms is not enough because there is a delay for the popup. --- tests/auto/q3popupmenu/tst_q3popupmenu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/q3popupmenu/tst_q3popupmenu.cpp b/tests/auto/q3popupmenu/tst_q3popupmenu.cpp index 5585c3a..df8573d 100644 --- a/tests/auto/q3popupmenu/tst_q3popupmenu.cpp +++ b/tests/auto/q3popupmenu/tst_q3popupmenu.cpp @@ -135,11 +135,11 @@ void tst_Q3PopupMenu::task177490_highlighted() QTest::mouseMove(&menu1, QPoint(x, y1)); QTest::mouseMove(&menu1, QPoint(x, y1 + 1)); - QTest::qWait(100); + QTest::qWait(1000); QTest::mouseMove(&menu1, QPoint(x, y2)); QTest::mouseMove(&menu1, QPoint(x, y2 + 1)); - QTest::qWait(100); + QTest::qWait(1000); QCOMPARE(spy.count(), 2); // one per menu item } -- cgit v0.12 From e20c832098d98076a0f988ce01b53586e370d272 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 28 Sep 2009 21:14:16 +0200 Subject: Fix Freemantle build of JSC/WebKit. Remove __clear_cache which is an internal function of GCC https://bugs.webkit.org/show_bug.cgi?id=28886 Patch by Gabor Loki on 2009-09-28 Reviewed by Simon Hausmann. Although __clear_cache is exported from GCC, this is an internal function. GCC makes no promises about it. * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::cacheFlush): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48824 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocator.h | 5 ----- src/3rdparty/webkit/JavaScriptCore/jit/ExecutableAllocator.h | 5 ----- 2 files changed, 10 deletions(-) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocator.h b/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocator.h index 12e2a32..3274fcc 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocator.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocator.h @@ -191,11 +191,6 @@ public: { User::IMB_Range(code, static_cast(code) + size); } -#elif PLATFORM(ARM) && COMPILER(GCC) && (GCC_VERSION >= 30406) && !defined(DISABLE_BUILTIN_CLEAR_CACHE) - static void cacheFlush(void* code, size_t size) - { - __clear_cache(reinterpret_cast(code), reinterpret_cast(code) + size); - } #elif PLATFORM(ARM_TRADITIONAL) && PLATFORM(LINUX) static void cacheFlush(void* code, size_t size) { diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/ExecutableAllocator.h b/src/3rdparty/webkit/JavaScriptCore/jit/ExecutableAllocator.h index 12e2a32..3274fcc 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/ExecutableAllocator.h +++ b/src/3rdparty/webkit/JavaScriptCore/jit/ExecutableAllocator.h @@ -191,11 +191,6 @@ public: { User::IMB_Range(code, static_cast(code) + size); } -#elif PLATFORM(ARM) && COMPILER(GCC) && (GCC_VERSION >= 30406) && !defined(DISABLE_BUILTIN_CLEAR_CACHE) - static void cacheFlush(void* code, size_t size) - { - __clear_cache(reinterpret_cast(code), reinterpret_cast(code) + size); - } #elif PLATFORM(ARM_TRADITIONAL) && PLATFORM(LINUX) static void cacheFlush(void* code, size_t size) { -- cgit v0.12 From 679a6b373a5496c069b1ed668f7eb166237bd0e2 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Mon, 28 Sep 2009 22:49:12 +0200 Subject: QWheelEvent not working on Cocoa 64Bit The patch which added support for smooth scrolling will work only on 32 bit builds. The new methods (e.g. deviceDeltaX) of the NSEvent were added with the float return type. This should be of CGFloat type instead, which is different from float on 64 bit builds. Reviewed-by: Trust Me --- src/gui/kernel/qcocoaview_mac.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 4ebf8a9..f482d1c 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -64,9 +64,9 @@ #include @interface NSEvent (DeviceDelta) - - (float)deviceDeltaX; - - (float)deviceDeltaY; - - (float)deviceDeltaZ; + - (CGFloat)deviceDeltaX; + - (CGFloat)deviceDeltaY; + - (CGFloat)deviceDeltaZ; @end QT_BEGIN_NAMESPACE -- cgit v0.12 From 88466bcb2162cd063912dbb0e73982095c15dcba Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Tue, 29 Sep 2009 00:24:01 +0200 Subject: doc: add some more \since 4.6 tags --- src/corelib/global/qglobal.cpp | 2 ++ src/corelib/tools/qlocale.cpp | 5 ++++- src/gui/graphicsview/qgraphicslayout.cpp | 2 ++ src/gui/image/qimagereader.cpp | 18 ++++++++++++------ src/gui/inputmethod/qinputcontext.cpp | 2 ++ src/gui/kernel/qapplication_s60.cpp | 4 ++++ src/gui/painting/qcolor.cpp | 23 +++++++++++++++++++++++ src/gui/painting/qpainter.cpp | 4 ++++ src/gui/painting/qprinter.cpp | 6 ++++-- src/testlib/qtestcase.cpp | 1 + 10 files changed, 58 insertions(+), 9 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 97362af..63e2891 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1066,6 +1066,7 @@ bool qSharedBuild() /*! \fn QSysInfo::SymbianVersion QSysInfo::symbianVersion() + \since 4.6 Returns the version of the Symbian operating system on which the application is run (Symbian only). @@ -1073,6 +1074,7 @@ bool qSharedBuild() /*! \fn QSysInfo::S60Version QSysInfo::s60Version() + \since 4.6 Returns the version of the S60 SDK system on which the application is run (S60 only). diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index dc61adb..4a66b92 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -637,7 +637,8 @@ static QString winSystemPMText() } /*! - Returns the fallback locale obtained from the system. + \since 4.6 + Returns the fallback locale obtained from the system. */ QLocale QSystemLocale::fallbackLocale() const { @@ -1283,6 +1284,8 @@ QVariant QSystemLocale::query(QueryType type, QVariant /* in */) const #elif !defined(Q_OS_SYMBIAN) /*! + \since 4.6 + Returns a fallback locale, that will get used for everything that is not explicitly overridden by the system locale. */ diff --git a/src/gui/graphicsview/qgraphicslayout.cpp b/src/gui/graphicsview/qgraphicslayout.cpp index f9800bc..2e9a30c 100644 --- a/src/gui/graphicsview/qgraphicslayout.cpp +++ b/src/gui/graphicsview/qgraphicslayout.cpp @@ -420,6 +420,8 @@ void QGraphicsLayout::widgetEvent(QEvent *e) */ /*! + \since 4.6 + This function is a convenience function provided for custom layouts, and will go through all items in the layout and reparent their graphics items to the closest QGraphicsWidget ancestor of the layout. diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index aff186b..074f3eb 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -696,14 +696,17 @@ bool QImageReader::autoDetectImageFormat() const /*! - Specifies that the image reader should decide which plugin to use - solely based on the contents in the datastream. + If \a ignored is set to true, then the image reader will ignore + specified formats or file extensions and decide which plugin to + use only based on the contents in the datastream. Setting this flag means that all image plugins gets loaded. Each plugin will read the first bytes in the image data and decide if - the plugin is compatible or not. The flag is set to \a ignored. + the plugin is compatible or not. - This also disables auto detecting image format. + This also disables auto detecting the image format. + + \sa decideFormatFromContent() */ void QImageReader::setDecideFormatFromContent(bool ignored) @@ -713,8 +716,11 @@ void QImageReader::setDecideFormatFromContent(bool ignored) /*! - Returns wether the image reader should decide which plugin to use - sloley based on the contents of the datastream + Returns whether the image reader should decide which plugin to use + only based on the contents of the datastream rather than on the file + extension. + + \sa setDecideFormatFromContent() */ bool QImageReader::decideFormatFromContent() const diff --git a/src/gui/inputmethod/qinputcontext.cpp b/src/gui/inputmethod/qinputcontext.cpp index 81cc3b8..8ee417f 100644 --- a/src/gui/inputmethod/qinputcontext.cpp +++ b/src/gui/inputmethod/qinputcontext.cpp @@ -469,6 +469,8 @@ bool QInputContext::x11FilterEvent(QWidget * /*keywidget*/, XEvent * /*event*/) #ifdef Q_WS_S60 /*! + \since 4.6 + This function may be overridden only if input method is depending on Symbian and you need raw TWsEvent. Otherwise, this function must not. diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 8daac42..0637652 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1305,6 +1305,7 @@ void QApplication::beep() /*! \warning This function is only available on Symbian. + \since 4.6 This function processes an individual Symbian window server \a event. It returns 1 if the event was handled, 0 if @@ -1427,6 +1428,7 @@ int QApplication::s60ProcessEvent(TWsEvent *event) /*! \warning This virtual function is only available on Symbian. + \since 4.6 If you create an application that inherits QApplication and reimplement this function, you get direct access to events that the are received @@ -1444,6 +1446,7 @@ bool QApplication::s60EventFilter(TWsEvent * /* aEvent */) /*! \warning This function is only available on Symbian. + \since 4.6 Handles \a{command}s which are typically handled by CAknAppUi::HandleCommandL(). Qts Ui integration into Symbian is @@ -1475,6 +1478,7 @@ void QApplication::symbianHandleCommand(int command) /*! \warning This function is only available on Symbian. + \since 4.6 Handles the resource change specified by \a type. diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index 5659aef..62e08f3 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -691,6 +691,8 @@ void QColor::setHsv(int h, int s, int v, int a) } /*! + \since 4.6 + Sets the contents pointed to by \a h, \a s, \a l, and \a a, to the hue, saturation, lightness, and alpha-channel (transparency) components of the color's HSL value. @@ -719,6 +721,8 @@ void QColor::getHslF(qreal *h, qreal *s, qreal *l, qreal *a) const } /*! + \since 4.6 + Sets the contents pointed to by \a h, \a s, \a l, and \a a, to the hue, saturation, lightness, and alpha-channel (transparency) components of the color's HSL value. @@ -747,6 +751,8 @@ void QColor::getHsl(int *h, int *s, int *l, int *a) const } /*! + \since 4.6 + Sets a HSL color lightness; \a h is the hue, \a s is the saturation, \a l is the lightness and \a a is the alpha component of the HSL color. @@ -773,6 +779,8 @@ void QColor::setHslF(qreal h, qreal s, qreal l, qreal a) } /*! + \since 4.6 + Sets a HSL color value; \a h is the hue, \a s is the saturation, \a l is the lightness and \a a is the alpha component of the HSL color. @@ -1332,6 +1340,8 @@ qreal QColor::valueF() const } /*! + \since 4.6 + Returns the hue color component of this color. \sa getHslF(), getHsl() @@ -1344,6 +1354,8 @@ int QColor::hslHue() const } /*! + \since 4.6 + Returns the saturation color component of this color. \sa saturationF(), getHsv(), {QColor#The HSV Color Model}{The HSV Color @@ -1357,6 +1369,8 @@ int QColor::hslSaturation() const } /*! + \since 4.6 + Returns the lightness color component of this color. \sa lightnessF(), getHsl() @@ -1369,6 +1383,8 @@ int QColor::lightness() const } /*! + \since 4.6 + Returns the hue color component of this color. \sa hue(), getHslF() @@ -1381,6 +1397,8 @@ qreal QColor::hslHueF() const } /*! + \since 4.6 + Returns the saturation color component of this color. \sa saturationF() getHslF() @@ -1393,6 +1411,8 @@ qreal QColor::hslSaturationF() const } /*! + \since 4.6 + Returns the lightness color component of this color. \sa value() getHslF() @@ -1979,6 +1999,8 @@ QColor QColor::fromHsvF(qreal h, qreal s, qreal v, qreal a) } /*! + \since 4.6 + Static convenience function that returns a QColor constructed from the HSV color values, \a h (hue), \a s (saturation), \a l (lightness), and \a a (alpha-channel, i.e. transparency). @@ -2010,6 +2032,7 @@ QColor QColor::fromHsl(int h, int s, int l, int a) /*! \overload + \since 4.6 Static convenience function that returns a QColor constructed from the HSV color values, \a h (hue), \a s (saturation), \a l (lightness), and \a a diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index ed1b5d1..f271af9 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -1895,6 +1895,8 @@ QPaintEngine *QPainter::paintEngine() const } /*! + \since 4.6 + Flushes the painting pipeline and prepares for the user issuing commands directly to the underlying graphics context. Must be followed by a call to endNativePainting(). @@ -1919,6 +1921,8 @@ void QPainter::beginNativePainting() } /*! + \since 4.6 + Restores the painter after manually issuing native painting commands. Lets the painter restore any native state that it relies on before calling any other painter commands. diff --git a/src/gui/painting/qprinter.cpp b/src/gui/painting/qprinter.cpp index eb9b11b..5ff0b96 100644 --- a/src/gui/painting/qprinter.cpp +++ b/src/gui/painting/qprinter.cpp @@ -1275,7 +1275,7 @@ QPrinter::ColorMode QPrinter::colorMode() const buffering up the copies and in those cases the application must make an explicit call to the print code for each copy. - \sa setNumCopies() + \sa setNumCopies(), actualNumCopies() */ int QPrinter::numCopies() const @@ -1286,13 +1286,15 @@ int QPrinter::numCopies() const /*! + \since 4.6 + Returns the number of copies that will be printed. The default value is 1. This function always returns the actual value specified in the print dialog or using setNumCopies(). - \sa setNumCopies(), numCopies(); + \sa setNumCopies(), numCopies() */ int QPrinter::actualNumCopies() const { diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index a2f0179..eb4dee1 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -735,6 +735,7 @@ QT_BEGIN_NAMESPACE */ /*! \fn void QTest::qWaitForWindowShown(QWidget *window) + \since 4.6 Waits until the \a window is shown in the screen. This is mainly useful for asynchronous systems like X11, where a window will be mapped to screen some -- cgit v0.12 From b88817e481f2cc2aea0787fe355659b581599abb Mon Sep 17 00:00:00 2001 From: Bill King Date: Tue, 29 Sep 2009 10:09:30 +1000 Subject: Fixes compile --- examples/webkit/formextractor/formextractor.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/webkit/formextractor/formextractor.cpp b/examples/webkit/formextractor/formextractor.cpp index 4b181e8..3ce888c 100644 --- a/examples/webkit/formextractor/formextractor.cpp +++ b/examples/webkit/formextractor/formextractor.cpp @@ -67,15 +67,15 @@ void FormExtractor::submit() QWebElement femaleGender = frame->findFirstElement("#genderFemale"); QWebElement updates = frame->findFirstElement("#updates"); - ui.firstNameEdit->setText(firstName.evaluateJavaScript("this.value").toString()); - ui.lastNameEdit->setText(lastName.evaluateJavaScript("this.value").toString()); + ui.firstNameEdit->setText(firstName.evaluateScript("this.value").toString()); + ui.lastNameEdit->setText(lastName.evaluateScript("this.value").toString()); - if (maleGender.evaluateJavaScript("this.checked").toBool()) - ui.genderEdit->setText(maleGender.evaluateJavaScript("this.value").toString()); - else if (femaleGender.evaluateJavaScript("this.checked").toBool()) - ui.genderEdit->setText(femaleGender.evaluateJavaScript("this.value").toString()); + if (maleGender.evaluateScript("this.checked").toBool()) + ui.genderEdit->setText(maleGender.evaluateScript("this.value").toString()); + else if (femaleGender.evaluateScript("this.checked").toBool()) + ui.genderEdit->setText(femaleGender.evaluateScript("this.value").toString()); - if (updates.evaluateJavaScript("this.checked").toBool()) + if (updates.evaluateScript("this.checked").toBool()) ui.updatesEdit->setText("Yes"); else ui.updatesEdit->setText("No"); -- cgit v0.12 From aa8865b37520cf591ae795895f4a38d5ad86c17a Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Mon, 28 Sep 2009 18:37:25 -0700 Subject: Fix a alpha issue with RGB32 and DirectFB Since we can't use RGB32 format with DirectFB (issues regarding Qt's assumptions about the alpha byte) we need to explicitly convert images of this type to the preferred alphaPixmap format. This fixes an issue where RGB32 images get a curious gray alpha overlay. Reviewed-by: Noam Rosenthal --- src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index ce9a55c..b15888b 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -288,7 +288,7 @@ bool QDirectFBPixmapData::fromDataBufferDescription(const DFBDataBufferDescripti void QDirectFBPixmapData::fromImage(const QImage &img, Qt::ImageConversionFlags flags) { - if (img.depth() == 1) { + if (img.depth() == 1 || img.format() == QImage::Format_RGB32) { fromImage(img.convertToFormat(screen->alphaPixmapFormat()), flags); return; } @@ -308,6 +308,8 @@ void QDirectFBPixmapData::fromImage(const QImage &img, if (flags != Qt::AutoColor) { image = img.convertToFormat(imageFormat, flags); flags = Qt::AutoColor; + } else if (img.format() == QImage::Format_RGB32) { + image = img.convertToFormat(imageFormat, flags); } else { image = img; } @@ -332,6 +334,7 @@ void QDirectFBPixmapData::fromImage(const QImage &img, } else { dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX); } + dfbSurface->Blit(dfbSurface, imageSurface, 0, 0, 0); imageSurface->Release(imageSurface); -- cgit v0.12 From 638f46a96b68d21137c4903c68015752ebdf58dc Mon Sep 17 00:00:00 2001 From: Bill King Date: Tue, 29 Sep 2009 13:46:10 +1000 Subject: Fixes failing autotest. --- tests/auto/qsqldatabase/tst_qsqldatabase.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp index ce2396d..4175bef 100644 --- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp @@ -2001,6 +2001,10 @@ void tst_QSqlDatabase::odbc_bindBoolean() QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); + if (tst_Databases::isMySQL(db)) { + QSKIP("MySql has inconsistent behaviour of bit field type across versions.", SkipSingle); + return; + } QSqlQuery q(db); QVERIFY_SQL(q, exec("CREATE TABLE " + qTableName("qtestBindBool") + "(id int, boolvalue bit)")); -- cgit v0.12 From 562f05d87ee41b7b95f91eea44a4a966dbcde1b9 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 29 Sep 2009 16:09:03 +1000 Subject: Assistant, Designer, Lingist and QMake manuals weren't generated. qdoc3 warns when it doesn't find doc source files that are listed in the .qdocconf file, but it doesn't error out. Thus the manuals haven't been generated since the 4.6 doc reorganization, but the failure has been silent. Reviewed-by: Trust Me --- tools/qdoc3/test/assistant.qdocconf | 2 +- tools/qdoc3/test/designer.qdocconf | 2 +- tools/qdoc3/test/linguist.qdocconf | 2 +- tools/qdoc3/test/qmake.qdocconf | 2 +- tools/qdoc3/test/qt-api-only-with-xcode.qdocconf | 8 ++++---- tools/qdoc3/test/qt-api-only.qdocconf | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf index 9ee8965..4ddc94a 100644 --- a/tools/qdoc3/test/assistant.qdocconf +++ b/tools/qdoc3/test/assistant.qdocconf @@ -31,7 +31,7 @@ qhp.Assistant.subprojects.examples.sortPages = true language = Cpp -sources = $QT_SOURCE_TREE/doc/src/assistant-manual.qdoc \ +sources = $QT_SOURCE_TREE/doc/src/development/assistant-manual.qdoc \ $QT_SOURCE_TREE/doc/src/examples/simpletextviewer.qdoc sources.fileextensions = "*.cpp *.qdoc" diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf index 2a65184..9d8bd23 100644 --- a/tools/qdoc3/test/designer.qdocconf +++ b/tools/qdoc3/test/designer.qdocconf @@ -31,7 +31,7 @@ qhp.Designer.subprojects.examples.sortPages = true language = Cpp -sources = $QT_SOURCE_TREE/doc/src/designer-manual.qdoc \ +sources = $QT_SOURCE_TREE/doc/src/development/designer-manual.qdoc \ $QT_SOURCE_TREE/doc/src/examples/calculatorbuilder.qdoc \ $QT_SOURCE_TREE/doc/src/examples/calculatorform.qdoc \ $QT_SOURCE_TREE/doc/src/examples/customwidgetplugin.qdoc \ diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf index 6c71993..f433529 100644 --- a/tools/qdoc3/test/linguist.qdocconf +++ b/tools/qdoc3/test/linguist.qdocconf @@ -31,7 +31,7 @@ qhp.Linguist.subprojects.examples.sortPages = true language = Cpp -sources = $QT_SOURCE_TREE/doc/src/linguist-manual.qdoc \ +sources = $QT_SOURCE_TREE/doc/src/internationalization/linguist-manual.qdoc \ $QT_SOURCE_TREE/doc/src/examples/hellotr.qdoc \ $QT_SOURCE_TREE/doc/src/examples/arrowpad.qdoc \ $QT_SOURCE_TREE/doc/src/examples/trollprint.qdoc diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf index 3dc1d3b..dcb3c9a 100644 --- a/tools/qdoc3/test/qmake.qdocconf +++ b/tools/qdoc3/test/qmake.qdocconf @@ -27,7 +27,7 @@ qhp.qmake.subprojects.manual.selectors = fake:page language = Cpp -sources = $QT_SOURCE_TREE/doc/src/qmake-manual.qdoc +sources = $QT_SOURCE_TREE/doc/src/development/qmake-manual.qdoc sources.fileextensions = "*.cpp *.qdoc" diff --git a/tools/qdoc3/test/qt-api-only-with-xcode.qdocconf b/tools/qdoc3/test/qt-api-only-with-xcode.qdocconf index 0389386..0d78cda 100644 --- a/tools/qdoc3/test/qt-api-only-with-xcode.qdocconf +++ b/tools/qdoc3/test/qt-api-only-with-xcode.qdocconf @@ -9,9 +9,9 @@ url = ./ # Ensures that the documentation for the tools is not included in the generated # .qhp file. -qhp.Qt.excluded = $QT_SOURCE_TREE/doc/src/assistant-manual.qdoc \ +qhp.Qt.excluded = $QT_SOURCE_TREE/doc/src/development/assistant-manual.qdoc \ $QT_SOURCE_TREE/doc/src/examples/simpletextviewer.qdoc \ - $QT_SOURCE_TREE/doc/src/designer-manual.qdoc \ + $QT_SOURCE_TREE/doc/src/development/designer-manual.qdoc \ $QT_SOURCE_TREE/doc/src/examples/calculatorbuilder.qdoc \ $QT_SOURCE_TREE/doc/src/examples/calculatorform.qdoc \ $QT_SOURCE_TREE/doc/src/examples/customwidgetplugin.qdoc \ @@ -19,11 +19,11 @@ qhp.Qt.excluded = $QT_SOURCE_TREE/doc/src/assistant-manual.qdoc \ $QT_SOURCE_TREE/doc/src/examples/containerextension.qdoc \ $QT_SOURCE_TREE/doc/src/examples/worldtimeclockbuilder.qdoc \ $QT_SOURCE_TREE/doc/src/examples/worldtimeclockplugin.qdoc \ - $QT_SOURCE_TREE/doc/src/linguist-manual.qdoc \ + $QT_SOURCE_TREE/doc/src/internationalization/linguist-manual.qdoc \ $QT_SOURCE_TREE/doc/src/examples/hellotr.qdoc \ $QT_SOURCE_TREE/doc/src/examples/arrowpad.qdoc \ $QT_SOURCE_TREE/doc/src/examples/trollprint.qdoc \ - $QT_SOURCE_TREE/doc/src/qmake-manual.qdoc + $QT_SOURCE_TREE/doc/src/development/qmake-manual.qdoc outputdir = $QT_BUILD_TREE/doc-build/html-qt base = file:$QT_BUILD_TREE/doc-build/html-qt diff --git a/tools/qdoc3/test/qt-api-only.qdocconf b/tools/qdoc3/test/qt-api-only.qdocconf index bc5656b..10b7be5 100644 --- a/tools/qdoc3/test/qt-api-only.qdocconf +++ b/tools/qdoc3/test/qt-api-only.qdocconf @@ -9,9 +9,9 @@ url = ./ # Ensures that the documentation for the tools is not included in the generated # .qhp file. -qhp.Qt.excluded += $QT_SOURCE_TREE/doc/src/assistant-manual.qdoc \ +qhp.Qt.excluded += $QT_SOURCE_TREE/doc/src/development/assistant-manual.qdoc \ $QT_SOURCE_TREE/doc/src/examples/simpletextviewer.qdoc \ - $QT_SOURCE_TREE/doc/src/designer-manual.qdoc \ + $QT_SOURCE_TREE/doc/src/development/designer-manual.qdoc \ $QT_SOURCE_TREE/doc/src/examples/calculatorbuilder.qdoc \ $QT_SOURCE_TREE/doc/src/examples/calculatorform.qdoc \ $QT_SOURCE_TREE/doc/src/examples/customwidgetplugin.qdoc \ @@ -19,11 +19,11 @@ qhp.Qt.excluded += $QT_SOURCE_TREE/doc/src/assistant-manual.qdoc \ $QT_SOURCE_TREE/doc/src/examples/containerextension.qdoc \ $QT_SOURCE_TREE/doc/src/examples/worldtimeclockbuilder.qdoc \ $QT_SOURCE_TREE/doc/src/examples/worldtimeclockplugin.qdoc \ - $QT_SOURCE_TREE/doc/src/linguist-manual.qdoc \ + $QT_SOURCE_TREE/doc/src/internationalization/linguist-manual.qdoc \ $QT_SOURCE_TREE/doc/src/examples/hellotr.qdoc \ $QT_SOURCE_TREE/doc/src/examples/arrowpad.qdoc \ $QT_SOURCE_TREE/doc/src/examples/trollprint.qdoc \ - $QT_SOURCE_TREE/doc/src/qmake-manual.qdoc + $QT_SOURCE_TREE/doc/src/development/qmake-manual.qdoc outputdir = $QT_BUILD_TREE/doc-build/html-qt tagfile = $QT_BUILD_TREE/doc-build/html-qt/qt.tags -- cgit v0.12 From dc741de083711e0089bd2fb5ed326a011f488830 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 29 Sep 2009 16:14:16 +1000 Subject: Fix qdoc error. Reviewed-by: Trust Me --- src/corelib/animation/qabstractanimation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index d6ef95b..f92c22d 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -704,8 +704,8 @@ bool QAbstractAnimation::event(QEvent *event) /*! \fn virtual void QAbstractAnimation::updateCurrentTime(int currentTime) = 0; - This pure virtual function is called every time the animation's current - time changes. + This pure virtual function is called every time the animation's + \a currentTime changes. \sa updateState() */ -- cgit v0.12 From baf6fc9f10aa751b786021ef9b23ac546881b699 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 29 Sep 2009 16:16:55 +1000 Subject: Improve error reporting when qdoc cannot open a source file. Make the user's life easier by including the reason for the error in the failure message. Reviewed-by: Trust Me --- tools/qdoc3/cppcodeparser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index 4b5f0c6..ec5ce96 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -47,6 +47,7 @@ #include #include +#include #include "codechunk.h" #include "config.h" @@ -281,7 +282,7 @@ void CppCodeParser::parseSourceFile(const Location& location, { FILE *in = fopen(QFile::encodeName(filePath), "r"); if (!in) { - location.error(tr("Cannot open C++ source file '%1'").arg(filePath)); + location.error(tr("Cannot open C++ source file '%1' (%2)").arg(filePath).arg(strerror(errno))); return; } -- cgit v0.12 From c7abca0813f1536482bca6b57a312cb11b2399d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Tue, 29 Sep 2009 08:21:39 +0200 Subject: Dont generate public docs for QSimplex. --- src/gui/graphicsview/qsimplex_p.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/graphicsview/qsimplex_p.cpp b/src/gui/graphicsview/qsimplex_p.cpp index 1ba24a3..1ece8b1 100644 --- a/src/gui/graphicsview/qsimplex_p.cpp +++ b/src/gui/graphicsview/qsimplex_p.cpp @@ -49,6 +49,7 @@ QT_BEGIN_NAMESPACE /*! + \internal \class QSimplex The QSimplex class is a Linear Programming problem solver based on the two-phase @@ -111,6 +112,7 @@ void QSimplex::clearDataStructures() } /*! + \internal Sets the new constraints in the simplex solver and returns whether the problem is feasible. @@ -509,6 +511,7 @@ qreal QSimplex::solver(solverFactor factor) } /*! + \internal Minimize the original objective. */ qreal QSimplex::solveMin() @@ -517,6 +520,7 @@ qreal QSimplex::solveMin() } /*! + \internal Maximize the original objective. */ qreal QSimplex::solveMax() -- cgit v0.12 From fd5269a9a80bf8b119086b3f326c72a332aba4e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Tue, 29 Sep 2009 08:27:49 +0200 Subject: Fix some docs to follow the Qt style. (remove asterisks, proper indenting) Note that this does *not* change the content of the docs. --- src/gui/graphicsview/qgraphicsanchorlayout.cpp | 88 +++++++++++++------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp index 78b6b53..b3ebb2b 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp @@ -171,23 +171,23 @@ QGraphicsAnchorLayout::~QGraphicsAnchorLayout() } /*! - * Creates an anchor between the edge \a firstEdge of item \a firstItem and the edge \a secondEdge - * of item \a secondItem. The magnitude of the anchor is picked up from the style. Anchors - * between a layout edge and an item edge will have a size of 0. - * If there is already an anchor between the edges, the the new anchor will replace the old one. - * - * \a firstItem and \a secondItem are automatically added to the layout if they are not part - * of the layout. This means that count() can increase with up to 2. - * - * The spacing an anchor will get depends on the type of anchor. For instance, anchors from the - * Right edge of one item to the Left edge of another (or vice versa) will use the default - * horizontal spacing. The same behaviour applies to Bottom to Top anchors, (but they will use - * the default vertical spacing). For all other anchor combinations, the spacing will be 0. - * All anchoring functions will follow this rule. - * - * The spacing can also be set manually by using QGraphicsAnchor::setSpacing() method. - * - * \sa addCornerAnchors(), addAnchors() + Creates an anchor between the edge \a firstEdge of item \a firstItem and the edge \a secondEdge + of item \a secondItem. The magnitude of the anchor is picked up from the style. Anchors + between a layout edge and an item edge will have a size of 0. + If there is already an anchor between the edges, the the new anchor will replace the old one. + + \a firstItem and \a secondItem are automatically added to the layout if they are not part + of the layout. This means that count() can increase with up to 2. + + The spacing an anchor will get depends on the type of anchor. For instance, anchors from the + Right edge of one item to the Left edge of another (or vice versa) will use the default + horizontal spacing. The same behaviour applies to Bottom to Top anchors, (but they will use + the default vertical spacing). For all other anchor combinations, the spacing will be 0. + All anchoring functions will follow this rule. + + The spacing can also be set manually by using QGraphicsAnchor::setSpacing() method. + + \sa addCornerAnchors(), addAnchors() */ QGraphicsAnchor * QGraphicsAnchorLayout::addAnchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint firstEdge, @@ -200,8 +200,8 @@ QGraphicsAnchorLayout::addAnchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint } /*! - Returns the anchor between the anchor points defined by \a firstItem and \a firstEdge and - \a secondItem and \a secondEdge. If there is no such anchor, the function will return 0. + Returns the anchor between the anchor points defined by \a firstItem and \a firstEdge and + \a secondItem and \a secondEdge. If there is no such anchor, the function will return 0. */ QGraphicsAnchor * QGraphicsAnchorLayout::anchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint firstEdge, @@ -212,30 +212,30 @@ QGraphicsAnchorLayout::anchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint fi } /*! - * Creates two anchors between \a firstItem and \a secondItem, where one is for the horizontal - * edge and another one for the vertical edge that the corners \a firstCorner and \a - * secondCorner specifies. - * The magnitude of the anchors is picked up from the style. - * - * This is a convenience function, since anchoring corners can be expressed as anchoring two edges. - * For instance, - * \code - * layout->addAnchor(layout, Qt::AnchorTop, b, Qt::AnchorTop); - * layout->addAnchor(layout, Qt::AnchorLeft, b, Qt::AnchorLeft); - * \endcode - * - * has the same effect as - * - * \code - * layout->addCornerAnchors(layout, Qt::TopLeft, b, Qt::TopLeft); - * \endcode - * - * If there is already an anchor between the edge pairs, it will be replaced by the anchors that - * this function specifies. - * - * \a firstItem and \a secondItem are automatically added to the layout if they are not part - * of the layout. This means that count() can increase with up to 2. - */ + Creates two anchors between \a firstItem and \a secondItem, where one is for the horizontal + edge and another one for the vertical edge that the corners \a firstCorner and \a + secondCorner specifies. + The magnitude of the anchors is picked up from the style. + + This is a convenience function, since anchoring corners can be expressed as anchoring two edges. + For instance, + \code + layout->addAnchor(layout, Qt::AnchorTop, b, Qt::AnchorTop); + layout->addAnchor(layout, Qt::AnchorLeft, b, Qt::AnchorLeft); + \endcode + + has the same effect as + + \code + layout->addCornerAnchors(layout, Qt::TopLeft, b, Qt::TopLeft); + \endcode + + If there is already an anchor between the edge pairs, it will be replaced by the anchors that + this function specifies. + + \a firstItem and \a secondItem are automatically added to the layout if they are not part of the + layout. This means that count() can increase with up to 2. +*/ void QGraphicsAnchorLayout::addCornerAnchors(QGraphicsLayoutItem *firstItem, Qt::Corner firstCorner, QGraphicsLayoutItem *secondItem, @@ -360,7 +360,7 @@ qreal QGraphicsAnchorLayout::verticalSpacing() const } /*! - \reimp + \reimp */ void QGraphicsAnchorLayout::setGeometry(const QRectF &geom) { -- cgit v0.12