From 97e423b50d316c3a9e2083c3a9d80bf16554faa9 Mon Sep 17 00:00:00 2001
From: Miikka Heikkinen <miikka.heikkinen@digia.com>
Date: Tue, 3 May 2011 16:50:46 +0300
Subject: Do not allow fullscreen/maximized windows to expand beyond client
 rect

Automatic layouting of widgets still managed to layout maximized and
fullscreen windows larger than client rect in Symbian in some cases.
Fixed by limiting window dimensions to client area boundaries in
setGeometry_sys if the window is maximized or fullscreen.

Task-number: QTBUG-5697
Reviewed-by: Sami Merila
---
 src/gui/kernel/qwidget_s60.cpp | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 12bcc4b..5e9584b 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -235,19 +235,21 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
     QSize oldSize(q->size());
     QRect oldGeom(data.crect);
 
-    // Lose maximized status if deliberate resize
-    if (w != oldSize.width() || h != oldSize.height())
-        data.window_state &= ~Qt::WindowMaximized;
-
     bool checkExtra = true;
-    if (q->isWindow() && (data.window_state & Qt::WindowFullScreen)) {
-        // Do not modity window size for fullscreen windows, if requested
-        // size is already equal to clientRect.
+    if (q->isWindow() && (data.window_state & (Qt::WindowFullScreen | Qt::WindowMaximized))) {
+        // Do not allow fullscreen/maximized windows to expand beyond client rect
         TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+        w = qMin(w, r.Width());
+        h = qMin(h, r.Height());
+
         if (w == r.Width() && h == r.Height())
             checkExtra = false;
     }
 
+    // Lose maximized status if deliberate resize
+    if (w != oldSize.width() || h != oldSize.height())
+        data.window_state &= ~Qt::WindowMaximized;
+
     if (checkExtra && extra) {  // any size restrictions?
         w = qMin(w,extra->maxw);
         h = qMin(h,extra->maxh);
-- 
cgit v0.12


From 0dce79459e4ac5b2ed64c01052206e21764d8933 Mon Sep 17 00:00:00 2001
From: Sami Merila <sami.merila@nokia.com>
Date: Mon, 9 May 2011 16:21:11 +0300
Subject: Provide internal API to avoid automatic translation of input widget

There will be cases when client will want to disable splitview
automatic view translation, so that keyboard is just brought on top of
the application and no other actions happen. There will be no new
public Qt GUI API to cover the cases (the public API will come from
QML Components), but the implementation is done with new private API.

Task-number: QTBUG-18716
Reviewed-by: Miikka Heikkinen
---
 src/gui/inputmethod/qcoefepinputcontext_p.h     |  1 +
 src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 10 ++++++++--
 src/gui/kernel/qt_s60_p.h                       |  2 ++
 src/s60installs/bwins/QtGuiu.def                |  1 +
 src/s60installs/eabi/QtGuiu.def                 |  1 +
 5 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h
index de3577f..57c1e45 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_p.h
+++ b/src/gui/inputmethod/qcoefepinputcontext_p.h
@@ -168,6 +168,7 @@ private:
 };
 
 Q_GUI_EXPORT void qt_s60_setPartialScreenInputMode(bool enable);
+Q_GUI_EXPORT void qt_s60_setPartialScreenAutomaticTranslation(bool enable);
 
 QT_END_NAMESPACE
 
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 06dc25c..a4d53c0 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -88,6 +88,11 @@ Q_GUI_EXPORT void qt_s60_setPartialScreenInputMode(bool enable)
         ic->update();
 }
 
+Q_GUI_EXPORT void qt_s60_setPartialScreenAutomaticTranslation(bool enable)
+{
+    S60->partial_keyboardAutoTranslation = enable;
+}
+
 QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
     : QInputContext(parent),
       m_fepState(q_check_ptr(new CAknEdwinState)),		// CBase derived object needs check on new
@@ -559,12 +564,13 @@ void QCoeFepInputContext::ensureFocusWidgetVisible(QWidget *widget)
             widget->resize(widget->width(), splitViewRect.height() - windowTop);
         }
 
