src/gui/kernel/qwidget_s60.cpp
branchRCL_3
changeset 13 cc75c76972ee
parent 12 25a739ee40f4
child 14 c0432d11811c
equal deleted inserted replaced
12:25a739ee40f4 13:cc75c76972ee
   476     if (q->internalWinId()) {
   476     if (q->internalWinId()) {
   477         if (!extra->activated)
   477         if (!extra->activated)
   478              activateSymbianWindow();
   478              activateSymbianWindow();
   479 
   479 
   480          QSymbianControl *id = static_cast<QSymbianControl *>(q->internalWinId());
   480          QSymbianControl *id = static_cast<QSymbianControl *>(q->internalWinId());
   481 
       
   482 #ifdef Q_WS_S60
       
   483         // Lazily initialize the S60 screen furniture when the first window is shown.
       
   484         if (!QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes)
       
   485                 && !S60->buttonGroupContainer() && !S60->statusPane()) {
       
   486 
       
   487             bool isFullscreen = q->windowState() & Qt::WindowFullScreen;
       
   488             bool cbaRequested = q->windowFlags() & Qt::WindowSoftkeysVisibleHint;
       
   489 
       
   490             // If the window is fullscreen and has not explicitly requested that the CBA be visible
       
   491             // we delay the creation even more.
       
   492             if ((!isFullscreen || cbaRequested) && !q->testAttribute(Qt::WA_DontShowOnScreen)) {
       
   493 
       
   494                 // Create the status pane and CBA here
       
   495                 CEikAppUi *ui = static_cast<CEikAppUi *>(S60->appUi());
       
   496                 MEikAppUiFactory *factory = CEikonEnv::Static()->AppUiFactory();
       
   497                 TRAP_IGNORE(factory->ReadAppInfoResourceL(0, ui));
       
   498                 if (S60->buttonGroupContainer())
       
   499                     S60->buttonGroupContainer()->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS);
       
   500 
       
   501                 if (S60->statusPane()) {
       
   502                     // Use QDesktopWidget as the status pane observer to proxy for the AppUi.
       
   503                     // Can't use AppUi directly because it privately inherits from MEikStatusPaneObserver.
       
   504                     QSymbianControl *desktopControl = static_cast<QSymbianControl *>(QApplication::desktop()->winId());
       
   505                     S60->statusPane()->SetObserver(desktopControl);
       
   506 
       
   507                     // Hide the status pane if fullscreen OR
       
   508                     // Fill client area if maximized OR
       
   509                     // Put window below status pane unless the window has an explicit position.
       
   510                     if (isFullscreen) {
       
   511                         S60->statusPane()->MakeVisible(false);
       
   512                     } else if (q->windowState() & Qt::WindowMaximized) {
       
   513                         TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
       
   514                         id->SetExtent(r.iTl, r.Size());
       
   515                     } else if (!q->testAttribute(Qt::WA_Moved)) {
       
   516                         id->SetPosition(static_cast<CEikAppUi*>(S60->appUi())->ClientRect().iTl);
       
   517                     }
       
   518                 }
       
   519             }
       
   520         }
       
   521 #endif
       
   522 
   481 
   523         id->MakeVisible(true);
   482         id->MakeVisible(true);
   524 
   483 
   525         if(q->isWindow())
   484         if(q->isWindow())
   526             id->setFocusSafely(true);
   485             id->setFocusSafely(true);