summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r--src/widgets/widgets/qabstractscrollarea.cpp10
-rw-r--r--src/widgets/widgets/qcombobox.cpp66
-rw-r--r--src/widgets/widgets/qcombobox_p.h4
-rw-r--r--src/widgets/widgets/qmenu.cpp10
-rw-r--r--src/widgets/widgets/qmenu_p.h50
-rw-r--r--src/widgets/widgets/qmenubar.cpp48
-rw-r--r--src/widgets/widgets/qmenubar_p.h43
-rw-r--r--src/widgets/widgets/qtabbar.cpp39
8 files changed, 5 insertions, 265 deletions
diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp
index f9eda3f10a..ba9aa155fc 100644
--- a/src/widgets/widgets/qabstractscrollarea.cpp
+++ b/src/widgets/widgets/qabstractscrollarea.cpp
@@ -306,11 +306,6 @@ void QAbstractScrollAreaPrivate::init()
viewport->grabGesture(Qt::PanGesture);
# endif
#endif
-#ifdef Q_WS_MAEMO_5
-# ifndef QT_NO_GESTURES
- // viewport->grabGesture(Qt::TouchFlickGesture);
-# endif
-#endif
}
#ifdef Q_WS_WIN
@@ -564,11 +559,6 @@ void QAbstractScrollArea::setViewport(QWidget *widget)
d->viewport->grabGesture(Qt::PanGesture);
#endif
#endif
-#ifdef Q_WS_MAEMO_5
-#ifndef QT_NO_GESTURES
-// d->viewport->grabGesture(Qt::TouchFlickGesture);
-#endif
-#endif
d->layoutChildren();
if (isVisible())
d->viewport->show();
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index 32780a07b3..56a59953bd 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -74,9 +74,6 @@
#ifndef QT_NO_EFFECTS
# include <private/qeffects_p.h>
#endif
-#if defined(Q_WS_S60)
-#include "private/qt_s60_p.h"
-#endif
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
@@ -549,11 +546,9 @@ 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);
@@ -2339,11 +2334,7 @@ void QComboBox::showPopup()
initStyleOption(&opt);
QRect listRect(style->subControlRect(QStyle::CC_ComboBox, &opt,
QStyle::SC_ComboBoxListBoxPopup, this));
-#ifndef Q_WS_S60
QRect screen = d->popupGeometry(QApplication::desktop()->screenNumber(this));
-#else
- QRect screen = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect());
-#endif
QPoint below = mapToGlobal(listRect.bottomLeft());
int belowHeight = screen.bottom() - below.y();
@@ -2436,14 +2427,11 @@ 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
@@ -2457,23 +2445,6 @@ void QComboBox::showPopup()
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 {
- TRect staConTopRect = TRect();
- AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStaconTop, staConTopRect);
- listRect.setWidth(listRect.height());
- //by default popup is centered on screen in landscape
- listRect.moveCenter(screen.center());
- if (staConTopRect.IsEmpty() && AknLayoutUtils::CbaLocation() != AknLayoutUtils::EAknCbaLocationBottom) {
- // landscape without stacon, menu should be at the right
- (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) {
@@ -2692,39 +2663,6 @@ void QComboBox::changeEvent(QEvent *e)
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)) {
- QRect screen = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect());
-
- 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 {
- TRect staConTopRect = TRect();
- AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStaconTop, staConTopRect);
- listRect.setWidth(listRect.height());
- //by default popup is centered on screen in landscape
- listRect.moveCenter(screen.center());
- if (staConTopRect.IsEmpty() && AknLayoutUtils::CbaLocation() != AknLayoutUtils::EAknCbaLocationBottom) {
- // landscape without stacon, menu should be at the right
- (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:
@@ -2753,10 +2691,6 @@ void QComboBox::changeEvent(QEvent *e)
void QComboBox::resizeEvent(QResizeEvent *)
{
Q_D(QComboBox);
-#ifdef Q_WS_S60
- if (d->viewContainer() && d->viewContainer()->isVisible())
- showPopup();
-#endif
d->updateLineEditGeometry();
}
diff --git a/src/widgets/widgets/qcombobox_p.h b/src/widgets/widgets/qcombobox_p.h
index b430a1bfe1..68b52aeac2 100644
--- a/src/widgets/widgets/qcombobox_p.h
+++ b/src/widgets/widgets/qcombobox_p.h
@@ -200,9 +200,7 @@ protected:
menuOpt.menuItemType = QStyleOptionMenuItem::Scroller;
if (sliderAction == QAbstractSlider::SliderSingleStepAdd)
menuOpt.state |= QStyle::State_DownArrow;
-#ifndef Q_WS_S60
p.eraseRect(rect());
-#endif
style()->drawControl(QStyle::CE_MenuScroller, &menuOpt, &p);
}
@@ -272,9 +270,7 @@ 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/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index d1296af78a..37d9e34b68 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -2893,16 +2893,6 @@ void QMenu::actionEvent(QActionEvent *e)
d->wce_menu->syncAction(e->action());
#endif
-#ifdef Q_WS_S60
- if (!d->symbian_menu)
- d->symbian_menu = new QMenuPrivate::QSymbianMenuPrivate;
- if (e->type() == QEvent::ActionAdded)
- d->symbian_menu->addAction(e->action(), d->symbian_menu->findAction(e->before()));
- else if (e->type() == QEvent::ActionRemoved)
- d->symbian_menu->removeAction(e->action());
- else if (e->type() == QEvent::ActionChanged)
- d->symbian_menu->syncAction(e->action());
-#endif
if (isVisible()) {
d->updateActionRects();
resize(sizeHint());
diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h
index c8db4e3e8b..af236c1c8f 100644
--- a/src/widgets/widgets/qmenu_p.h
+++ b/src/widgets/widgets/qmenu_p.h
@@ -61,22 +61,10 @@
#include "QtCore/qbasictimer.h"
#include "private/qwidget_p.h"
-
-#ifdef Q_WS_S60
-class CEikMenuPane;
-#define QT_SYMBIAN_FIRST_MENU_ITEM 32000
-#define QT_SYMBIAN_LAST_MENU_ITEM 41999 // 10000 items ought to be enough for anybody...
-#endif
QT_BEGIN_NAMESPACE
#ifndef QT_NO_MENU
-#ifdef Q_WS_S60
-void qt_symbian_next_menu_from_action(QWidget* actionContainer);
-void qt_symbian_show_toplevel(CEikMenuPane* menuPane);
-void qt_symbian_show_submenu(CEikMenuPane* menuPane, int id);
-#endif // Q_WS_S60
-
class QTornOffMenu;
class QEventLoop;
@@ -88,15 +76,6 @@ struct QWceMenuAction {
QWceMenuAction() : menuHandle(0), command(0) {}
};
#endif
-#ifdef Q_WS_S60
-struct QSymbianMenuAction {
- uint command;
- int parent;
- CEikMenuPane* menuPane;
- QPointer<QAction> action;
- QSymbianMenuAction() : command(0) {}
-};
-#endif
class QMenuPrivate : public QWidgetPrivate
{
@@ -115,9 +94,6 @@ public:
#if defined(Q_WS_WINCE) && !defined(QT_NO_MENUBAR)
,wce_menu(0)
#endif
-#ifdef Q_WS_S60
- ,symbian_menu(0)
-#endif
{ }
~QMenuPrivate()
{
@@ -126,10 +102,6 @@ public:
#if defined(Q_WS_WINCE) && !defined(QT_NO_MENUBAR)
delete wce_menu;
#endif
-#ifdef Q_WS_S60
- delete symbian_menu;
-#endif
-
}
void init();
@@ -281,28 +253,6 @@ public:
HMENU wceMenu();
QAction* wceCommands(uint command);
#endif
-#if defined(Q_WS_S60)
- struct QSymbianMenuPrivate {
- QList<QSymbianMenuAction*> actionItems;
- QSymbianMenuPrivate();
- ~QSymbianMenuPrivate();
- void addAction(QAction *, QSymbianMenuAction* =0);
- void addAction(QSymbianMenuAction *, QSymbianMenuAction* =0);
- void syncAction(QSymbianMenuAction *);
- inline void syncAction(QAction *a) { syncAction(findAction(a)); }
- void removeAction(QSymbianMenuAction *);
- void rebuild(bool reCreate = false);
- inline void removeAction(QAction *a) { removeAction(findAction(a)); }
- inline QSymbianMenuAction *findAction(QAction *a) {
- for(int i = 0; i < actionItems.size(); i++) {
- QSymbianMenuAction *act = actionItems[i];
- if(a == act->action)
- return act;
- }
- return 0;
- }
- } *symbian_menu;
-#endif
QPointer<QWidget> noReplayFor;
};
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index a0c9ae0f28..f353d430c8 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -788,10 +788,6 @@ QMenuBar::~QMenuBar()
if (qt_wince_is_mobile())
d->wceDestroyMenuBar();
#endif
-#ifdef Q_WS_S60
- Q_D(QMenuBar);
- d->symbianDestroyMenuBar();
-#endif
}
/*!
@@ -1043,7 +1039,7 @@ void QMenuBar::paintEvent(QPaintEvent *e)
*/
void QMenuBar::setVisible(bool visible)
{
-#if defined(Q_OS_MAC) || defined(Q_OS_WINCE) || defined(Q_WS_S60)
+#if defined(Q_OS_MAC) || defined(Q_OS_WINCE)
if (isNativeMenuBar()) {
if (!visible)
QWidget::setVisible(false);
@@ -1249,9 +1245,7 @@ void QMenuBar::actionEvent(QActionEvent *e)
if (d->platformMenuBar) {
QPlatformMenuBar *nativeMenuBar = d->platformMenuBar;
-#if defined(Q_WS_S60)
- QMenuBarPrivate::QSymbianMenuBarPrivate *nativeMenuBar = d->symbian_menubar;
-#elif defined(Q_WS_WINCE)
+#if defined(Q_WS_WINCE)
QMenuBarPrivate::QWceMenuBarPrivate *nativeMenuBar = d->wce_menubar;
#endif
if (!nativeMenuBar)
@@ -1348,38 +1342,6 @@ void QMenuBarPrivate::handleReparent()
if (qt_wince_is_mobile() && wce_menubar)
wce_menubar->rebuild();
#endif
-#ifdef Q_WS_S60
-
- // Construct symbian_menubar when this code path is entered first time
- // and when newParent != NULL
- if (!symbian_menubar)
- symbianCreateMenuBar(newParent);
-
- // Reparent and rebuild menubar when parent is changed
- if (symbian_menubar) {
- if (oldParent != newParent)
- reparentMenuBar(oldParent, newParent);
- q->hide();
- symbian_menubar->rebuild();
- }
-
-#ifdef QT_SOFTKEYS_ENABLED
- // Constuct menuBarAction when this code path is entered first time
- if (!menuBarAction) {
- if (newParent) {
- menuBarAction = QSoftKeyManager::createAction(QSoftKeyManager::MenuSoftKey, newParent);
- newParent->addAction(menuBarAction);
- }
- } else {
- // If reparenting i.e. we already have menuBarAction, remove it from old parent
- // and add for a new parent
- if (oldParent)
- oldParent->removeAction(menuBarAction);
- if (newParent)
- newParent->addAction(menuBarAction);
- }
-#endif // QT_SOFTKEYS_ENABLED
-#endif // Q_WS_S60
}
/*!
@@ -1564,7 +1526,7 @@ QRect QMenuBar::actionGeometry(QAction *act) const
QSize QMenuBar::minimumSizeHint() const
{
Q_D(const QMenuBar);
-#if defined(Q_OS_MAC) || defined(Q_WS_WINCE) || defined(Q_WS_S60)
+#if defined(Q_OS_MAC) || defined(Q_WS_WINCE)
const bool as_gui_menubar = !isNativeMenuBar();
#else
const bool as_gui_menubar = true;
@@ -1620,7 +1582,7 @@ QSize QMenuBar::minimumSizeHint() const
QSize QMenuBar::sizeHint() const
{
Q_D(const QMenuBar);
-#if defined(Q_OS_MAC) || defined(Q_WS_WINCE) || defined(Q_WS_S60)
+#if defined(Q_OS_MAC) || defined(Q_WS_WINCE)
const bool as_gui_menubar = !isNativeMenuBar();
#else
const bool as_gui_menubar = true;
@@ -1679,7 +1641,7 @@ QSize QMenuBar::sizeHint() const
int QMenuBar::heightForWidth(int) const
{
Q_D(const QMenuBar);
-#if defined(Q_OS_MAC) || defined(Q_WS_WINCE) || defined(Q_WS_S60)
+#if defined(Q_OS_MAC) || defined(Q_WS_WINCE)
const bool as_gui_menubar = !isNativeMenuBar();
#else
const bool as_gui_menubar = true;
diff --git a/src/widgets/widgets/qmenubar_p.h b/src/widgets/widgets/qmenubar_p.h
index a73ec1ddde..a15a1e432e 100644
--- a/src/widgets/widgets/qmenubar_p.h
+++ b/src/widgets/widgets/qmenubar_p.h
@@ -61,13 +61,6 @@
#include "qguifunctions_wince.h"
#endif
-#ifndef QT_NO_MENUBAR
-#ifdef Q_WS_S60
-class CCoeControl;
-class CEikMenuBar;
-#endif
-#endif
-
QT_BEGIN_NAMESPACE
#ifndef QT_NO_MENUBAR
@@ -83,10 +76,6 @@ public:
#ifdef Q_WS_WINCE
, wce_menubar(0), wceClassicMenu(false)
#endif
-#ifdef Q_WS_S60
- , symbian_menubar(0)
-#endif
-
{ }
~QMenuBarPrivate()
{
@@ -94,9 +83,6 @@ public:
#ifdef Q_WS_WINCE
delete wce_menubar;
#endif
-#ifdef Q_WS_S60
- delete symbian_menubar;
-#endif
}
void init();
@@ -203,35 +189,6 @@ public:
void wceRefresh();
bool wceEmitSignals(QList<QWceMenuAction*> actions, uint command);
#endif
-#ifdef Q_WS_S60
- void symbianCreateMenuBar(QWidget *);
- void symbianDestroyMenuBar();
- void reparentMenuBar(QWidget *oldParent, QWidget *newParent);
- struct QSymbianMenuBarPrivate {
- QList<QSymbianMenuAction*> actionItems;
- QMenuBarPrivate *d;
- QSymbianMenuBarPrivate(QMenuBarPrivate *menubar);
- ~QSymbianMenuBarPrivate();
- void addAction(QAction *, QSymbianMenuAction* =0);
- void addAction(QSymbianMenuAction *, QSymbianMenuAction* =0);
- void syncAction(QSymbianMenuAction *);
- inline void syncAction(QAction *a) { syncAction(findAction(a)); }
- void removeAction(QSymbianMenuAction *);
- void rebuild();
- inline void removeAction(QAction *a) { removeAction(findAction(a)); }
- inline QSymbianMenuAction *findAction(QAction *a) {
- for(int i = 0; i < actionItems.size(); i++) {
- QSymbianMenuAction *act = actionItems[i];
- if(a == act->action)
- return act;
- }
- return 0;
- }
- void insertNativeMenuItems(const QList<QAction*> &actions);
-
- } *symbian_menubar;
- static int symbianCommands(int command);
-#endif
#ifdef QT_SOFTKEYS_ENABLED
QAction *menuBarAction;
#endif
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp
index bf9c7ccb92..d8dc4347d8 100644
--- a/src/widgets/widgets/qtabbar.cpp
+++ b/src/widgets/widgets/qtabbar.cpp
@@ -67,10 +67,6 @@
#include <private/qt_cocoa_helpers_mac_p.h>
#endif
-#ifndef QT_NO_STYLE_S60
-#include "qs60style.h"
-#endif
-
QT_BEGIN_NAMESPACE
@@ -495,9 +491,6 @@ void QTabBarPrivate::layoutTabs()
if (useScrollButtons && tabList.count() && last > available) {
int extra = extraWidth();
-#ifndef QT_NO_STYLE_S60
- QS60Style *s60Style = qobject_cast<QS60Style*>(QApplication::style());
-#endif
if (!vertTabs) {
Qt::LayoutDirection ld = q->layoutDirection();
QRect arrows = QStyle::visualRect(ld, q->rect(),
@@ -505,57 +498,25 @@ void QTabBarPrivate::layoutTabs()
int buttonOverlap = q->style()->pixelMetric(QStyle::PM_TabBar_ScrollButtonOverlap, 0, q);
if (ld == Qt::LeftToRight) {
-// In S60style, tab scroll buttons are layoutted separately, on the sides of the tabbar.
-#ifndef QT_NO_STYLE_S60
- if (s60Style) {
- rightB->setGeometry(arrows.left() + extra / 2, arrows.top(), extra / 2, arrows.height());
- leftB->setGeometry(0, arrows.top(), extra / 2, arrows.height());
- } else {
-#endif
leftB->setGeometry(arrows.left(), arrows.top(), extra/2, arrows.height());
rightB->setGeometry(arrows.right() - extra/2 + buttonOverlap, arrows.top(),
extra/2, arrows.height());
-#ifndef QT_NO_STYLE_S60
- }
-#endif
leftB->setArrowType(Qt::LeftArrow);
rightB->setArrowType(Qt::RightArrow);
} else {
-#ifndef QT_NO_STYLE_S60
- if (s60Style) {
- rightB->setGeometry(arrows.left() + extra / 2, arrows.top(), extra / 2, arrows.height());
- leftB->setGeometry(0, arrows.top(), extra / 2, arrows.height());
- } else {
-#endif
rightB->setGeometry(arrows.left(), arrows.top(), extra/2, arrows.height());
leftB->setGeometry(arrows.right() - extra/2 + buttonOverlap, arrows.top(),
extra/2, arrows.height());
-#ifndef QT_NO_STYLE_S60
- }
-#endif
rightB->setArrowType(Qt::LeftArrow);
leftB->setArrowType(Qt::RightArrow);
}
} else {
-#ifndef QT_NO_STYLE_S60
- if (s60Style) {
- QRect arrows = QRect(0, 0, size.width(), available );
- leftB->setGeometry(arrows.left(), arrows.top(), arrows.width(), extra / 2);
- leftB->setArrowType(Qt::UpArrow);
- rightB->setGeometry(arrows.left(), arrows.bottom() - extra / 2 + 1,
- arrows.width(), extra / 2);
- rightB->setArrowType(Qt::DownArrow);
- } else {
-#endif
QRect arrows = QRect(0, available - extra, size.width(), extra );
leftB->setGeometry(arrows.left(), arrows.top(), arrows.width(), extra/2);
leftB->setArrowType(Qt::UpArrow);
rightB->setGeometry(arrows.left(), arrows.bottom() - extra/2 + 1,
arrows.width(), extra/2);
rightB->setArrowType(Qt::DownArrow);
-#ifndef QT_NO_STYLE_S60
- }
-#endif
}
leftB->setEnabled(scrollOffset > 0);
rightB->setEnabled(last - scrollOffset >= available - extra);