src/gui/widgets/qcombobox.cpp
changeset 22 79de32ba3296
parent 19 fcece45ef507
child 25 e24348a560a6
equal deleted inserted replaced
19:fcece45ef507 22:79de32ba3296
    74 #include <private/qt_cocoa_helpers_mac_p.h>
    74 #include <private/qt_cocoa_helpers_mac_p.h>
    75 #endif
    75 #endif
    76 #ifndef QT_NO_EFFECTS
    76 #ifndef QT_NO_EFFECTS
    77 # include <private/qeffects_p.h>
    77 # include <private/qeffects_p.h>
    78 #endif
    78 #endif
       
    79 #if defined(Q_WS_S60)
       
    80 #include "private/qt_s60_p.h"
       
    81 #endif
       
    82 
    79 QT_BEGIN_NAMESPACE
    83 QT_BEGIN_NAMESPACE
    80 
    84 
    81 QComboBoxPrivate::QComboBoxPrivate()
    85 QComboBoxPrivate::QComboBoxPrivate()
    82     : QWidgetPrivate(),
    86     : QWidgetPrivate(),
    83       model(0),
    87       model(0),
  2447 #ifdef Q_WS_S60
  2451 #ifdef Q_WS_S60
  2448         if (screen.width() < screen.height()) {
  2452         if (screen.width() < screen.height()) {
  2449             // in portait, menu should be positioned above softkeys
  2453             // in portait, menu should be positioned above softkeys
  2450             listRect.moveBottom(screen.bottom());
  2454             listRect.moveBottom(screen.bottom());
  2451         } else {
  2455         } else {
  2452             // landscape, menu should be at the right and horizontally centered
  2456             TRect staConTopRect = TRect();
       
  2457             AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStaconTop, staConTopRect);
  2453             listRect.setWidth(listRect.height());
  2458             listRect.setWidth(listRect.height());
       
  2459             //by default popup is centered on screen in landscape
  2454             listRect.moveCenter(screen.center());
  2460             listRect.moveCenter(screen.center());
  2455             (opt.direction == Qt::LeftToRight) ? listRect.setRight(screen.right()) :
  2461             if (staConTopRect.IsEmpty()) {
  2456                                                  listRect.setLeft(screen.left());
  2462                 // landscape without stacon, menu should be at the right
       
  2463                 (opt.direction == Qt::LeftToRight) ? listRect.setRight(screen.right()) :
       
  2464                                                      listRect.setLeft(screen.left());
       
  2465             }
  2457         }
  2466         }
  2458 #endif
  2467 #endif
  2459     } else if (!boundToScreen || listRect.height() <= belowHeight) {
  2468     } else if (!boundToScreen || listRect.height() <= belowHeight) {
  2460         listRect.moveTopLeft(below);
  2469         listRect.moveTopLeft(below);
  2461     } else if (listRect.height() <= aboveHeight) {
  2470     } else if (listRect.height() <= aboveHeight) {
  2679 
  2688 
  2680                 if (screen.width() < screen.height()) {
  2689                 if (screen.width() < screen.height()) {
  2681                     // in portait, menu should be positioned above softkeys
  2690                     // in portait, menu should be positioned above softkeys
  2682                     listRect.moveBottom(screen.bottom());
  2691                     listRect.moveBottom(screen.bottom());
  2683                 } else {
  2692                 } else {
  2684                     // landscape, menu should be at the right and horizontally centered
  2693                     TRect staConTopRect = TRect();
       
  2694                     AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStaconTop, staConTopRect);
  2685                     listRect.setWidth(listRect.height());
  2695                     listRect.setWidth(listRect.height());
       
  2696                     //by default popup is centered on screen in landscape
  2686                     listRect.moveCenter(screen.center());
  2697                     listRect.moveCenter(screen.center());
  2687                     (opt.direction == Qt::LeftToRight) ? listRect.setRight(screen.right()) :
  2698                     if (staConTopRect.IsEmpty()) {
  2688                                                          listRect.setLeft(screen.left());
  2699                         // landscape without stacon, menu should be at the right
       
  2700                         (opt.direction == Qt::LeftToRight) ? listRect.setRight(screen.right()) :
       
  2701                                                              listRect.setLeft(screen.left());
       
  2702                     }
       
  2703                     d->container->setGeometry(listRect);
  2689                 }
  2704                 }
  2690                 d->container->setGeometry(listRect);
       
  2691             }
  2705             }
  2692         }
  2706         }
  2693 #endif
  2707 #endif
  2694 
  2708 
  2695         // ### need to update scrollers etc. as well here
  2709         // ### need to update scrollers etc. as well here