From 8aaa0cbf3451dee7bc8e8276faad3b2f2954dc1c Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Mon, 11 May 2009 14:01:06 +0200 Subject: Fixed namespace issues, now works on Symbian under namespace --- demos/embedded/desktopservices/contenttab.h | 2 ++ demos/embedded/desktopservices/desktopwidget.h | 2 ++ demos/embedded/desktopservices/linktab.h | 2 ++ src/corelib/arch/generic/qatomic_generic_unix.cpp | 2 ++ src/gui/dialogs/qfilesystemmodel.cpp | 6 +++--- src/gui/inputmethod/qinputcontext.h | 9 ++++----- src/gui/kernel/qapplication.h | 7 ++++--- src/gui/kernel/qclipboard_s60.cpp | 7 +------ src/gui/kernel/qcursor.cpp | 3 +-- src/gui/kernel/qcursor_s60.cpp | 1 + src/gui/kernel/qdnd_s60.cpp | 7 +------ src/gui/kernel/qkeymapper_s60.cpp | 3 --- src/gui/kernel/qsound_s60.cpp | 2 -- src/gui/kernel/qwidget_p.h | 13 +++++++------ src/gui/kernel/qwidget_s60.cpp | 2 ++ src/gui/painting/qwindowsurface_s60_p.h | 3 ++- src/gui/text/qfontengine_s60.cpp | 2 ++ src/gui/text/qfontengine_s60_p.h | 4 ++-- src/gui/widgets/qmenu.h | 4 +++- src/gui/widgets/qmenu_p.h | 4 +++- src/gui/widgets/qmenu_symbian.cpp | 3 +++ src/gui/widgets/qmenubar_p.h | 9 ++++++--- 22 files changed, 53 insertions(+), 44 deletions(-) diff --git a/demos/embedded/desktopservices/contenttab.h b/demos/embedded/desktopservices/contenttab.h index bfbb044..60fabc8 100644 --- a/demos/embedded/desktopservices/contenttab.h +++ b/demos/embedded/desktopservices/contenttab.h @@ -23,7 +23,9 @@ // INTERNAL INCLUDES // FORWARD DECLARATIONS +QT_BEGIN_NAMESPACE class QListWidgetItem; +QT_END_NAMESPACE // CLASS DECLARATION diff --git a/demos/embedded/desktopservices/desktopwidget.h b/demos/embedded/desktopservices/desktopwidget.h index 5b74e48..a947e80 100644 --- a/demos/embedded/desktopservices/desktopwidget.h +++ b/demos/embedded/desktopservices/desktopwidget.h @@ -18,7 +18,9 @@ // INTERNAL INCLUDES // FORWARD DECLARATIONS +QT_BEGIN_NAMESPACE class QTabWidget; +QT_END_NAMESPACE // CLASS DECLARATION /** diff --git a/demos/embedded/desktopservices/linktab.h b/demos/embedded/desktopservices/linktab.h index 02ad494..f88c334 100644 --- a/demos/embedded/desktopservices/linktab.h +++ b/demos/embedded/desktopservices/linktab.h @@ -18,8 +18,10 @@ #include "contenttab.h" // FORWARD DECLARATIONS +QT_BEGIN_NAMESPACE class QWidget; class QListWidgetItem; +QT_END_NAMESPACE // CLASS DECLARATION diff --git a/src/corelib/arch/generic/qatomic_generic_unix.cpp b/src/corelib/arch/generic/qatomic_generic_unix.cpp index f8d5450..876042f 100644 --- a/src/corelib/arch/generic/qatomic_generic_unix.cpp +++ b/src/corelib/arch/generic/qatomic_generic_unix.cpp @@ -45,6 +45,7 @@ #include +QT_BEGIN_NAMESPACE static pthread_mutex_t qAtomicMutex = PTHREAD_MUTEX_INITIALIZER; Q_CORE_EXPORT @@ -118,4 +119,5 @@ void *QBasicAtomicPointer_fetchAndAddOrdered(void * volatile *_q_value, qptrdiff pthread_mutex_unlock(&qAtomicMutex); return returnValue; } +QT_END_NAMESPACE #endif //!defined(Q_OS_SYMBIAN) && !defined(Q_CC_RVCT) diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp index 8b68411..e802cab 100644 --- a/src/gui/dialogs/qfilesystemmodel.cpp +++ b/src/gui/dialogs/qfilesystemmodel.cpp @@ -1929,8 +1929,8 @@ bool QFileSystemModelPrivate::passNameFilters(const QFileSystemNode *node) const return true; } -#include "moc_qfilesystemmodel.cpp" +QT_END_NAMESPACE -#endif // QT_NO_FILESYSTEMMODEL +#include "moc_qfilesystemmodel.cpp" -QT_END_NAMESPACE +#endif // QT_NO_FILESYSTEMMODEL \ No newline at end of file diff --git a/src/gui/inputmethod/qinputcontext.h b/src/gui/inputmethod/qinputcontext.h index b84c52b..bc4c63c 100644 --- a/src/gui/inputmethod/qinputcontext.h +++ b/src/gui/inputmethod/qinputcontext.h @@ -67,6 +67,10 @@ QT_BEGIN_HEADER +#ifdef Q_WS_S60 +class TWsEvent; +#endif + QT_BEGIN_NAMESPACE QT_MODULE(Gui) @@ -76,11 +80,6 @@ class QFont; class QPopupMenu; class QInputContextPrivate; -#ifdef Q_WS_S60 -class TWsEvent; -#endif - - class Q_GUI_EXPORT QInputContext : public QObject { Q_OBJECT diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h index 807d347..a42f47a 100644 --- a/src/gui/kernel/qapplication.h +++ b/src/gui/kernel/qapplication.h @@ -61,6 +61,10 @@ QT_BEGIN_HEADER +#if defined(Q_WS_S60) +class TWsEvent; +#endif + QT_BEGIN_NAMESPACE QT_MODULE(Gui) @@ -84,9 +88,6 @@ class QApplicationPrivate; #endif #define qApp (static_cast(QCoreApplication::instance())) -#if defined(Q_WS_S60) -class TWsEvent; -#endif class Q_GUI_EXPORT QApplication : public QCoreApplication { diff --git a/src/gui/kernel/qclipboard_s60.cpp b/src/gui/kernel/qclipboard_s60.cpp index 1ba1dfe..ec595b5 100644 --- a/src/gui/kernel/qclipboard_s60.cpp +++ b/src/gui/kernel/qclipboard_s60.cpp @@ -25,9 +25,6 @@ #include QT_BEGIN_NAMESPACE -QT_USE_NAMESPACE - - //### Mime Type mapping to UIDs const TUid KQtCbDataStream = {0x666777}; @@ -246,7 +243,5 @@ void QClipboard::connectNotify( const char * ) void QClipboard::ownerDestroyed() { } - -#endif // QT_NO_CLIPBOARD - QT_END_NAMESPACE +#endif // QT_NO_CLIPBOARD \ No newline at end of file diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp index ed7e020..c24abc4 100644 --- a/src/gui/kernel/qcursor.cpp +++ b/src/gui/kernel/qcursor.cpp @@ -559,7 +559,6 @@ QCursor::operator QVariant() const { return QVariant(QVariant::Cursor, this); } - +QT_END_NAMESPACE #endif // QT_NO_CURSOR -QT_END_NAMESPACE diff --git a/src/gui/kernel/qcursor_s60.cpp b/src/gui/kernel/qcursor_s60.cpp index 0670b6f..4d3f067 100644 --- a/src/gui/kernel/qcursor_s60.cpp +++ b/src/gui/kernel/qcursor_s60.cpp @@ -14,6 +14,7 @@ #include #ifdef QT_NO_CURSOR +QT_BEGIN_NAMESPACE QPoint QCursor::pos() { diff --git a/src/gui/kernel/qdnd_s60.cpp b/src/gui/kernel/qdnd_s60.cpp index 5b888f7..09605be 100644 --- a/src/gui/kernel/qdnd_s60.cpp +++ b/src/gui/kernel/qdnd_s60.cpp @@ -26,8 +26,6 @@ #include #include QT_BEGIN_NAMESPACE - -QT_USE_NAMESPACE //### artistic impression of Symbians default DnD cursor ? static QPixmap *defaultPm = 0; @@ -363,8 +361,5 @@ QStringList QDropData::formats_sys() const return QStringList(); } - -#endif // QT_NO_DRAGANDDROP - - QT_END_NAMESPACE +#endif // QT_NO_DRAGANDDROP diff --git a/src/gui/kernel/qkeymapper_s60.cpp b/src/gui/kernel/qkeymapper_s60.cpp index 96dfa03..2919551 100644 --- a/src/gui/kernel/qkeymapper_s60.cpp +++ b/src/gui/kernel/qkeymapper_s60.cpp @@ -14,9 +14,6 @@ QT_BEGIN_NAMESPACE -QT_USE_NAMESPACE - - QKeyMapperPrivate::QKeyMapperPrivate() { fillKeyMap(); diff --git a/src/gui/kernel/qsound_s60.cpp b/src/gui/kernel/qsound_s60.cpp index 3ab5230..2ac7e26 100644 --- a/src/gui/kernel/qsound_s60.cpp +++ b/src/gui/kernel/qsound_s60.cpp @@ -25,8 +25,6 @@ QT_BEGIN_NAMESPACE -QT_USE_NAMESPACE - class QAuServerS60; class QAuBucketS60 : public QAuBucket, public MMdaAudioPlayerCallback diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 362571f..16d4fd4 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -79,6 +79,13 @@ #include "QtGui/qscreen_qws.h" #endif +#if defined(Q_WS_S60) +class RDrawableWindow; +class CCoeControl; +class CAknTitlePane; +class CAknContextPane; +#endif + QT_BEGIN_NAMESPACE // Extra QWidget data @@ -90,12 +97,6 @@ class QWSManager; #if defined(Q_WS_MAC) class QCoreGraphicsPaintEnginePrivate; #endif -#if defined(Q_WS_S60) -class RDrawableWindow; -class CCoeControl; -class CAknTitlePane; -class CAknContextPane; -#endif class QPaintEngine; class QPixmap; class QWidgetBackingStore; diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 116dc35..46e0571 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -940,3 +940,5 @@ void QWidget::activateWindow() rw->SetOrdinalPosition(0); } } + +QT_END_NAMESPACE diff --git a/src/gui/painting/qwindowsurface_s60_p.h b/src/gui/painting/qwindowsurface_s60_p.h index a238f5b..7b70fd5 100644 --- a/src/gui/painting/qwindowsurface_s60_p.h +++ b/src/gui/painting/qwindowsurface_s60_p.h @@ -26,10 +26,11 @@ #include #include "private/qwindowsurface_p.h" +class CFbsBitmap; + QT_BEGIN_NAMESPACE struct QS60WindowSurfacePrivate; -class CFbsBitmap; class QS60WindowSurface : public QWindowSurface { diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index 0c6d5b9..580291a 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -22,6 +22,8 @@ #include #include +QT_BEGIN_NAMESPACE + static const int maxFontSizeInPixels = 60; QFontEngineS60Extensions::QFontEngineS60Extensions(COpenFont *font) diff --git a/src/gui/text/qfontengine_s60_p.h b/src/gui/text/qfontengine_s60_p.h index 0b20c74..ef4a508 100644 --- a/src/gui/text/qfontengine_s60_p.h +++ b/src/gui/text/qfontengine_s60_p.h @@ -28,13 +28,13 @@ #include "qsize.h" #include -QT_BEGIN_NAMESPACE - class CFbsBitmap; class CFbsBitmapDevice; class CFbsBitGc; class CFont; +QT_BEGIN_NAMESPACE + // ..gives us access to truetype tables, UTF-16<->GlyphID mapping, and glyph outlines class QFontEngineS60Extensions { diff --git a/src/gui/widgets/qmenu.h b/src/gui/widgets/qmenu.h index 1e544f7..1676eb8 100644 --- a/src/gui/widgets/qmenu.h +++ b/src/gui/widgets/qmenu.h @@ -52,13 +52,15 @@ #endif QT_BEGIN_HEADER +#ifdef Q_OS_SYMBIAN + class CEikMenuPane; +#endif QT_BEGIN_NAMESPACE QT_MODULE(Gui) #ifdef Q_OS_SYMBIAN - class CEikMenuPane; IMPORT_C void qt_symbian_show_toplevel(CEikMenuPane* menuPane); IMPORT_C void qt_symbian_show_submenu(CEikMenuPane* menuPane, int id); #endif diff --git a/src/gui/widgets/qmenu_p.h b/src/gui/widgets/qmenu_p.h index 61cc3db..d47749f 100644 --- a/src/gui/widgets/qmenu_p.h +++ b/src/gui/widgets/qmenu_p.h @@ -61,6 +61,9 @@ #include "QtCore/qbasictimer.h" #include "private/qwidget_p.h" +#ifdef Q_OS_SYMBIAN +class CEikMenuPane; +#endif QT_BEGIN_NAMESPACE #ifndef QT_NO_MENU @@ -121,7 +124,6 @@ struct QWceMenuAction { }; #endif #ifdef Q_OS_SYMBIAN -class CEikMenuPane; struct QSymbianMenuAction { uint command; int parent; diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index a50c5c0..37c5fdb 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -367,4 +367,7 @@ void QMenuBarPrivate::QSymbianMenuBarPrivate::rebuild() rebuildMenu(); } + +QT_END_NAMESPACE + #endif //QT_NO_MENUBAR diff --git a/src/gui/widgets/qmenubar_p.h b/src/gui/widgets/qmenubar_p.h index f617d80..d562cd9 100644 --- a/src/gui/widgets/qmenubar_p.h +++ b/src/gui/widgets/qmenubar_p.h @@ -61,14 +61,17 @@ #include "qguifunctions_wince.h" #endif -QT_BEGIN_NAMESPACE - #ifndef QT_NO_MENUBAR -class QMenuBarExtension; #ifdef Q_OS_SYMBIAN class CCoeControl; class CEikMenuBar; #endif +#endif + +QT_BEGIN_NAMESPACE + +#ifndef QT_NO_MENUBAR +class QMenuBarExtension; class QMenuBarPrivate : public QWidgetPrivate { Q_DECLARE_PUBLIC(QMenuBar) -- cgit v0.12 From 05cd23af6f7e729e564e8ed2f47a8e9890d3f222 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 11 May 2009 13:58:24 +0200 Subject: Refactored implementation so that it works with multiple QMainWindows --- src/gui/widgets/qmenu_symbian.cpp | 59 +++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index 9e53df5..4c8b4ae 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -32,8 +32,10 @@ QT_BEGIN_NAMESPACE // ### FIX/Document this, we need some safe range of menu id's for Qt that don't clash with AIW ones +typedef QHash MenuBarHash; +Q_GLOBAL_STATIC(MenuBarHash, menubars) + #define QT_FIRST_MENU_ITEM 32000 -static QList s60_menubars; struct SymbianMenuItem { @@ -47,6 +49,15 @@ static QList symbianMenus; static QList nativeMenuBars; static uint qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; +bool menuExists() +{ + QWidget *w = qApp->activeWindow(); + QMenuBarPrivate *mb = menubars()->value(w); + if (!mb) + return false; + return true; +} + // ### FIX THIS, copy/paste of original (faulty) stripped text implementation. // Implementation should be removed from QAction implementation to some generic place static QString qt_strippedText_copy_from_qaction(QString s) @@ -167,7 +178,7 @@ static void setSoftkeys() { CEikButtonGroupContainer* cba = CEikonEnv::Static()->AppUiFactory()->Cba(); if (cba){ - if (s60_menubars.count()>0) + if (menuExists()) cba->SetCommandSetL(R_AVKON_SOFTKEYS_OPTIONS_EXIT); else cba->SetCommandSetL(R_AVKON_SOFTKEYS_EXIT); @@ -176,24 +187,23 @@ static void setSoftkeys() static void rebuildMenu() { - qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; - deleteAll( &symbianMenus ); - if (s60_menubars.count()==0) - return; - for (int i = 0; i < s60_menubars.last()->actions.size(); ++i) { - QSymbianMenuAction *symbianActionTopLevel = new QSymbianMenuAction; - symbianActionTopLevel->action = s60_menubars.last()->actions.at(i); - symbianActionTopLevel->parent = 0; - symbianActionTopLevel->command = qt_symbian_menu_static_cmd_id++; - qt_symbian_insert_action(symbianActionTopLevel, &symbianMenus); + QMenuBarPrivate *mb = 0; + setSoftkeys(); + QWidget *w = qApp->activeWindow(); + if (w) + { + mb = menubars()->value(w); + qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; + deleteAll( &symbianMenus ); + if (!mb) + return; + mb->symbian_menubar->rebuild(); } - - return; } Q_GUI_EXPORT void qt_symbian_show_toplevel( CEikMenuPane* menuPane) { - if (s60_menubars.count()==0) + if (!menuExists()) return; rebuildMenu(); for (int i = 0; i < symbianMenus.count(); ++i) @@ -251,6 +261,7 @@ void QMenuBarPrivate::symbianCreateMenuBar(QWidget *parent) { Q_Q(QMenuBar); if (parent && parent->isWindow()){ + menubars()->insert(q->window(), this); symbian_menubar = new QSymbianMenuBarPrivate(this); nativeMenuBars.append(q); } @@ -261,7 +272,7 @@ void QMenuBarPrivate::symbianDestroyMenuBar() Q_Q(QMenuBar); int index = nativeMenuBars.indexOf(q); nativeMenuBars.removeAt(index); - s60_menubars.removeLast(); + menubars()->remove(q->window()); rebuildMenu(); if (symbian_menubar) delete symbian_menubar; @@ -271,7 +282,6 @@ void QMenuBarPrivate::symbianDestroyMenuBar() QMenuBarPrivate::QSymbianMenuBarPrivate::QSymbianMenuBarPrivate(QMenuBarPrivate *menubar) { d = menubar; - s60_menubars.append(menubar); } QMenuBarPrivate::QSymbianMenuBarPrivate::~QSymbianMenuBarPrivate() @@ -364,10 +374,17 @@ void QMenuBarPrivate::QSymbianMenuBarPrivate::removeAction(QSymbianMenuAction *a void QMenuBarPrivate::QSymbianMenuBarPrivate::rebuild() { setSoftkeys(); - if (s60_menubars.count()==0) + qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; + deleteAll( &symbianMenus ); + if (!d) return; - - rebuildMenu(); - } + for (int i = 0; i < d->actions.size(); ++i) { + QSymbianMenuAction *symbianActionTopLevel = new QSymbianMenuAction; + symbianActionTopLevel->action = d->actions.at(i); + symbianActionTopLevel->parent = 0; + symbianActionTopLevel->command = qt_symbian_menu_static_cmd_id++; + qt_symbian_insert_action(symbianActionTopLevel, &symbianMenus); + } +} #endif //QT_NO_MENUBAR -- cgit v0.12 From cca5c6b033c23d4e153032012e8279bbcce74728 Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 11 May 2009 13:45:37 +0200 Subject: Make autoSipEnabled available on all platforms. This is relevant on S60 too, so it's time to make it cross platform. RevBy: mauricek --- src/gui/kernel/qapplication.cpp | 12 +++++++----- src/gui/kernel/qapplication.h | 4 ++-- src/gui/kernel/qapplication_p.h | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 56a65be..285f882 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -135,8 +135,8 @@ bool QApplicationPrivate::quitOnLastWindowClosed = true; #ifdef Q_OS_WINCE int QApplicationPrivate::autoMaximizeThreshold = -1; -bool QApplicationPrivate::autoSipEnabled = false; #endif +bool QApplicationPrivate::autoSipEnabled = false; QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, QApplication::Type type) : QCoreApplicationPrivate(argc, argv) @@ -1234,11 +1234,13 @@ bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventLis \since 4.5 \brief toggles automatic SIP (software input panel) visibility - The auto SIP property is only available as part of Qt for Windows CE. - Set this property to true to automatically display the SIP when entering widgets that accept keyboard input. This property only affects widgets with - the WA_InputMethodEnabled attribute set. + the WA_InputMethodEnabled attribute set, and is typically used to launch + a virtual keyboard on devices which have very few or no keys. + + The property only has an effect on platforms which use software input + panels, such as Windows CE and Symbian. */ #ifdef Q_OS_WINCE @@ -1251,6 +1253,7 @@ int QApplication::autoMaximizeThreshold() const { return QApplicationPrivate::autoMaximizeThreshold; } +#endif void QApplication::setAutoSipEnabled(const bool enabled) { @@ -1261,7 +1264,6 @@ bool QApplication::autoSipEnabled() const { return QApplicationPrivate::autoSipEnabled; } -#endif #ifndef QT_NO_STYLE_STYLESHEET diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h index 15066da..afe5fa5 100644 --- a/src/gui/kernel/qapplication.h +++ b/src/gui/kernel/qapplication.h @@ -111,8 +111,8 @@ class Q_GUI_EXPORT QApplication : public QCoreApplication #endif #ifdef Q_OS_WINCE Q_PROPERTY(int autoMaximizeThreshold READ autoMaximizeThreshold WRITE setAutoMaximizeThreshold) - Q_PROPERTY(bool autoSipEnabled READ autoSipEnabled WRITE setAutoSipEnabled) #endif + Q_PROPERTY(bool autoSipEnabled READ autoSipEnabled WRITE setAutoSipEnabled) public: enum Type { Tty, GuiClient, GuiServer }; @@ -298,9 +298,9 @@ public Q_SLOTS: #ifdef Q_OS_WINCE void setAutoMaximizeThreshold(const int threshold); int autoMaximizeThreshold() const; +#endif void setAutoSipEnabled(const bool enabled); bool autoSipEnabled() const; -#endif static void closeAllWindows(); static void aboutQt(); diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index bfc5652..a6fc602 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -221,8 +221,8 @@ public: static void emitLastWindowClosed(); #ifdef Q_OS_WINCE static int autoMaximizeThreshold; - static bool autoSipEnabled; #endif + static bool autoSipEnabled; static QGraphicsSystem *graphicsSystem() #if !defined(Q_WS_QWS) -- cgit v0.12 From 3861672c358d7180bce13af53e82df2b0617c7d4 Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 11 May 2009 13:47:45 +0200 Subject: Small doc update. --- src/gui/kernel/qapplication.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 285f882..1b6bdea 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -3463,6 +3463,8 @@ Qt::LayoutDirection QApplication::layoutDirection() /*! \property autoSipOnMouseFocus + \since 4.6 + \brief toggles SIP (software input panel) launch policy This property holds whether widgets should request a software input panel when it is focused with the mouse. This is typically used to -- cgit v0.12 From 58927cf98f94a9b300845cb631ebace303a6050f Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 11 May 2009 13:48:05 +0200 Subject: Make autoSipOnMouseFocus non-static. This way we are consistent with autoSipEnabled. --- src/gui/kernel/qapplication.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h index afe5fa5..ca0eb98 100644 --- a/src/gui/kernel/qapplication.h +++ b/src/gui/kernel/qapplication.h @@ -201,9 +201,6 @@ public: static void setKeyboardInputInterval(int); static int keyboardInputInterval(); - static void setAutoSipOnMouseFocus(bool); - static bool autoSipOnMouseFocus(); - #ifndef QT_NO_WHEELEVENT static void setWheelScrollLines(int); static int wheelScrollLines(); @@ -301,6 +298,8 @@ public Q_SLOTS: #endif void setAutoSipEnabled(const bool enabled); bool autoSipEnabled() const; + void setAutoSipOnMouseFocus(bool); + bool autoSipOnMouseFocus(); static void closeAllWindows(); static void aboutQt(); -- cgit v0.12 From f7df92920b8697238439cede8b60bf2ec047c81d Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 11 May 2009 13:49:10 +0200 Subject: Make QLineEdit care about autoSipEnabled. If the property is disabled, it will not ask for an input panel. --- src/gui/widgets/qlineedit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index fa337af..116d000 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -1774,8 +1774,8 @@ void QLineEdit::mouseReleaseEvent(QMouseEvent* e) } #endif - if (e->button() == Qt::LeftButton && (!d->clickCausedFocus - || QApplication::autoSipOnMouseFocus())) { + if (e->button() == Qt::LeftButton && qApp->autoSipEnabled() + && (!d->clickCausedFocus || qApp->autoSipOnMouseFocus())) { QEvent event(QEvent::RequestSoftwareInputPanel); QApplication::sendEvent(this, &event); } -- cgit v0.12 From e9ca540112b0fdd0d8122f7f9cc9c297016de68b Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 11 May 2009 16:12:23 +0200 Subject: Changed implementation to use QMultiHash instead of QHash. Fixes a bug when setting a new menubar to QMainWindow --- src/gui/widgets/qmenu_symbian.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index 4c8b4ae..d329cd5 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -32,7 +32,7 @@ QT_BEGIN_NAMESPACE // ### FIX/Document this, we need some safe range of menu id's for Qt that don't clash with AIW ones -typedef QHash MenuBarHash; +typedef QMultiHash MenuBarHash; Q_GLOBAL_STATIC(MenuBarHash, menubars) #define QT_FIRST_MENU_ITEM 32000 @@ -272,7 +272,7 @@ void QMenuBarPrivate::symbianDestroyMenuBar() Q_Q(QMenuBar); int index = nativeMenuBars.indexOf(q); nativeMenuBars.removeAt(index); - menubars()->remove(q->window()); + menubars()->remove(q->window(), this); rebuildMenu(); if (symbian_menubar) delete symbian_menubar; -- cgit v0.12 From 7aec9035cb0e23eecfdcec9e441092a485ca7f0a Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 11 May 2009 16:58:15 +0200 Subject: Fix for disappearing options menu button when starting some of the example applications --- src/gui/widgets/qmenu_symbian.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index 438bfd5..86affe3 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -53,7 +53,7 @@ bool menuExists() { QWidget *w = qApp->activeWindow(); QMenuBarPrivate *mb = menubars()->value(w); - if (!mb) + if ((!mb) && !menubars()->count()) return false; return true; } -- cgit v0.12