camerauis/cameraxui/cxui/src/cxuiprecaptureview.cpp
changeset 36 b12f3922a74f
parent 32 5c1e3c6aa4ef
child 37 64817133cd1d
equal deleted inserted replaced
32:5c1e3c6aa4ef 36:b12f3922a74f
    14 * Description:
    14 * Description:
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <coemain.h>
    18 #include <coemain.h>
    19 #include <QGraphicsSceneEvent>
       
    20 #include <QProcess>
    19 #include <QProcess>
    21 #include <QApplication>
    20 #include <QApplication>
    22 #include <hbmainwindow.h>
    21 #include <hbmainwindow.h>
    23 #include <hbslider.h>
    22 #include <hbslider.h>
    24 #include <hbtoolbar.h>
    23 #include <hbtoolbar.h>
   167 {
   166 {
   168     CX_DEBUG_ENTER_FUNCTION();
   167     CX_DEBUG_ENTER_FUNCTION();
   169 
   168 
   170     if (mMainWindow) {
   169     if (mMainWindow) {
   171         mEngine->viewfinderControl().setWindow(mMainWindow->effectiveWinId());
   170         mEngine->viewfinderControl().setWindow(mMainWindow->effectiveWinId());
   172         setFlag(QGraphicsItem::ItemIsFocusable);
       
   173         setFocusPolicy(Qt::StrongFocus);
       
   174         setFocus();
       
   175     }
   171     }
   176 
   172 
   177     CX_DEBUG_EXIT_FUNCTION();
   173     CX_DEBUG_EXIT_FUNCTION();
   178 }
   174 }
   179 
   175 
   276     // be postponed using sections in layout xml
   272     // be postponed using sections in layout xml
   277     if (!mWidgetsLoaded) {
   273     if (!mWidgetsLoaded) {
   278         // call load widgets to load app DocML and get the pointers to needed widgets
   274         // call load widgets to load app DocML and get the pointers to needed widgets
   279         loadWidgets();
   275         loadWidgets();
   280     }
   276     }
   281 
       
   282     CxuiView::toggleControls();
   277     CxuiView::toggleControls();
   283 }
       
   284 
       
   285 
       
   286 // ---------------------------------------------------------------------------
       
   287 // CxuiPrecaptureView::mousePressEvent
       
   288 //
       
   289 // ---------------------------------------------------------------------------
       
   290 //
       
   291 void CxuiPrecaptureView::mousePressEvent(QGraphicsSceneMouseEvent *event)
       
   292 {
       
   293     //! @todo temporary workaround for title bar mouse event handling bug
       
   294     if (event->type() == QEvent::GraphicsSceneMousePress && event->scenePos().y() > 70) {
       
   295         toggleControls();
       
   296         event->accept();
       
   297     }
       
   298 }
   278 }
   299 
   279 
   300 // ---------------------------------------------------------------------------
   280 // ---------------------------------------------------------------------------
   301 // CxuiPrecaptureView::handleZoomLevelChange
   281 // CxuiPrecaptureView::handleZoomLevelChange
   302 // Slot to handle zoom level change signal from zoom control.
   282 // Slot to handle zoom level change signal from zoom control.
   481 * If the setting dialog was launched from the setting grid, show grid again now.
   461 * If the setting dialog was launched from the setting grid, show grid again now.
   482 * @param action Action that launched the dialog.
   462 * @param action Action that launched the dialog.
   483 */
   463 */
   484 void CxuiPrecaptureView::prepareToCloseDialog(HbAction *action)
   464 void CxuiPrecaptureView::prepareToCloseDialog(HbAction *action)
   485 {
   465 {
   486     if (!action) {
       
   487         return;
       
   488     }
       
   489 
       
   490     // Check if the dialog was started from grid, and show the grid now if needed.
   466     // Check if the dialog was started from grid, and show the grid now if needed.
   491     // Autofocus key-press will clear the action to disable showing the grid.
   467     // Autofocus key-press will clear the action to disable showing the grid.
   492     QString fromGrid = action->property(PROPERTY_KEY_SETTING_GRID).toString();
   468     if (action) {
   493     if (fromGrid.compare(QString(PROPERTY_KEY_TRUE)) == 0 ) {
   469         QString fromGrid = action->property(PROPERTY_KEY_SETTING_GRID).toString();
   494         showSettingsGrid();
   470         if (fromGrid.compare(QString(PROPERTY_KEY_TRUE)) == 0 ) {
       
   471             showSettingsGrid();
       
   472         }
   495     }
   473     }
   496 
   474 
   497     // Clear the starter actions to be sure they are not reused.
   475     // Clear the starter actions to be sure they are not reused.
   498     if (mSettingsDialog) {
   476     if (mSettingsDialog) {
   499         mSettingsDialog->setStarterAction(NULL);
   477         mSettingsDialog->setStarterAction(NULL);