telutils/dialpad/tsrc/dialpadtest/dialpadtestview.cpp
changeset 45 61f927bc9441
parent 27 7eb70891911c
child 46 2fa1fa551b0b
equal deleted inserted replaced
39:cee7e9e0906c 45:61f927bc9441
   103 {
   103 {
   104     QRectF screenRect(mMainWindow.layoutRect());
   104     QRectF screenRect(mMainWindow.layoutRect());
   105 
   105 
   106     if (mMainWindow.orientation() == Qt::Horizontal) {
   106     if (mMainWindow.orientation() == Qt::Horizontal) {
   107         // dialpad takes half of the screen
   107         // dialpad takes half of the screen
   108         if (layoutDirection() == Qt::LeftToRight) {
   108         mDialpad->setPos(QPointF(screenRect.width()/2,
   109             mDialpad->setPos(QPointF(screenRect.width()/2,
   109                                  this->scenePos().y()));
   110                                      this->scenePos().y()));
   110         mDialpad->resize(screenRect.width()/2,
   111             mDialpad->setPreferredSize(screenRect.width()/2,
   111                          (screenRect.height()-scenePos().y()));
   112                                        (screenRect.height()-scenePos().y()));
       
   113         } else {
       
   114             mDialpad->setPos(QPointF(0,this->scenePos().y()));
       
   115             mDialpad->setPreferredSize(screenRect.width()/2,
       
   116                                        (screenRect.height()-scenePos().y()));
       
   117         }
       
   118     } else {
   112     } else {
   119         qreal screenHeight = screenRect.height();
   113         qreal screenHeight = screenRect.height();
   120         mDialpad->setPos(0, screenHeight/2.25);
   114         mDialpad->setPos(0, screenHeight/2.25);
   121         mDialpad->setPreferredSize(screenRect.width(),
   115         mDialpad->resize(screenRect.width(),screenHeight - screenHeight/2.25);
   122                                    screenHeight - screenHeight/2.25);
       
   123     }
   116     }
   124 }
   117 }
   125 
   118 
   126 void DialpadTestView::switchOrientation()
   119 void DialpadTestView::switchOrientation()
   127 {
   120 {