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 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