diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-10 13:06:23 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-10 13:06:23 (GMT) |
commit | 1f88e7df38aa890cf893cf7f5b60546dbd922bdf (patch) | |
tree | ed0d36781e8fa36cd62dd90b284e14d6f611af17 /src | |
parent | afd6dbb4f0cdf5ea5b008351537c5d377af89c91 (diff) | |
parent | 4a0b21f43a2ce59c4fa4a79fe33fa7f19822eb04 (diff) | |
download | Qt-1f88e7df38aa890cf893cf7f5b60546dbd922bdf.zip Qt-1f88e7df38aa890cf893cf7f5b60546dbd922bdf.tar.gz Qt-1f88e7df38aa890cf893cf7f5b60546dbd922bdf.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
compile fix for plugins\sqldrivers\sqlite on WinCE 6
fix menu handling on Windows CE
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/qmenu_p.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/qmenu_wince.cpp | 24 | ||||
-rw-r--r-- | src/plugins/sqldrivers/sqlite/sqlite.pro | 2 |
3 files changed, 21 insertions, 7 deletions
diff --git a/src/gui/widgets/qmenu_p.h b/src/gui/widgets/qmenu_p.h index aaed6b1..495872c 100644 --- a/src/gui/widgets/qmenu_p.h +++ b/src/gui/widgets/qmenu_p.h @@ -347,7 +347,7 @@ public: void syncAction(QWceMenuAction *); inline void syncAction(QAction *a) { syncAction(findAction(a)); } void removeAction(QWceMenuAction *); - void rebuild(bool reCreate = false); + void rebuild(); inline void removeAction(QAction *a) { removeAction(findAction(a)); } inline QWceMenuAction *findAction(QAction *a) { for(int i = 0; i < actionItems.size(); i++) { diff --git a/src/gui/widgets/qmenu_wince.cpp b/src/gui/widgets/qmenu_wince.cpp index edef466..1577f0a 100644 --- a/src/gui/widgets/qmenu_wince.cpp +++ b/src/gui/widgets/qmenu_wince.cpp @@ -253,6 +253,12 @@ static void qt_wce_insert_action(HMENU menu, QWceMenuAction *action, bool create } } +// Removes all items from the menu without destroying the handles. +static void qt_wce_clear_menu(HMENU hMenu) +{ + while (RemoveMenu(hMenu, 0, MF_BYPOSITION)); +} + /*! \internal @@ -403,7 +409,8 @@ QMenuPrivate::QWceMenuPrivate::QWceMenuPrivate() { QMenuPrivate::QWceMenuPrivate::~QWceMenuPrivate() { qt_wce_delete_action_list(&actionItems); - menuHandle = 0; + if (menuHandle) + DestroyMenu(menuHandle); } void QMenuPrivate::QWceMenuPrivate::addAction(QAction *a, QWceMenuAction *before) { @@ -438,14 +445,17 @@ HMENU QMenuPrivate::wceMenu(bool create) { if (!wce_menu) wce_menu = new QWceMenuPrivate; if (!wce_menu->menuHandle || create) - wce_menu->rebuild(create); + wce_menu->rebuild(); return wce_menu->menuHandle; } -void QMenuPrivate::QWceMenuPrivate::rebuild(bool reCreate) { - if (menuHandle && !reCreate) - DestroyMenu(menuHandle); - menuHandle = CreatePopupMenu(); +void QMenuPrivate::QWceMenuPrivate::rebuild() +{ + if (!menuHandle) + menuHandle = CreatePopupMenu(); + else + qt_wce_clear_menu(menuHandle); + for (int i = 0; i < actionItems.size(); ++i) { QWceMenuAction *action = actionItems.at(i); action->menuHandle = menuHandle; @@ -521,6 +531,7 @@ void QMenuBarPrivate::QWceMenuBarPrivate::rebuild() { resourceHandle = IDR_MAIN_MENU5; } Q_ASSERT_X(menubarHandle, "rebuild !created", "menubar already deleted"); + qt_wce_clear_menu(menuHandle); DestroyWindow(menubarHandle); menubarHandle = qt_wce_create_menubar(parentWindowHandle, qt_wce_get_module_handle(), resourceHandle); Q_ASSERT_X(menubarHandle, "rebuild classic menu", "cannot create menubar from resource"); @@ -562,6 +573,7 @@ void QMenuBarPrivate::QWceMenuBarPrivate::rebuild() { leftButtonIsMenu = (leftButtonAction && leftButtonAction->menu()); Q_ASSERT_X(menubarHandle, "rebuild !created", "menubar already deleted"); + qt_wce_clear_menu(menuHandle); DestroyWindow(menubarHandle); if (leftButtonIsMenu) { menubarHandle = qt_wce_create_menubar(parentWindowHandle, qt_wce_get_module_handle(), IDR_MAIN_MENU2); diff --git a/src/plugins/sqldrivers/sqlite/sqlite.pro b/src/plugins/sqldrivers/sqlite/sqlite.pro index c609a9e..fb31233 100644 --- a/src/plugins/sqldrivers/sqlite/sqlite.pro +++ b/src/plugins/sqldrivers/sqlite/sqlite.pro @@ -14,4 +14,6 @@ SOURCES = smain.cpp \ QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE } +wince*: DEFINES += HAVE_LOCALTIME_S=0 + include(../qsqldriverbase.pri) |