camerauis/cameraxui/cxui/src/cxuiview.cpp
changeset 36 b12f3922a74f
parent 32 5c1e3c6aa4ef
child 37 64817133cd1d
equal deleted inserted replaced
32:5c1e3c6aa4ef 36:b12f3922a74f
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <QGraphicsItem>
    18 #include <QGraphicsItem>
    19 #include <QProcess>
    19 #include <QProcess>
       
    20 #include <QGraphicsSceneEvent>
    20 #include <hbtoolbar.h>
    21 #include <hbtoolbar.h>
    21 #include <hbnotificationdialog.h>
    22 #include <hbnotificationdialog.h>
    22 #include <hbframeitem.h>
    23 #include <hbframeitem.h>
    23 #include "cxuiview.h"
    24 #include "cxuiview.h"
    24 #include "cxutils.h"
    25 #include "cxutils.h"
    43         mEngine(NULL),
    44         mEngine(NULL),
    44         mDocumentLoader(NULL),
    45         mDocumentLoader(NULL),
    45         mSlider(NULL),
    46         mSlider(NULL),
    46         mToolbar(NULL),
    47         mToolbar(NULL),
    47         mIndicators(NULL),
    48         mIndicators(NULL),
    48         mHideControlsTimeout(this)
    49         mHideControlsTimeout(this),
       
    50         mControlsFeedback(HbFeedback::BasicItem)
    49 {
    51 {
    50     CX_DEBUG_IN_FUNCTION();
    52     CX_DEBUG_IN_FUNCTION();
    51 }
    53 }
    52 
    54 
    53 /*!
    55 /*!
   355             }
   357             }
   356         }
   358         }
   357     }
   359     }
   358 }
   360 }
   359 
   361 
       
   362 /*!
       
   363  * Handle mouse press events on this view. Needed to implement toggling of
       
   364  * controls and playing feedback.
       
   365  * \param event event to be handled
       
   366  */
       
   367 void CxuiView::mousePressEvent(QGraphicsSceneMouseEvent *event)
       
   368 {
       
   369     //! @todo temporary workaround for title bar mouse event handling bug
       
   370     if (event->type() == QEvent::GraphicsSceneMousePress && event->scenePos().y() > 70) {
       
   371         mControlsFeedback.setModalities(HbFeedback::All);
       
   372         mControlsFeedback.play();
       
   373         event->accept();
       
   374     }
       
   375 }
       
   376 
       
   377 /*!
       
   378  * Handle mouse release events on this view. Needed to implement toggling of
       
   379  * controls and playing feedback.
       
   380  * \param event to be handled
       
   381  */
       
   382 void CxuiView::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
       
   383 {
       
   384     //! @todo temporary workaround for title bar mouse event handling bug
       
   385     if (event->type() == QEvent::GraphicsSceneMouseRelease && event->scenePos().y() > 70) {
       
   386         // todo: sound disabling doesn't work in orbit yet so don't do feedback on release
       
   387         // needs to be enabled when orbit support is done
       
   388         //mControlsFeedback.setModalities(HbFeedback::Tactile);
       
   389         //mControlsFeedback.play();
       
   390         toggleControls();
       
   391         event->accept();
       
   392     }
       
   393 }
   360 // End of file
   394 // End of file