summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/image/qimage.cpp2
-rw-r--r--src/gui/image/qpixmap.cpp2
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp47
-rw-r--r--src/gui/kernel/qapplication_s60.cpp2
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60.cpp35
-rw-r--r--src/gui/kernel/qt_s60_p.h2
-rw-r--r--src/gui/kernel/qwidget.cpp20
-rw-r--r--src/gui/kernel/qwidget_p.h2
-rw-r--r--src/gui/kernel/qwidget_s60.cpp11
-rw-r--r--src/gui/painting/painting.pri7
-rw-r--r--src/gui/painting/qgraphicssystem.cpp16
-rw-r--r--src/gui/painting/qgraphicssystem_p.h3
-rw-r--r--src/gui/painting/qgraphicssystemex_p.h66
-rw-r--r--src/gui/painting/qgraphicssystemex_symbian.cpp86
-rw-r--r--src/gui/painting/qgraphicssystemex_symbian_p.h73
-rw-r--r--src/gui/text/qfontengine_ft.cpp4
-rw-r--r--src/gui/text/qtextcontrol.cpp6
-rw-r--r--src/gui/text/qtextobject.cpp7
-rw-r--r--src/gui/text/qtextobject.h2
-rw-r--r--src/gui/widgets/qlinecontrol.cpp4
-rw-r--r--src/gui/widgets/qmainwindow.cpp2
-rw-r--r--src/gui/widgets/qmainwindowlayout.cpp1
-rw-r--r--src/gui/widgets/qmainwindowlayout_p.h1
-rw-r--r--src/gui/widgets/qmenu.cpp12
24 files changed, 355 insertions, 58 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 50b372ea63..25f6295b71 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -4449,6 +4449,8 @@ QImage QImage::scaled(const QSize& s, Qt::AspectRatioMode aspectMode, Qt::Transf
QSize newSize = size();
newSize.scale(s, aspectMode);
+ newSize.rwidth() = qMax(newSize.width(), 1);
+ newSize.rheight() = qMax(newSize.height(), 1);
if (newSize == size())
return *this;
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index c34f6ac1b2..640864d7dc 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -1514,6 +1514,8 @@ QPixmap QPixmap::scaled(const QSize& s, Qt::AspectRatioMode aspectMode, Qt::Tran
QSize newSize = size();
newSize.scale(s, aspectMode);
+ newSize.rwidth() = qMax(newSize.width(), 1);
+ newSize.rheight() = qMax(newSize.height(), 1);
if (newSize == size())
return *this;
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index a4d53c09a7..23109e1453 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -240,21 +240,6 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
return false;
switch (event->type()) {
- case QEvent::MouseButtonPress:
- // Alphanumeric keypad doesn't like it when we click and text is still getting displayed
- // It ignores the mouse event, so we need to commit and send a selection event (which will get triggered
- // after the commit)
- if (!m_preeditString.isEmpty()) {
- commitCurrentString(true);
-
- int pos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt();
-
- QList<QInputMethodEvent::Attribute> selectAttributes;
- selectAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, pos, 0, QVariant());
- QInputMethodEvent selectEvent(QLatin1String(""), selectAttributes);
- sendEvent(selectEvent);
- }
- break;
case QEvent::KeyPress:
commitTemporaryPreeditString();
// fall through intended
@@ -333,7 +318,10 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
if (sControl) {
sControl->setIgnoreFocusChanged(false);
}
- return true;
+ //If m_pointerHandler has already been set, it means that fep inline editing is in progress.
+ //When this is happening, do not filter out pointer events.
+ if (!m_pointerHandler)
+ return true;
}
return false;
@@ -385,18 +373,31 @@ void QCoeFepInputContext::commitTemporaryPreeditString()
commitCurrentString(false);
}
-void QCoeFepInputContext::mouseHandler( int x, QMouseEvent *event)
+void QCoeFepInputContext::mouseHandler(int x, QMouseEvent *event)
{
Q_ASSERT(focusWidget());
if (event->type() == QEvent::MouseButtonPress && event->button() == Qt::LeftButton) {
- commitCurrentString(true);
- int pos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt();
+ QWidget *proxy = focusWidget()->focusProxy();
+ Qt::InputMethodHints currentHints = proxy ? proxy->inputMethodHints() : focusWidget()->inputMethodHints();
+
+ //If splitview is open and T9 word is tapped, pass the pointer event to pointer handler.
+ //This will open the "suggested words" list. Pass pointer position always as zero, to make
+ //full word replacement in case user makes a selection.
+ if (S60->partial_keyboard && S60->partialKeyboardOpen
+ && m_pointerHandler
+ && !(currentHints & Qt::ImhNoPredictiveText)
+ && (x > 0 && x < m_preeditString.length())) {
+ m_pointerHandler->HandlePointerEventInInlineTextL(TPointerEvent::EButton1Up, 0, 0);
+ } else {
+ commitCurrentString(true);
+ int pos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt();
- QList<QInputMethodEvent::Attribute> attributes;
- attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, pos + x, 0, QVariant());
- QInputMethodEvent event(QLatin1String(""), attributes);
- sendEvent(event);
+ QList<QInputMethodEvent::Attribute> attributes;
+ attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, pos + x, 0, QVariant());
+ QInputMethodEvent event(QLatin1String(""), attributes);
+ sendEvent(event);
+ }
}
}
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 68c1ab506d..815d221dc2 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1490,8 +1490,10 @@ void QSymbianControl::HandleResourceChange(int resourceType)
}
if (ic && isSplitViewWidget(widget)) {
if (resourceType == KSplitViewCloseEvent) {
+ S60->partialKeyboardOpen = false;
ic->resetSplitViewWidget();
} else {
+ S60->partialKeyboardOpen = true;
ic->ensureFocusWidgetVisible(widget);
}
}
diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index d80cf8a502..71ae520dd4 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -176,22 +176,27 @@ void QSoftKeyManagerPrivateS60::setNativeSoftkey(CEikButtonGroupContainer &cba,
QPoint QSoftKeyManagerPrivateS60::softkeyIconPosition(int position, QSize sourceSize, QSize targetSize)
{
QPoint iconPosition(0,0);
- switch( AknLayoutUtils::CbaLocation() )
- {
- case AknLayoutUtils::EAknCbaLocationBottom:
- // RSK must be moved to right, LSK in on correct position by default
- if (position == RSK_POSITION)
- iconPosition.setX(targetSize.width() - sourceSize.width());
- break;
- case AknLayoutUtils::EAknCbaLocationRight:
- case AknLayoutUtils::EAknCbaLocationLeft:
- // Already in correct position
- default:
- break;
- }
- // Align horizontally to center
- iconPosition.setY((targetSize.height() - sourceSize.height()) >> 1);
+ // Prior to S60 5.3 icons need to be properly positioned to buttons, but starting with 5.3
+ // positioning is done on Avkon side.
+ if (QSysInfo::s60Version() < QSysInfo::SV_S60_5_3) {
+ switch (AknLayoutUtils::CbaLocation())
+ {
+ case AknLayoutUtils::EAknCbaLocationBottom:
+ // RSK must be moved to right, LSK in on correct position by default
+ if (position == RSK_POSITION)
+ iconPosition.setX(targetSize.width() - sourceSize.width());
+ break;
+ case AknLayoutUtils::EAknCbaLocationRight:
+ case AknLayoutUtils::EAknCbaLocationLeft:
+ // Already in correct position
+ default:
+ break;
+ }
+
+ // Align horizontally to center
+ iconPosition.setY((targetSize.height() - sourceSize.height()) >> 1);
+ }
return iconPosition;
}
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index 464039321e..00236499d1 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -160,6 +160,7 @@ public:
int orientationSet : 1;
int partial_keyboard : 1;
int partial_keyboardAutoTranslation : 1;
+ int partialKeyboardOpen : 1;
QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type
QPointer<QWidget> splitViewLastWidget;
@@ -351,6 +352,7 @@ inline QS60Data::QS60Data()
orientationSet(0),
partial_keyboard(0),
partial_keyboardAutoTranslation(1),
+ partialKeyboardOpen(0),
s60ApplicationFactory(0)
#ifdef Q_OS_SYMBIAN
,s60InstalledTrapHandler(0)
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 4c1a6dd100..9556169e52 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -299,6 +299,7 @@ QWidgetPrivate::QWidgetPrivate(int version)
#ifndef QT_NO_IM
, inheritsInputMethodHints(0)
#endif
+ , inSetParent(0)
#if defined(Q_WS_X11)
, picture(0)
#elif defined(Q_WS_WIN)
@@ -2589,6 +2590,22 @@ WId QWidget::effectiveWinId() const
if (id || !testAttribute(Qt::WA_WState_Created))
return id;
QWidget *realParent = nativeParentWidget();
+ if (!realParent && d_func()->inSetParent) {
+ // In transitional state. This is really just a workaround. The real problem
+ // is that QWidgetPrivate::setParent_sys (platform specific code) first sets
+ // the window id to 0 (setWinId(0)) before it sets the Qt::WA_WState_Created
+ // attribute to false. The correct way is to do it the other way around, and
+ // in that case the Qt::WA_WState_Created logic above will kick in and
+ // return 0 whenever the widget is in a transitional state. However, changing
+ // the original logic for all platforms is far more intrusive and might
+ // break existing applications.
+ // Note: The widget can only be in a transitional state when changing its
+ // parent -- everything else is an internal error -- hence explicitly checking
+ // against 'inSetParent' rather than doing an unconditional return whenever
+ // 'realParent' is 0 (which may cause strange artifacts and headache later).
+ return 0;
+ }
+ // This widget *must* have a native parent widget.
Q_ASSERT(realParent);
Q_ASSERT(realParent->internalWinId());
return realParent->internalWinId();
@@ -10101,6 +10118,7 @@ void QWidget::setParent(QWidget *parent)
void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
{
Q_D(QWidget);
+ d->inSetParent = true;
bool resized = testAttribute(Qt::WA_Resized);
bool wasCreated = testAttribute(Qt::WA_WState_Created);
QWidget *oldtlw = window();
@@ -10261,6 +10279,8 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
ancestorProxy->d_func()->embedSubWindow(this);
}
#endif
+
+ d->inSetParent = false;
}
/*!
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index 919f8bc3da..acf1860666 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -232,6 +232,7 @@ struct QTLWExtra {
#elif defined(Q_OS_SYMBIAN)
uint inExpose : 1; // Prevents drawing recursion
uint nativeWindowTransparencyEnabled : 1; // Tracks native window transparency
+ uint forcedToRaster : 1;
#elif defined(Q_WS_QPA)
QPlatformWindow *platformWindow;
QPlatformWindowFormat platformWindowFormat;
@@ -770,6 +771,7 @@ public:
#ifndef QT_NO_IM
uint inheritsInputMethodHints : 1;
#endif
+ uint inSetParent : 1;
// *************************** Platform specific ************************************
#if defined(Q_WS_X11) // <----------------------------------------------------------- X11
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 5e9584b242..c011cf17ae 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -578,6 +578,11 @@ void QWidgetPrivate::show_sys()
if (isFullscreen) {
const bool cbaVisible = S60->buttonGroupContainer() && S60->buttonGroupContainer()->IsVisible();
S60->setStatusPaneAndButtonGroupVisibility(false, cbaVisible);
+ if (cbaVisible) {
+ // Fix window dimensions as without screen furniture they will have
+ // defaulted to full screen dimensions initially.
+ id->handleClientAreaChange();
+ }
}
}
}
@@ -792,7 +797,7 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
adjustFlags(data.window_flags, q);
// keep compatibility with previous versions, we need to preserve the created state
// (but we recreate the winId for the widget being reparented, again for compatibility)
- if (wasCreated || (!q->isWindow() && parent->testAttribute(Qt::WA_WState_Created)))
+ if (wasCreated || (!q->isWindow() && parent && parent->testAttribute(Qt::WA_WState_Created)))
createWinId();
if (q->isWindow() || (!parent || parent->isVisible()) || explicitlyHidden)
q->setAttribute(Qt::WA_WState_Hidden);
@@ -835,7 +840,8 @@ void QWidgetPrivate::s60UpdateIsOpaque()
RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow());
#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
- if (QApplicationPrivate::instance()->useTranslucentEGLSurfaces) {
+ if (QApplicationPrivate::instance()->useTranslucentEGLSurfaces
+ && !extra->topextra->forcedToRaster) {
window->SetSurfaceTransparency(!isOpaque);
extra->topextra->nativeWindowTransparencyEnabled = !isOpaque;
return;
@@ -1019,6 +1025,7 @@ void QWidgetPrivate::createTLSysExtra()
{
extra->topextra->inExpose = 0;
extra->topextra->nativeWindowTransparencyEnabled = 0;
+ extra->topextra->forcedToRaster = 0;
}
void QWidgetPrivate::deleteTLSysExtra()
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index 65e7af4742..f1496b1b10 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -9,6 +9,7 @@ HEADERS += \
painting/qdrawutil.h \
painting/qemulationpaintengine_p.h \
painting/qgraphicssystem_p.h \
+ painting/qgraphicssystemex_p.h \
painting/qmatrix.h \
painting/qmemrotate_p.h \
painting/qoutlinemapper_p.h \
@@ -249,8 +250,10 @@ embedded {
symbian {
HEADERS += painting/qwindowsurface_s60_p.h \
- painting/qdrawhelper_arm_simd_p.h
- SOURCES += painting/qwindowsurface_s60.cpp
+ painting/qdrawhelper_arm_simd_p.h \
+ painting/qgraphicssystemex_symbian_p.h
+ SOURCES += painting/qwindowsurface_s60.cpp \
+ painting/qgraphicssystemex_symbian.cpp
armccIfdefBlock = \
"$${LITERAL_HASH}if defined(ARMV6)" \
"MACRO QT_HAVE_ARM_SIMD" \
diff --git a/src/gui/painting/qgraphicssystem.cpp b/src/gui/painting/qgraphicssystem.cpp
index 171ef46f98..d82fdc9ecc 100644
--- a/src/gui/painting/qgraphicssystem.cpp
+++ b/src/gui/painting/qgraphicssystem.cpp
@@ -55,6 +55,9 @@
#endif
#ifdef Q_OS_SYMBIAN
# include <private/qpixmap_s60_p.h>
+# include <private/qgraphicssystemex_symbian_p.h>
+#else
+# include <private/qgraphicssystemex_p.h>
#endif
QT_BEGIN_NAMESPACE
@@ -89,9 +92,18 @@ QPixmapData *QGraphicsSystem::createPixmapData(QPixmapData *origin)
return createPixmapData(origin->pixelType());
}
-void QGraphicsSystem::releaseCachedResources()
+#ifdef Q_OS_SYMBIAN
+Q_GLOBAL_STATIC(QSymbianGraphicsSystemEx, symbianPlatformExtension)
+#endif
+
+QGraphicsSystemEx* QGraphicsSystem::platformExtension()
{
- // Do nothing here
+#ifdef Q_OS_SYMBIAN
+ // this is used on raster graphics systems. HW accelerated
+ // graphics systems will overwrite this function.
+ return symbianPlatformExtension();
+#endif
+ return 0;
}
QT_END_NAMESPACE
diff --git a/src/gui/painting/qgraphicssystem_p.h b/src/gui/painting/qgraphicssystem_p.h
index 0f99a311a6..275f9eb0f2 100644
--- a/src/gui/painting/qgraphicssystem_p.h
+++ b/src/gui/painting/qgraphicssystem_p.h
@@ -63,6 +63,7 @@ QT_BEGIN_NAMESPACE
class QPixmapFilter;
class QBlittable;
+class QGraphicsSystemEx;
class Q_GUI_EXPORT QGraphicsSystem
{
@@ -77,7 +78,7 @@ public:
// to have a graphics system.
static QPixmapData *createDefaultPixmapData(QPixmapData::PixelType type);
- virtual void releaseCachedResources();
+ virtual QGraphicsSystemEx* platformExtension();
};
QT_END_NAMESPACE
diff --git a/src/gui/painting/qgraphicssystemex_p.h b/src/gui/painting/qgraphicssystemex_p.h
new file mode 100644
index 0000000000..6feb11655c
--- /dev/null
+++ b/src/gui/painting/qgraphicssystemex_p.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 QGRAPHICSSYSTEMEX_P_H
+#define QGRAPHICSSYSTEMEX_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_GUI_EXPORT QGraphicsSystemEx
+{
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/painting/qgraphicssystemex_symbian.cpp b/src/gui/painting/qgraphicssystemex_symbian.cpp
new file mode 100644
index 0000000000..2d3f137992
--- /dev/null
+++ b/src/gui/painting/qgraphicssystemex_symbian.cpp
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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$
+**
+****************************************************************************/
+
+#include "qgraphicssystemex_symbian_p.h"
+#include "private/qwidget_p.h"
+#include "private/qbackingstore_p.h"
+#include "private/qapplication_p.h"
+
+#include <QDebug>
+
+QT_BEGIN_NAMESPACE
+
+void QSymbianGraphicsSystemEx::releaseCachedGpuResources()
+{
+ // Do nothing here
+ // This is implemented in graphics system specific plugin
+}
+
+void QSymbianGraphicsSystemEx::releaseAllGpuResources()
+{
+ releaseCachedGpuResources();
+
+ foreach (QWidget *widget, QApplication::topLevelWidgets()) {
+ if (QTLWExtra *topExtra = qt_widget_private(widget)->maybeTopData())
+ topExtra->backingStore.destroy();
+ }
+}
+
+bool QSymbianGraphicsSystemEx::hasBCM2727()
+{
+ return !QApplicationPrivate::instance()->useTranslucentEGLSurfaces;
+}
+
+void QSymbianGraphicsSystemEx::forceToRaster(QWidget *window)
+{
+ if (window && window->isWindow()) {
+ qt_widget_private(window)->createTLExtra();
+ if (QTLWExtra *topExtra = qt_widget_private(window)->maybeTopData()) {
+ topExtra->forcedToRaster = 1;
+ if (topExtra->backingStore.data()) {
+ topExtra->backingStore.create(window);
+ topExtra->backingStore.registerWidget(window);
+ }
+ }
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/painting/qgraphicssystemex_symbian_p.h b/src/gui/painting/qgraphicssystemex_symbian_p.h
new file mode 100644
index 0000000000..0b1e39efd4
--- /dev/null
+++ b/src/gui/painting/qgraphicssystemex_symbian_p.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 QSYMBIANGRAPHICSSYSTEMEX_P_H
+#define QSYMBIANGRAPHICSSYSTEMEX_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "private/qgraphicssystemex_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QWidget;
+
+class Q_GUI_EXPORT QSymbianGraphicsSystemEx : public QGraphicsSystemEx
+{
+public:
+ virtual void releaseCachedGpuResources();
+ virtual void releaseAllGpuResources();
+ virtual bool hasBCM2727();
+ virtual void forceToRaster(QWidget *window);
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index 4dae2a3784..9d4a21a3e3 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -1751,6 +1751,7 @@ glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, QFixed subPixe
} else {
glyphSet = &defaultGlyphSet;
}
+ bool needsDelete = false;
Glyph * g = glyphSet->getGlyph(glyph);
if (!g || g->format != format) {
face = lockFace();
@@ -1758,6 +1759,7 @@ glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, QFixed subPixe
FT_Matrix_Multiply(&glyphSet->transformationMatrix, &m);
freetype->matrix = m;
g = loadGlyph(glyphSet, glyph, subPixelPosition, format);
+ needsDelete = true;
}
if (g) {
@@ -1766,6 +1768,8 @@ glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, QFixed subPixe
overall.width = g->width;
overall.height = g->height;
overall.xoff = g->advance;
+ if (needsDelete)
+ delete g;
} else {
int left = FLOOR(face->glyph->metrics.horiBearingX);
int right = CEIL(face->glyph->metrics.horiBearingX + face->glyph->metrics.width);
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index 43967307bc..a8bf763851 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -677,7 +677,7 @@ void QTextControlPrivate::extendWordwiseSelection(int suggestedNewPosition, qrea
const qreal wordEndX = line.cursorToX(curs.position() - blockPos) + blockCoordinates.x();
- if (mouseXPosition < wordStartX || mouseXPosition > wordEndX)
+ if (!wordSelectionEnabled && (mouseXPosition < wordStartX || mouseXPosition > wordEndX))
return;
// keep the already selected word even when moving to the left
@@ -1579,8 +1579,10 @@ void QTextControlPrivate::mousePressEvent(QEvent *e, Qt::MouseButton button, con
emit q->cursorPositionChanged();
_q_updateCurrentCharFormatAndSelection();
} else {
- if (cursor.position() != oldCursorPos)
+ if (cursor.position() != oldCursorPos) {
emit q->cursorPositionChanged();
+ emit q->microFocusChanged();
+ }
selectionChanged();
}
repaintOldAndNewSelection(oldSelection);
diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp
index 8dabcc771b..b7e05d247e 100644
--- a/src/gui/text/qtextobject.cpp
+++ b/src/gui/text/qtextobject.cpp
@@ -891,11 +891,6 @@ QTextBlockUserData::~QTextBlockUserData()
Returns true if this text block is valid; otherwise returns false.
*/
-bool QTextBlock::isValid() const
-{
- return p != 0 && p->blockMap().isValid(n);
-}
-
/*!
\fn QTextBlock &QTextBlock::operator=(const QTextBlock &other)
@@ -1493,7 +1488,7 @@ QTextBlock::iterator QTextBlock::end() const
*/
QTextBlock QTextBlock::next() const
{
- if (!isValid())
+ if (!isValid() || !p->blockMap().isValid(n))
return QTextBlock();
return QTextBlock(p, p->blockMap().next(n));
diff --git a/src/gui/text/qtextobject.h b/src/gui/text/qtextobject.h
index 1588349a3f..a443e7975e 100644
--- a/src/gui/text/qtextobject.h
+++ b/src/gui/text/qtextobject.h
@@ -205,7 +205,7 @@ public:
inline QTextBlock(const QTextBlock &o) : p(o.p), n(o.n) {}
inline QTextBlock &operator=(const QTextBlock &o) { p = o.p; n = o.n; return *this; }
- bool isValid() const;
+ inline bool isValid() const { return p != 0 && n != 0; }
inline bool operator==(const QTextBlock &o) const { return p == o.p && n == o.n; }
inline bool operator!=(const QTextBlock &o) const { return p != o.p || n != o.n; }
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index 2a15555b89..c9dae77d25 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -435,6 +435,8 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event)
c += event->commitString().length() - qMin(-event->replacementStart(), event->replacementLength());
m_cursor += event->replacementStart();
+ if (m_cursor < 0)
+ m_cursor = 0;
// insert commit string
if (event->replacementLength()) {
@@ -447,7 +449,7 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event)
cursorPositionChanged = true;
}
- m_cursor = qMin(c, m_text.length());
+ m_cursor = qBound(0, c, m_text.length());
for (int i = 0; i < event->attributes().size(); ++i) {
const QInputMethodEvent::Attribute &a = event->attributes().at(i);
diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp
index 43d67962e8..e39e5955ca 100644
--- a/src/gui/widgets/qmainwindow.cpp
+++ b/src/gui/widgets/qmainwindow.cpp
@@ -78,7 +78,6 @@ public:
: layout(0), explicitIconSize(false), toolButtonStyle(Qt::ToolButtonIconOnly)
#ifdef Q_WS_MAC
, useHIToolBar(false)
- , activateUnifiedToolbarAfterFullScreen(false)
#endif
#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR)
, hasOldCursor(false) , cursorAdjusted(false)
@@ -90,7 +89,6 @@ public:
Qt::ToolButtonStyle toolButtonStyle;
#ifdef Q_WS_MAC
bool useHIToolBar;
- bool activateUnifiedToolbarAfterFullScreen;
#endif
void init();
QList<int> hoverSeparator;
diff --git a/src/gui/widgets/qmainwindowlayout.cpp b/src/gui/widgets/qmainwindowlayout.cpp
index d4afe075be..8880ca9bf6 100644
--- a/src/gui/widgets/qmainwindowlayout.cpp
+++ b/src/gui/widgets/qmainwindowlayout.cpp
@@ -1699,6 +1699,7 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLay
, gapIndicator(new QRubberBand(QRubberBand::Rectangle, mainwindow))
#endif //QT_NO_RUBBERBAND
#ifdef Q_WS_MAC
+ , activateUnifiedToolbarAfterFullScreen(false)
, blockVisiblityCheck(false)
#endif
{
diff --git a/src/gui/widgets/qmainwindowlayout_p.h b/src/gui/widgets/qmainwindowlayout_p.h
index 20aca61deb..0442510c0b 100644
--- a/src/gui/widgets/qmainwindowlayout_p.h
+++ b/src/gui/widgets/qmainwindowlayout_p.h
@@ -338,7 +338,6 @@ public:
void removeFromMacToolbar(QToolBar *toolbar);
void cleanUpMacToolbarItems();
void fixSizeInUnifiedToolbar(QToolBar *tb) const;
- bool useHIToolBar;
bool activateUnifiedToolbarAfterFullScreen;
void syncUnifiedToolbarVisibility();
bool blockVisiblityCheck;
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index b0ea00f811..1dac66150b 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -82,6 +82,10 @@
# include <private/qt_cocoa_helpers_mac_p.h>
#endif
+#ifdef Q_WS_S60
+# include "private/qt_s60_p.h"
+#endif
+
QT_BEGIN_NAMESPACE
@@ -172,6 +176,14 @@ void QMenuPrivate::init()
q->addAction(selectAction);
q->addAction(cancelAction);
#endif
+
+#ifdef Q_WS_S60
+ if (S60->avkonComponentsSupportTransparency) {
+ bool noSystemBackground = q->testAttribute(Qt::WA_NoSystemBackground);
+ q->setAttribute(Qt::WA_TranslucentBackground); // also sets WA_NoSystemBackground
+ q->setAttribute(Qt::WA_NoSystemBackground, noSystemBackground); // restore system background attribute
+ }
+#endif
}
int QMenuPrivate::scrollerHeight() const