-        if (gv->scene()) {
+        if (gv->scene() && S60->partial_keyboardAutoTranslation) {
             const QRectF microFocusRect = gv->scene()->inputMethodQuery(Qt::ImMicroFocus).toRectF();
             gv->ensureVisible(microFocusRect);
         }
     } else {
-        translateInputWidget();
+        if (S60->partial_keyboardAutoTranslation)
+            translateInputWidget();
     }
 
     if (alwaysResize)
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index 02977ce..c5f7751 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -159,6 +159,7 @@ public:
     int menuBeingConstructed : 1;
     int orientationSet : 1;
     int partial_keyboard : 1;
+    int partial_keyboardAutoTranslation : 1;
     QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type
     QPointer<QWidget> splitViewLastWidget;
 
@@ -348,6 +349,7 @@ inline QS60Data::QS60Data()
   menuBeingConstructed(0),
   orientationSet(0),
   partial_keyboard(0),
+  partial_keyboardAutoTranslation(1),
   s60ApplicationFactory(0)
 #ifdef Q_OS_SYMBIAN
   ,s60InstalledTrapHandler(0)
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index 813bbf8..495db21 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -13953,4 +13953,5 @@ EXPORTS
 	?staticMetaObjectExtraData@QWorkspace@@0UQMetaObjectExtraData@@B @ 13952 NONAME ; struct QMetaObjectExtraData const QWorkspace::staticMetaObjectExtraData
 	?staticMetaObjectExtraData@QSessionManager@@0UQMetaObjectExtraData@@B @ 13953 NONAME ; struct QMetaObjectExtraData const QSessionManager::staticMetaObjectExtraData
 	?qt_static_metacall@QGraphicsItemAnimation@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 13954 NONAME ; void QGraphicsItemAnimation::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
+	?qt_s60_setPartialScreenAutomaticTranslation@@YAX_N@Z @ 13955 NONAME ; void qt_s60_setPartialScreenAutomaticTranslation(bool)
 
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index 6646401..133e627 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12799,4 +12799,5 @@ EXPORTS
 	_ZNK10QZipWriter6deviceEv @ 12798 NONAME
 	_ZNK10QZipWriter6existsEv @ 12799 NONAME
 	_ZNK10QZipWriter6statusEv @ 12800 NONAME
+	_Z43qt_s60_setPartialScreenAutomaticTranslationb @ 12801 NONAME
 
-- 
cgit v0.12


From 79bf29e6b324313827042208c7555c568d2ed3d3 Mon Sep 17 00:00:00 2001
From: Miikka Heikkinen <miikka.heikkinen@digia.com>
Date: Tue, 10 May 2011 12:25:31 +0300
Subject: Update softkeys after orientation switch.

This is needed to render the softkeys correctly in case the softkeys
have icons.

