From 1fb00d68de22a414f5e3f57b6623f570a002167a Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 27 May 2009 12:02:32 +0300 Subject: Implemented task 247268 - Cleanup qeventdispatcher_unix.cpp. All qeventdispatcher_unix.cpp changes were reverted since, this file is not anymore used in Symbian OS branch. --- src/corelib/kernel/qeventdispatcher_unix.cpp | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp index ce38b73..6aa3b56 100644 --- a/src/corelib/kernel/qeventdispatcher_unix.cpp +++ b/src/corelib/kernel/qeventdispatcher_unix.cpp @@ -54,7 +54,7 @@ #include #include -#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) || defined(QT_BOOTSTRAPPED) && !defined(Q_OS_SYMBIAN) +#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) || defined(QT_BOOTSTRAPPED) # include #endif @@ -65,7 +65,7 @@ Q_CORE_EXPORT bool qt_disable_lowpriority_timers=false; /***************************************************************************** UNIX signal handling *****************************************************************************/ -#if !defined(Q_OS_SYMBIAN) + static sig_atomic_t signal_received; static sig_atomic_t signals_fired[NSIG]; @@ -74,7 +74,7 @@ static void signalHandler(int sig) signals_fired[sig] = 1; signal_received = 1; } -#endif + static void initThreadPipeFD(int fd) { @@ -134,7 +134,6 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags, int nsel; do { -#if !defined(Q_OS_SYMBIAN) if (mainThread) { while (signal_received) { signal_received = 0; @@ -146,7 +145,7 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags, } } } -#endif + // Process timers and socket notifiers - the common UNIX stuff int highest = 0; if (! (flags & QEventLoop::ExcludeSocketNotifiers) && (sn_highest >= 0)) { @@ -258,7 +257,7 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags, QTimerInfoList::QTimerInfoList() { -#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_SYMBIAN) +#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) useMonotonicTimers = false; # if (_POSIX_MONOTONIC_CLOCK == 0) @@ -299,7 +298,7 @@ timeval QTimerInfoList::updateCurrentTime() return currentTime; } -#if ((_POSIX_MONOTONIC_CLOCK-0 <= 0) || defined(QT_BOOTSTRAPPED)) && !defined(Q_OS_SYMBIAN) +#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) || defined(QT_BOOTSTRAPPED) /* Returns true if the real time clock has changed by more than 10% @@ -375,11 +374,7 @@ void QTimerInfoList::repairTimersIfNeeded() void QTimerInfoList::getTime(timeval &t) { timespec ts; -#if !defined(Q_OS_SYMBIAN) clock_gettime(CLOCK_MONOTONIC, &ts); -#else - clock_gettime(CLOCK_REALTIME, &ts); -#endif t.tv_sec = ts.tv_sec; t.tv_usec = ts.tv_nsec / 1000; } @@ -944,7 +939,7 @@ void QEventDispatcherUNIX::flush() -#if !defined(Q_OS_SYMBIAN) + void QCoreApplication::watchUnixSignal(int sig, bool watch) { if (sig < NSIG) { @@ -958,10 +953,5 @@ void QCoreApplication::watchUnixSignal(int sig, bool watch) sigaction(sig, &sa, 0); } } -#else -void QCoreApplication::watchUnixSignal(int, bool) -{ -} -#endif QT_END_NAMESPACE -- cgit v0.12 From e2c09e6b998aa139fa24e5a1f685159be97de8bd Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 27 May 2009 12:31:09 +0300 Subject: Fixed qscriptv8testsuite test case deployment for Symbian. Also gave more heap for test to run properly on Symbian. --- tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro index 9e35801..9a17e13 100644 --- a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro +++ b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro @@ -2,10 +2,10 @@ load(qttest_p4) QT = core script SOURCES += tst_qscriptv8testsuite.cpp -wince*: { +wince*|symbian: { testFiles.sources = tests testFiles.path = . DEPLOYMENT += testFiles } - +symbian:TARGET.EPOCHEAPSIZE = 0x00020000 0x01000000 -- cgit v0.12 From 448d7d5702e90e21e1effe2ff460a48aa4a0b7d2 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 27 May 2009 12:50:12 +0300 Subject: Converted qstylesheetstyle test case to use qttest_p4. qttest_p4 takes care of definign the UID3 for autotests in Symbian OS, among the other things. The UID3 is needed to run tests ih HW with cetest. --- tests/auto/qstylesheetstyle/qstylesheetstyle.pro | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/tests/auto/qstylesheetstyle/qstylesheetstyle.pro b/tests/auto/qstylesheetstyle/qstylesheetstyle.pro index 6acb0b4..7babe25 100644 --- a/tests/auto/qstylesheetstyle/qstylesheetstyle.pro +++ b/tests/auto/qstylesheetstyle/qstylesheetstyle.pro @@ -1,14 +1,4 @@ -###################################################################### -# Automatically generated by qmake (2.01a) Wed Apr 26 13:53:24 2006 -###################################################################### - -TEMPLATE = app -TARGET = tst_qstylesheetstyle -DEPENDPATH += . -INCLUDEPATH += . .. - -CONFIG += console qtestlib -contains(QT_CONFIG, qt3support): QT += qt3support +load(qttest_p4) # Input SOURCES += tst_qstylesheetstyle.cpp -- cgit v0.12 From 0d819337435487a84e274714a759eb4bda24f942 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 27 May 2009 13:00:01 +0300 Subject: Fixed qscriptv8testsuite test case out-of-memory crashes. Increased qscriptv8testsuite max heap size and skipped two test cases on Symbian which demand too much memory. --- tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro | 2 +- tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro index 9a17e13..9976bb2 100644 --- a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro +++ b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro @@ -8,4 +8,4 @@ testFiles.path = . DEPLOYMENT += testFiles } -symbian:TARGET.EPOCHEAPSIZE = 0x00020000 0x01000000 +symbian:TARGET.EPOCHEAPSIZE = 0x00020000 0x02000000 diff --git a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp index 435af41..5811938 100644 --- a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp +++ b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp @@ -256,6 +256,11 @@ tst_Suite::tst_Suite() addTestExclusion("mul-exhaustive", "Demands too much memory on WinCE"); #endif +#ifdef Q_OS_SYMBIAN + addTestExclusion("nested-repetition-count-overflow", "Demands too much memory on Symbian"); + addTestExclusion("unicode-test", "Demands too much memory on Symbian"); +#endif + QVector *data = qt_meta_data_tst_Suite(); // content: *data << 1 // revision -- cgit v0.12 From 3bf92180a78cd14e76e11b9effc45e0a27889b8f Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 27 May 2009 13:08:49 +0300 Subject: Updated S60 installation docs. --- doc/src/installation.qdoc | 129 +++++++++++++++++++----- doc/src/s60-introduction.qdoc | 9 +- doc/src/snippets/code/doc_src_installation.qdoc | 25 +++-- 3 files changed, 117 insertions(+), 46 deletions(-) diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc index 85ea20c..91b7a25 100644 --- a/doc/src/installation.qdoc +++ b/doc/src/installation.qdoc @@ -505,7 +505,6 @@ in the \l{Qt for Windows CE Requirements} document. \ingroup installation \ingroup qts60 \brief How to install Qt on S60. - \list 1 \o Install needed IDE and SDKs @@ -522,9 +521,84 @@ in the \l{Qt for Windows CE Requirements} document. \note Users of \bold{S60 Platform SDK 3rd Edition FP1} also need special updates. The update can be found \l{http://pepper.troll.no/s60prereleases/patches/}{here}. - \note The wsini.ini provided with the \bold{S60 Platform SDK 5th Edition v0.9} - needs to be updated for correct font rendering in the emulator. The update can be found - \l{http://pepper.troll.no/s60prereleases/patches/}{here}. + \o Depending on how you obtained the Qt for S60 release, follow the instructions in one of these pages: + \list + \o \l{Installing Qt for S60 with installer} + \o \l{Installing Qt for S60 from source package} + \endlist +\endlist +*/ + +/*! \page install-S60-installer.html + +\title Installing Qt for S60 with installer +\ingroup installation +\ingroup qts60 +\brief How to install Qt on S60 using installer. +\list 1 + + \o Install Qt + + Run the \c{qt-s60-%VERSION%.exe} to install Qt. + + \note Qt must be installed on the same drive as the S60 SDK you are + using, and the install path must not contain any spaces. + + \o Environment variables + + In order to build and use Qt, the \c PATH environment variable needs + to be extended: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 18 + + This is done by adding \c{c:\Qt\%VERSION%\bin} to the \c PATH variable. + + On Windows the PATH can be extended by navigating to + "Control Panel->System->Advanced->Environment variables". + + \note Instead of modifying system path, you can also use the "Qt S60 Command Prompt" + to build your applications. It can be launched from start menu. + + In addition, you must configure the environment for use with the S60 + emulator. This is done by locating the Carbide.c++ submenu on the Start + menu, and choosing "Configure environment for WINSCW command line". + + \o Running Qt demos + + We've included a subset of the Qt demos in this package for you + to try out. An excellent starting point is the "fluidlauncher" + demo. To run the demo on a real device, you first have to install + the Qt libraries and demos on the device. + Install \c{qt_libs_armv5_urel.sisx} and \c{fluidlauncher_armv5_urel.sisx} + found at Qt installation folder to the device. + + To run the demos on the emulator, navigate to + \c{%EPOCROOT%\Epoc32\release\winscw\udeb\} and start any of the + Qt demos located there, for example: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 26 + + For more information about building and running Qt programs on S60, + see \l{S60 - Introduction to using Qt}. + + We hope you will enjoy using Qt. + +\endlist + +*/ +/*! \page install-S60-sources.html + +\title Installing Qt for S60 from source package +\ingroup installation +\ingroup qts60 +\brief How to install Qt on S60 from source package. + +\list 1 + + \o Install needed tools + + Building Qt libraries requires \l{http://www.arm.com/products/DevTools/RVCT.html}{RVCT} 2.2 [build 616] or later, + which is not available free of charge. \o Install Qt @@ -561,11 +635,9 @@ in the \l{Qt for Windows CE Requirements} document. \o Build Qt - The Qt libraries comes pre-built for real devices. - If you are using a 3.x S60 SDK, install \c{qts60binaries\3.x\qtlibs-%VERSION%.exe} - into the S60 SDK root directory. For example: \c{C:\Symbian\9.2\S60_3rd_FP1_2\} - If you are using a 5.0 S60 SDK, install \c{qts60binaries\5.0\qtlibs-%VERSION%.exe} - into the S60 SDK root directory. For example: \c{C:\S60\devices\S60_5th_Edition_SDK_v0.9\} + To build Qt for the device, type: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 28 To build Qt for the emulator, type: @@ -576,33 +648,34 @@ in the \l{Qt for Windows CE Requirements} document. \o Running Qt demos We've included a subset of the Qt demos in this package for you - to try out. An excellent starting point is the "fluidlauncher" - demo. To run the demo on a real device, you first have to install - the Qt libraries on the device. - For 3.x devices install \c{qts60binaries\3.x\qt_libs_armv5_udeb.sisx} - For 5.0 devices install \c{qts60binaries\5.0\qt_libs_armv5_udeb.sisx} - included in this package to the device. Then type: + to try out. An excellent starting point is the "fluidlauncher" + demo. To run the demo on a real device, you first have to install + the Qt libraries on the device: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 29 + + \note You will need to supply certificate that allows installation + of binaries with "All -Tcb" capability to your device. + + Similarly, install fluidlauncher to the device: - \snippet doc/src/snippets/code/doc_src_installation.qdoc 25 + \snippet doc/src/snippets/code/doc_src_installation.qdoc 30 - This will create a self-signed \c fluidlauncher_gcce_udeb.sisx and + This will create a self-signed \c fluidlauncher_armv5_urel.sisx and install it to your device. - \note You can specify your own certificate and key files as additional parameters to - \c createpackage if default ones are not suitable. - - To run the demos on the emulator simply run: + To run the demos on the emulator simply run: - \snippet doc/src/snippets/code/doc_src_installation.qdoc 27 + \snippet doc/src/snippets/code/doc_src_installation.qdoc 27 - Or, if you need to supply arguments to the program, navigate to - \c{%EPOCROOT%\Epoc32\release\winscw\udeb\} and start any of the - Qt demos located there, for example: + Or, if you need to supply arguments to the program, navigate to + \c{%EPOCROOT%\Epoc32\release\winscw\udeb\} and start any of the + Qt demos located there, for example: - \snippet doc/src/snippets/code/doc_src_installation.qdoc 26 + \snippet doc/src/snippets/code/doc_src_installation.qdoc 26 - For more information about building and running Qt programs on S60, - see \l{S60 - Introduction to using Qt}. + For more information about building and running Qt programs on S60, + see \l{S60 - Introduction to using Qt}. We hope you will enjoy using Qt. diff --git a/doc/src/s60-introduction.qdoc b/doc/src/s60-introduction.qdoc index a574355..e6e6b7e 100644 --- a/doc/src/s60-introduction.qdoc +++ b/doc/src/s60-introduction.qdoc @@ -19,19 +19,14 @@ \tableofcontents - \section1 Required tools - - In order to use Qt for S60 you need to have a typical S60 development - setup. See \l{Qt for S60 Requirements} for the details. - \section1 Installing Qt Follow the instructions found in \l{Installing Qt on S60}. \section1 Building your own applications - If you are new to Qt development, have a look at \l{How to Learn Qt} - and \l{Qt Tutorial}. In general, the difference between developing a + If you are new to Qt development, have a look at \l{How to Learn Qt}. + In general, the difference between developing a Qt application on S60 compared to any of the other platforms supported by Qt is not that big. diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc index 2930317..8730125 100644 --- a/doc/src/snippets/code/doc_src_installation.qdoc +++ b/doc/src/snippets/code/doc_src_installation.qdoc @@ -138,17 +138,6 @@ make debug-winscw //! [24] -//! [25] -cd examples -make debug-gcce -cd ..\demos - -make debug-gcce -cd embedded\fluidlauncher -createpackage -i fluidlauncher_gcce_udeb.pkg -//! [25] - - //! [26] wiggly.exe -small-screen //! [26] @@ -156,3 +145,17 @@ wiggly.exe -small-screen //! [27] make run //! [27] + +//! [28] +make release-armv5 +//! [28] + +//! [29] +cd src\s60installs +createpackage -i qt_libs_armv5_urel.pkg +//! [29] + +//! [30] +cd embedded\fluidlauncher +createpackage -i fluidlauncher_armv5_urel.pkg +//! [30] -- cgit v0.12 From a135a11faeafaed264e264975b74ba7665ff5e42 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 27 May 2009 13:21:57 +0300 Subject: Configured qtwidgets autotest to use default IAP without user prompts. --- tests/auto/qtwidgets/tst_qtwidgets.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/auto/qtwidgets/tst_qtwidgets.cpp b/tests/auto/qtwidgets/tst_qtwidgets.cpp index a6a3be1..6a79242 100644 --- a/tests/auto/qtwidgets/tst_qtwidgets.cpp +++ b/tests/auto/qtwidgets/tst_qtwidgets.cpp @@ -47,15 +47,28 @@ #include "mainwindow.h" +#include "../network-settings.h" class tst_QtWidgets: public QObject { Q_OBJECT +public: + tst_QtWidgets(); + virtual ~tst_QtWidgets(); + private slots: void snapshot(); }; +tst_QtWidgets::tst_QtWidgets() +{ + Q_SET_DEFAULT_IAP +} + +tst_QtWidgets::~tst_QtWidgets() +{ +} void tst_QtWidgets::snapshot() { -- cgit v0.12 From 86d5c38d3f21a7d89dd619fa448a9c50527d8ba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Wed, 27 May 2009 13:44:40 +0300 Subject: S60Style: Keep the background texture in static QPixmap pointer. --- src/gui/styles/qs60style.cpp | 27 +++++++++++++++++---------- src/gui/styles/qs60style_p.h | 20 ++++++++++++-------- src/gui/styles/qs60style_simulated.cpp | 19 +++++-------------- src/gui/styles/qs60style_symbian.cpp | 34 ++++++++++++---------------------- 4 files changed, 46 insertions(+), 54 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 071b60a..5f7c083 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -95,7 +95,8 @@ const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = { const short *QS60StylePrivate::m_pmPointer = QS60StylePrivate::data[0]; #endif // defined(QT_S60STYLE_LAYOUTDATA_SIMULATED) -bool QS60StylePrivate::m_backgroundValid = false; +// theme background texture +QPixmap *QS60StylePrivate::m_background = 0; const struct QS60StylePrivate::frameElementCenter QS60StylePrivate::m_frameElementsData[] = { {SE_ButtonNormal, QS60StyleEnums::SP_QsnFrButtonTbCenter}, @@ -352,25 +353,25 @@ QFont QS60StylePrivate::s60Font( void QS60StylePrivate::clearCaches(QS60StylePrivate::CacheClearReason reason) { - switch(reason){ + switch(reason){ case CC_LayoutChange: // when layout changes, the colors remain in cache, but graphics and fonts can change m_mappedFontsCache.clear(); - m_backgroundValid = false; + deleteBackground(); QPixmapCache::clear(); break; case CC_ThemeChange: m_colorCache.clear(); QPixmapCache::clear(); - m_backgroundValid = false; + deleteBackground(); case CC_UndefinedChange: default: m_colorCache.clear(); m_mappedFontsCache.clear(); QPixmapCache::clear(); - m_backgroundValid = false; + deleteBackground(); break; - } + } } // Since S60Style has 'button' and 'tooltip' as a graphic, we don't have any native color which to use @@ -561,6 +562,14 @@ void QS60StylePrivate::setBackgroundTexture(QApplication *app) const app->setPalette(applicationPalette); } +void QS60StylePrivate::deleteBackground() +{ + if (QS60StylePrivate::m_background) { + delete QS60StylePrivate::m_background; + QS60StylePrivate::m_background = 0; + } +} + int QS60StylePrivate::focusRectPenWidth() { return pixelMetric(QS60Style::PM_DefaultFrameWidth); @@ -1314,16 +1323,14 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, (listView->selectionMode() == QAbstractItemView::SingleSelection || listView->selectionMode() == QAbstractItemView::NoSelection); QRect selectionRect = subElementRect(SE_ItemViewItemCheckIndicator, &voptAdj, widget); - if (voptAdj.state & QStyle::State_Selected && - !singleSelection) { + if (voptAdj.state & QStyle::State_Selected && !singleSelection) { QStyleOptionViewItemV4 option(voptAdj); option.rect = selectionRect; // Draw selection mark. drawPrimitive(QStyle::PE_IndicatorViewItemCheck, &option, painter, widget); if ( textRect.right() > selectionRect.left() ) textRect.setRight(selectionRect.left()); - } - else if (singleSelection && + } else if (singleSelection && voptAdj.features & QStyleOptionViewItemV2::HasCheckIndicator) { // draw the check mark if (selectionRect.isValid()) { diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index ba7dca3..bedff58 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -331,13 +331,13 @@ public: SF_StateDisabled = 0x0020, SF_ColorSkinned = 0x0040, }; - + enum CacheClearReason { CC_UndefinedChange = 0, CC_LayoutChange, CC_ThemeChange }; - + Q_DECLARE_FLAGS(SkinElementFlags, SkinElementFlag) // draws skin element @@ -373,8 +373,10 @@ public: int pointSize = -1) const; // clears all style caches (fonts, colors, pixmaps) void clearCaches(CacheClearReason reason = CC_UndefinedChange); - // returns themed background texture - static QPixmap backgroundTexture(); + + // themed main background oprations + void setBackgroundTexture(QApplication *application) const; + static void deleteBackground(); static bool isTouchSupported(); static bool isToolBarBackground(); @@ -383,7 +385,6 @@ public: QColor colorFromFrameGraphics(QS60StylePrivate::SkinFrameElements frame) const; void setThemePalette(QApplication *application) const; void setThemePalette(QWidget *widget) const; - void setBackgroundTexture(QApplication *application) const; static int focusRectPenWidth(); @@ -411,6 +412,8 @@ public: static QPixmap frame(SkinFrameElements frame, const QSize &size, SkinElementFlags flags = KDefaultSkinElementFlags); + static QPixmap backgroundTexture(); + private: static void drawPart(QS60StyleEnums::SkinParts part, QPainter *painter, const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags); @@ -424,9 +427,9 @@ private: SkinElementFlags flags = KDefaultSkinElementFlags); static QPixmap cachedFrame(SkinFrameElements frame, const QSize &size, SkinElementFlags flags = KDefaultSkinElementFlags); - + static void refreshUI(); - + static QSize partSize(QS60StyleEnums::SkinParts part, SkinElementFlags flags = KDefaultSkinElementFlags); static QPixmap part(QS60StyleEnums::SkinParts part, const QSize &size, @@ -436,7 +439,8 @@ private: static QSize screenSize(); - static bool m_backgroundValid; + // Contains background texture. + static QPixmap *m_background; const static SkinElementFlags KDefaultSkinElementFlags; }; diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 65336ae..3edc874 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -193,24 +193,15 @@ QVariant QS60StylePrivate::styleProperty_specific(const char *name) const QPixmap QS60StylePrivate::backgroundTexture() { - static QPixmap result; - // Poor mans caching. + Making sure that there is always only one background image in memory at a time - -/* - TODO: 1) Hold the background QPixmap as pointer in a static class member. - Also add a deleteBackground() function and call that in ~QS60StylePrivate() - 2) Don't cache the background at all as soon as we have native pixmap support -*/ - - if (!m_backgroundValid) { - result = QPixmap(); + if (!m_background) { const QSize size = QApplication::activeWindow()?QApplication::activeWindow()->size():QSize(100, 100); - result = part(QS60StyleEnums::SP_QsnBgScreen, size); - m_backgroundValid = true; + QPixmap background = part(QS60StyleEnums::SP_QsnBgScreen, size); + m_background = new QPixmap(background); } - return result; + return *m_background; } + bool QS60StylePrivate::isTouchSupported() { #ifdef QT_KEYPAD_NAVIGATION diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index 3fc4c8c..f860842 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -583,26 +583,6 @@ QPixmap QS60StyleModeSpecifics::fromFbsBitmap(CFbsBitmap *icon, CFbsBitmap *mask return QPixmap::fromImage(iconImage); } -QPixmap QS60StylePrivate::backgroundTexture() -{ - static QPixmap result; - // Poor mans caching. + Making sure that there is always only one background image in memory at a time - -/* - TODO: 1) Hold the background QPixmap as pointer in a static class member. - Also add a deleteBackground() function and call that in ~QS60StylePrivate() - 2) Don't cache the background at all as soon as we have native pixmap support -*/ - - if (!m_backgroundValid) { - result = QPixmap(); - result = part(QS60StyleEnums::SP_QsnBgScreen, - QSize(S60->screenWidthInPixels, S60->screenHeightInPixels), SkinElementFlags()); - m_backgroundValid = true; - } - return result; -} - bool QS60StylePrivate::isTouchSupported() { return bool(AknLayoutUtils::PenEnabled()); @@ -975,7 +955,7 @@ void QS60StylePrivate::setActiveLayout() break; } } - + //not found, lets try without mirroring info if (activeLayoutIndex==-1){ for (int i=0; iscreenWidthInPixels, S60->screenHeightInPixels), SkinElementFlags()); + m_background = new QPixmap(background); + } + return *m_background; +} + // If the public SDK returns compressed images, please let us also uncompress those! void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap* aTrgBitmap, CFbsBitmap* aSrcBitmap) { -- cgit v0.12 From 97228a74cbb6bffa2d621f3267da9270381aec37 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 27 May 2009 13:48:48 +0300 Subject: Workaround for non-native makefile target names with symbian-abl. --- tests/auto/qresourceengine/qresourceengine.pro | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/auto/qresourceengine/qresourceengine.pro b/tests/auto/qresourceengine/qresourceengine.pro index f487b97..d98c2db 100644 --- a/tests/auto/qresourceengine/qresourceengine.pro +++ b/tests/auto/qresourceengine/qresourceengine.pro @@ -9,7 +9,11 @@ load(resources) SOURCES += tst_resourceengine.cpp RESOURCES += testqrc/test.qrc -runtime_resource.target = $$PWD/runtime_resource.rcc +symbian-sbsv2 { + runtime_resource.target = $$PWD/runtime_resource.rcc +} else { + runtime_resource.target = runtime_resource.rcc +} runtime_resource.depends = $$PWD/testqrc/test.qrc runtime_resource.commands = $$QMAKE_RCC -root /runtime_resource/ -binary $${runtime_resource.depends} -o $${runtime_resource.target} QMAKE_EXTRA_TARGETS = runtime_resource -- cgit v0.12 From df4a095019638356520728f88ac4d919e654dcdd Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Wed, 27 May 2009 15:41:01 +0200 Subject: Modify QDesktopWidget to emit proper signals on resize. The resize behavior of QDesktopWidget was somewhat undefined on Symbian because we weren't actually changing the size of the widget. This patch fixes that and also implements the resizeEvent() function so that it properly emits signals. We didn't call resize() to change the size here because our implementation of setGeometry_sys() ignores the desktop widget since it doesn't have a backing store and isn't a real window. Task-number: 253930 --- src/gui/kernel/qapplication_s60.cpp | 10 ++++++ src/gui/kernel/qdesktopwidget_s60.cpp | 63 ++++++++++++++++++++++++++++++----- 2 files changed, 65 insertions(+), 8 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index dd51fcd..5b2c1fb 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -14,6 +14,7 @@ #include "qevent.h" #include "qeventdispatcher_s60_p.h" #include "qwidget.h" +#include "qdesktopwidget.h" #include "private/qbackingstore_p.h" #include "qt_s60_p.h" #include "private/qevent_p.h" @@ -49,6 +50,8 @@ static bool appNoGrab = false; // Grabbing enabled Q_GUI_EXPORT QS60Data *qt_s60Data = 0; extern bool qt_sendSpontaneousEvent(QObject*,QEvent*); +extern QDesktopWidget *qt_desktopWidget; // qapplication.cpp + QWidget *qt_button_down = 0; // widget got last button-down bool qt_nograb() // application no-grab option @@ -988,6 +991,13 @@ int QApplication::s60ProcessEvent(TWsEvent *event) case EEventScreenDeviceChanged: if (S60) S60->updateScreenSize(); + if (qt_desktopWidget) { + QSize oldSize = qt_desktopWidget->size(); + qt_desktopWidget->data->crect.setWidth(S60->screenWidthInPixels); + qt_desktopWidget->data->crect.setHeight(S60->screenHeightInPixels); + QResizeEvent e(qt_desktopWidget->size(), oldSize); + QApplication::sendEvent(qt_desktopWidget, &e); + } return 0; // Propagate to CONE case EEventWindowVisibilityChanged: if (controlInMap) { diff --git a/src/gui/kernel/qdesktopwidget_s60.cpp b/src/gui/kernel/qdesktopwidget_s60.cpp index 029892e..d57d289 100644 --- a/src/gui/kernel/qdesktopwidget_s60.cpp +++ b/src/gui/kernel/qdesktopwidget_s60.cpp @@ -32,34 +32,58 @@ public: static int screenCount; static int primaryScreen; + + static QVector *rects; + static QVector *workrects; + + static int refcount; }; int QDesktopWidgetPrivate::screenCount = 1; int QDesktopWidgetPrivate::primaryScreen = 0; +QVector *QDesktopWidgetPrivate::rects = 0; +QVector *QDesktopWidgetPrivate::workrects = 0; +int QDesktopWidgetPrivate::refcount = 0; QDesktopWidgetPrivate::QDesktopWidgetPrivate() { + ++refcount; } QDesktopWidgetPrivate::~QDesktopWidgetPrivate() { + if (!--refcount) + cleanup(); } void QDesktopWidgetPrivate::init(QDesktopWidget *that) { - TInt screenCount=0; - TInt result=0; + int screenCount=0; + + if (HAL::Get(0, HALData::EDisplayNumberOfScreens, screenCount) == KErrNone) + QDesktopWidgetPrivate::screenCount = screenCount; + else + QDesktopWidgetPrivate::screenCount = 0; - result = HAL::Get(0, HALData::EDisplayNumberOfScreens, screenCount); - QDesktopWidgetPrivate::screenCount = screenCount; - if( result != KErrNone) - { - // ### What to do if no screens found? - } + rects = new QVector(); + workrects = new QVector(); + + rects->resize(QDesktopWidgetPrivate::screenCount); + workrects->resize(QDesktopWidgetPrivate::screenCount); + + // ### TODO: Implement proper multi-display support + rects->resize(1); + rects->replace(0, that->rect()); + workrects->resize(1); + workrects->replace(0, that->rect()); } void QDesktopWidgetPrivate::cleanup() { + delete rects; + rects = 0; + delete workrects; + workrects = 0; } @@ -120,6 +144,29 @@ int QDesktopWidget::screenNumber(const QPoint &point) const void QDesktopWidget::resizeEvent(QResizeEvent *) { + Q_D(QDesktopWidget); + QVector oldrects; + oldrects = *d->rects; + QVector oldworkrects; + oldworkrects = *d->workrects; + int oldscreencount = d->screenCount; + + QDesktopWidgetPrivate::cleanup(); + QDesktopWidgetPrivate::init(this); + + for (int i = 0; i < qMin(oldscreencount, d->screenCount); ++i) { + QRect oldrect = oldrects[i]; + QRect newrect = d->rects->at(i); + if (oldrect != newrect) + emit resized(i); + } + + for (int j = 0; j < qMin(oldscreencount, d->screenCount); ++j) { + QRect oldrect = oldworkrects[j]; + QRect newrect = d->workrects->at(j); + if (oldrect != newrect) + emit workAreaResized(j); + } } QT_END_NAMESPACE -- cgit v0.12