From 4be79721e6db9e460d00eb13a0736be8eca36721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Mon, 1 Mar 2010 15:07:02 +0100 Subject: Fix windowflags example --- examples/widgets/windowflags/controllerwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/widgets/windowflags/controllerwindow.cpp b/examples/widgets/windowflags/controllerwindow.cpp index a1e5455..fb82b8f 100644 --- a/examples/widgets/windowflags/controllerwindow.cpp +++ b/examples/widgets/windowflags/controllerwindow.cpp @@ -149,7 +149,7 @@ void ControllerWindow::createTypeGroupBox() splashScreenRadioButton = createRadioButton(tr("Splash screen")); windowRadioButton->setChecked(true); - QVBoxLayout *layout = new QGridLayout; + QGridLayout *layout = new QGridLayout; layout->addWidget(windowRadioButton, 0, 0); layout->addWidget(dialogRadioButton, 1, 0); layout->addWidget(sheetRadioButton, 2, 0); -- cgit v0.12 From 94b2938086203bc6154b107c518df7a6fbfb4b2c Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Tue, 2 Mar 2010 10:56:03 +0200 Subject: Fixed FEP crash when selected text was replaced with a a new T9 text. In T9 input mode StartFepInlineEditL gets called with empty initial text. In case there was text selected in editor when editing started, the selected text did not get removed since the logic in editors to detect input is as follows: bool isGettingInput = !event->commitString().isEmpty() || event->preeditString() != preeditAreaText() || event->replacementLength() > 0; This means that empty preeditString did not trigger selection removal, but the selected text was removed when non-empty inline text was provided by UpdateFepInlineTextL. However, the S60 FEP assumes that StartFepInlineEditL removes the selected text, i.e GetCursorSelectionForFep after StartFepInlineEditL must return empty selection. The above issue was fixed by removing the selected text explicitly in StartFepInlineEditL if aInitialInlineText is empty. Task-number: QTBUG-6363 Reviewed-by: Axis --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 1ac8ace..cc60246 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -551,6 +551,21 @@ void QCoeFepInputContext::StartFepInlineEditL(const TDesC& aInitialInlineText, m_formatRetriever = &aInlineTextFormatRetriever; m_pointerHandler = &aPointerEventHandlerDuringInlineEdit; + // With T9 aInitialInlineText is typically empty when StartFepInlineEditL is called, + // but FEP requires that selected text is always removed at StartFepInlineEditL. + // Let's remove the selected text if aInitialInlineText is empty and there is selected text + if (m_preeditString.isEmpty()) { + int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt(); + int replacementLength = qAbs(m_cursorPos-anchor); + if (replacementLength > 0) { + int replacementStart = m_cursorPos < anchor ? 0 : -replacementLength; + QList clearSelectionAttributes; + QInputMethodEvent clearSelectionEvent(QLatin1String(""), clearSelectionAttributes); + clearSelectionEvent.setCommitString(QLatin1String(""), replacementStart, replacementLength); + sendEvent(clearSelectionEvent); + } + } + applyFormat(&attributes); attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, -- cgit v0.12 From a76d12862122504bae2e75cb78bdb21d180aaca0 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Tue, 2 Mar 2010 16:03:26 +0200 Subject: Re-applied a fix which get lost during softkey refactoring. See original commit (b461da1040c32d6690870290d6716a3b5cb7e9e9) for more information. Task-number: QTBUG-6220 Reviewed-By: TrustMe --- src/gui/kernel/qsoftkeymanager_s60.cpp | 7 ++++++- src/gui/widgets/qmainwindow.cpp | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp index 2a1ecc5..dedf0a1 100644 --- a/src/gui/kernel/qsoftkeymanager_s60.cpp +++ b/src/gui/kernel/qsoftkeymanager_s60.cpp @@ -284,7 +284,12 @@ bool QSoftKeyManagerPrivateS60::setSoftkey(CEikButtonGroupContainer &cba, TPtrC nativeText = qt_QString2TPtrC(text); int command = S60_COMMAND_START + position; setNativeSoftkey(cba, position, command, nativeText); - cba.DimCommand(command, !action->isEnabled()); + // QMainWindow "Options" action is set to invisible in order it does not appear in context menu + // and all invisible actions are by default disabled. + // However we never want to dim options softkey, even it is set to invisible + QVariant property = action->property(MENU_ACTION_PROPERTY); + const bool dimmed = (property.isValid() && property.toBool()) ? false : !action->isEnabled(); + cba.DimCommand(command, dimmed); realSoftKeyActions.insert(command, action); return true; } diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index e7c4f45..7e59bb0 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -119,6 +119,7 @@ void QMainWindowPrivate::init() q->setAttribute(Qt::WA_Hover); #ifdef QT_SOFTKEYS_ENABLED menuBarAction = QSoftKeyManager::createAction(QSoftKeyManager::MenuSoftKey, q); + menuBarAction->setVisible(false); #endif } -- cgit v0.12 From dfcbab749e51cddbbdec35d58c37814d4d21f30f Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Tue, 2 Mar 2010 16:20:12 +0200 Subject: Symbian event dispatcher needs to run all active objects. Symbian event dispatcher runs only active objects that have priority CActive::EPriorityIdle or above. CActive defines standard priorities but priority can be anything from KMinTInt to KMaxTInt Task-number: QTBUG-8654 Reviewed-by: axis --- src/corelib/kernel/qeventdispatcher_symbian.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index 1d7be79..191be6c 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -733,7 +733,7 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla } TInt error; - handledSymbianEvent = CActiveScheduler::RunIfReady(error, CActive::EPriorityIdle); + handledSymbianEvent = CActiveScheduler::RunIfReady(error, KMinTInt); if (error) { qWarning("CActiveScheduler::RunIfReady() returned error: %i\n", error); CActiveScheduler::Current()->Error(error); -- cgit v0.12