diff options
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 34 | ||||
-rw-r--r-- | src/gui/kernel/qt_s60_p.h | 1 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 4 |
5 files changed, 36 insertions, 7 deletions
diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h index 92cf0f8..f1e3cb0 100644 --- a/src/gui/kernel/qapplication.h +++ b/src/gui/kernel/qapplication.h @@ -327,7 +327,7 @@ public: { if (replace) changeOverrideCursor(cursor); else setOverrideCursor(cursor); } # endif inline static QT3_SUPPORT bool hasGlobalMouseTracking() {return true;} - inline static QT3_SUPPORT void setGlobalMouseTracking(bool) {}; + inline static QT3_SUPPORT void setGlobalMouseTracking(bool) {} inline static QT3_SUPPORT void flushX() { flush(); } static inline QT3_SUPPORT void setWinStyleHighlightColor(const QColor &c) { QPalette p(palette()); diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 8561045..220b222 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -63,10 +63,13 @@ #include "apgwgnam.h" // For CApaWindowGroupName #include <MdaAudioTonePlayer.h> // For CMdaAudioToneUtility -#if !defined(QT_NO_IM) && defined(Q_WS_S60) -#include "qinputcontext.h" -#include <private/qcoefepinputcontext_p.h> -#endif // !defined(QT_NO_IM) && defined(Q_WS_S60) +#if defined(Q_WS_S60) +# if !defined(QT_NO_IM) +# include "qinputcontext.h" +# include <private/qcoefepinputcontext_p.h> +# endif +# include <private/qs60mainapplication_p.h> +#endif #include "private/qstylesheetstyle_p.h" @@ -715,6 +718,22 @@ TTypeUid::Ptr QSymbianControl::MopSupplyObject(TTypeUid id) void qt_init(QApplicationPrivate * /* priv */, int) { + if (!CCoeEnv::Static()) { + // The S60 framework has not been initalized. We need to do it. + TApaApplicationFactory factory(NewApplication); + CApaCommandLine* commandLine = 0; + TInt err = CApaCommandLine::GetCommandLineFromProcessEnvironment(commandLine); + // After this construction, CEikonEnv will be available from CEikonEnv::Static(). + // (much like our qApp). + CEikonEnv* coe = new CEikonEnv; + QT_TRAP_THROWING(coe->ConstructAppFromCommandLineL(factory,*commandLine)); + delete commandLine; + + S60->qtOwnsS60Environment = true; + } else { + S60->qtOwnsS60Environment = false; + } + #ifdef QT_NO_DEBUG if (!qgetenv("QT_S60_AUTO_FLUSH_WSERV").isEmpty()) #endif @@ -766,6 +785,13 @@ void qt_cleanup() // it dies. delete QApplicationPrivate::inputContext; QApplicationPrivate::inputContext = 0; + + if (S60->qtOwnsS60Environment) { + CEikonEnv* coe = CEikonEnv::Static(); + coe->PrepareToExit(); + // The CEikonEnv itself is destroyed in here. + coe->DestroyEnvironment(); + } } void QApplicationPrivate::initializeWidgetPaletteHash() diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index 78301af..ea1ca69 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -95,6 +95,7 @@ public: int screenHeightInTwips; int defaultDpiX; int defaultDpiY; + int qtOwnsS60Environment : 1; static inline void updateScreenSize(); static inline RWsSession& wsSession(); static inline RWindowGroup& windowGroup(); diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h index f398dbd..284558f 100644 --- a/src/gui/kernel/qwidget.h +++ b/src/gui/kernel/qwidget.h @@ -830,7 +830,7 @@ public: inline QT3_SUPPORT void setFont(const QFont &f, bool) { setFont(f); } inline QT3_SUPPORT void setPalette(const QPalette &p, bool) { setPalette(p); } enum BackgroundOrigin { WidgetOrigin, ParentOrigin, WindowOrigin, AncestorOrigin }; - inline QT3_SUPPORT void setBackgroundOrigin(BackgroundOrigin){}; + inline QT3_SUPPORT void setBackgroundOrigin(BackgroundOrigin) {} inline QT3_SUPPORT BackgroundOrigin backgroundOrigin() const { return WindowOrigin; } inline QT3_SUPPORT QPoint backgroundOffset() const { return QPoint(); } inline QT3_SUPPORT void repaint(bool) { repaint(); } diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 6da35d8..d630143 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -722,7 +722,9 @@ void QWidgetPrivate::setWindowIcon_sys(bool forceReset) // The API to get title_pane graphics size is not public -> assume square space based // on titlebar font height. CAknBitmap would be optimum, wihtout setting the size, since // then title pane would automatically scale the bitmap. Unfortunately it is not public API - const CFont * font = AknLayoutUtils::FontFromId(EAknLogicalFontTitleFont); + // Also this function is leaving, although it is not named as such. + const CFont * font; + QT_TRAP_THROWING(font = AknLayoutUtils::FontFromId(EAknLogicalFontTitleFont)); TSize iconSize(font->HeightInPixels(), font->HeightInPixels()); QIcon icon = q->windowIcon(); |