summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2010-03-19 04:06:02 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-03-19 04:06:02 (GMT)
commitf9e3b16b7e2f3ca9ecf6f05341c2a78fb561b682 (patch)
tree65f3b637a19ff47fcc97e3f22deeae7d843cad17 /src/gui
parent331ad8eb0aedb4baefcaf6f08a8e0ce440a32b06 (diff)
parent8a7de547942c9a660dfc45c176ea1a3027bbf99a (diff)
downloadQt-f9e3b16b7e2f3ca9ecf6f05341c2a78fb561b682.zip
Qt-f9e3b16b7e2f3ca9ecf6f05341c2a78fb561b682.tar.gz
Qt-f9e3b16b7e2f3ca9ecf6f05341c2a78fb561b682.tar.bz2
Merge remote branch 'origin/4.7' into oslo-staging-1
Conflicts: mkspecs/common/symbian/symbian.conf
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/dialogs/qerrormessage.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsproxywidget.cpp5
-rw-r--r--src/gui/graphicsview/qgraphicsproxywidget_p.h1
-rw-r--r--src/gui/gui.pro12
-rw-r--r--src/gui/itemviews/qsortfilterproxymodel.cpp4
-rw-r--r--src/gui/itemviews/qtreeview.cpp22
-rw-r--r--src/gui/kernel/qapplication_s60.cpp10
-rw-r--r--src/gui/kernel/qcursor_s60.cpp2
-rw-r--r--src/gui/kernel/qwidget.cpp2
-rw-r--r--src/gui/painting/qwindowsurface_s60.cpp4
-rw-r--r--src/gui/s60framework/s60framework.pri2
-rw-r--r--src/gui/styles/qs60style.cpp36
-rw-r--r--src/gui/text/qfont.cpp2
-rw-r--r--src/gui/text/qfont_s60.cpp4
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp4
-rw-r--r--src/gui/util/util.pri9
-rw-r--r--src/gui/widgets/qcombobox.cpp50
-rw-r--r--src/gui/widgets/qcombobox_p.h2
-rw-r--r--src/gui/widgets/qmenu_symbian.cpp2
-rw-r--r--src/gui/widgets/qsplitter.cpp35
-rw-r--r--src/gui/widgets/widgets.pri2
21 files changed, 152 insertions, 60 deletions
diff --git a/src/gui/dialogs/qerrormessage.cpp b/src/gui/dialogs/qerrormessage.cpp
index 0bca811..7be7481 100644
--- a/src/gui/dialogs/qerrormessage.cpp
+++ b/src/gui/dialogs/qerrormessage.cpp
@@ -70,10 +70,10 @@ extern bool qt_wince_is_high_dpi(); //defined in qguifunctions_wince.cpp
#if defined(QT_SOFTKEYS_ENABLED)
#include <qaction.h>
+#endif
#ifdef Q_WS_S60
#include "private/qt_s60_p.h"
#endif
-#endif
QT_BEGIN_NAMESPACE
diff --git a/src/gui/graphicsview/qgraphicsproxywidget.cpp b/src/gui/graphicsview/qgraphicsproxywidget.cpp
index a39ccfd..483eb62 100644
--- a/src/gui/graphicsview/qgraphicsproxywidget.cpp
+++ b/src/gui/graphicsview/qgraphicsproxywidget.cpp
@@ -1315,6 +1315,8 @@ void QGraphicsProxyWidget::focusInEvent(QFocusEvent *event)
return;
}
+ d->proxyIsGivingFocus = true;
+
switch (event->reason()) {
case Qt::TabFocusReason: {
if (QWidget *focusChild = d->findFocusChild(0, true))
@@ -1328,10 +1330,11 @@ void QGraphicsProxyWidget::focusInEvent(QFocusEvent *event)
default:
if (d->widget && d->widget->focusWidget()) {
d->widget->focusWidget()->setFocus(event->reason());
- return;
}
break;
}
+
+ d->proxyIsGivingFocus = false;
}
/*!
diff --git a/src/gui/graphicsview/qgraphicsproxywidget_p.h b/src/gui/graphicsview/qgraphicsproxywidget_p.h
index 60eb058..8aed363 100644
--- a/src/gui/graphicsview/qgraphicsproxywidget_p.h
+++ b/src/gui/graphicsview/qgraphicsproxywidget_p.h
@@ -118,6 +118,7 @@ public:
quint32 styleChangeMode : 2;
quint32 paletteChangeMode : 2;
quint32 focusFromWidgetToProxy : 1;
+ quint32 proxyIsGivingFocus : 1;
};
QT_END_NAMESPACE
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index d46f3b4..52531a3 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -51,12 +51,14 @@ contains(DEFINES,QT_EVAL):include($$QT_SOURCE_TREE/src/corelib/eval.pri)
QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtGui.dynlist
DEFINES += Q_INTERNAL_QAPP_SRC
-symbian: {
+symbian {
TARGET.UID3=0x2001B2DD
- # ro-section in gui can exceed default allocated space, so move rw-section a little further
- QMAKE_LFLAGS.ARMCC += --rw-base 0x800000
- QMAKE_LFLAGS.GCCE += -Tdata 0xC00000
+ symbian-abld:symbian-sbsv2 {
+ # ro-section in gui can exceed default allocated space, so move rw-section a little further
+ QMAKE_LFLAGS.ARMCC += --rw-base 0x800000
+ QMAKE_LFLAGS.GCCE += -Tdata 0xC00000
+ }
# Partial upgrade SIS file
vendorinfo = \
@@ -70,7 +72,7 @@ symbian: {
pu_header = "; Partial upgrade package for testing QtGui changes without reinstalling everything" \
"$${LITERAL_HASH}{\"Qt gui\"}, (0x2001E61C), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU"
partial_upgrade.pkg_prerules = pu_header vendorinfo
- partial_upgrade.sources = qtgui.dll
+ partial_upgrade.sources = $$QMAKE_LIBDIR_QT/QtGui.dll
partial_upgrade.path = c:/sys/bin
DEPLOYMENT = partial_upgrade $$DEPLOYMENT
}
diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp
index c6ad345..dce5c6a 100644
--- a/src/gui/itemviews/qsortfilterproxymodel.cpp
+++ b/src/gui/itemviews/qsortfilterproxymodel.cpp
@@ -1217,13 +1217,13 @@ void QSortFilterProxyModelPrivate::_q_sourceAboutToBeReset()
{
Q_Q(QSortFilterProxyModel);
q->beginResetModel();
- invalidatePersistentIndexes();
- clear_mapping();
}
void QSortFilterProxyModelPrivate::_q_sourceReset()
{
Q_Q(QSortFilterProxyModel);
+ invalidatePersistentIndexes();
+ clear_mapping();
// All internal structures are deleted in clear()
q->endResetModel();
update_source_sort_column();
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index 2764baa..b2457f3 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -1233,17 +1233,17 @@ bool QTreeView::viewportEvent(QEvent *event)
int oldBranch = d->hoverBranch;
d->hoverBranch = d->itemDecorationAt(he->pos());
if (oldBranch != d->hoverBranch) {
- QModelIndex oldIndex = d->modelIndex(oldBranch),
- newIndex = d->modelIndex(d->hoverBranch);
- if (oldIndex != newIndex) {
- QRect oldRect = visualRect(oldIndex);
- QRect newRect = visualRect(newIndex);
- oldRect.setLeft(oldRect.left() - d->indent);
- newRect.setLeft(newRect.left() - d->indent);
- //we need to paint the whole items (including the decoration) so that when the user
- //moves the mouse over those elements they are updated
- viewport()->update(oldRect);
- viewport()->update(newRect);
+ //we need to paint the whole items (including the decoration) so that when the user
+ //moves the mouse over those elements they are updated
+ if (oldBranch >= 0) {
+ int y = d->coordinateForItem(oldBranch);
+ int h = d->itemHeight(oldBranch);
+ viewport()->update(QRect(0, y, viewport()->width(), h));
+ }
+ if (d->hoverBranch >= 0) {
+ int y = d->coordinateForItem(d->hoverBranch);
+ int h = d->itemHeight(d->hoverBranch);
+ viewport()->update(QRect(0, y, viewport()->width(), h));
}
}
break; }
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 4a15cf2..27b490b 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -52,6 +52,7 @@
#include "qstring.h"
#include "qdebug.h"
#include "qimage.h"
+#include "qcombobox.h"
#include "private/qkeymapper_p.h"
#include "private/qfont_p.h"
#ifndef QT_NO_STYLE_S60
@@ -1254,11 +1255,13 @@ void qt_init(QApplicationPrivate * /* priv */, int)
}
#endif
+#ifdef QT_KEYPAD_NAVIGATION
if (touch) {
QApplicationPrivate::navigationMode = Qt::NavigationModeNone;
} else {
QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadDirectional;
}
+#endif
#ifndef QT_NO_CURSOR
//Check if window server pointer cursors are supported or not
@@ -1407,11 +1410,13 @@ void QApplicationPrivate::leaveModal_sys(QWidget *widget)
void QApplicationPrivate::openPopup(QWidget *popup)
{
+ if (popup && qobject_cast<QComboBox *>(popup->parentWidget()))
+ static_cast<QSymbianControl *>(popup->effectiveWinId())->FadeBehindPopup(ETrue);
+
if (!QApplicationPrivate::popupWidgets)
QApplicationPrivate::popupWidgets = new QWidgetList;
QApplicationPrivate::popupWidgets->append(popup);
-
// Cancel focus widget pointer capture and long tap timer
if (QApplication::focusWidget()) {
static_cast<QSymbianControl*>(QApplication::focusWidget()->effectiveWinId())->CancelLongTapTimer();
@@ -1450,6 +1455,9 @@ void QApplicationPrivate::openPopup(QWidget *popup)
void QApplicationPrivate::closePopup(QWidget *popup)
{
+ if (popup && qobject_cast<QComboBox *>(popup->parentWidget()))
+ static_cast<QSymbianControl *>(popup->effectiveWinId())->FadeBehindPopup(EFalse);
+
if (!QApplicationPrivate::popupWidgets)
return;
QApplicationPrivate::popupWidgets->removeAll(popup);
diff --git a/src/gui/kernel/qcursor_s60.cpp b/src/gui/kernel/qcursor_s60.cpp
index 54a9176..68e079e 100644
--- a/src/gui/kernel/qcursor_s60.cpp
+++ b/src/gui/kernel/qcursor_s60.cpp
@@ -44,7 +44,7 @@
#include <private/qapplication_p.h>
#include <coecntrl.h>
#include <qcursor.h>
-#include <qt_s60_p.h>
+#include <private/qt_s60_p.h>
#include <qbitmap.h>
#include <w32std.h>
#include <qapplication.h>
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index e5310ea..af5fcd1 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -6171,6 +6171,8 @@ void QWidget::setFocus(Qt::FocusReason reason)
previousProxyFocus = topData->proxyWidget->widget()->focusWidget();
if (previousProxyFocus && previousProxyFocus->focusProxy())
previousProxyFocus = previousProxyFocus->focusProxy();
+ if (previousProxyFocus == this && !topData->proxyWidget->d_func()->proxyIsGivingFocus)
+ return;
}
}
#endif
diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp
index d05c7e4..b25dce5 100644
--- a/src/gui/painting/qwindowsurface_s60.cpp
+++ b/src/gui/painting/qwindowsurface_s60.cpp
@@ -44,8 +44,8 @@
#include <QtGui/qpaintdevice.h>
#include <private/qwidget_p.h>
#include "qwindowsurface_s60_p.h"
-#include "qpixmap_s60_p.h"
-#include "qt_s60_p.h"
+#include <private/qpixmap_s60_p.h>
+#include <private/qt_s60_p.h>
#include "private/qdrawhelper_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/gui/s60framework/s60framework.pri b/src/gui/s60framework/s60framework.pri
index 6080e6d..e177a33 100644
--- a/src/gui/s60framework/s60framework.pri
+++ b/src/gui/s60framework/s60framework.pri
@@ -9,6 +9,8 @@ minimalAppResource31 = \
"END"
MMP_RULES += minimalAppResource31
+SYMBIAN_RESOURCES += s60framework/s60main.rss
+
SOURCES += s60framework/qs60mainapplication.cpp \
s60framework/qs60mainappui.cpp \
s60framework/qs60maindocument.cpp
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index bf5a62e..a2ebebb 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -104,11 +104,11 @@ const int QS60StylePrivate::m_numberOfLayouts =
const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = {
// *** generated pixel metrics ***
-{5,0,-909,0,0,2,0,0,-1,7,12,19,13,13,6,200,-909,-909,-909,20,13,2,0,0,21,7,18,-909,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,4,4,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1},
-{5,0,-909,0,0,1,0,0,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,-909,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,3,3,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1},
-{7,0,-909,0,0,2,0,0,-1,25,69,28,19,19,9,258,-909,-909,-909,23,19,26,0,0,32,25,72,-909,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,13,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1},
-{7,0,-909,0,0,2,0,0,-1,25,68,28,19,19,9,258,-909,-909,-909,31,19,6,0,0,32,25,60,-909,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,12,12,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1},
-{7,0,-909,0,0,2,0,0,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,-909,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1}
+{5,0,-909,0,0,2,0,0,-1,7,12,19,13,13,6,200,-909,-909,-909,20,13,2,0,0,21,7,18,0,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,4,4,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1},
+{5,0,-909,0,0,1,0,0,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,0,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,3,3,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1},
+{7,0,-909,0,0,2,0,0,-1,25,69,28,19,19,9,258,-909,-909,-909,23,19,26,0,0,32,25,72,0,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,13,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1},
+{7,0,-909,0,0,2,0,0,-1,25,68,28,19,19,9,258,-909,-909,-909,31,19,6,0,0,32,25,60,0,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,12,12,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1},
+{7,0,-909,0,0,2,0,0,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,0,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1}
// *** End of generated data ***
};
@@ -2475,6 +2475,9 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
{
int retValue = -1;
switch (sh) {
+ case SH_ComboBox_Popup:
+ retValue = true;
+ break;
case SH_Table_GridLineColor:
retValue = int(QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors, 2, 0).rgba());
break;
@@ -2690,6 +2693,19 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
height - 2 * frameThickness);
}
break;
+ case SC_ComboBoxListBoxPopup: {
+ const QRect desktopContent = QApplication::desktop()->availableGeometry();
+
+ // take the size of this and position bottom above available area
+ QRect popupRect;
+ const int width = desktopContent.width() - pixelMetric(PM_LayoutRightMargin) - pixelMetric(PM_LayoutLeftMargin);
+ popupRect.setWidth(width);
+ popupRect.setHeight(desktopContent.height()); //combobox resets height anyway based on content
+ popupRect.setBottom(desktopContent.bottom());
+ popupRect.translate(pixelMetric(PM_LayoutLeftMargin), 0);
+ ret = popupRect;
+ }
+ break;
default:
break;
}
@@ -2844,9 +2860,13 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con
ret = menuItem->rect;
if (element == SE_ItemViewItemDecoration) {
- if (menuItem->direction == Qt::RightToLeft)
- ret.translate(ret.width()-indicatorWidth, 0);
- ret.setWidth(indicatorWidth);
+ if (menuItem->icon.isNull()) {
+ ret = QRect();
+ } else {
+ if (menuItem->direction == Qt::RightToLeft)
+ ret.translate(ret.width()-indicatorWidth, 0);
+ ret.setWidth(indicatorWidth);
+ }
} else {
ret = menuItem->rect;
if (!menuItem->icon.isNull())
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index dd9e69e..9b85c04 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -73,7 +73,7 @@
#endif
#endif
#ifdef Q_OS_SYMBIAN
-#include "qt_s60_p.h"
+#include <private/qt_s60_p.h>
#endif
#include <QMutexLocker>
diff --git a/src/gui/text/qfont_s60.cpp b/src/gui/text/qfont_s60.cpp
index 52c77d6..ccd17a2 100644
--- a/src/gui/text/qfont_s60.cpp
+++ b/src/gui/text/qfont_s60.cpp
@@ -40,8 +40,8 @@
****************************************************************************/
#include "qfont.h"
-#include "qt_s60_p.h"
-#include "qpixmap_s60_p.h"
+#include <private/qt_s60_p.h>
+#include <private/qpixmap_s60_p.h>
#include "qmutex.h"
QT_BEGIN_NAMESPACE
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
index 87a73df..621f666 100644
--- a/src/gui/text/qfontdatabase_s60.cpp
+++ b/src/gui/text/qfontdatabase_s60.cpp
@@ -45,8 +45,8 @@
#include "qfontengine_s60_p.h"
#include "qabstractfileengine.h"
#include "qdesktopservices.h"
-#include "qpixmap_s60_p.h"
-#include "qt_s60_p.h"
+#include <private/qpixmap_s60_p.h>
+#include <private/qt_s60_p.h>
#include "qendian.h"
#include <private/qcore_symbian_p.h>
#if defined(QT_NO_FREETYPE)
diff --git a/src/gui/util/util.pri b/src/gui/util/util.pri
index 3074367..bd2af85 100644
--- a/src/gui/util/util.pri
+++ b/src/gui/util/util.pri
@@ -41,5 +41,12 @@ embedded {
symbian {
LIBS += -lsendas2 -letext -lapmime
- contains(QT_CONFIG, s60): LIBS += -lplatformenv -lCommonUI
+ contains(QT_CONFIG, s60) {
+ LIBS += -lplatformenv
+ contains(CONFIG, is_using_gnupoc) {
+ LIBS += -lcommonui
+ } else {
+ LIBS += -lCommonUI
+ }
+ }
}
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index f71d250..c16f18a 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -532,9 +532,11 @@ void QComboBoxPrivateContainer::setItemView(QAbstractItemView *itemView)
QStyleOptionComboBox opt = comboStyleOption();
const bool usePopup = combo->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, combo);
#ifndef QT_NO_SCROLLBAR
+#ifndef Q_WS_S60
if (usePopup)
view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
#endif
+#endif
if (combo->style()->styleHint(QStyle::SH_ComboBox_ListMouseTracking, &opt, combo) ||
usePopup) {
view->setMouseTracking(true);
@@ -2417,24 +2419,44 @@ void QComboBox::showPopup()
// Position horizontally.
listRect.moveLeft(above.x());
+#ifndef Q_WS_S60
// Position vertically so the curently selected item lines up
// with the combo box.
const QRect currentItemRect = view()->visualRect(view()->currentIndex());
const int offset = listRect.top() - currentItemRect.top();
listRect.moveTop(above.y() + offset - listRect.top());
+#endif
// Clamp the listRect height and vertical position so we don't expand outside the
// available screen geometry.This may override the vertical position, but it is more
// important to show as much as possible of the popup.
const int height = !boundToScreen ? listRect.height() : qMin(listRect.height(), screen.height());
+#ifdef Q_WS_S60
+ //popup needs to be stretched with screen minimum dimension
+ listRect.setHeight(qMin(screen.height(), screen.width()));
+#else
listRect.setHeight(height);
+#endif
+
if (boundToScreen) {
if (listRect.top() < screen.top())
listRect.moveTop(screen.top());
if (listRect.bottom() > screen.bottom())
listRect.moveBottom(screen.bottom());
}
+#ifdef Q_WS_S60
+ if (screen.width() < screen.height()) {
+ // in portait, menu should be positioned above softkeys
+ listRect.moveBottom(screen.bottom());
+ } else {
+ // landscape, menu should be at the right and horizontally centered
+ listRect.setWidth(listRect.height());
+ listRect.moveCenter(screen.center());
+ (opt.direction == Qt::LeftToRight) ? listRect.setRight(screen.right()) :
+ listRect.setLeft(screen.left());
+ }
+#endif
} else if (!boundToScreen || listRect.height() <= belowHeight) {
listRect.moveTopLeft(below);
} else if (listRect.height() <= aboveHeight) {
@@ -2643,6 +2665,34 @@ void QComboBox::changeEvent(QEvent *e)
if (d->lineEdit)
d->updateLineEditGeometry();
d->setLayoutItemMargins(QStyle::SE_ComboBoxLayoutItem);
+
+#ifdef Q_WS_S60
+ if (d->container) {
+ QStyleOptionComboBox opt;
+ initStyleOption(&opt);
+
+ if (style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, this)) {
+ const QRect screen = d->popupGeometry(QApplication::desktop()->screenNumber(this));
+
+ QRect listRect(style()->subControlRect(QStyle::CC_ComboBox, &opt,
+ QStyle::SC_ComboBoxListBoxPopup, this));
+ listRect.setHeight(qMin(screen.height(), screen.width()));
+
+ if (screen.width() < screen.height()) {
+ // in portait, menu should be positioned above softkeys
+ listRect.moveBottom(screen.bottom());
+ } else {
+ // landscape, menu should be at the right and horizontally centered
+ listRect.setWidth(listRect.height());
+ listRect.moveCenter(screen.center());
+ (opt.direction == Qt::LeftToRight) ? listRect.setRight(screen.right()) :
+ listRect.setLeft(screen.left());
+ }
+ d->container->setGeometry(listRect);
+ }
+ }
+#endif
+
// ### need to update scrollers etc. as well here
break;
case QEvent::EnabledChange:
diff --git a/src/gui/widgets/qcombobox_p.h b/src/gui/widgets/qcombobox_p.h
index 74dfdc9..92d85cc 100644
--- a/src/gui/widgets/qcombobox_p.h
+++ b/src/gui/widgets/qcombobox_p.h
@@ -270,7 +270,9 @@ protected:
const QStyleOptionViewItem &option,
const QModelIndex &index) const {
QStyleOptionMenuItem opt = getStyleOption(option, index);
+#ifndef Q_WS_S60
painter->fillRect(option.rect, opt.palette.background());
+#endif
mCombo->style()->drawControl(QStyle::CE_MenuItem, &opt, painter, mCombo);
}
QSize sizeHint(const QStyleOptionViewItem &option,
diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp
index 7224768..4a9cfed 100644
--- a/src/gui/widgets/qmenu_symbian.cpp
+++ b/src/gui/widgets/qmenu_symbian.cpp
@@ -48,7 +48,7 @@
#include <private/qapplication_p.h>
#include <private/qmenu_p.h>
#include <private/qmenubar_p.h>
-#include <qt_s60_p.h>
+#include <private/qt_s60_p.h>
#include <QtCore/qlibrary.h>
#ifdef Q_WS_S60
diff --git a/src/gui/widgets/qsplitter.cpp b/src/gui/widgets/qsplitter.cpp
index 965094e..f4076eb 100644
--- a/src/gui/widgets/qsplitter.cpp
+++ b/src/gui/widgets/qsplitter.cpp
@@ -1276,7 +1276,6 @@ void QSplitter::childEvent(QChildEvent *c)
if (!c->child()->isWidgetType())
return;
QWidget *w = static_cast<QWidget*>(c->child());
-
if (c->added() && !d->blockChildAdd && !w->isWindow() && !d->findWidget(w)) {
d->insertWidget_helper(d->list.count(), w, false);
} else if (c->polished() && !d->blockChildAdd) {
@@ -1313,18 +1312,16 @@ void QSplitter::setRubberBand(int pos)
const int rBord = 3; // customizable?
int hw = handleWidth();
if (!d->rubberBand) {
- d->rubberBand = new QRubberBand(QRubberBand::Line);
+ QBoolBlocker b(d->blockChildAdd);
+ d->rubberBand = new QRubberBand(QRubberBand::Line, this);
// For accessibility to identify this special widget.
d->rubberBand->setObjectName(QLatin1String("qt_rubberband"));
}
- if (d->orient == Qt::Horizontal)
- d->rubberBand->setGeometry(QRect(QPoint(pos + hw / 2 - rBord, r.y()),
- QSize(2 * rBord, r.height())).translated(mapToGlobal(QPoint())));
- else
- d->rubberBand->setGeometry(QRect(QPoint(r.x(), pos + hw / 2 - rBord),
- QSize(r.width(), 2 * rBord)).translated(mapToGlobal(QPoint())));
- if (!d->rubberBand->isVisible())
- d->rubberBand->show();
+
+ const QRect newGeom = d->orient == Qt::Horizontal ? QRect(QPoint(pos + hw / 2 - rBord, r.y()), QSize(2 * rBord, r.height()))
+ : QRect(QPoint(r.x(), pos + hw / 2 - rBord), QSize(r.width(), 2 * rBord));
+ d->rubberBand->setGeometry(newGeom);
+ d->rubberBand->show();
}
/*!
@@ -1555,16 +1552,14 @@ QSize QSplitter::sizeHint() const
ensurePolished();
int l = 0;
int t = 0;
- QObjectList childList = children();
- for (int i = 0; i < childList.size(); ++i) {
- if (QWidget *w = qobject_cast<QWidget *>(childList.at(i))) {
- if (w->isHidden())
- continue;
- QSize s = w->sizeHint();
- if (s.isValid()) {
- l += d->pick(s);
- t = qMax(t, d->trans(s));
- }
+ for (int i = 0; i < d->list.size(); ++i) {
+ QWidget *w = d->list.at(i)->widget;
+ if (w->isHidden())
+ continue;
+ QSize s = w->sizeHint();
+ if (s.isValid()) {
+ l += d->pick(s);
+ t = qMax(t, d->trans(s));
}
}
return orientation() == Qt::Horizontal ? QSize(l, t) : QSize(t, l);
diff --git a/src/gui/widgets/widgets.pri b/src/gui/widgets/widgets.pri
index 6883dd8..937b8d6 100644
--- a/src/gui/widgets/widgets.pri
+++ b/src/gui/widgets/widgets.pri
@@ -164,6 +164,6 @@ wince*: {
!static: QMAKE_WRITE_DEFAULT_RC = 1
}
-symbian*: {
+symbian: {
SOURCES += widgets/qmenu_symbian.cpp
}