summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-05 06:51:01 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-05 06:51:01 (GMT)
commit5d7aaf0a63b01b2fbdd952b0e37442cce62456a9 (patch)
treed72949c70da95d4e06d0dec8330ae0b77211541e
parentc06a5b4459a50716e4d41183fa9c2fd39d605c3e (diff)
parentb837e7024afcf4597082998f97dcc663c13c6380 (diff)
downloadQt-5d7aaf0a63b01b2fbdd952b0e37442cce62456a9.zip
Qt-5d7aaf0a63b01b2fbdd952b0e37442cce62456a9.tar.gz
Qt-5d7aaf0a63b01b2fbdd952b0e37442cce62456a9.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public: Fixed crash in Symbian when having empty QMenu in menubar.
-rw-r--r--src/gui/widgets/qmenu_symbian.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp
index eae97a6..e46688c 100644
--- a/src/gui/widgets/qmenu_symbian.cpp
+++ b/src/gui/widgets/qmenu_symbian.cpp
@@ -256,6 +256,14 @@ void qt_symbian_show_submenu( CEikMenuPane* menuPane, int id)
{
SymbianMenuItem* menu = qt_symbian_find_menu(id, symbianMenus);
if (menu) {
+ // Normally first AddMenuItemL call for menuPane will create the item array.
+ // However if we don't have any items, we still need the item array. Otherwise
+ // menupane will crash. That's why we create item array here manually, and
+ // AddMenuItemL will then use the existing array.
+ CEikMenuPane::CItemArray* itemArray = q_check_ptr(new CEikMenuPane::CItemArray);
+ menuPane->SetItemArray(itemArray);
+ menuPane->SetItemArrayOwnedExternally(EFalse);
+
for (int i = 0; i < menu->children.count(); ++i)
QT_TRAP_THROWING(menuPane->AddMenuItemL(menu->children.at(i)->menuItemData));
}