From 7bd60b56dee678ae6a013983fcd403d5c00a20d1 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 11 Aug 2009 18:48:24 +0200 Subject: Cleaned public Api of QS60Style due to review by Volker Hilsheimer. Moved handleDynamicLayoutVariantSwitch and handleSkinChange from QS60Style to QS60StylePrivate. QApplication (the only one calling those functions) is now a friend, thus has access to the private class. --- src/gui/kernel/qapplication_s60.cpp | 4 ++-- src/gui/styles/qs60style.h | 7 +------ src/gui/styles/qs60style_p.h | 5 +++++ src/gui/styles/qs60style_s60.cpp | 20 +++++++++----------- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index d2183d2..db78349 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1100,7 +1100,7 @@ void QApplication::symbianResourceChange(int type) s60Style = qobject_cast(QApplication::style()); if (s60Style) - s60Style->handleDynamicLayoutVariantSwitch(); + s60Style->d_func()->handleDynamicLayoutVariantSwitch(); #endif } break; @@ -1108,7 +1108,7 @@ void QApplication::symbianResourceChange(int type) #ifndef QT_NO_STYLE_S60 case KAknsMessageSkinChange: if (QS60Style *s60Style = qobject_cast(QApplication::style())) - s60Style->handleSkinChange(); + s60Style->d_func()->handleSkinChange(); break; #endif #endif // Q_WS_S60 diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h index bdd8c8a..7711b19 100644 --- a/src/gui/styles/qs60style.h +++ b/src/gui/styles/qs60style.h @@ -89,12 +89,6 @@ public: bool saveS60ThemeToBlob(const QString &blobFile) const; #endif // !Q_WS_S60 -#ifdef Q_WS_S60 -public Q_SLOTS: - void handleDynamicLayoutVariantSwitch(); - void handleSkinChange(); -#endif // Q_WS_S60 - protected Q_SLOTS: QIcon standardIconImplementation( StandardPixmap standardIcon, const QStyleOption * option = 0, const QWidget * widget = 0 ) const; @@ -102,6 +96,7 @@ protected Q_SLOTS: private: Q_DISABLE_COPY(QS60Style) friend class QStyleFactory; + friend class QApplication; }; #endif // QT_NO_STYLE_S60 diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 0cd2310..680d787 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -455,6 +455,11 @@ public: SkinElementFlags flags = KDefaultSkinElementFlags); static QPixmap backgroundTexture(); +#ifdef Q_WS_S60 + void handleDynamicLayoutVariantSwitch(); + void handleSkinChange(); +#endif // Q_WS_S60 + private: static void drawPart(QS60StyleEnums::SkinParts part, QPainter *painter, const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags); diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 635442b..45be2eb 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -1358,26 +1358,24 @@ QS60Style::QS60Style() { } -void QS60Style::handleDynamicLayoutVariantSwitch() +void QS60StylePrivate::handleDynamicLayoutVariantSwitch() { - Q_D(QS60Style); - d->clearCaches(QS60StylePrivate::CC_LayoutChange); - d->setActiveLayout(); - d->refreshUI(); - d->setBackgroundTexture(qApp); + clearCaches(QS60StylePrivate::CC_LayoutChange); + setActiveLayout(); + refreshUI(); + setBackgroundTexture(qApp); foreach (QWidget *widget, QApplication::allWidgets()) widget->ensurePolished(); } -void QS60Style::handleSkinChange() +void QS60StylePrivate::handleSkinChange() { - Q_D(QS60Style); - d->clearCaches(QS60StylePrivate::CC_ThemeChange); - d->setThemePalette(qApp); + clearCaches(QS60StylePrivate::CC_ThemeChange); + setThemePalette(qApp); foreach (QWidget *topLevelWidget, QApplication::allWidgets()){ QEvent e(QEvent::StyleChange); QApplication::sendEvent(topLevelWidget, &e); - d->setThemePalette(topLevelWidget); + setThemePalette(topLevelWidget); topLevelWidget->ensurePolished(); } } -- cgit v0.12 From 6d8679f68edc53766b1d9c201226f8fc410c946f Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 11 Aug 2009 19:42:21 +0200 Subject: Docs: Mentioning that Symbian has a default font size of 7 points --- src/gui/text/qfont.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index a575199..6279ecd 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -775,7 +775,9 @@ QFont::QFont() Constructs a font object with the specified \a family, \a pointSize, \a weight and \a italic settings. - If \a pointSize is <= 0, it is set to 12. + If \a pointSize is <= 0, it is set to a default font size. + That default size is 12 points except on Symbian, where it is + 7 points. The \a family name may optionally also include a foundry name, e.g. "Helvetica [Cronyx]". If the \a family is -- cgit v0.12 From bc0a3868da2a08a6940d7dcb10721c968b995fbe Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 11 Aug 2009 20:17:27 +0200 Subject: Doc improvement made by David Boddie. Reviewed-by: David Boddie --- src/gui/text/qfont.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 6279ecd..c47a834 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -775,9 +775,9 @@ QFont::QFont() Constructs a font object with the specified \a family, \a pointSize, \a weight and \a italic settings. - If \a pointSize is <= 0, it is set to a default font size. - That default size is 12 points except on Symbian, where it is - 7 points. + If \a pointSize is zero or negative, the point size of the font + is set to a system-dependent default value. Generally, this is + 12 points, except on Symbian where it is 7 points. The \a family name may optionally also include a foundry name, e.g. "Helvetica [Cronyx]". If the \a family is -- cgit v0.12 From 1b75966678eafd3ce47fb49c1c387a12df571d7d Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Wed, 12 Aug 2009 11:06:35 +1000 Subject: Fixed failure to build tests due to missing qkeyevent. Since the qkeyevent test was removed, also remove it from auto.pro. --- tests/auto/auto.pro | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index a048bc7..c36cd75 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -186,7 +186,6 @@ SUBDIRS += \ qitemmodel \ qitemselectionmodel \ qitemview \ - qkeyevent \ qkeysequence \ qlabel \ qlayout \ -- cgit v0.12 From 5d084d2207b78e2ac45360839d7fa69c3c71960f Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 12 Aug 2009 11:03:28 +0300 Subject: Updated QtScript.txt autotest category file to reflect current test set. --- tests/auto/_Categories/QtScript.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/_Categories/QtScript.txt b/tests/auto/_Categories/QtScript.txt index abd93a4..3b7e79a 100644 --- a/tests/auto/_Categories/QtScript.txt +++ b/tests/auto/_Categories/QtScript.txt @@ -6,7 +6,6 @@ qscriptengine qscriptengineagent #qscriptenginedebugger does not compile, requires QtScriptTools.lib qscriptjstestsuite -qscriptqobject qscriptstring qscriptv8testsuite qscriptvalue -- cgit v0.12 From 7191199ec9682a12d10619e87b373517022c2e28 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 12 Aug 2009 11:04:56 +0300 Subject: Fixed QtScript autotest build breaks due to incorrect SRCDIR usage. --- tests/auto/qscriptengine/qscriptengine.pro | 2 +- tests/auto/qscriptengine/tst_qscriptengine.cpp | 4 ++++ tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp | 4 ++++ tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro | 2 +- tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp | 4 ++++ 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/auto/qscriptengine/qscriptengine.pro b/tests/auto/qscriptengine/qscriptengine.pro index 39484bd..c33b979 100644 --- a/tests/auto/qscriptengine/qscriptengine.pro +++ b/tests/auto/qscriptengine/qscriptengine.pro @@ -1,7 +1,7 @@ load(qttest_p4) QT = core gui script SOURCES += tst_qscriptengine.cpp -DEFINES += SRCDIR=\\\"$$PWD\\\" +!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" wince*|symbian*: { addFiles.sources = script diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp index ab4364e..de3a6aa 100644 --- a/tests/auto/qscriptengine/tst_qscriptengine.cpp +++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp @@ -49,6 +49,10 @@ #include #include +#if defined(Q_OS_SYMBIAN) +# define SRCDIR "" +#endif + Q_DECLARE_METATYPE(QList) Q_DECLARE_METATYPE(QObjectList) diff --git a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp index ab0ddca..2733845 100644 --- a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp +++ b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp @@ -44,6 +44,10 @@ #include +#if defined(Q_OS_SYMBIAN) +# define SRCDIR "" +#endif + //TESTED_CLASS= //TESTED_FILES= diff --git a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro index 58c53e4..3f641b5 100644 --- a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro +++ b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro @@ -1,7 +1,7 @@ load(qttest_p4) QT = core script SOURCES += tst_qscriptv8testsuite.cpp -DEFINES += SRCDIR=\\\"$$PWD\\\" +!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" wince*|symbian: { testFiles.sources = tests diff --git a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp index 6604104..724c2fb 100644 --- a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp +++ b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp @@ -45,6 +45,10 @@ #include +#if defined(Q_OS_SYMBIAN) +# define SRCDIR "" +#endif + //TESTED_CLASS= //TESTED_FILES= -- cgit v0.12 From bceb9733ceae86612adb622d88d6681a13ccd52c Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 12 Aug 2009 11:16:07 +0300 Subject: Fixed qdom autotest build break due to incorrect SRCDIR usage in Symbian. --- tests/auto/qdom/qdom.pro | 2 +- tests/auto/qdom/tst_qdom.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/auto/qdom/qdom.pro b/tests/auto/qdom/qdom.pro index 84b721e..61914b5 100644 --- a/tests/auto/qdom/qdom.pro +++ b/tests/auto/qdom/qdom.pro @@ -10,7 +10,7 @@ wince*|symbian*: { DEPLOYMENT += addFiles DEPLOYMENT_PLUGIN += qcncodecs qjpcodecs qkrcodecs qtwcodecs - DEFINES += SRCDIR=\\\"\\\" + !symbian:DEFINES += SRCDIR=\\\"\\\" } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp index 5b4787f..cea0402 100644 --- a/tests/auto/qdom/tst_qdom.cpp +++ b/tests/auto/qdom/tst_qdom.cpp @@ -52,6 +52,10 @@ #include #include +#if defined(Q_OS_SYMBIAN) +# define SRCDIR "" +#endif + //TESTED_CLASS= //TESTED_FILES= -- cgit v0.12 From 6383349c11fdff670a0244edb16fd7b7750a4e62 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 12 Aug 2009 11:48:28 +0300 Subject: Fixed QtNetwork autotest build breaks for Symbian. Also updated QtNetwork auto test category file. --- src/network/access/qhttpnetworkconnection_p.h | 2 +- tests/auto/_Categories/QtNetwork.txt | 2 +- tests/auto/qhostinfo/tst_qhostinfo.cpp | 4 ++-- tests/auto/qsslsocket/tst_qsslsocket.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h index d6b0325..33c72b4 100644 --- a/src/network/access/qhttpnetworkconnection_p.h +++ b/src/network/access/qhttpnetworkconnection_p.h @@ -65,7 +65,7 @@ #include #include -#include "qhttpnetworkconnectionchannel_p.h" +#include #ifndef QT_NO_HTTP diff --git a/tests/auto/_Categories/QtNetwork.txt b/tests/auto/_Categories/QtNetwork.txt index f08cfc9..30645d7 100644 --- a/tests/auto/_Categories/QtNetwork.txt +++ b/tests/auto/_Categories/QtNetwork.txt @@ -1,4 +1,4 @@ -_networkselftest +networkselftest #qsocketnotifier qabstractnetworkcache qabstractsocket diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp index bf499ec..9943414 100644 --- a/tests/auto/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp @@ -14,7 +14,7 @@ ** ** 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 +** General Public License version 2.1 as published by 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 @@ -219,7 +219,7 @@ void tst_QHostInfo::lookupIPv4_data() #ifdef Q_OS_SYMBIAN // Test server lookup QTest::newRow("lookup_01") << QtNetworkSettings::serverName() << QtNetworkSettings::serverIP().toString() << int(QHostInfo::NoError); - QTest::newRow("literal_ip4") << QtNetworkSettings::serverIP() << QtNetworkSettings::serverIP().toString() << int(QHostInfo::NoError); + QTest::newRow("literal_ip4") << QtNetworkSettings::serverIP().toString() << QtNetworkSettings::serverIP().toString() << int(QHostInfo::NoError); QTest::newRow("multiple_ip4") << "multi.dev.troll.no" << "1.2.3.4 1.2.3.5 10.3.3.31" << int(QHostInfo::NoError); #else QTest::newRow("empty") << "" << "" << int(QHostInfo::HostNotFound); diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp index 12e8f1b..05b0794 100644 --- a/tests/auto/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp @@ -626,7 +626,7 @@ void tst_QSslSocket::connectToHostEncryptedWithVerificationPeerName() socket->addCaCertificates(QLatin1String(SRCDIR "certs/qt-test-server-cacert.pem")); #ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND - connect(&socket, SIGNAL(sslErrors(QList)), + connect(socket, SIGNAL(sslErrors(QList)), this, SLOT(untrustedWorkaroundSlot(QList))); #endif -- cgit v0.12 From c84749652f59d19fd1c5f611e8d105464f8bc673 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 12 Aug 2009 11:52:10 +0300 Subject: Fixed SRCDIR usage in qscriptengine test for Symbian --- tests/auto/qscriptengine/qscriptengine.pro | 1 + tests/auto/qscriptengine/tst_qscriptengine.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/auto/qscriptengine/qscriptengine.pro b/tests/auto/qscriptengine/qscriptengine.pro index c33b979..4d1828f 100644 --- a/tests/auto/qscriptengine/qscriptengine.pro +++ b/tests/auto/qscriptengine/qscriptengine.pro @@ -10,5 +10,6 @@ wince*|symbian*: { } symbian: { + DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x","")) TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb" } diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp index de3a6aa..cb2ab2e 100644 --- a/tests/auto/qscriptengine/tst_qscriptengine.cpp +++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp @@ -49,16 +49,17 @@ #include #include -#if defined(Q_OS_SYMBIAN) -# define SRCDIR "" -#endif - Q_DECLARE_METATYPE(QList) Q_DECLARE_METATYPE(QObjectList) //TESTED_CLASS= //TESTED_FILES= +#if defined(Q_OS_SYMBIAN) +# define STRINGIFY(x) #x +# define TOSTRING(x) STRINGIFY(x) +# define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) +#endif class tst_QScriptEngine : public QObject { Q_OBJECT @@ -231,7 +232,7 @@ void tst_QScriptEngine::newFunction() QCOMPARE(fun.prototype().isValid(), true); QCOMPARE(fun.prototype().isFunction(), true); QCOMPARE(fun.prototype().strictlyEquals(eng.evaluate("Function.prototype")), true); - + QCOMPARE(fun.call().isNull(), true); QCOMPARE(fun.construct().isObject(), true); } -- cgit v0.12 From ba62482f69385ba929384e0402135891c77eddcb Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 12 Aug 2009 09:44:51 +0200 Subject: Revert "Changed the behavior of ImCursorPosition slightly." This reverts commit ce02d0e9e0ad8d8ac47e4f3ee95bac5cb74ed184. This turned out not to be enough for proper selection support together with S60 FEP. Instead we will revert the behavior and add new API. (cherry picked from commit 6545932efa45ea2b8fbc1459d760ec5f15c63120) Conflicts: doc/src/qnamespace.qdoc src/gui/widgets/qlineedit.cpp --- src/gui/widgets/qlineedit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index 5b04616..cd9666d 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -1657,7 +1657,7 @@ QVariant QLineEdit::inputMethodQuery(Qt::InputMethodQuery property) const case Qt::ImFont: return font(); case Qt::ImCursorPosition: - return QVariant(d->control->hasSelectedText() ? d->control->selectionEnd() : d->control->cursor()); + return QVariant(d->control->cursor()); case Qt::ImSurroundingText: return QVariant(text()); case Qt::ImCurrentSelection: -- cgit v0.12 From 9e03643608527e9ea567b186c7b9209a52908d27 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 12 Aug 2009 09:59:17 +0200 Subject: Redid patch that was lost during merge with 4.6. See commit 203b2b2c611e2 for details. --- src/gui/widgets/qlineedit_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qlineedit_p.h b/src/gui/widgets/qlineedit_p.h index b21820c..f1263c6 100644 --- a/src/gui/widgets/qlineedit_p.h +++ b/src/gui/widgets/qlineedit_p.h @@ -101,7 +101,7 @@ public: inline bool shouldEnableInputMethod() const { - return !control->isReadOnly() && (control->echoMode() == QLineEdit::Normal || control->echoMode() == QLineEdit::PasswordEchoOnEdit); + return !control->isReadOnly(); } QPoint tripleClick; -- cgit v0.12 From 4d1c7a4f2f8f451d13d9a5bffc4c44c3221c3ca1 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 12 Aug 2009 10:09:50 +0200 Subject: Redid 7b95b70bc307 for QLineControl. --- src/gui/widgets/qlinecontrol.cpp | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index f4a2348..80215e1 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -400,8 +400,17 @@ void QLineControl::moveCursor(int pos, bool mark) */ void QLineControl::processInputMethodEvent(QInputMethodEvent *event) { - int priorState = m_undoState; - removeSelectedText(); + int priorState = 0; + bool isGettingInput = !event->commitString().isEmpty() || !event->preeditString().isEmpty() + || event->replacementLength() > 0; + bool cursorPositionChanged = false; + + if (isGettingInput) { + // If any text is being input, remove selected text. + priorState = m_undoState; + removeSelectedText(); + } + int c = m_cursor; // cursor position after insertion of commit string if (event->replacementStart() <= 0) @@ -415,11 +424,30 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event) m_selend = m_selstart + event->replacementLength(); removeSelectedText(); } - if (!event->commitString().isEmpty()) + if (!event->commitString().isEmpty()) { insert(event->commitString()); + cursorPositionChanged = true; + } m_cursor = qMin(c, m_text.length()); + for (int i = 0; i < event->attributes().size(); ++i) { + const QInputMethodEvent::Attribute &a = event->attributes().at(i); + if (a.type == QInputMethodEvent::Selection) { + m_cursor = qBound(0, a.start + a.length, m_text.length()); + if (a.length) { + m_selstart = qMax(0, qMin(a.start, m_text.length())); + m_selend = m_cursor; + if (m_selend < m_selstart) { + qSwap(m_selstart, m_selend); + } + } else { + m_selstart = m_selend = 0; + } + cursorPositionChanged = true; + } + } + setPreeditArea(m_cursor, event->preeditString()); m_preeditCursor = event->preeditString().length(); m_hideCursor = false; @@ -442,9 +470,10 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event) } m_textLayout.setAdditionalFormats(formats); updateDisplayText(); - if (!event->commitString().isEmpty()) + if (cursorPositionChanged) emitCursorPositionChanged(); - finishChange(priorState); + if (isGettingInput) + finishChange(priorState); } /*! -- cgit v0.12 From 8cfcc81c9ff784d61eccdef53a3ce7ef125526f8 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 12 Aug 2009 10:57:22 +0200 Subject: Fixed warning. --- src/gui/widgets/qlineedit_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qlineedit_p.h b/src/gui/widgets/qlineedit_p.h index f1263c6..2c0d08f 100644 --- a/src/gui/widgets/qlineedit_p.h +++ b/src/gui/widgets/qlineedit_p.h @@ -76,7 +76,7 @@ public: QLineEditPrivate() : control(0), frame(1), contextMenuEnabled(1), cursorVisible(0), - dragEnabled(0), hscroll(0), vscroll(0), clickCausedFocus(0), + dragEnabled(0), clickCausedFocus(0), hscroll(0), vscroll(0), alignment(Qt::AlignLeading | Qt::AlignVCenter), leftTextMargin(0), topTextMargin(0), rightTextMargin(0), bottomTextMargin(0) { -- cgit v0.12 From efa40eb09f8f1aca87439456666a2747e435e548 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 12 Aug 2009 12:38:52 +0300 Subject: Skipped setEnvironment test in qprocess test for Symbian --- tests/auto/qprocess/tst_qprocess.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/auto/qprocess/tst_qprocess.cpp b/tests/auto/qprocess/tst_qprocess.cpp index 6059833..111a093 100644 --- a/tests/auto/qprocess/tst_qprocess.cpp +++ b/tests/auto/qprocess/tst_qprocess.cpp @@ -164,7 +164,7 @@ protected slots: void restartProcess(); void waitForReadyReadInAReadyReadSlotSlot(); void waitForBytesWrittenInABytesWrittenSlotSlot(); - + private: QProcess *process; qint64 bytesAvailable; @@ -1805,8 +1805,9 @@ void tst_QProcess::setEnvironment_data() void tst_QProcess::setEnvironment() { -#if !defined (Q_OS_WINCE) - // there is no concept of system variables on Windows CE as there is no console +#if defined (Q_OS_WINCE) || defined(Q_OS_SYMBIAN) + QSKIP("OS doesn't support environment variables", SkipAll); +#endif // make sure our environment variables are correct QVERIFY(qgetenv("tst_QProcess").isEmpty()); @@ -1882,7 +1883,6 @@ void tst_QProcess::setEnvironment() QCOMPARE(process.readAll(), value.toLocal8Bit()); } -#endif } //----------------------------------------------------------------------------- void tst_QProcess::systemEnvironment() -- cgit v0.12 From 9bba7e42a2988967507d536c497c54efc791eb67 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 12 Aug 2009 11:38:39 +0200 Subject: Removed call to base class mouseReleaseEvent that shouldn't happen. In that codepath, the item is editable, and we don't want the normal mouse handling (which may move the item) to happen. RevBy: Andreas --- src/gui/graphicsview/qgraphicsitem.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 2ef78b2..7091b5d 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -9108,7 +9108,6 @@ void QGraphicsTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) QApplication::sendEvent(receiver, &_event); } } - QGraphicsItem::mouseReleaseEvent(event); dd->clickCausedFocus = 0; dd->sendControlEvent(event); -- cgit v0.12 From b64f4af233f0672c40e44358f0efa80ebfaa7620 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 12 Aug 2009 13:26:43 +0300 Subject: Workaround for Nokia X86 compiler, to compile get more GUI test compile. Apparently Nokia X86 compiler is not able to use templated qCompare when given arguments have different different type but same base class. This error should be isolated and reported to Nokia X86 team. See task: 259508 --- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 2 +- tests/auto/qgroupbox/tst_qgroupbox.cpp | 2 +- tests/auto/qwidget/tst_qwidget.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 892e182..0b15928 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -597,7 +597,7 @@ void tst_QGraphicsItem::destruction() child->setParentItem(parent); parent->setVisible(false); scene->addItem(parent); - QCOMPARE(child->parentItem(), parent); + QCOMPARE(child->parentItem(), static_cast(parent)); delete scene; QCOMPARE(itemDeleted, 110); } diff --git a/tests/auto/qgroupbox/tst_qgroupbox.cpp b/tests/auto/qgroupbox/tst_qgroupbox.cpp index 4933deb..383326d 100644 --- a/tests/auto/qgroupbox/tst_qgroupbox.cpp +++ b/tests/auto/qgroupbox/tst_qgroupbox.cpp @@ -467,7 +467,7 @@ void tst_QGroupBox::propagateFocus() box.show(); box.setFocus(); QTest::qWait(250); - QCOMPARE(qApp->focusWidget(), &lineEdit); + QCOMPARE(qApp->focusWidget(), static_cast(&lineEdit)); } QTEST_MAIN(tst_QGroupBox) diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 98a5e73..0014e12 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -9272,7 +9272,7 @@ void tst_QWidget::inputFocus_task257832() QSKIP("No input context", SkipSingle); widget->setFocus(); context->setFocusWidget(widget); - QCOMPARE(context->focusWidget(), widget); + QCOMPARE(context->focusWidget(), static_cast(widget)); widget->setReadOnly(true); QVERIFY(!context->focusWidget()); delete widget; -- cgit v0.12 From 0e3b37152aab2794eced6663984a28c0c9d698a4 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 12 Aug 2009 13:29:06 +0300 Subject: Fixed qimagereader test compilation --- tests/auto/qimagereader/qimagereader.pro | 2 +- tests/auto/qimagereader/tst_qimagereader.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/auto/qimagereader/qimagereader.pro b/tests/auto/qimagereader/qimagereader.pro index b4e1de1..31a9b0f 100644 --- a/tests/auto/qimagereader/qimagereader.pro +++ b/tests/auto/qimagereader/qimagereader.pro @@ -3,7 +3,7 @@ SOURCES += tst_qimagereader.cpp MOC_DIR=tmp QT += network RESOURCES += qimagereader.qrc -DEFINES += SRCDIR=\\\"$$PWD\\\" +!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" !contains(QT_CONFIG, no-gif):DEFINES += QTEST_HAVE_GIF !contains(QT_CONFIG, no-jpeg):DEFINES += QTEST_HAVE_JPEG diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp index ea30b3c..3b1b40b 100644 --- a/tests/auto/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/qimagereader/tst_qimagereader.cpp @@ -55,6 +55,10 @@ #include #include +#if defined(Q_OS_SYMBIAN) +# define SRCDIR "." +#endif + typedef QMap QStringMap; typedef QList QIntList; Q_DECLARE_METATYPE(QImage) -- cgit v0.12 From 30880f6b5c4a22c1929146caaab2dc6ba39dc338 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 12 Aug 2009 13:29:06 +0300 Subject: Updated QtGui.txt autotest category file. --- tests/auto/_Categories/QtGui.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/auto/_Categories/QtGui.txt b/tests/auto/_Categories/QtGui.txt index dcb3be5..e07216f 100644 --- a/tests/auto/_Categories/QtGui.txt +++ b/tests/auto/_Categories/QtGui.txt @@ -87,7 +87,6 @@ qitemeditorfactory qitemmodel qitemselectionmodel qitemview -qkeyevent qkeysequence qlabel qlayout @@ -118,7 +117,6 @@ qpixmap qpixmapcache qpixmapfilter qplaintextedit -qpointarray #qprinter NO PRINTING SUPPORT ON SYMBIAN YET #qprinterinfo qprogressbar -- cgit v0.12 From 47f86ea037c11e2890f331f88c05fcd8667118c2 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 12 Aug 2009 13:30:57 +0300 Subject: Fixed QtGui autotest build breaks due to incorrect SRCDIR usage. --- tests/auto/qimagereader/qimagereader.pro | 2 +- tests/auto/qimagereader/tst_qimagereader.cpp | 4 ++++ tests/auto/qsplitter/qsplitter.pro | 2 +- tests/auto/qsplitter/tst_qsplitter.cpp | 4 ++++ tests/auto/qstyle/qstyle.pro | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/auto/qimagereader/qimagereader.pro b/tests/auto/qimagereader/qimagereader.pro index b4e1de1..31a9b0f 100644 --- a/tests/auto/qimagereader/qimagereader.pro +++ b/tests/auto/qimagereader/qimagereader.pro @@ -3,7 +3,7 @@ SOURCES += tst_qimagereader.cpp MOC_DIR=tmp QT += network RESOURCES += qimagereader.qrc -DEFINES += SRCDIR=\\\"$$PWD\\\" +!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" !contains(QT_CONFIG, no-gif):DEFINES += QTEST_HAVE_GIF !contains(QT_CONFIG, no-jpeg):DEFINES += QTEST_HAVE_JPEG diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp index ea30b3c..291025d 100644 --- a/tests/auto/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/qimagereader/tst_qimagereader.cpp @@ -55,6 +55,10 @@ #include #include +#if defined(Q_OS_SYMBIAN) +# define SRCDIR "" +#endif + typedef QMap QStringMap; typedef QList QIntList; Q_DECLARE_METATYPE(QImage) diff --git a/tests/auto/qsplitter/qsplitter.pro b/tests/auto/qsplitter/qsplitter.pro index 8c3e40b..5ec2b9d 100644 --- a/tests/auto/qsplitter/qsplitter.pro +++ b/tests/auto/qsplitter/qsplitter.pro @@ -8,7 +8,7 @@ wince*|symbian*: { addFiles.sources = extradata.txt setSizes3.dat addFiles.path = . DEPLOYMENT += addFiles - DEFINES += SRCDIR=\\\"./\\\" + !symbian:DEFINES += SRCDIR=\\\"./\\\" } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qsplitter/tst_qsplitter.cpp b/tests/auto/qsplitter/tst_qsplitter.cpp index a44e25d..d76bf78 100644 --- a/tests/auto/qsplitter/tst_qsplitter.cpp +++ b/tests/auto/qsplitter/tst_qsplitter.cpp @@ -57,6 +57,10 @@ #include // for file error messages #include "../../shared/util.h" +#if defined(Q_OS_SYMBIAN) +# define SRCDIR "" +#endif + //TESTED_CLASS= //TESTED_FILES= diff --git a/tests/auto/qstyle/qstyle.pro b/tests/auto/qstyle/qstyle.pro index 8163f26..1ffe369 100644 --- a/tests/auto/qstyle/qstyle.pro +++ b/tests/auto/qstyle/qstyle.pro @@ -3,7 +3,7 @@ TARGET.EPOCHEAPSIZE = 0x200000 0x800000 SOURCES += tst_qstyle.cpp wince*|symbian*: { - DEFINES += SRCDIR=\\\".\\\" + !symbian:DEFINES += SRCDIR=\\\".\\\" addPixmap.sources = task_25863.png addPixmap.path = . DEPLOYMENT += addPixmap -- cgit v0.12 From b69d50ef3b799b8fa7889e68e5d792f37e744937 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Wed, 12 Aug 2009 13:23:06 +0200 Subject: Revert '80dba8b8': Fixing default constructor problem with RVCT. These were added to workaround a bug in RVCT which has apparently been fixed. --- src/sql/kernel/qsqlfield.cpp | 11 +---------- src/sql/kernel/qsqlfield.h | 6 +++--- src/sql/kernel/qsqlresult.cpp | 4 +--- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/sql/kernel/qsqlfield.cpp b/src/sql/kernel/qsqlfield.cpp index 4bb56a3..b528850 100644 --- a/src/sql/kernel/qsqlfield.cpp +++ b/src/sql/kernel/qsqlfield.cpp @@ -159,20 +159,11 @@ public: \sa setRequiredStatus() setLength() setPrecision() setDefaultValue() setGenerated() setReadOnly() */ -QSqlField::QSqlField() -{ - d = new QSqlFieldPrivate(QString(), QVariant::Invalid); -} - -QSqlField::QSqlField(const QString& fieldName) -{ - d = new QSqlFieldPrivate(fieldName, QVariant::Invalid); -} - QSqlField::QSqlField(const QString& fieldName, QVariant::Type type) { d = new QSqlFieldPrivate(fieldName, type); } + /*! Constructs a copy of \a other. */ diff --git a/src/sql/kernel/qsqlfield.h b/src/sql/kernel/qsqlfield.h index d70af15..2c3b52a 100644 --- a/src/sql/kernel/qsqlfield.h +++ b/src/sql/kernel/qsqlfield.h @@ -58,9 +58,9 @@ class Q_SQL_EXPORT QSqlField public: enum RequiredStatus { Unknown = -1, Optional = 0, Required = 1 }; - QSqlField(); - QSqlField(const QString& fieldName); - QSqlField(const QString& fieldName, QVariant::Type type); + QSqlField(const QString& fieldName = QString(), + QVariant::Type type = QVariant::Invalid); + QSqlField(const QSqlField& other); QSqlField& operator=(const QSqlField& other); bool operator==(const QSqlField& other) const; diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp index 2a1ba64..93c9d9f 100644 --- a/src/sql/kernel/qsqlresult.cpp +++ b/src/sql/kernel/qsqlresult.cpp @@ -53,9 +53,7 @@ QT_BEGIN_NAMESPACE struct QHolder { - QHolder(): holderName(QString()), holderPos(-1) {} - QHolder(const QString& hldr): holderName(hldr), holderPos(-1) {} - QHolder(const QString& hldr, int index): holderName(hldr), holderPos(index) {} + QHolder(const QString& hldr = QString(), int index = -1): holderName(hldr), holderPos(index) {} bool operator==(const QHolder& h) const { return h.holderPos == holderPos && h.holderName == holderName; } bool operator!=(const QHolder& h) const { return h.holderPos != holderPos || h.holderName != holderName; } QString holderName; -- cgit v0.12 From a96ef64c37b32bbbb9799bd8567dff383cb49549 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Wed, 12 Aug 2009 13:37:29 +0200 Subject: Revert "Fix to QtNetwork ARMV5 UDEB compilation" This reverts commit 32f931cb6ab5f3e50f1f582276d896f2dff716f1. This reverts commit e39de8681800cbe2ce31c155d23237410b7c21f3. The above commits were added as a workaround to a bug in RVCT which has been fixed. Conflicts: src/network/access/qnetworkcookie.h src/network/access/qnetworkrequest.h --- src/network/access/qnetworkcookie.cpp | 37 ---------------------------------- src/network/access/qnetworkcookie.h | 4 +--- src/network/access/qnetworkrequest.cpp | 12 ----------- src/network/access/qnetworkrequest.h | 4 +--- 4 files changed, 2 insertions(+), 55 deletions(-) diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp index dd5edb0..854bd17 100644 --- a/src/network/access/qnetworkcookie.cpp +++ b/src/network/access/qnetworkcookie.cpp @@ -97,43 +97,6 @@ QT_BEGIN_NAMESPACE /*! Create a new QNetworkCookie object, initializing the cookie name - and its value to empty QByteArray - - A cookie is only valid if it has a name. However, the value is - opaque to the application and being empty may have significance to - the remote server. -*/ -QNetworkCookie::QNetworkCookie() - : d(new QNetworkCookiePrivate) -{ - qRegisterMetaType(); - qRegisterMetaType >(); - - d->name = QByteArray(); - d->value = QByteArray(); -} - -/*! - Create a new QNetworkCookie object, initializing the cookie name - to \a name and its value to empty QByteArray. - - A cookie is only valid if it has a name. However, the value is - opaque to the application and being empty may have significance to - the remote server. -*/ -QNetworkCookie::QNetworkCookie( const QByteArray &name ) - : d(new QNetworkCookiePrivate) -{ - qRegisterMetaType(); - qRegisterMetaType >(); - - d->name = name; - d->value = QByteArray(); -} - - -/*! - Create a new QNetworkCookie object, initializing the cookie name to \a name and its value to \a value. A cookie is only valid if it has a name. However, the value is diff --git a/src/network/access/qnetworkcookie.h b/src/network/access/qnetworkcookie.h index 35c7095..ef309a8 100644 --- a/src/network/access/qnetworkcookie.h +++ b/src/network/access/qnetworkcookie.h @@ -67,9 +67,7 @@ public: Full }; - QNetworkCookie(); - QNetworkCookie(const QByteArray &name ); - QNetworkCookie(const QByteArray &name, const QByteArray &value ); + QNetworkCookie(const QByteArray &name = QByteArray(), const QByteArray &value = QByteArray()); QNetworkCookie(const QNetworkCookie &other); ~QNetworkCookie(); QNetworkCookie &operator=(const QNetworkCookie &other); diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index caa8669..d6d76f7 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -242,18 +242,6 @@ public: }; /*! - Constructs a QNetworkRequest object with empty QUrl. - - \sa url(), setUrl() -*/ -QNetworkRequest::QNetworkRequest() - : d(new QNetworkRequestPrivate) -{ - d->url = QUrl(); -} - - -/*! Constructs a QNetworkRequest object with \a url as the URL to be requested. diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h index cf06f7c..1ea7934 100644 --- a/src/network/access/qnetworkrequest.h +++ b/src/network/access/qnetworkrequest.h @@ -87,9 +87,7 @@ public: AlwaysCache }; - - explicit QNetworkRequest(); - explicit QNetworkRequest(const QUrl &url); + explicit QNetworkRequest(const QUrl &url = QUrl()); QNetworkRequest(const QNetworkRequest &other); ~QNetworkRequest(); QNetworkRequest &operator=(const QNetworkRequest &other); -- cgit v0.12 From 48a72aceeacb904b47176232a7d6624f6cc72f33 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 12 Aug 2009 14:50:16 +0300 Subject: Fixed qfileinfo autotest for Symbian --- tests/auto/qfileinfo/tst_qfileinfo.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp index 4a091e3..9227add 100644 --- a/tests/auto/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp @@ -237,7 +237,6 @@ void tst_QFileInfo::copy() tst_QFileInfo::tst_QFileInfo() { - Q_SET_DEFAULT_IAP } void tst_QFileInfo::isFile_data() @@ -331,6 +330,9 @@ void tst_QFileInfo::isRoot_data() QTest::newRow("drive 1") << "c:" << false; QTest::newRow("drive 2") << "c:/" << true; QTest::newRow("drive 3") << "p:/" << false; +#endif + +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) QTest::newRow("unc 1") << "//" + QtNetworkSettings::winServerName() << true; QTest::newRow("unc 2") << "//" + QtNetworkSettings::winServerName() + "/" << true; QTest::newRow("unc 3") << "//" + QtNetworkSettings::winServerName() + "/testshare" << false; @@ -485,6 +487,8 @@ void tst_QFileInfo::canonicalFilePath() QCOMPARE(info1.canonicalFilePath(), info2.canonicalFilePath()); } } +# if !defined(Q_OS_SYMBIAN) + // Symbian doesn't support links to directories { const QString link(QDir::tempPath() + QDir::separator() + "tst_qfileinfo"); QFile::remove(link); @@ -516,6 +520,7 @@ void tst_QFileInfo::canonicalFilePath() QCOMPARE(info1.canonicalFilePath(), info2.canonicalFilePath()); } } +# endif #endif } -- cgit v0.12 From 7a9b580030208a806897146b4c0f1d8f0d9caaa4 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 12 Aug 2009 15:15:33 +0300 Subject: Removed qdirectpainter test from Symbian tests, as it is for embedded Linux only --- tests/auto/_Categories/QtGui.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/_Categories/QtGui.txt b/tests/auto/_Categories/QtGui.txt index e07216f..77830b2 100644 --- a/tests/auto/_Categories/QtGui.txt +++ b/tests/auto/_Categories/QtGui.txt @@ -38,7 +38,7 @@ qdesktopwidget qdial qdialog qdialogbuttonbox -qdirectpainter cetest-subdir: test +#qdirectpainter cetest-subdir: test TEST IS FOR EMBEDDED LINUX ONLY qdirmodel qdockwidget qdoublespinbox -- cgit v0.12