diff options
Diffstat (limited to 'src/gui/widgets/qmenu_symbian.cpp')
-rw-r--r-- | src/gui/widgets/qmenu_symbian.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index 491c78e..1ed3505 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -184,19 +184,21 @@ static void rebuildMenu() QMenuBarPrivate *mb = 0; QWidget *w = qApp->activeWindow(); QMainWindow *mainWindow = qobject_cast<QMainWindow*>(w); - QSoftKeyStack* softKeyStack = mainWindow->softKeyStack(); - if (!softKeyStack->isEmpty()) { - const QSoftkeySet& softKeyTop = softKeyStack->top(); - int index=0; - bool found=false; - while( index<softKeyTop.count() && !found) { - QSoftKeyAction* softAction = softKeyTop.at(index); - QSoftKeyAction::StandardRole role = softAction->role(); - if(softAction->role() == QSoftKeyAction::ContextMenu) { - widgetWithContextMenu = softAction->parentWidget(); - found=true; - } - index++; + if (mainWindow) { + QSoftKeyStack* softKeyStack = mainWindow->softKeyStack(); + if (!softKeyStack->isEmpty()) { + const QSoftkeySet& softKeyTop = softKeyStack->top(); + int index=0; + bool found=false; + while( index<softKeyTop.count() && !found) { + QSoftKeyAction* softAction = softKeyTop.at(index); + QSoftKeyAction::StandardRole role = softAction->role(); + if(softAction->role() == QSoftKeyAction::ContextMenu) { + widgetWithContextMenu = softAction->parentWidget(); + found=true; + } + index++; + } } } |