diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-30 16:14:03 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-30 16:14:03 (GMT) |
commit | 570f8970bea646055583671397c3d2706ac45004 (patch) | |
tree | 6e68ed9939ad6ca87ffa17bbfec803b4f3089783 | |
parent | 597117790ad86a1e68526fa7ccd1a38fca2b55f3 (diff) | |
parent | 20dbb967f030041d1dc94b989b0b085ca84baa33 (diff) | |
download | Qt-570f8970bea646055583671397c3d2706ac45004.zip Qt-570f8970bea646055583671397c3d2706ac45004.tar.gz Qt-570f8970bea646055583671397c3d2706ac45004.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Fix QHeaderView test case for VGA Symbian devices.
Fix for BCM2727 chip detection on Symbian
Fix QMenuBar autotest failures for Symbian
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 25 | ||||
-rw-r--r-- | src/gui/painting/qgraphicssystemex_symbian.cpp | 36 | ||||
-rw-r--r-- | src/gui/painting/qgraphicssystemex_symbian_p.h | 3 | ||||
-rw-r--r-- | src/opengl/qgl_symbian.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qheaderview/tst_qheaderview.cpp | 12 | ||||
-rw-r--r-- | tests/auto/qmenubar/tst_qmenubar.cpp | 10 |
6 files changed, 60 insertions, 30 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index b3f9eec..6d1b96f 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -74,6 +74,7 @@ # include <centralrepository.h> # include "qs60mainappui.h" # include "qinputcontext.h" +# include <private/qgraphicssystemex_symbian_p.h> #endif #if defined(Q_WS_S60) @@ -1835,26 +1836,12 @@ void qt_init(QApplicationPrivate * /* priv */, int) #ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE QApplicationPrivate::instance()->useTranslucentEGLSurfaces = true; - const TUid KIvePropertyCat = {0x2726beef}; - enum TIvePropertyChipType { - EVCBCM2727B1 = 0x00000000, - EVCBCM2763A0 = 0x04000100, - EVCBCM2763B0 = 0x04000102, - EVCBCM2763C0 = 0x04000103, - EVCBCM2763C1 = 0x04000104, - EVCBCMUnknown = 0x7fffffff - }; - - TInt chipType = EVCBCMUnknown; - if (RProperty::Get(KIvePropertyCat, 0 /*chip type*/, chipType) == KErrNone) { - if (chipType == EVCBCM2727B1) { - // We have only 32MB GPU memory. Use raster surfaces - // for transparent TLWs. - QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false; - } - } else { + if (QSymbianGraphicsSystemEx::hasBCM2727()) { + // We have only 32MB GPU memory. Use raster surfaces + // for transparent TLWs. QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false; } + if (QApplicationPrivate::graphics_system_name == QLatin1String("raster")) QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false; #else @@ -2005,7 +1992,7 @@ void QApplicationPrivate::openPopup(QWidget *popup) QApplicationPrivate::popupWidgets->append(popup); // Cancel focus widget pointer capture and long tap timer - if (QApplication::focusWidget()) { + if (QApplication::focusWidget() && QApplication::focusWidget()->effectiveWinId()) { static_cast<QSymbianControl*>(QApplication::focusWidget()->effectiveWinId())->CancelLongTapTimer(); QApplication::focusWidget()->effectiveWinId()->SetPointerCapture(false); } diff --git a/src/gui/painting/qgraphicssystemex_symbian.cpp b/src/gui/painting/qgraphicssystemex_symbian.cpp index 980f72c..dc4dd92 100644 --- a/src/gui/painting/qgraphicssystemex_symbian.cpp +++ b/src/gui/painting/qgraphicssystemex_symbian.cpp @@ -45,10 +45,39 @@ #include "private/qapplication_p.h" #include "qwidget_p.h" -#include <QDebug> +#include <e32property.h> QT_BEGIN_NAMESPACE +static bool bcm2727Initialized = false; +static bool bcm2727 = false; + +bool QSymbianGraphicsSystemEx::hasBCM2727() +{ + if (bcm2727Initialized) + return bcm2727; + + const TUid KIvePropertyCat = {0x2726beef}; + enum TIvePropertyChipType { + EVCBCM2727B1 = 0x00000000, + EVCBCM2763A0 = 0x04000100, + EVCBCM2763B0 = 0x04000102, + EVCBCM2763C0 = 0x04000103, + EVCBCM2763C1 = 0x04000104, + EVCBCMUnknown = 0x7fffffff + }; + + TInt chipType = EVCBCMUnknown; + if (RProperty::Get(KIvePropertyCat, 0, chipType) == KErrNone) { + if (chipType == EVCBCM2727B1) + bcm2727 = true; + } + + bcm2727Initialized = true; + + return bcm2727; +} + void QSymbianGraphicsSystemEx::releaseCachedGpuResources() { // Do nothing here @@ -65,11 +94,6 @@ void QSymbianGraphicsSystemEx::releaseAllGpuResources() } } -bool QSymbianGraphicsSystemEx::hasBCM2727() -{ - return !QApplicationPrivate::instance()->useTranslucentEGLSurfaces; -} - void QSymbianGraphicsSystemEx::forceToRaster(QWidget *window) { if (window && window->isWindow()) { diff --git a/src/gui/painting/qgraphicssystemex_symbian_p.h b/src/gui/painting/qgraphicssystemex_symbian_p.h index c1d1bdf..1f2a7c6 100644 --- a/src/gui/painting/qgraphicssystemex_symbian_p.h +++ b/src/gui/painting/qgraphicssystemex_symbian_p.h @@ -62,9 +62,10 @@ class QWidget; class Q_GUI_EXPORT QSymbianGraphicsSystemEx : public QGraphicsSystemEx { public: + static bool hasBCM2727(); + virtual void releaseCachedGpuResources(); virtual void releaseAllGpuResources(); - virtual bool hasBCM2727(); virtual void forceToRaster(QWidget *window); }; diff --git a/src/opengl/qgl_symbian.cpp b/src/opengl/qgl_symbian.cpp index 91904d0..86176c9 100644 --- a/src/opengl/qgl_symbian.cpp +++ b/src/opengl/qgl_symbian.cpp @@ -183,9 +183,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) // almost same as d->ownsEglContext = true; d->eglContext->setApi(QEgl::OpenGL); - QGraphicsSystemEx *ex = QApplicationPrivate::graphicsSystem()->platformExtension(); - QSymbianGraphicsSystemEx *symex = static_cast<QSymbianGraphicsSystemEx*>(ex); - if (symex && !symex->hasBCM2727()) { + if (!QSymbianGraphicsSystemEx::hasBCM2727()) { // Most likely we have hw support for multisampling // so let's enable it. d->glFormat.setSampleBuffers(1); diff --git a/tests/auto/qheaderview/tst_qheaderview.cpp b/tests/auto/qheaderview/tst_qheaderview.cpp index 3a659aa..52eeee4 100644 --- a/tests/auto/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/qheaderview/tst_qheaderview.cpp @@ -563,7 +563,7 @@ void tst_QHeaderView::sectionSize() QFETCH(int, lastVisibleSectionSize); QFETCH(int, persistentSectionSize); -#ifdef Q_OS_WINCE +#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) // We test on a device with doubled pixels. Therefore we need to specify // different boundaries. initialDefaultSize = qMax(view->minimumSectionSize(), 30); @@ -676,6 +676,16 @@ void tst_QHeaderView::visualIndexAt() QFETCH(QList<int>, coordinate); QFETCH(QList<int>, visual); +#ifdef Q_OS_SYMBIAN + // Some Symbian devices have larger minimum section size than what is expected. + // Need to do this here instead of visualIndexAt_data() as view pointer doesn't + // seem to be valid there. + int minSize = view->minimumSectionSize(); + if (minSize > 30) { + coordinate.clear(); + coordinate << -1 << 0 << minSize + 1 << (minSize * 3) + 1 << 99999; + } +#endif view->setStretchLastSection(true); topLevel->show(); diff --git a/tests/auto/qmenubar/tst_qmenubar.cpp b/tests/auto/qmenubar/tst_qmenubar.cpp index 72048d9..d548a51 100644 --- a/tests/auto/qmenubar/tst_qmenubar.cpp +++ b/tests/auto/qmenubar/tst_qmenubar.cpp @@ -515,6 +515,10 @@ void tst_QMenuBar::activatedCount_noQt3() #if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM) QSKIP("On Mac/WinCE, native key events are needed to test menu action activation", SkipAll); #endif +#ifdef Q_OS_SYMBIAN + QSKIP("On Symbian OS, native key events are needed to test menu action activation", SkipAll); +#endif + // create a popup menu with menu items set the accelerators later... initSimpleMenubar_noQt3(); @@ -1573,6 +1577,12 @@ void tst_QMenuBar::task256322_highlight() file2->setText("file2"); QAction *nothing = win.menuBar()->addAction("nothing"); +#ifdef Q_WS_S60 + // Set minimum width to ensure that menu items are not added to the menu extension. + // Minimum width 360 is the minimal screen width in any supported Symbian device. + win.menuBar()->setMinimumWidth(360); +#endif + win.show(); QTest::qWait(200); |