src/hbwidgets/sliders/hbabstractslidercontrol.cpp
changeset 6 c3690ec91ef8
parent 0 16d8024aca5e
child 23 e6ad4ef83b23
equal deleted inserted replaced
5:627c4a0fd0e7 6:c3690ec91ef8
    98  */
    98  */
    99 
    99 
   100 /*!
   100 /*!
   101     \var HbAbstractSliderControl::SliderSingleStepSub
   101     \var HbAbstractSliderControl::SliderSingleStepSub
   102 
   102 
   103     Substract a single step.
   103     Subtract a single step.
   104  */
   104  */
   105 
   105 
   106 /*!
   106 /*!
   107     \var HbAbstractSliderControl::SliderPageStepAdd
   107     \var HbAbstractSliderControl::SliderPageStepAdd
   108 
   108 
   110  */
   110  */
   111 
   111 
   112 /*!
   112 /*!
   113     \var HbAbstractSliderControl::SliderPageStepSub
   113     \var HbAbstractSliderControl::SliderPageStepSub
   114 
   114 
   115     Substract a page step.
   115     Subtract a page step.
   116  */
   116  */
   117 
   117 
   118 /*!
   118 /*!
   119     \var HbAbstractSliderControl::SliderToMinimum
   119     \var HbAbstractSliderControl::SliderToMinimum
   120 
   120 
   856     SliderAction action = SliderNoAction;
   856     SliderAction action = SliderNoAction;
   857     switch (event->key()) {
   857     switch (event->key()) {
   858 
   858 
   859         // It seems we need to use invertedAppearance for Left and right, otherwise, things look weird.
   859         // It seems we need to use invertedAppearance for Left and right, otherwise, things look weird.
   860         case Qt::Key_Left:
   860         case Qt::Key_Left:
   861             if(orientation()==Qt::Horizontal){
   861             if( d->keyNavigation() && orientation()==Qt::Horizontal){
   862                 if (layoutDirection() == Qt::RightToLeft)
   862                 if (layoutDirection() == Qt::RightToLeft)
   863                     action = d->invertedAppearance ? SliderSingleStepSub : SliderSingleStepAdd;
   863                     action = d->invertedAppearance ? SliderSingleStepSub : SliderSingleStepAdd;
   864                 else
   864                 else
   865                     action = !d->invertedAppearance ? SliderSingleStepSub : SliderSingleStepAdd;
   865                     action = !d->invertedAppearance ? SliderSingleStepSub : SliderSingleStepAdd;
   866                 event->accept();
   866                 event->accept();
   869             else {
   869             else {
   870                  HbWidget::keyPressEvent(event);
   870                  HbWidget::keyPressEvent(event);
   871             }
   871             }
   872             break;
   872             break;
   873         case Qt::Key_Right:
   873         case Qt::Key_Right:
   874             if(orientation()==Qt::Horizontal){
   874             if( d->keyNavigation() && orientation()==Qt::Horizontal){
   875                 if (layoutDirection() == Qt::RightToLeft)
   875                 if (layoutDirection() == Qt::RightToLeft)
   876                     action = d->invertedAppearance ? SliderSingleStepAdd : SliderSingleStepSub;
   876                     action = d->invertedAppearance ? SliderSingleStepAdd : SliderSingleStepSub;
   877                 else
   877                 else
   878                     action = !d->invertedAppearance ? SliderSingleStepAdd : SliderSingleStepSub;
   878                     action = !d->invertedAppearance ? SliderSingleStepAdd : SliderSingleStepSub;
   879                 event->accept();
   879                 event->accept();
   881             else{
   881             else{
   882                  HbWidget::keyPressEvent(event);
   882                  HbWidget::keyPressEvent(event);
   883             }
   883             }
   884             break;
   884             break;
   885         case Qt::Key_Up:
   885         case Qt::Key_Up:
   886             if(orientation()==Qt::Vertical){
   886             if( d->keyNavigation() && orientation()==Qt::Vertical){
   887                 action = d->invertedControls ? SliderSingleStepSub : SliderSingleStepAdd;
   887                 action = d->invertedControls ? SliderSingleStepSub : SliderSingleStepAdd;
   888                 event->accept();
   888                 event->accept();
   889             }
   889             }
   890             else{
   890             else{
   891                  HbWidget::keyPressEvent(event);
   891                  HbWidget::keyPressEvent(event);
   892             }
   892             }
   893             break;
   893             break;
   894         case Qt::Key_Down:
   894         case Qt::Key_Down:
   895             if(orientation()==Qt::Vertical){
   895             if( d->keyNavigation() && orientation()==Qt::Vertical){
   896                 action = d->invertedControls ? SliderSingleStepAdd : SliderSingleStepSub;
   896                 action = d->invertedControls ? SliderSingleStepAdd : SliderSingleStepSub;
   897                 event->accept();
   897                 event->accept();
   898             }
   898             }
   899             else {
   899             else {
   900                  HbWidget::keyPressEvent(event);
   900                  HbWidget::keyPressEvent(event);