Task-number: QTBUG-19150
Reviewed-by: Sami Merila
---
 src/gui/kernel/qapplication_s60.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 2221500..d6cafbd 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1509,6 +1509,10 @@ void QSymbianControl::HandleResourceChange(int resourceType)
 #ifdef Q_WS_S60
     case KEikDynamicLayoutVariantSwitch:
     {
+#ifdef QT_SOFTKEYS_ENABLED
+        // Update needed just in case softkeys contain icons
+        QSoftKeyManager::updateSoftKeys();
+#endif
         handleClientAreaChange();
         // Send resize event to trigger desktopwidget workAreaResized signal
         if (qt_desktopWidget) {
-- 
cgit v0.12


From eb07f3c1ad33b208d65d0af550ec279bac390c66 Mon Sep 17 00:00:00 2001
From: Miikka Heikkinen <miikka.heikkinen@digia.com>
Date: Tue, 10 May 2011 12:46:52 +0300
Subject: Fix softkeys in case a dialog with softkeys that have icons is
 closed.

Icons were not cleared from softkeys properly when a dialog with
softkeys that had icons was closed, resulting in having those icons in
softkeys that should have been empty or have text.

Task-number: QTBUG-19154
Reviewed-by: Sami Merila
---
 src/gui/kernel/qsoftkeymanager_s60.cpp | 40 +++++++++++++++++++++++++---------
 1 file changed, 30 insertions(+), 10 deletions(-)

diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index 79ed91a..d80cf8a 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -278,12 +278,6 @@ bool QSoftKeyManagerPrivateS60::setSoftkeyImage(CEikButtonGroupContainer *cba,
             EikSoftkeyImage::SetImage(cba, *myimage, left); // Takes myimage ownership
             cbaHasImage[position] = true;
             ret = true;
-        } else {
-            // Restore softkey to text based
-            if (cbaHasImage[position]) {
-                EikSoftkeyImage::SetLabel(cba, left);
-                cbaHasImage[position] = false;
-            }
         }
     }
     return ret;
@@ -294,7 +288,7 @@ bool QSoftKeyManagerPrivateS60::setSoftkey(CEikButtonGroupContainer &cba,
 {
     QAction *action = highestPrioritySoftkey(role);
     if (action) {
-        setSoftkeyImage(&cba, *action, position);
+        bool hasImage = setSoftkeyImage(&cba, *action, position);
         QString text = softkeyText(*action);
         TPtrC nativeText = qt_QString2TPtrC(text);
         int command = S60_COMMAND_START + position;
@@ -303,6 +297,11 @@ bool QSoftKeyManagerPrivateS60::setSoftkey(CEikButtonGroupContainer &cba,
             command = softKeyCommandActions.value(action);
 #endif
         setNativeSoftkey(cba, position, command, nativeText);
+        if (!hasImage && cbaHasImage[position]) {
+            EikSoftkeyImage::SetLabel(&cba, (position == LSK_POSITION));
+            cbaHasImage[position] = false;
+        }
+
         const bool dimmed = !action->isEnabled() && !QSoftKeyManager::isForceEnabledInSofkeys(action);
         cba.DimCommand(command, dimmed);
         realSoftKeyActions.insert(command, action);
@@ -313,7 +312,18 @@ bool QSoftKeyManagerPrivateS60::setSoftkey(CEikButtonGroupContainer &cba,
 
 bool QSoftKeyManagerPrivateS60::setLeftSoftkey(CEikButtonGroupContainer &cba)
 {
-    return setSoftkey(cba, QAction::PositiveSoftKey, LSK_POSITION);
+    if (!setSoftkey(cba, QAction::PositiveSoftKey, LSK_POSITION)) {
+        if (cbaHasImage[LSK_POSITION]) {
+            // Clear any residual icon if LSK has no action. A real softkey
+            // is needed for SetLabel command to work, so do a temporary dummy
+            setNativeSoftkey(cba, LSK_POSITION, EAknSoftkeyExit, KNullDesC);
+            EikSoftkeyImage::SetLabel(&cba, true);
+            setNativeSoftkey(cba, LSK_POSITION, EAknSoftkeyEmpty, KNullDesC);
+            cbaHasImage[LSK_POSITION] = false;
+        }
+        return false;
+    }
+    return true;
 }
 
 bool QSoftKeyManagerPrivateS60::setMiddleSoftkey(CEikButtonGroupContainer &cba)
@@ -332,16 +342,26 @@ bool QSoftKeyManagerPrivateS60::setRightSoftkey(CEikButtonGroupContainer &cba)
         if (windowType != Qt::Dialog && windowType != Qt::Popup) {
             QString text(QSoftKeyManager::tr("Exit"));
             TPtrC nativeText = qt_QString2TPtrC(text);
+            setNativeSoftkey(cba, RSK_POSITION, EAknSoftkeyExit, nativeText);
             if (cbaHasImage[RSK_POSITION]) {
                 EikSoftkeyImage::SetLabel(&cba, false);
                 cbaHasImage[RSK_POSITION] = false;
             }
-            setNativeSoftkey(cba, RSK_POSITION, EAknSoftkeyExit, nativeText);
             cba.DimCommand(EAknSoftkeyExit, false);
             return true;
+        } else {
+            if (cbaHasImage[RSK_POSITION]) {
+                // Clear any residual icon if RSK has no action. A real softkey
+                // is needed for SetLabel command to work, so do a temporary dummy
+                setNativeSoftkey(cba, RSK_POSITION, EAknSoftkeyExit, KNullDesC);
+                EikSoftkeyImage::SetLabel(&cba, false);
+                setNativeSoftkey(cba, RSK_POSITION, EAknSoftkeyEmpty, KNullDesC);
+                cbaHasImage[RSK_POSITION] = false;
+            }
+            return false;
         }
     }
-    return false;
+    return true;
 }
 
 void QSoftKeyManagerPrivateS60::setSoftkeys(CEikButtonGroupContainer &cba)
-- 
cgit v0.12


From 87b50f0b3615e6c14df8282cbc3ecb2ab03a9b9e Mon Sep 17 00:00:00 2001
From: Sami Merila <sami.merila@nokia.com>
Date: Thu, 12 May 2011 10:27:03 +0300
Subject: Symbian build failure for Armv5

1. Changed externs to Q_GUI_EXPORTs
2. ABSENTed missing exports from openGL's DEF-file

Reviewed-by: Tomi Vihria
---
 src/gui/painting/qpainter.cpp      |  2 +-
 src/opengl/qpaintengine_opengl.cpp |  4 ++--
 src/openvg/qpaintengine_vg.cpp     |  4 ++--
 src/s60installs/eabi/QtOpenGLu.def | 14 +++++++-------
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 9e28102..3fd4c5b 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -692,7 +692,7 @@ void QPainterPrivate::updateInvMatrix()
     invMatrix = state->matrix.inverted();
 }
 
-extern bool qt_isExtendedRadialGradient(const QBrush &brush);
+Q_GUI_EXPORT bool qt_isExtendedRadialGradient(const QBrush &brush);
 
 void QPainterPrivate::updateEmulationSpecifier(QPainterState *s)
 {
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index 5fa9f32..58ce6f8 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -2119,7 +2119,7 @@ void QOpenGLPaintEnginePrivate::fillPath(const QPainterPath &path)
     updateGLMatrix();
 }
 
-extern bool qt_isExtendedRadialGradient(const QBrush &brush);
+Q_GUI_EXPORT bool qt_isExtendedRadialGradient(const QBrush &brush);
 
 static inline bool needsEmulation(Qt::BrushStyle style)
 {
@@ -5450,7 +5450,7 @@ void QOpenGLPaintEngine::transformChanged()
     updateMatrix(state()->matrix);
 }
 
-extern QPainterPath qt_painterPathFromVectorPath(const QVectorPath &path);
+Q_GUI_EXPORT QPainterPath qt_painterPathFromVectorPath(const QVectorPath &path);
 
 void QOpenGLPaintEngine::fill(const QVectorPath &path, const QBrush &brush)
 {
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index 68a6a0b..70e26fb 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -280,7 +280,7 @@ public:
 
     inline bool needsEmulation(const QBrush &brush) const
     {
-        extern bool qt_isExtendedRadialGradient(const QBrush &brush);
+        Q_GUI_EXPORT bool qt_isExtendedRadialGradient(const QBrush &brush);
         return qt_isExtendedRadialGradient(brush);
     }
 
@@ -1579,7 +1579,7 @@ void QVGPaintEngine::draw(const QVectorPath &path)
     vgDestroyPath(vgpath);
 }
 
-extern QPainterPath qt_painterPathFromVectorPath(const QVectorPath &path);
+Q_GUI_EXPORT QPainterPath qt_painterPathFromVectorPath(const QVectorPath &path);
 
 void QVGPaintEngine::fill(const QVectorPath &path, const QBrush &brush)
 {
diff --git a/src/s60installs/eabi/QtOpenGLu.def b/src/s60installs/eabi/QtOpenGLu.def
index 44f7306..11ac503 100644
--- a/src/s60installs/eabi/QtOpenGLu.def
+++ b/src/s60installs/eabi/QtOpenGLu.def
@@ -759,11 +759,11 @@ EXPORTS
 	_ZNK14QGLPaintDevice9isFlippedEv @ 758 NONAME
 	_ZNK16QGLWindowSurface8featuresEv @ 759 NONAME
 	_ZNK26QGLFramebufferObjectFormat6mipmapEv @ 760 NONAME
-	_ZTI22QGLContextResourceBase @ 761 NONAME
-	_ZTI27QGLContextGroupResourceBase @ 762 NONAME
-	_ZTV22QGLContextResourceBase @ 763 NONAME
-	_ZTV27QGLContextGroupResourceBase @ 764 NONAME
-	_ZThn104_N20QGLTextureGlyphCacheD0Ev @ 765 NONAME
-	_ZThn104_N20QGLTextureGlyphCacheD1Ev @ 766 NONAME
-	_ZThn8_NK16QGLWindowSurface8featuresEv @ 767 NONAME
+	_ZTI22QGLContextResourceBase @ 761 NONAME ABSENT
+	_ZTI27QGLContextGroupResourceBase @ 762 NONAME ABSENT
+	_ZTV22QGLContextResourceBase @ 763 NONAME ABSENT
+	_ZTV27QGLContextGroupResourceBase @ 764 NONAME ABSENT
+	_ZThn104_N20QGLTextureGlyphCacheD0Ev @ 765 NONAME ABSENT
+	_ZThn104_N20QGLTextureGlyphCacheD1Ev @ 766 NONAME ABSENT
+	_ZThn8_NK16QGLWindowSurface8featuresEv @ 767 NONAME ABSENT
 
-- 
cgit v0.12


From d7d9a14de00f9391ab0be953357d24713f580675 Mon Sep 17 00:00:00 2001
From: Miikka Heikkinen <miikka.heikkinen@digia.com>
Date: Wed, 11 May 2011 15:42:25 +0300
Subject: Fix loss of focus and activation when hiding a child widget

Don't deactivate the active window when hiding its child if it has
another child that currently has the focus.

Task-number: QTBUG-19196
Reviewed-by: Sami Merila
---
 src/gui/kernel/qapplication_s60.cpp | 31 ++++++++++++++++++++-----------
 src/gui/kernel/qt_s60_p.h           |  1 +
 2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index d6cafbd..68c1ab5 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1360,6 +1360,23 @@ void QSymbianControl::PositionChanged()
     }
 }
 
+// Search recursively if there is a child widget that is both visible and focused.
+bool QSymbianControl::hasFocusedAndVisibleChild(QWidget *parentWidget)
+{
+    for (int i = 0; i < parentWidget->children().size(); ++i) {
+        QObject *object = parentWidget->children().at(i);
+        if (object && object->isWidgetType()) {
+            QWidget *w = static_cast<QWidget *>(object);
+            WId winId = w->internalWinId();
+            if (winId && winId->IsFocused() && winId->IsVisible())
+                return true;
+            if (hasFocusedAndVisibleChild(w))
+                return true;
+        }
+    }
+    return false;
+}
+
 void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */)
 {
     if (m_ignoreFocusChanged || (qwidget->windowType() & Qt::WindowType_Mask) == Qt::Desktop)
@@ -1392,17 +1409,9 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */)
         if (qwidget->isWindow())
             S60->setRecursiveDecorationsVisibility(qwidget, qwidget->windowState());
 #endif
-    } else if (QApplication::activeWindow() == qwidget->window()) {
-        bool focusedControlFound = false;
-        WId winId = 0;
-        for (QWidget *w = qwidget->parentWidget(); w && (winId = w->internalWinId()); w = w->parentWidget()) {
-            if (winId->IsFocused() && winId->IsVisible()) {
-                focusedControlFound = true;
-                break;
-            } else if (w->isWindow())
-                break;
-        }
-        if (!focusedControlFound) {
+    } else {
+        QWidget *parentWindow = qwidget->window();
+        if (QApplication::activeWindow() == parentWindow && !hasFocusedAndVisibleChild(parentWindow)) {
             if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog() || S60->menuBeingConstructed) {
                 QWidget *fw = QApplication::focusWidget();
                 if (fw) {
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index c5f7751..4640393 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -300,6 +300,7 @@ private:
     void translateAdvancedPointerEvent(const TAdvancedPointerEvent *event);
 #endif
     bool isSplitViewWidget(QWidget *widget);
+    bool hasFocusedAndVisibleChild(QWidget *parentWidget);
 
 public:
     void handleClientAreaChange();
-- 
cgit v0.12


From 455440996f659ae246536b7450ba9b7900d015d0 Mon Sep 17 00:00:00 2001
From: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Date: Thu, 12 May 2011 12:16:45 +0200
Subject: Disable QtConcurrent for Symbian winscw builds.

While QtConcurrent is nowadays usable with RVCT and GCCE compilers,
the compiler used for the winscw target has problems with the
templates still. To enable building 4.8 on winscw, the patch
defines QT_NO_CONCURRENT and QT_NO_QFUTURE in qglobal.h for
this target. However this causes further complications in the
Q_OBJECT classes of QtConcurrent because moc will be run without
having QT_NO_CONCURRENT and QFUTURE defined (as moc is not a Symbian
app and for other Symbian targets they must not be defined, which makes
differentiation in qglobal.h impossible for the moc run) and having a
moc file generated for a class that will be ifdef'ed out during
compilation causes build breaks. Therefore additional dummy stubs are
provided in QFutureWatcherBase.

Reviewed-by: Liang Qi
---
 src/corelib/concurrent/qfuturewatcher.cpp          | 14 +++++++++++++-
 src/corelib/concurrent/qfuturewatcher.h            | 13 +++++++++----
 src/corelib/global/qglobal.h                       | 10 ++++++++++
 tests/auto/qfuture/versioncheck.h                  |  4 ++++
 tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp |  1 +
 5 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/src/corelib/concurrent/qfuturewatcher.cpp b/src/corelib/concurrent/qfuturewatcher.cpp
index ea12bc9..728714a 100644
--- a/src/corelib/concurrent/qfuturewatcher.cpp
+++ b/src/corelib/concurrent/qfuturewatcher.cpp
@@ -589,4 +589,16 @@ void QFutureWatcherBasePrivate::sendCallOutEvent(QFutureCallOutEvent *event)
 
 QT_END_NAMESPACE
 
-#endif // QT_NO_CONCURRENT
+#else
+
+// On Symbian winscw target QT_NO_QFUTURE and QT_NO_CONCURRENT are both defined.
+// However moc will be run without having them set, so provide a dummy stub at
+// least for the slots to prevent linker errors.
+
+void QFutureWatcherBase::cancel() { }
+void QFutureWatcherBase::setPaused(bool) { }
+void QFutureWatcherBase::pause() { }
+void QFutureWatcherBase::resume() { }
+void QFutureWatcherBase::togglePaused() { }
+
+#endif // QT_NO_QFUTURE
diff --git a/src/corelib/concurrent/qfuturewatcher.h b/src/corelib/concurrent/qfuturewatcher.h
index 5fe2007..26e549d 100644
--- a/src/corelib/concurrent/qfuturewatcher.h
+++ b/src/corelib/concurrent/qfuturewatcher.h
@@ -44,8 +44,6 @@
 
 #include <QtCore/qfuture.h>
 
-#ifndef QT_NO_QFUTURE
-
 #include <QtCore/qobject.h>
 
 QT_BEGIN_HEADER
@@ -56,6 +54,11 @@ QT_MODULE(Core)
 class QEvent;
 
 class QFutureWatcherBasePrivate;
+
+#ifdef QT_NO_QFUTURE
+class QFutureInterfaceBase;
+#endif
+
 class Q_CORE_EXPORT QFutureWatcherBase : public QObject
 {
     Q_OBJECT
@@ -114,6 +117,8 @@ private:
     virtual QFutureInterfaceBase &futureInterface() = 0;
 };
 
+#ifndef QT_NO_QFUTURE
+
 template <typename T>
 class QFutureWatcher : public QFutureWatcherBase
 {
@@ -214,9 +219,9 @@ Q_INLINE_TEMPLATE void QFutureWatcher<void>::setFuture(const QFuture<void> &_fut
     connectOutputInterface();
 }
 
+#endif // QT_NO_QFUTURE
+
 QT_END_NAMESPACE
 QT_END_HEADER
 
-#endif // QT_NO_CONCURRENT
-
 #endif // QFUTUREWATCHER_H
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 49f5f98..3e1f011 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -2545,6 +2545,16 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf();
 //Symbian does not support data imports from a DLL
 #define Q_NO_DATA_RELOCATION
 
+// Winscw compiler is unable to compile QtConcurrent.
+#ifdef Q_CC_NOKIAX86
+#ifndef QT_NO_CONCURRENT
+#define QT_NO_CONCURRENT
+#endif
+#ifndef QT_NO_QFUTURE
+#define QT_NO_QFUTURE
+#endif
+#endif
+
 QT_END_NAMESPACE
 // forward declare std::exception
 #ifdef __cplusplus
diff --git a/tests/auto/qfuture/versioncheck.h b/tests/auto/qfuture/versioncheck.h
index 0cf7b76..32a33c8 100644
--- a/tests/auto/qfuture/versioncheck.h
+++ b/tests/auto/qfuture/versioncheck.h
@@ -47,3 +47,7 @@
 #if defined(Q_CC_MSVC) && _MSC_VER  < 1400
 #define QT_NO_CONCURRENT_TEST
 #endif
+
+#if defined(Q_CC_NOKIAX86)
+#define QT_NO_CONCURRENT_TEST
+#endif
diff --git a/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp b/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp
index f287450..2f1adb4 100644
--- a/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp
+++ b/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp
@@ -2418,6 +2418,7 @@ void tst_QtConcurrentMap::incrementalResults() {}
 void tst_QtConcurrentMap::stressTest() {}
 void tst_QtConcurrentMap::throttling() {}
 void tst_QtConcurrentMap::stlContainers() {}
+void tst_QtConcurrentMap::qFutureAssignmentLeak() { }
 void tst_QtConcurrentMap::noDetatch() {}
 
 QTEST_NOOP_MAIN
-- 
cgit v0.12


From a5d66497b105e9e8d1a39d24ec643862961ce75c Mon Sep 17 00:00:00 2001
From: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Date: Thu, 12 May 2011 15:37:04 +0200
Subject: Fix QtOpenGL def file for armv5.

Reviewed-by: TRUSTME
---
 src/s60installs/eabi/QtOpenGLu.def | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/s60installs/eabi/QtOpenGLu.def b/src/s60installs/eabi/QtOpenGLu.def
index 11ac503..c252484 100644
--- a/src/s60installs/eabi/QtOpenGLu.def
+++ b/src/s60installs/eabi/QtOpenGLu.def
@@ -766,4 +766,18 @@ EXPORTS
 	_ZThn104_N20QGLTextureGlyphCacheD0Ev @ 765 NONAME ABSENT
 	_ZThn104_N20QGLTextureGlyphCacheD1Ev @ 766 NONAME ABSENT
 	_ZThn8_NK16QGLWindowSurface8featuresEv @ 767 NONAME ABSENT
+	_ZN14QGLSignalProxy18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv @ 768 NONAME
+	_ZN14QGLSignalProxy25staticMetaObjectExtraDataE @ 769 NONAME DATA 8
+	_ZN16QGLShaderProgram18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv @ 770 NONAME
+	_ZN16QGLShaderProgram25staticMetaObjectExtraDataE @ 771 NONAME DATA 8
+	_ZN16QGLWindowSurface18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv @ 772 NONAME
+	_ZN16QGLWindowSurface25staticMetaObjectExtraDataE @ 773 NONAME DATA 8
+	_ZN21QGraphicsShaderEffect18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv @ 774 NONAME
+	_ZN21QGraphicsShaderEffect25staticMetaObjectExtraDataE @ 775 NONAME DATA 8
+	_ZN22QGLEngineShaderManager18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv @ 776 NONAME
+	_ZN22QGLEngineShaderManager25staticMetaObjectExtraDataE @ 777 NONAME DATA 8
+	_ZN9QGLShader18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv @ 778 NONAME
+	_ZN9QGLShader25staticMetaObjectExtraDataE @ 779 NONAME DATA 8
+	_ZN9QGLWidget18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv @ 780 NONAME
+	_ZN9QGLWidget25staticMetaObjectExtraDataE @ 781 NONAME DATA 8
 
-- 
cgit v0.12