diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-07-03 02:52:17 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-07-03 02:52:17 (GMT) |
commit | daeb81493aef4fd8f632ba4ea7f8d12ed80fa7be (patch) | |
tree | 7d10df975019f40c7c279d917ca45caa4fd14f92 /src/gui | |
parent | 8c01157a9056f91d40d3579bfc0eb9b81a5f99d8 (diff) | |
parent | cefb4a2e9056f390871cd01f733c2519fd15d308 (diff) | |
download | Qt-daeb81493aef4fd8f632ba4ea7f8d12ed80fa7be.zip Qt-daeb81493aef4fd8f632ba4ea7f8d12ed80fa7be.tar.gz Qt-daeb81493aef4fd8f632ba4ea7f8d12ed80fa7be.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:
Hide some more files from git-status.
Fixed Qt symbian/linux-armcc mkspec when configured with -qtlibinfix.
Fixed symbian/linux-armcc mkspec when configured with -qtlibinfix.
Fixed deployment locations for various profiles.
Added a top-level runonphone target for Qt and QtWebKit.
QS60Style: Simplify QMenu drawing
QS60Style: Remove gap from QProgressDialog
ColorDialog is incorrectly positioned
Support for "deploy" make target in Symbian
qtguiu.def merge conflict fix
Fix for include "private/qt_s60_p.h" in non-symbian builds
Making orbit input methods work with Qt apps with -no-s60
Using the remaining valid data to construct the QTime object when msec parsing failed.
QProgressDialog text is too close to dialog border
fix for broken input method loading
Avkon Removal DEF file updates
Stub version of QS60Style
Avkon removal configured with -no-s60
QFileDialog broken in landscape in N8
Diffstat (limited to 'src/gui')
27 files changed, 525 insertions, 144 deletions
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index a6bd78a..9e0437c 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -67,12 +67,12 @@ extern bool qt_wince_is_smartphone(); //is defined in qguifunctions_wce.cpp #elif defined(Q_OS_SYMBIAN) # include "qfiledialog.h" # include "qfontdialog.h" -# include "qcolordialog.h" # include "qwizard.h" +# include "private/qt_s60_p.h" #endif #if defined(Q_WS_S60) -#include "private/qt_s60_p.h" +#include <AknUtils.h> // AknLayoutUtils #endif #ifndef SPI_GETSNAPTODEFBUTTON @@ -393,7 +393,7 @@ void QDialogPrivate::resetModalitySetByOpen() resetModalityTo = -1; } -#if defined(Q_WS_WINCE) || defined(Q_WS_S60) +#if defined(Q_WS_WINCE) || defined(Q_OS_SYMBIAN) #ifdef Q_WS_WINCE_WM void QDialogPrivate::_q_doneAction() { @@ -413,7 +413,7 @@ bool QDialog::event(QEvent *e) accept(); result = true; } -#else +#elif defined(Q_WS_S60) if ((e->type() == QEvent::StyleChange) || (e->type() == QEvent::Resize )) { if (!testAttribute(Qt::WA_Moved)) { Qt::WindowStates state = windowState(); @@ -423,6 +423,7 @@ bool QDialog::event(QEvent *e) setWindowState(state); } } + // TODO is Symbian, non-S60 behaviour required? #endif return result; } @@ -527,14 +528,19 @@ int QDialog::exec() #endif //QT_NO_MENUBAR #endif //Q_WS_WINCE_WM + bool showSystemDialogFullScreen = false; #ifdef Q_OS_SYMBIAN if (qobject_cast<QFileDialog *>(this) || qobject_cast<QFontDialog *>(this) || - qobject_cast<QColorDialog *>(this) || qobject_cast<QWizard *>(this)) - showMaximized(); - else + qobject_cast<QWizard *>(this)) { + showSystemDialogFullScreen = true; + } #endif // Q_OS_SYMBIAN - show(); + if (showSystemDialogFullScreen) { + setWindowFlags(windowFlags() | Qt::WindowSoftkeysVisibleHint); + setWindowState(Qt::WindowFullScreen); + } + show(); #ifdef Q_WS_MAC d->mac_nativeDialogModalHelp(); @@ -818,8 +824,8 @@ void QDialog::adjustPosition(QWidget* w) return; #endif -#ifdef Q_WS_S60 - if (s60AdjustedPosition()) +#ifdef Q_OS_SYMBIAN + if (symbianAdjustedPosition()) //dialog has already been positioned return; #endif @@ -887,13 +893,12 @@ void QDialog::adjustPosition(QWidget* w) move(p); } -#if defined(Q_WS_S60) +#if defined(Q_OS_SYMBIAN) /*! \internal */ -bool QDialog::s60AdjustedPosition() +bool QDialog::symbianAdjustedPosition() { +#if defined(Q_WS_S60) QPoint p; - const QSize mainAreaSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size(); - const int statusPaneHeight = (S60->screenHeightInPixels - mainAreaSize.height())>>1; const bool doS60Positioning = !(isFullScreen()||isMaximized()); if (doS60Positioning) { // naive way to deduce screen orientation @@ -937,6 +942,10 @@ bool QDialog::s60AdjustedPosition() move(p); } return doS60Positioning; +#else + // TODO - check positioning requirement for Symbian, non-s60 + return false; +#endif } #endif diff --git a/src/gui/dialogs/qdialog.h b/src/gui/dialogs/qdialog.h index 777256a..b2ba93c 100644 --- a/src/gui/dialogs/qdialog.h +++ b/src/gui/dialogs/qdialog.h @@ -107,7 +107,7 @@ public Q_SLOTS: protected: QDialog(QDialogPrivate &, QWidget *parent, Qt::WindowFlags f = 0); -#if defined(Q_WS_WINCE) || defined(Q_WS_S60) +#if defined(Q_WS_WINCE) || defined(Q_OS_SYMBIAN) bool event(QEvent *e); #endif void keyPressEvent(QKeyEvent *); @@ -123,8 +123,8 @@ private: Q_DECLARE_PRIVATE(QDialog) Q_DISABLE_COPY(QDialog) -#if defined(Q_WS_S60) - bool s60AdjustedPosition(); +#if defined(Q_OS_SYMBIAN) + bool symbianAdjustedPosition(); #endif diff --git a/src/gui/dialogs/qprogressdialog.cpp b/src/gui/dialogs/qprogressdialog.cpp index a2d7b23..d64c847 100644 --- a/src/gui/dialogs/qprogressdialog.cpp +++ b/src/gui/dialogs/qprogressdialog.cpp @@ -153,6 +153,13 @@ void QProgressDialogPrivate::layout() const bool centered = bool(q->style()->styleHint(QStyle::SH_ProgressDialog_CenterCancelButton, 0, q)); + int additionalSpacing = 0; +#ifdef Q_OS_SYMBIAN + //In Symbian, we need to have wider margins for dialog borders, as the actual border is some pixels + //inside the dialog area (to enable transparent borders) + additionalSpacing = mlr; +#endif + QSize cs = cancel ? cancel->sizeHint() : QSize(0,0); QSize bh = bar->sizeHint(); int cspc; @@ -185,8 +192,8 @@ void QProgressDialogPrivate::layout() } if (label) - label->setGeometry(mlr, 0, q->width()-mlr*2, lh); - bar->setGeometry(mlr, lh+sp, q->width()-mlr*2, bh.height()); + label->setGeometry(mlr, additionalSpacing, q->width() - mlr * 2, lh); + bar->setGeometry(mlr, lh + sp + additionalSpacing, q->width() - mlr * 2, bh.height()); } void QProgressDialogPrivate::retranslateStrings() diff --git a/src/gui/gui.pro b/src/gui/gui.pro index 7f1cb78..dede9d0 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -72,7 +72,7 @@ symbian { pu_header = "; Partial upgrade package for testing QtGui changes without reinstalling everything" \ "$${LITERAL_HASH}{\"Qt gui\"}, (0x2001E61C), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU" partial_upgrade.pkg_prerules = pu_header vendorinfo - partial_upgrade.sources = $$QMAKE_LIBDIR_QT/QtGui.dll + partial_upgrade.sources = $$QMAKE_LIBDIR_QT/QtGui$${QT_LIBINFIX}.dll partial_upgrade.path = c:/sys/bin DEPLOYMENT = partial_upgrade $$DEPLOYMENT } diff --git a/src/gui/image/qpixmapdatafactory.cpp b/src/gui/image/qpixmapdatafactory.cpp index 8014660..7498a7c 100644 --- a/src/gui/image/qpixmapdatafactory.cpp +++ b/src/gui/image/qpixmapdatafactory.cpp @@ -53,7 +53,7 @@ #ifdef Q_WS_MAC # include <private/qpixmap_mac_p.h> #endif -#ifdef Q_WS_S60 +#ifdef Q_OS_SYMBIAN # include <private/qpixmap_s60_p.h> #endif @@ -82,7 +82,7 @@ QPixmapData* QSimplePixmapDataFactory::create(QPixmapData::PixelType type) return new QRasterPixmapData(type); #elif defined(Q_WS_MAC) return new QMacPixmapData(type); -#elif defined(Q_WS_S60) +#elif defined(Q_OS_SYMBIAN) return new QS60PixmapData(type); #else #error QSimplePixmapDataFactory::create() not implemented diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri index 6fd45ad..f9c84c1 100644 --- a/src/gui/kernel/kernel.pri +++ b/src/gui/kernel/kernel.pri @@ -120,18 +120,21 @@ symbian { kernel/qkeymapper_s60.cpp\ kernel/qclipboard_s60.cpp\ kernel/qdnd_s60.cpp \ - kernel/qsound_s60.cpp \ - kernel/qsoftkeymanager_s60.cpp + kernel/qsound_s60.cpp HEADERS += \ kernel/qt_s60_p.h \ - kernel/qeventdispatcher_s60_p.h \ - kernel/qsoftkeymanager_s60_p.h + kernel/qeventdispatcher_s60_p.h LIBS += -lbafl -lestor INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE INCLUDEPATH += ../3rdparty/s60 + + contains(QT_CONFIG, s60) { + SOURCES += kernel/qsoftkeymanager_s60.cpp + HEADERS += kernel/qsoftkeymanager_s60_p.h + } } diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 1680ef4..ccfe88c 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -81,7 +81,7 @@ #include <private/qt_x11_p.h> #endif -#if defined(Q_WS_X11) || defined(Q_WS_S60) +#if defined(Q_WS_X11) || defined(Q_OS_SYMBIAN) #include "qinputcontextfactory.h" #endif @@ -2771,7 +2771,7 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave) { qt_win_set_cursor(cursorWidget, true); #elif defined(Q_WS_X11) qt_x11_enforce_cursor(cursorWidget, true); -#elif defined(Q_WS_S60) +#elif defined(Q_OS_SYMBIAN) qt_symbian_set_cursor(cursorWidget, true); #endif } diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h index cb1d063..d31d9e5 100644 --- a/src/gui/kernel/qapplication.h +++ b/src/gui/kernel/qapplication.h @@ -61,7 +61,7 @@ QT_BEGIN_HEADER -#if defined(Q_WS_S60) +#if defined(Q_OS_SYMBIAN) class CApaApplication; #endif @@ -118,7 +118,7 @@ class Q_GUI_EXPORT QApplication : public QCoreApplication public: enum Type { Tty, GuiClient, GuiServer }; -#ifdef Q_WS_S60 +#ifdef Q_OS_SYMBIAN typedef CApaApplication * (*QS60MainApplicationFactory)(); #endif @@ -130,7 +130,7 @@ public: QApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0, int = QT_VERSION); QApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0, int = QT_VERSION); #endif -#if defined(Q_WS_S60) +#if defined(Q_OS_SYMBIAN) QApplication(QApplication::QS60MainApplicationFactory factory, int &argc, char **argv, int = QT_VERSION); #endif #endif @@ -366,7 +366,7 @@ public: QApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0); QApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0); #endif -#if defined(Q_WS_S60) || defined(qdoc) +#if defined(Q_OS_SYMBIAN) || defined(qdoc) QApplication(QApplication::QS60MainApplicationFactory factory, int &argc, char **argv); #endif #endif diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index a7c7310..0d65811 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -69,14 +69,17 @@ #include "apgwgnam.h" // For CApaWindowGroupName #include <mdaaudiotoneplayer.h> // For CMdaAudioToneUtility +#if defined(Q_OS_SYMBIAN) +# include <private/qs60mainapplication_p.h> +# include <centralrepository.h> +# include "qs60mainappui.h" +# include "qinputcontext.h" +#endif + #if defined(Q_WS_S60) # if !defined(QT_NO_IM) -# include "qinputcontext.h" # include <private/qcoefepinputcontext_p.h> # endif -# include <private/qs60mainapplication_p.h> -# include <centralrepository.h> -# include "qs60mainappui.h" #endif #include "private/qstylesheetstyle_p.h" @@ -894,7 +897,7 @@ TKeyResponse QSymbianControl::sendKeyEvent(QWidget *widget, QKeyEvent *keyEvent) if (qic && qic->filterEvent(keyEvent)) return EKeyWasConsumed; } -#endif // !defined(QT_NO_IM) && defined(Q_WS_S60) +#endif // !defined(QT_NO_IM) && defined(Q_OS_SYMBIAN) if (widget && qt_sendSpontaneousEvent(widget, keyEvent)) if (keyEvent->isAccepted()) @@ -1974,10 +1977,10 @@ int QApplicationPrivate::symbianHandleCommand(const QSymbianEvent *symbianEvent) ret = 1; break; default: +#ifdef Q_WS_S60 bool handled = QSoftKeyManager::handleCommand(command); if (handled) ret = 1; -#ifdef Q_WS_S60 else ret = QMenuBarPrivate::symbianCommands(command); #endif diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index 204e38c..d8ef67d 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -155,7 +155,9 @@ public: static inline CAknTitlePane* titlePane(); static inline CAknContextPane* contextPane(); static inline CEikButtonGroupContainer* buttonGroupContainer(); +#endif +#ifdef Q_OS_SYMBIAN TTrapHandler *s60InstalledTrapHandler; #endif }; @@ -208,7 +210,7 @@ protected: // from MAknFadedComponent TInt CountFadedComponents() {return 1;} CCoeControl* FadedComponent(TInt /*aIndex*/) {return this;} #else - #warning No fallback implementation for QSymbianControl::FadeBehindPopup + // #warning No fallback implementation for QSymbianControl::FadeBehindPopup void FadeBehindPopup(bool /*fade*/){ } #endif @@ -277,9 +279,9 @@ inline QS60Data::QS60Data() avkonComponentsSupportTransparency(0), menuBeingConstructed(0), memoryLimitForHwRendering(0), - s60ApplicationFactory(0), -#ifdef Q_WS_S60 - s60InstalledTrapHandler(0) + s60ApplicationFactory(0) +#ifdef Q_OS_SYMBIAN + ,s60InstalledTrapHandler(0) #endif { } diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index dd568cd..233df15 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -10695,7 +10695,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) break; case Qt::WA_AcceptTouchEvents: -#if defined(Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_WS_S60) +#if defined(Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_OS_SYMBIAN) if (on) d->registerTouchWindow(); #endif diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 3f351d9..2818d88 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -54,6 +54,7 @@ #ifdef Q_WS_S60 #include <aknappui.h> +#include <eikbtgpc.h> #endif // This is necessary in order to be able to perform delayed invokation on slots @@ -1082,12 +1083,14 @@ void QWidget::setWindowState(Qt::WindowStates newstate) Qt::WindowStates oldstate = windowState(); const TBool isFullscreen = newstate & Qt::WindowFullScreen; +#ifdef Q_WS_S60 const TBool cbaRequested = windowFlags() & Qt::WindowSoftkeysVisibleHint; const TBool cbaVisible = CEikButtonGroupContainer::Current() ? true : false; const TBool softkeyVisibilityChange = isFullscreen && (cbaRequested != cbaVisible); if (oldstate == newstate && !softkeyVisibilityChange) return; +#endif // Q_WS_S60 if (isWindow()) { createWinId(); diff --git a/src/gui/painting/qgraphicssystem.cpp b/src/gui/painting/qgraphicssystem.cpp index 69ce47e..f06e309 100644 --- a/src/gui/painting/qgraphicssystem.cpp +++ b/src/gui/painting/qgraphicssystem.cpp @@ -50,7 +50,7 @@ #ifdef Q_WS_MAC # include <private/qpixmap_mac_p.h> #endif -#ifdef Q_WS_S60 +#ifdef Q_OS_SYMBIAN # include <private/qpixmap_s60_p.h> #endif @@ -71,7 +71,7 @@ QPixmapData *QGraphicsSystem::createDefaultPixmapData(QPixmapData::PixelType typ return new QRasterPixmapData(type); #elif defined(Q_WS_MAC) return new QMacPixmapData(type); -#elif defined(Q_WS_S60) +#elif defined(Q_OS_SYMBIAN) return new QS60PixmapData(type); #elif !defined(Q_WS_QWS) #error QGraphicsSystem::createDefaultPixmapData() not implemented diff --git a/src/gui/s60framework/qs60mainapplication.cpp b/src/gui/s60framework/qs60mainapplication.cpp index 41ac1a8..0f9367e 100644 --- a/src/gui/s60framework/qs60mainapplication.cpp +++ b/src/gui/s60framework/qs60mainapplication.cpp @@ -71,17 +71,17 @@ _LIT(KQtWrapperResourceFile, "\\resource\\apps\\s60main" QT_LIBINFIX_UNICODE L". The QS60MainApplication provides a helper class for use in migrating from existing S60 based applications to Qt based applications. It is - used in the exact same way as the \c CAknApplication class from + used in the exact same way as the \c CEikApplication class from Symbian, but internally provides extensions used by Qt. When modifying old S60 applications that rely on implementing - functions in \c CAknApplication, the class should be modified to - inherit from this class instead of \c CAknApplication. Then the + functions in \c CEikApplication, the class should be modified to + inherit from this class instead of \c CEikApplication. Then the application can choose to override only certain functions. To make Qt use the custom application objects, pass a factory function to \c{QApplication::QApplication(QApplication::QS60MainApplicationFactory, int &, char **)}. - For more information on \c CAknApplication, please see the S60 documentation. + For more information on \c CEikApplication, please see the S60 documentation. Unlike other Qt classes, QS60MainApplication behaves like an S60 class, and can throw Symbian leaves. @@ -136,4 +136,19 @@ TFileName QS60MainApplication::ResourceFileName() const return KNullDesC(); } +void QS60MainApplication::PreDocConstructL() +{ + QS60MainApplicationBase::PreDocConstructL(); +} + +CDictionaryStore *QS60MainApplication::OpenIniFileLC(RFs &aFs) const +{ + return QS60MainApplicationBase::OpenIniFileLC(aFs); +} + +void QS60MainApplication::NewAppServerL(CApaAppServer *&aAppServer) +{ + QS60MainApplicationBase::NewAppServerL(aAppServer); +} + QT_END_NAMESPACE diff --git a/src/gui/s60framework/qs60mainapplication.h b/src/gui/s60framework/qs60mainapplication.h index 997f30f..cb22e68 100644 --- a/src/gui/s60framework/qs60mainapplication.h +++ b/src/gui/s60framework/qs60mainapplication.h @@ -44,9 +44,15 @@ #include <QtCore/qglobal.h> -#ifdef Q_WS_S60 +#ifdef Q_OS_SYMBIAN +#ifdef Q_WS_S60 #include <aknapp.h> +typedef CAknApplication QS60MainApplicationBase; +#else +#include <eikapp.h> +typedef CEikApplication QS60MainApplicationBase; +#endif QT_BEGIN_HEADER @@ -54,7 +60,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Gui) -class Q_GUI_EXPORT QS60MainApplication : public CAknApplication +class Q_GUI_EXPORT QS60MainApplication : public QS60MainApplicationBase { public: QS60MainApplication(); @@ -65,6 +71,14 @@ public: virtual TFileName ResourceFileName() const; +public: + + virtual void PreDocConstructL(); + + virtual CDictionaryStore *OpenIniFileLC(RFs &aFs) const; + + virtual void NewAppServerL(CApaAppServer *&aAppServer); + protected: virtual CApaDocument *CreateDocumentL(); @@ -74,6 +88,6 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // Q_WS_S60 +#endif // Q_OS_SYMBIAN #endif // QS60MAINAPPLICATION_H diff --git a/src/gui/s60framework/qs60mainappui.cpp b/src/gui/s60framework/qs60mainappui.cpp index ce13de8..40c2d03 100644 --- a/src/gui/s60framework/qs60mainappui.cpp +++ b/src/gui/s60framework/qs60mainappui.cpp @@ -41,20 +41,25 @@ // INCLUDE FILES #include <exception> +#include <qglobal.h> +#ifdef Q_WS_S60 #include <avkon.hrh> #include <eikmenub.h> #include <eikmenup.h> +#include <avkon.rsg> +#endif #include <barsread.h> #include <qconfig.h> -#if defined(QT_LIBINFIX_UNQUOTED) +#ifdef Q_WS_S60 +# if defined(QT_LIBINFIX_UNQUOTED) // Two level macro needed for proper expansion of libinfix -# define QT_S60MAIN_RSG_2(x) <s60main##x##.rsg> -# define QT_S60MAIN_RSG(x) QT_S60MAIN_RSG_2(x) -# include QT_S60MAIN_RSG(QT_LIBINFIX_UNQUOTED) -#else -# include <s60main.rsg> +# define QT_S60MAIN_RSG_2(x) <s60main##x##.rsg> +# define QT_S60MAIN_RSG(x) QT_S60MAIN_RSG_2(x) +# include QT_S60MAIN_RSG(QT_LIBINFIX_UNQUOTED) +# else +# include <s60main.rsg> +# endif #endif -#include <avkon.rsg> #include "qs60mainappui.h" #include <QtGui/qapplication.h> @@ -115,14 +120,16 @@ void QS60MainAppUi::ConstructL() // ENoAppResourceFile and ENonStandardResourceFile makes UI to work without // resource files in most SDKs. S60 3rd FP1 public seems to require resource file // even these flags are defined - TInt flags = CAknAppUi::EAknEnableSkin - | CAknAppUi::ENoScreenFurniture - | CAknAppUi::ENonStandardResourceFile; + TInt flags = CEikAppUi::ENoScreenFurniture + | CEikAppUi::ENonStandardResourceFile; +#ifdef Q_WS_S60 + flags |= CAknAppUi::EAknEnableSkin; // After 5th Edition S60, native side supports animated wallpapers. // However, there is no support for that feature on Qt side, so indicate to // native UI framework that this application will not support background animations. if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0) flags |= KAknDisableAnimationBackground; +#endif BaseConstructL(flags); } @@ -168,7 +175,7 @@ void QS60MainAppUi::HandleCommandL(TInt command) */ void QS60MainAppUi::HandleResourceChangeL(TInt type) { - CAknAppUi::HandleResourceChangeL(type); + QS60MainAppUiBase::HandleResourceChangeL(type); if (qApp) { QSymbianEvent event(QSymbianEvent::ResourceChangeEvent, type); @@ -185,7 +192,7 @@ void QS60MainAppUi::HandleResourceChangeL(TInt type) * If you override this function, you should call the base class implementation if you do not * handle the event. */ -void QS60MainAppUi::HandleWsEventL(const TWsEvent& wsEvent, CCoeControl *destination) +void QS60MainAppUi::HandleWsEventL(const TWsEvent &wsEvent, CCoeControl *destination) { int result = 0; if (qApp) { @@ -196,7 +203,7 @@ void QS60MainAppUi::HandleWsEventL(const TWsEvent& wsEvent, CCoeControl *destina } if (result <= 0) - CAknAppUi::HandleWsEventL(wsEvent, destination); + QS60MainAppUiBase::HandleWsEventL(wsEvent, destination); } @@ -236,6 +243,7 @@ void QS60MainAppUi::DynInitMenuBarL(TInt /* resourceId */, CEikMenuBar * /* menu */ void QS60MainAppUi::DynInitMenuPaneL(TInt resourceId, CEikMenuPane *menuPane) { +#ifdef Q_WS_S60 if (resourceId == R_QT_WRAPPERAPP_MENU) { if (menuPane->NumberOfItemsInPane() <= 1) QT_TRYCATCH_LEAVING(qt_symbian_show_toplevel(menuPane)); @@ -245,6 +253,9 @@ void QS60MainAppUi::DynInitMenuPaneL(TInt resourceId, CEikMenuPane *menuPane) && resourceId != R_AVKON_MENUPANE_LANGUAGE_DEFAULT) { QT_TRYCATCH_LEAVING(qt_symbian_show_submenu(menuPane, resourceId)); } +#else + QS60MainAppUiBase::DynInitMenuPaneL(resourceId, menuPane); +#endif } /*! @@ -255,16 +266,104 @@ void QS60MainAppUi::DynInitMenuPaneL(TInt resourceId, CEikMenuPane *menuPane) * * If you override this function, you should call the base class implementation as well. */ -void QS60MainAppUi::RestoreMenuL(CCoeControl* menuWindow, TInt resourceId, TMenuType menuType) +void QS60MainAppUi::RestoreMenuL(CCoeControl *menuWindow, TInt resourceId, TMenuType menuType) { +#ifdef Q_WS_S60 if (resourceId >= QT_SYMBIAN_FIRST_MENU_ITEM && resourceId <= QT_SYMBIAN_LAST_MENU_ITEM) { if (menuType == EMenuPane) DynInitMenuPaneL(resourceId, (CEikMenuPane*)menuWindow); else DynInitMenuBarL(resourceId, (CEikMenuBar*)menuWindow); - } else { - CAknAppUi::RestoreMenuL(menuWindow, resourceId, menuType); + } else +#endif + { + QS60MainAppUiBase::RestoreMenuL(menuWindow, resourceId, menuType); } } +void QS60MainAppUi::Exit() +{ + QS60MainAppUiBase::Exit(); +} + +void QS60MainAppUi::SetFadedL(TBool aFaded) +{ + QS60MainAppUiBase::SetFadedL(aFaded); +} + +TRect QS60MainAppUi::ApplicationRect() const +{ + return QS60MainAppUiBase::ApplicationRect(); +} + +void QS60MainAppUi::HandleScreenDeviceChangedL() +{ + QS60MainAppUiBase::HandleScreenDeviceChangedL(); +} + +void QS60MainAppUi::HandleApplicationSpecificEventL(TInt aType, const TWsEvent &aEvent) +{ + QS60MainAppUiBase::HandleApplicationSpecificEventL(aType, aEvent); +} + +TTypeUid::Ptr QS60MainAppUi::MopSupplyObject(TTypeUid aId) +{ + return QS60MainAppUiBase::MopSupplyObject(aId); +} + +void QS60MainAppUi::ProcessCommandL(TInt aCommand) +{ + QS60MainAppUiBase::ProcessCommandL(aCommand); +} + +TErrorHandlerResponse QS60MainAppUi::HandleError (TInt aError, const SExtendedError &aExtErr, TDes &aErrorText, TDes &aContextText) +{ + return QS60MainAppUiBase::HandleError(aError, aExtErr, aErrorText, aContextText); +} + +void QS60MainAppUi::HandleViewDeactivation(const TVwsViewId &aViewIdToBeDeactivated, const TVwsViewId &aNewlyActivatedViewId) +{ + QS60MainAppUiBase::HandleViewDeactivation(aViewIdToBeDeactivated, aNewlyActivatedViewId); +} + +void QS60MainAppUi::PrepareToExit() +{ + QS60MainAppUiBase::PrepareToExit(); +} + +void QS60MainAppUi::HandleTouchPaneSizeChange() +{ + QS60MainAppUiBase::HandleTouchPaneSizeChange(); +} + +void QS60MainAppUi::HandleSystemEventL(const TWsEvent &aEvent) +{ + QS60MainAppUiBase::HandleSystemEventL(aEvent); +} + +void QS60MainAppUi::Reserved_MtsmPosition() +{ + QS60MainAppUiBase::Reserved_MtsmPosition(); +} + +void QS60MainAppUi::Reserved_MtsmObject() +{ + QS60MainAppUiBase::Reserved_MtsmObject(); +} + +void QS60MainAppUi::HandleForegroundEventL(TBool aForeground) +{ + QS60MainAppUiBase::HandleForegroundEventL(aForeground); +} + +#ifndef Q_WS_S60 + +void QS60StubAknAppUi::HandleViewDeactivation(const TVwsViewId &, const TVwsViewId &) {} +void QS60StubAknAppUi::HandleTouchPaneSizeChange() {} +void QS60StubAknAppUi::HandleStatusPaneSizeChange() {} +void QS60StubAknAppUi::Reserved_MtsmPosition() {} +void QS60StubAknAppUi::Reserved_MtsmObject() {} + +#endif + QT_END_NAMESPACE diff --git a/src/gui/s60framework/qs60mainappui.h b/src/gui/s60framework/qs60mainappui.h index dcc72d1..796059f 100644 --- a/src/gui/s60framework/qs60mainappui.h +++ b/src/gui/s60framework/qs60mainappui.h @@ -44,9 +44,55 @@ #include <QtCore/qglobal.h> -#ifdef Q_WS_S60 +#ifdef Q_OS_SYMBIAN +#ifdef Q_WS_S60 #include <aknappui.h> +typedef CAknAppUi QS60MainAppUiBase; +#else +#include <eikappui.h> +// these stub classes simulate the structure of CAknAppUi, to help binary compatibility between Qt configured with and without S60/Avkon +class QS60StubAknAppUiBase : public CEikAppUi +{ +private: + int qS60StubAknAppUiBaseSpace[4]; +}; + +class QS60StubMEikStatusPaneObserver +{ +public: + virtual void HandleStatusPaneSizeChange() = 0; +}; + +class QS60StubMAknTouchPaneObserver +{ +public: + virtual void HandleTouchPaneSizeChange() = 0; +}; + +class QS60StubAknAppUi : public QS60StubAknAppUiBase, QS60StubMEikStatusPaneObserver, + public MCoeViewDeactivationObserver, + public QS60StubMAknTouchPaneObserver +{ +public: // MCoeViewDeactivationObserver + virtual void HandleViewDeactivation(const TVwsViewId&, const TVwsViewId &); + +public: // from MAknTouchPaneObserver + virtual void HandleTouchPaneSizeChange(); + +protected: // from MEikStatusPaneObserver + virtual void HandleStatusPaneSizeChange(); + +protected: // from CAknAppUi + virtual void Reserved_MtsmPosition(); + virtual void Reserved_MtsmObject(); + +private: + int qS60StubAknAppUiSpace[4]; +}; + +typedef QS60StubAknAppUi QS60MainAppUiBase; +#endif QT_BEGIN_HEADER @@ -54,7 +100,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Gui) -class Q_GUI_EXPORT QS60MainAppUi : public CAknAppUi +class Q_GUI_EXPORT QS60MainAppUi : public QS60MainAppUiBase { public: QS60MainAppUi(); @@ -63,7 +109,7 @@ public: virtual void ConstructL(); - virtual void RestoreMenuL(CCoeControl* menuWindow,TInt resourceId,TMenuType menuType); + virtual void RestoreMenuL(CCoeControl *menuWindow,TInt resourceId,TMenuType menuType); virtual void DynInitMenuBarL(TInt resourceId, CEikMenuBar *menuBar); virtual void DynInitMenuPaneL(TInt resourceId, CEikMenuPane *menuPane); @@ -74,13 +120,32 @@ public: virtual void HandleStatusPaneSizeChange(); protected: - virtual void HandleWsEventL(const TWsEvent& event, CCoeControl* destination); + virtual void HandleWsEventL(const TWsEvent &event, CCoeControl *destination); + +public: + virtual void Exit(); + virtual void SetFadedL(TBool aFaded); + virtual TRect ApplicationRect() const; + virtual void ProcessCommandL(TInt aCommand); + virtual TErrorHandlerResponse HandleError (TInt aError, const SExtendedError &aExtErr, TDes &aErrorText, TDes &aContextText); + virtual void HandleViewDeactivation(const TVwsViewId &aViewIdToBeDeactivated, const TVwsViewId &aNewlyActivatedViewId); + virtual void PrepareToExit(); + virtual void HandleTouchPaneSizeChange(); + +protected: + virtual void HandleScreenDeviceChangedL(); + virtual void HandleApplicationSpecificEventL(TInt aType, const TWsEvent &aEvent); + virtual TTypeUid::Ptr MopSupplyObject(TTypeUid aId); + virtual void HandleSystemEventL(const TWsEvent &aEvent); + virtual void Reserved_MtsmPosition(); + virtual void Reserved_MtsmObject(); + virtual void HandleForegroundEventL(TBool aForeground); }; QT_END_NAMESPACE QT_END_HEADER -#endif // Q_WS_S60 +#endif // Q_OS_SYMBIAN #endif // QS60MAINAPPUI_H diff --git a/src/gui/s60framework/qs60maindocument.cpp b/src/gui/s60framework/qs60maindocument.cpp index 487e067..ed33a41 100644 --- a/src/gui/s60framework/qs60maindocument.cpp +++ b/src/gui/s60framework/qs60maindocument.cpp @@ -57,15 +57,15 @@ QT_BEGIN_NAMESPACE The QS60MainDocument provides a helper class for use in migrating from existing S60 based applications to Qt based applications. It is - used in the exact same way as the \c CAknDocument class from + used in the exact same way as the \c CEikDocument class from Symbian, but internally provides extensions used by Qt. When modifying old S60 applications that rely on implementing - functions in \c CAknDocument, the class should be modified to - inherit from this class instead of \c CAknDocument. Then the + functions in \c CEikDocument, the class should be modified to + inherit from this class instead of \c CEikDocument. Then the application can choose to override only certain functions. - For more information on \c CAknDocument, please see the S60 + For more information on \c CEikDocument, please see the S60 documentation. Unlike other Qt classes, QS60MainDocument behaves like an S60 class, @@ -79,8 +79,8 @@ QT_BEGIN_NAMESPACE * * \a mainApplication should contain a pointer to a QS60MainApplication instance. */ -QS60MainDocument::QS60MainDocument(CEikApplication& mainApplication) - : CAknDocument(mainApplication) +QS60MainDocument::QS60MainDocument(CEikApplication &mainApplication) + : QS60MainDocumentBase(mainApplication) { // No implementation required } @@ -105,4 +105,14 @@ CEikAppUi *QS60MainDocument::CreateAppUiL() return (static_cast <CEikAppUi*>(new(ELeave)QS60MainAppUi)); } +CFileStore *QS60MainDocument::OpenFileL(TBool aDoOpen, const TDesC &aFilename, RFs &aFs) +{ + return QS60MainDocumentBase::OpenFileL(aDoOpen, aFilename, aFs); +} + +void QS60MainDocument::OpenFileL(CFileStore *&aFileStore, RFile &aFile) +{ + QS60MainDocumentBase::OpenFileL(aFileStore, aFile); +} + QT_END_NAMESPACE diff --git a/src/gui/s60framework/qs60maindocument.h b/src/gui/s60framework/qs60maindocument.h index 553675f..2f0564f 100644 --- a/src/gui/s60framework/qs60maindocument.h +++ b/src/gui/s60framework/qs60maindocument.h @@ -44,9 +44,15 @@ #include <QtCore/qglobal.h> -#ifdef Q_WS_S60 +#ifdef Q_OS_SYMBIAN -#include <AknDoc.h> +#ifdef Q_WS_S60 +#include <akndoc.h> +typedef CAknDocument QS60MainDocumentBase; +#else +#include <eikdoc.h> +typedef CEikDocument QS60MainDocumentBase; +#endif class CEikApplication; @@ -58,7 +64,7 @@ QT_MODULE(Gui) class QS60MainAppUi; -class Q_GUI_EXPORT QS60MainDocument : public CAknDocument +class Q_GUI_EXPORT QS60MainDocument : public QS60MainDocumentBase { public: @@ -69,12 +75,18 @@ public: public: virtual CEikAppUi *CreateAppUiL(); + +public: + + virtual CFileStore *OpenFileL(TBool aDoOpen, const TDesC &aFilename, RFs &aFs); + + virtual void OpenFileL(CFileStore *&aFileStore, RFile &aFile); }; QT_END_NAMESPACE QT_END_HEADER -#endif // Q_WS_S60 +#endif // Q_OS_SYMBIAN #endif // QS60MAINDOCUMENT_H diff --git a/src/gui/s60framework/s60framework.pri b/src/gui/s60framework/s60framework.pri index f9d89dc..edbacc0 100644 --- a/src/gui/s60framework/s60framework.pri +++ b/src/gui/s60framework/s60framework.pri @@ -1,16 +1,20 @@ +contains(QT_CONFIG, s60) { # This block serves the minimalistic resource file for S60 3.1 platforms. # Note there is no way to ifdef S60 version in mmp file, that is why the resource # file is always compiled for WINSCW -minimalAppResource31 = \ - "SOURCEPATH s60framework" \ - "START RESOURCE s60main.rss" \ - "TARGET s60main$${QT_LIBINFIX}" \ - "HEADER" \ - "TARGETPATH /resource/apps" \ - "END" -MMP_RULES += minimalAppResource31 -SYMBIAN_RESOURCES += s60framework/s60main.rss + minimalAppResource31 = \ + "SOURCEPATH s60framework" \ + "START RESOURCE s60main.rss" \ + "TARGET s60main$${QT_LIBINFIX}" \ + "HEADER" \ + "TARGETPATH /resource/apps" \ + "END" + + MMP_RULES += minimalAppResource31 + + SYMBIAN_RESOURCES += s60framework/s60main.rss +} SOURCES += s60framework/qs60mainapplication.cpp \ s60framework/qs60mainappui.cpp \ diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 45bcc00..e28403b 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1765,52 +1765,31 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, QRect iconRect = subElementRect(SE_ItemViewItemDecoration, &optionMenuItem, widget); QRect textRect = subElementRect(SE_ItemViewItemText, &optionMenuItem, widget); - //todo: move the vertical spacing stuff into subElementRect - const int vSpacing = QS60StylePrivate::pixelMetric(PM_LayoutVerticalSpacing); QStyleOptionMenuItem optionCheckBox; //Regardless of checkbox visibility, make room for it, this mirrors native implementation, //where text and icon placement is static regardless of content of menu item. - const int hSpacing = QS60StylePrivate::pixelMetric(PM_LayoutHorizontalSpacing); optionCheckBox.QStyleOptionMenuItem::operator=(*menuItem); optionCheckBox.rect.setWidth(pixelMetric(PM_IndicatorWidth)); optionCheckBox.rect.setHeight(pixelMetric(PM_IndicatorHeight)); + + const int vSpacing = QS60StylePrivate::pixelMetric(PM_LayoutVerticalSpacing); + //The vertical spacing is doubled; it needs one spacing to separate checkbox from + //highlight and then it needs one to separate it whatever is shown after it (text/icon/both). + const int moveByX = optionCheckBox.rect.width() + 2 * vSpacing; optionCheckBox.rect.moveCenter(QPoint( - optionCheckBox.rect.center().x(), + optionCheckBox.rect.center().x() + moveByX >> 1, menuItem->rect.center().y())); - const int moveByX = optionCheckBox.rect.width() + vSpacing + - pixelMetric(PM_DefaultFrameWidth); - if (optionMenuItem.direction == Qt::LeftToRight) { - if (iconRect.isValid()) { - iconRect.translate(moveByX, 0); - iconRect.setWidth(iconRect.width() + vSpacing); - } - if (textRect.isValid()) { - textRect.translate(moveByX, 0); - textRect.setWidth(textRect.width() - moveByX - vSpacing); - } - optionCheckBox.rect.translate(vSpacing + pixelMetric(PM_DefaultFrameWidth), hSpacing >> 1); - } else { - if (textRect.isValid()) - textRect.setWidth(textRect.width() - moveByX); - if (iconRect.isValid()) { - iconRect.setWidth(iconRect.width() + vSpacing); - iconRect.translate(-optionCheckBox.rect.width() - vSpacing, 0); - } + + if (optionMenuItem.direction != Qt::LeftToRight) optionCheckBox.rect.translate(textRect.width() + iconRect.width(), 0); - } + const bool selected = (option->state & State_Selected) && (option->state & State_Enabled); if (selected) { - const int spacing = pixelMetric(PM_DefaultFrameWidth) * 2; - int start; int end; - if (QApplication::layoutDirection() == Qt::LeftToRight) { - start = optionMenuItem.rect.left() + spacing; - end = qMax(textRect.right(), iconRect.right() + spacing); - } else { - start = qMax(spacing, qMin(textRect.left(), iconRect.left() - spacing)); - end = optionMenuItem.rect.right() - spacing; - } + const int spacing = ignoreCheckMark ? (vSpacing + QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth)) : 0; + const int start = optionMenuItem.rect.left() + spacing; + const int end = optionMenuItem.rect.right() - spacing; //-1 adjustment to avoid highlight being on top of possible separator item const QRect highlightRect = QRect( QPoint(start, option->rect.top()), @@ -3025,20 +3004,38 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con pixelMetric(PM_SmallIconSize, opt, widget); ret = menuItem->rect; + QRect checkBoxRect = checkable ? menuItem->rect : QRect(); + if (checkable) { + checkBoxRect.setWidth(pixelMetric(PM_IndicatorWidth)); + checkBoxRect.setHeight(pixelMetric(PM_IndicatorHeight)); + } + + const int vSpacing = QS60StylePrivate::pixelMetric(PM_LayoutVerticalSpacing); + //The vertical spacing is doubled; it needs one spacing to separate checkbox from + //highlight and then it needs one to separate it whatever is shown after it (text/icon/both). + const int moveByX = checkBoxRect.width() + 2 * vSpacing; + if (element == SE_ItemViewItemDecoration) { if (menuItem->icon.isNull()) { ret = QRect(); } else { if (menuItem->direction == Qt::RightToLeft) - ret.translate(ret.width() - indicatorWidth, 0); + ret.translate(ret.width() - indicatorWidth - moveByX, 0); + else + ret.translate(moveByX, 0); ret.setWidth(indicatorWidth); } } else { - if (!menuItem->icon.isNull()) + if (!menuItem->icon.isNull()) { if (menuItem->direction == Qt::LeftToRight) ret.adjust(indicatorWidth, 0, 0, 0); else ret.adjust(0, 0, -indicatorWidth, 0); + } + if (menuItem->direction == Qt::LeftToRight) + ret.adjust(moveByX, 0, 0, 0); + else + ret.adjust(0, 0, -moveByX, 0); // Make room for submenu indicator if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu){ @@ -3116,6 +3113,11 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con case SE_CheckBoxFocusRect: ret = opt->rect; break; + case SE_ProgressBarLabel: + case SE_ProgressBarContents: + case SE_ProgressBarGroove: + ret = opt->rect; + break; default: ret = QCommonStyle::subElementRect(element, opt, widget); } diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h index c878538..f588d9f 100644 --- a/src/gui/styles/qs60style.h +++ b/src/gui/styles/qs60style.h @@ -50,8 +50,6 @@ QT_BEGIN_NAMESPACE QT_MODULE(Gui) -#if !defined(QT_NO_STYLE_S60) - //Public custom pixel metrics values. //These can be used to fetch custom pixel metric value from outside QS60Style. enum { @@ -91,14 +89,14 @@ public: #endif bool event(QEvent *e); -#ifndef Q_WS_S60 +#ifndef Q_OS_SYMBIAN static QStringList partKeys(); static QStringList colorListKeys(); void setS60Theme(const QHash<QString, QPicture> &parts, const QHash<QPair<QString , int>, QColor> &colors); bool loadS60ThemeFromBlob(const QString &blobFile); bool saveS60ThemeToBlob(const QString &blobFile) const; -#endif // !Q_WS_S60 +#endif // !Q_OS_SYMBIAN protected Q_SLOTS: QIcon standardIconImplementation( @@ -113,8 +111,6 @@ private: friend class QApplicationPrivate; }; -#endif // QT_NO_STYLE_S60 - QT_END_NAMESPACE QT_END_HEADER diff --git a/src/gui/styles/qs60style_stub.cpp b/src/gui/styles/qs60style_stub.cpp new file mode 100644 index 0000000..a3a5b9d --- /dev/null +++ b/src/gui/styles/qs60style_stub.cpp @@ -0,0 +1,131 @@ +/**************************************************************************** +** +** Copyright (C) 2009 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 "qs60style.h" +#include "qdebug.h" + +#if defined(QT_NO_STYLE_S60) +QT_BEGIN_NAMESPACE + +QS60Style::QS60Style() +{ + qWarning() << "QS60Style stub created"; +} + +QS60Style::~QS60Style() +{ +} + +void QS60Style::drawComplexControl(ComplexControl , const QStyleOptionComplex *, QPainter *, const QWidget *) const +{ +} + +void QS60Style::drawControl(ControlElement , const QStyleOption *, QPainter *, const QWidget *) const +{ +} + +void QS60Style::drawPrimitive(PrimitiveElement , const QStyleOption *, QPainter *, const QWidget *) const +{ +} + +int QS60Style::pixelMetric(PixelMetric , const QStyleOption *, const QWidget *) const +{ + return 0; +} + +QSize QS60Style::sizeFromContents(ContentsType , const QStyleOption *, const QSize &, const QWidget *) const +{ + return QSize(); +} + +int QS60Style::styleHint(StyleHint , const QStyleOption *, const QWidget *, QStyleHintReturn *) const +{ + return 0; +} + +QRect QS60Style::subControlRect(ComplexControl , const QStyleOptionComplex *, SubControl , const QWidget *) const +{ + return QRect(); +} + +QRect QS60Style::subElementRect(SubElement , const QStyleOption *, const QWidget *) const +{ + return QRect(); +} + +void QS60Style::polish(QWidget *) +{ +} + +void QS60Style::unpolish(QWidget *) +{ +} + +void QS60Style::polish(QApplication *) +{ +} + +void QS60Style::unpolish(QApplication *) +{ +} + +bool QS60Style::event(QEvent *) +{ + return false; +} + +QIcon QS60Style::standardIconImplementation(StandardPixmap , const QStyleOption *, const QWidget *) const +{ + return QIcon(); +} + +void QS60Style::timerEvent(QTimerEvent *) +{ +} + +bool QS60Style::eventFilter(QObject *, QEvent *) +{ + return false; +} + +QT_END_NAMESPACE + +#endif // QT_NO_STYLE_S60 diff --git a/src/gui/styles/styles.pri b/src/gui/styles/styles.pri index 0a96272..b22a908 100644 --- a/src/gui/styles/styles.pri +++ b/src/gui/styles/styles.pri @@ -182,5 +182,9 @@ contains( styles, s60 ):contains(QT_CONFIG, s60) { RESOURCES += styles/qstyle_s60_simulated.qrc } } else { + symbian { + HEADERS += styles/qs60style.h + SOURCES += styles/qs60style_stub.cpp + } DEFINES += QT_NO_STYLE_S60 } diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp index a415180..24f6ccf 100644 --- a/src/gui/util/qdesktopservices_s60.cpp +++ b/src/gui/util/qdesktopservices_s60.cpp @@ -39,9 +39,6 @@ ** ****************************************************************************/ -// This flag changes the implementation to use S60 CDcoumentHandler -// instead of apparch when opening the files -#define USE_DOCUMENTHANDLER #include <qcoreapplication.h> #include <qdir.h> @@ -56,10 +53,16 @@ #include <rsendas.h> // RSendAs #include <rsendasmessage.h> // RSendAsMessage +#ifdef Q_WS_S60 +// This flag changes the implementation to use S60 CDcoumentHandler +// instead of apparch when opening the files +#define USE_DOCUMENTHANDLER +#endif + // copied from miutset.h, so we don't get a dependency into the app layer const TUid KUidMsgTypeSMTP = {0x10001028}; // 268439592 -#ifdef Q_WS_S60 +#ifdef Q_OS_SYMBIAN # include <pathinfo.h> // PathInfo # ifdef USE_DOCUMENTHANDLER # include <DocumentHandler.h> // CDocumentHandler @@ -264,7 +267,7 @@ static TDriveUnit writableExeDrive() static TPtrC writableDataRoot() { TDriveUnit drive = exeDrive(); -#ifdef Q_WS_S60 +#ifdef Q_OS_SYMBIAN switch(drive.operator TInt()){ case EDriveC: return PathInfo::PhoneMemoryRootPath(); @@ -391,19 +394,19 @@ QString QDesktopServices::storageLocation(StandardLocation type) break; case MusicLocation: path.Append(writableDataRoot()); -#ifdef Q_WS_S60 +#ifdef Q_OS_SYMBIAN path.Append(PathInfo::SoundsPath()); #endif break; case MoviesLocation: path.Append(writableDataRoot()); -#ifdef Q_WS_S60 +#ifdef Q_OS_SYMBIAN path.Append(PathInfo::VideosPath()); #endif break; case PicturesLocation: path.Append(writableDataRoot()); -#ifdef Q_WS_S60 +#ifdef Q_OS_SYMBIAN path.Append(PathInfo::ImagesPath()); #endif break; diff --git a/src/gui/util/util.pri b/src/gui/util/util.pri index be8db93..bea520e 100644 --- a/src/gui/util/util.pri +++ b/src/gui/util/util.pri @@ -43,9 +43,8 @@ embedded { } symbian { - LIBS += -lsendas2 -letext -lapmime + LIBS += -lsendas2 -letext -lapmime -lplatformenv contains(QT_CONFIG, s60) { - LIBS += -lplatformenv contains(CONFIG, is_using_gnupoc) { LIBS += -lcommonui } else { diff --git a/src/gui/widgets/qmenubar_p.h b/src/gui/widgets/qmenubar_p.h index 82070fe..fc6701c 100644 --- a/src/gui/widgets/qmenubar_p.h +++ b/src/gui/widgets/qmenubar_p.h @@ -269,10 +269,10 @@ public: } *symbian_menubar; static int symbianCommands(int command); +#endif #ifdef QT_SOFTKEYS_ENABLED QAction *menuBarAction; #endif -#endif }; #endif |