diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-12-12 10:20:22 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-12-12 10:20:22 (GMT) |
commit | 8203fbfc9e6762dc08676538d82d14709658d275 (patch) | |
tree | 560d5d8bd7e9c2de0f0f662aaeb8022424986b10 /src | |
parent | 9b760682e5686e9df7ccf181cea3c3440aa08647 (diff) | |
parent | 3696ce040cba7c0a352aaeea94d66f9392598b81 (diff) | |
download | Qt-8203fbfc9e6762dc08676538d82d14709658d275.zip Qt-8203fbfc9e6762dc08676538d82d14709658d275.tar.gz Qt-8203fbfc9e6762dc08676538d82d14709658d275.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-symbian-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-symbian-staging:
Fix window surface config on OpenGL graphics system.
Symbian: Fix a case sensitivity issue with QMAKE_EXTRA_COMPILERS
Symbian: Fix double deletion of selected text when using predictive
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 26 | ||||
-rw-r--r-- | src/opengl/qgl_egl.cpp | 20 | ||||
-rw-r--r-- | src/opengl/qgl_symbian.cpp | 21 |
3 files changed, 51 insertions, 16 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 3bcac62..02bc4d0 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -1388,15 +1388,25 @@ void QCoeFepInputContext::StartFepInlineEditL(const TDesC& aInitialInlineText, // 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 cursorPos = w->inputMethodQuery(Qt::ImCursorPosition).toInt(); - int replacementLength = qAbs(cursorPos-anchor); - if (replacementLength > 0) { - int replacementStart = cursorPos < anchor ? 0 : -replacementLength; - QList<QInputMethodEvent::Attribute> clearSelectionAttributes; - QInputMethodEvent clearSelectionEvent(QLatin1String(""), clearSelectionAttributes); - clearSelectionEvent.setCommitString(QLatin1String(""), replacementStart, replacementLength); + QString currentSelection = w->inputMethodQuery(Qt::ImCurrentSelection).toString(); + if (!currentSelection.isEmpty()) { + // To correctly remove selection in cases where we have multiple lines selected, + // we must rely on the control's own selection removal mechanism, as surrounding + // text contains only one line. It's also impossible to accurately detect + // these overselection cases as the anchor and cursor positions are limited to the + // surrounding text. + // Solution is to clear the selection by faking a preedit. Use a dummy character + // from the current selection just to be safe. + QString dummyText = currentSelection.left(1); + QList<QInputMethodEvent::Attribute> attributes; + QInputMethodEvent clearSelectionEvent(dummyText, attributes); + clearSelectionEvent.setCommitString(QLatin1String(""), 0, 0); sendEvent(clearSelectionEvent); + + // Now that selection is taken care of, clear the fake preedit. + QInputMethodEvent clearPreeditEvent(QLatin1String(""), attributes); + clearPreeditEvent.setCommitString(QLatin1String(""), 0, 0); + sendEvent(clearPreeditEvent); } } diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp index 0b96350..21047d7 100644 --- a/src/opengl/qgl_egl.cpp +++ b/src/opengl/qgl_egl.cpp @@ -64,6 +64,25 @@ void qt_eglproperties_set_glformat(QEglProperties& eglProperties, const QGLForma int stencilSize = glFormat.stencilBufferSize(); int sampleCount = glFormat.samples(); +#ifdef Q_OS_SYMBIAN + // on Symbian we prefer 32-bit configs + if (glFormat.alpha() && alphaSize <= 0) + alphaSize = 8; + if (glFormat.depth() && depthSize <= 0) + depthSize = 24; + if (glFormat.stencil() && stencilSize <= 0) + stencilSize = 8; + if (glFormat.sampleBuffers() && sampleCount <= 0) + sampleCount = 1; + + redSize = redSize > 0 ? redSize : 8; + greenSize = greenSize > 0 ? greenSize : 8; + blueSize = blueSize > 0 ? blueSize : 8; + alphaSize = alphaSize > 0 ? alphaSize : 8; + depthSize = depthSize > 0 ? depthSize : 24; + stencilSize = stencilSize > 0 ? stencilSize : 8; + sampleCount = sampleCount > 0 ? sampleCount : 4; +#else // QGLFormat uses a magic value of -1 to indicate "don't care", even when a buffer of that // type has been requested. So we must check QGLFormat's booleans too if size is -1: if (glFormat.alpha() && alphaSize <= 0) @@ -101,6 +120,7 @@ void qt_eglproperties_set_glformat(QEglProperties& eglProperties, const QGLForma depthSize = depthSize > 0 ? depthSize : 0; stencilSize = stencilSize > 0 ? stencilSize : 0; sampleCount = sampleCount > 0 ? sampleCount : 0; +#endif eglProperties.setValue(EGL_RED_SIZE, redSize); eglProperties.setValue(EGL_GREEN_SIZE, greenSize); diff --git a/src/opengl/qgl_symbian.cpp b/src/opengl/qgl_symbian.cpp index 0148304..7d343f6 100644 --- a/src/opengl/qgl_symbian.cpp +++ b/src/opengl/qgl_symbian.cpp @@ -181,14 +181,19 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) // almost same as d->ownsEglContext = true; d->eglContext->setApi(QEgl::OpenGL); - // Allow apps to override ability to use multisampling by setting an environment variable. Eg: - // qputenv("QT_SYMBIAN_DISABLE_GL_MULTISAMPLE", "1"); - // Added to allow camera app to start with limited memory. - if (!QSymbianGraphicsSystemEx::hasBCM2727() && !qgetenv("QT_SYMBIAN_DISABLE_GL_MULTISAMPLE").toInt()) { - // Most likely we have hw support for multisampling - // so let's enable it. - d->glFormat.setSampleBuffers(1); - d->glFormat.setSamples(4); + if (d->glFormat.samples() == EGL_DONT_CARE) { + // Allow apps to override ability to use multisampling by setting an environment variable. Eg: + // qputenv("QT_SYMBIAN_DISABLE_GL_MULTISAMPLE", "1"); + // Added to allow camera app to start with limited memory. + if (!QSymbianGraphicsSystemEx::hasBCM2727() && !qgetenv("QT_SYMBIAN_DISABLE_GL_MULTISAMPLE").toInt()) { + // Most likely we have hw support for multisampling + // so let's enable it. + d->glFormat.setSampleBuffers(1); + d->glFormat.setSamples(4); + } else { + d->glFormat.setSampleBuffers(0); + d->glFormat.setSamples(1); + } } // If the device is a widget with WA_TranslucentBackground set, make sure the glFormat |