From 02500f25cc7ce5c7a9109c6cf433c79001e0594e Mon Sep 17 00:00:00 2001 From: axis Date: Thu, 3 Feb 2011 15:45:00 +0100 Subject: Fixed a bug where the softkeys would leave a see-through "hole". In cases where the widget was created from the event loop instead of main(), the middle three softkeys would not get the right visibility and would leave a "hole" in the application where one could see what was beneath it. It could also be clicked, which would bring the app to the background which was really annoying. Fixed by setting the visibility manually upon creation. It should still be possible to alter the visibility of the toolbar manually after the widget creation, if someone requires that. Task: QTBUG-16578 RevBy: Gareth Stockwell AutoTest: N/A, but tested with various combinations of fullscreen, non-fullscreen and softkey visibility modes. No regressions. (cherry picked from commit 231dcfc8b6a90c3a0ab4869e0a9ab45403fd9a8c) --- src/gui/kernel/qwidget_s60.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index b585968..1551162 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -54,6 +54,7 @@ #ifdef Q_WS_S60 #include +#include #include #endif @@ -511,6 +512,18 @@ void QWidgetPrivate::show_sys() Q_ASSERT(!oldCba); S60->setButtonGroupContainer(cba); + // If the creation of the first widget is delayed, for example by doing it + // inside the event loop, S60 somehow "forgets" to set the visibility of the + // toolbar (the three middle softkeys) when you flip the phone over, so we + // need to do it ourselves to avoid a "hole" in the application, even though + // Qt itself does not use the toolbar directly.. + CAknAppUi *appui = dynamic_cast(CEikonEnv::Static()->AppUi()); + if (appui) { + CAknToolbar *toolbar = appui->PopupToolbar(); + if (toolbar && !toolbar->IsVisible()) + toolbar->SetToolbarVisibility(ETrue); + } + CEikMenuBar *menuBar = new(ELeave) CEikMenuBar; menuBar->ConstructL(ui, 0, R_AVKON_MENUPANE_EMPTY); menuBar->SetMenuType(CEikMenuBar::EMenuOptions); -- cgit v0.12