From fc14bd2c92d42aa055ce634e246820cef426ec9c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 20 Oct 2011 16:36:05 +0200 Subject: Widgets: Remove Q_WS_QPA and qpa-sections from .pro files. Enable compilation without -qpa. - Remove conditionals from Q_WS_QPA sections. - Rename precompiled header. - Remove gui-related Q_OS_SYMBIAN-#ifdef sections. - Leave other Q_WS code in for reference. Change-Id: I16326b631fff483aec8edd2f7a2e7a1822eab814 Reviewed-by: Friedemann Kleint --- src/opengl/qglframebufferobject.cpp | 1 + src/widgets/dialogs/dialogs.pri | 5 +- src/widgets/dialogs/qdialog.cpp | 92 +------------------ src/widgets/dialogs/qdialog.h | 6 +- src/widgets/dialogs/qfiledialog.cpp | 6 +- src/widgets/dialogs/qfiledialog_p.h | 5 +- src/widgets/dialogs/qinputdialog.cpp | 7 -- src/widgets/dialogs/qmessagebox.cpp | 19 +--- src/widgets/dialogs/qprogressdialog.cpp | 6 -- src/widgets/graphicsview/qgraphicsitem.cpp | 2 +- src/widgets/kernel/kernel.pri | 107 ++++------------------ src/widgets/kernel/qapplication.cpp | 132 ++------------------------- src/widgets/kernel/qapplication.h | 46 +--------- src/widgets/kernel/qapplication_p.h | 27 ------ src/widgets/kernel/qguiplatformplugin.cpp | 8 +- src/widgets/kernel/qinputcontext.h | 3 - src/widgets/kernel/qt_gui_pch.h | 85 ------------------ src/widgets/kernel/qt_widgets_pch.h | 85 ++++++++++++++++++ src/widgets/kernel/qwidget.cpp | 139 +++-------------------------- src/widgets/kernel/qwidget.h | 39 +------- src/widgets/kernel/qwidget_p.h | 102 +-------------------- src/widgets/styles/styles.pri | 3 +- src/widgets/util/qflickgesture.cpp | 12 --- src/widgets/util/util.pri | 25 +----- src/widgets/widgets.pro | 2 - src/widgets/widgets/qabstractspinbox.cpp | 12 +-- src/widgets/widgets/qlineedit.cpp | 6 +- src/widgets/widgets/qmenu.cpp | 2 - src/widgets/widgets/qwidgettextcontrol.cpp | 6 +- src/widgets/widgets/widgets.pri | 3 +- 30 files changed, 145 insertions(+), 848 deletions(-) delete mode 100644 src/widgets/kernel/qt_gui_pch.h create mode 100644 src/widgets/kernel/qt_widgets_pch.h diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 5e140ab9da..75c1bbe99e 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -49,6 +49,7 @@ #include #include +#include QT_BEGIN_NAMESPACE diff --git a/src/widgets/dialogs/dialogs.pri b/src/widgets/dialogs/dialogs.pri index fbff8c742c..b90eee44c8 100644 --- a/src/widgets/dialogs/dialogs.pri +++ b/src/widgets/dialogs/dialogs.pri @@ -20,7 +20,8 @@ HEADERS += \ dialogs/qfileinfogatherer_p.h \ dialogs/qwizard.h -!qpa:mac { +# TODO +false:mac { OBJECTIVE_SOURCES += dialogs/qfiledialog_mac.mm \ dialogs/qfontdialog_mac.mm \ dialogs/qnspanelproxy_mac.mm @@ -41,8 +42,6 @@ HEADERS += \ } win32 { - qpa:DEFINES += QT_NO_PRINTDIALOG - HEADERS += dialogs/qwizard_win_p.h \ dialogs/qfiledialog_win_p.h SOURCES += dialogs/qdialogsbinarycompat_win.cpp \ diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index 03c5316c04..de71e451a7 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -64,15 +64,6 @@ extern bool qt_wince_is_mobile(); //defined in qguifunctions_wce.cpp extern bool qt_wince_is_smartphone(); //is defined in qguifunctions_wce.cpp #elif defined(Q_WS_X11) # include "../kernel/qt_x11_p.h" -#elif defined(Q_OS_SYMBIAN) -# include "qfiledialog.h" -# include "qfontdialog.h" -# include "qwizard.h" -# include "private/qt_s60_p.h" -#endif - -#if defined(Q_WS_S60) -#include // AknLayoutUtils #endif #ifndef SPI_GETSNAPTODEFBUTTON @@ -378,7 +369,7 @@ void QDialogPrivate::resetModalitySetByOpen() resetModalityTo = -1; } -#if defined(Q_WS_WINCE) || defined(Q_OS_SYMBIAN) +#if defined(Q_WS_WINCE) #ifdef Q_WS_WINCE_WM void QDialogPrivate::_q_doneAction() { @@ -514,13 +505,6 @@ int QDialog::exec() #endif //Q_WS_WINCE_WM bool showSystemDialogFullScreen = false; -#ifdef Q_OS_SYMBIAN - if (qobject_cast(this) || qobject_cast(this) || - qobject_cast(this)) { - showSystemDialogFullScreen = true; - } -#endif // Q_OS_SYMBIAN - if (showSystemDialogFullScreen) { setWindowFlags(windowFlags() | Qt::WindowSoftkeysVisibleHint); setWindowState(Qt::WindowFullScreen); @@ -808,13 +792,6 @@ void QDialog::adjustPosition(QWidget* w) if (X11->isSupportedByWM(ATOM(_NET_WM_FULL_PLACEMENT))) return; #endif - -#ifdef Q_OS_SYMBIAN - if (symbianAdjustedPosition()) - //dialog has already been positioned - return; -#endif - QPoint p(0, 0); int extraw = 0, extrah = 0, scrn = 0; if (w) @@ -878,73 +855,6 @@ void QDialog::adjustPosition(QWidget* w) move(p); } -#if defined(Q_OS_SYMBIAN) -/*! \internal */ -bool QDialog::symbianAdjustedPosition() -{ -#if defined(Q_WS_S60) - QPoint p; - QPoint oldPos = pos(); - if (isFullScreen()) { - p.setX(0); - p.setY(0); - } else if (isMaximized()) { - TRect statusPaneRect = TRect(); - if (S60->screenHeightInPixels > S60->screenWidthInPixels) { - AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStatusPane, statusPaneRect); - } else { - AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStaconTop, statusPaneRect); - } - - p.setX(0); - p.setY(statusPaneRect.Height()); - } else { - // naive way to deduce screen orientation - if (S60->screenHeightInPixels > S60->screenWidthInPixels) { - int cbaHeight; - TRect rect; - AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, rect); - cbaHeight = rect.Height(); - p.setY(S60->screenHeightInPixels - height() - cbaHeight); - p.setX(0); - } else { - const int scrollbarWidth = style()->pixelMetric(QStyle::PM_ScrollBarExtent); - TRect staConTopRect = TRect(); - AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStaconTop, staConTopRect); - if (staConTopRect.IsEmpty()) { - TRect cbaRect = TRect(); - AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, cbaRect); - AknLayoutUtils::TAknCbaLocation cbaLocation = AknLayoutUtils::CbaLocation(); - switch (cbaLocation) { - case AknLayoutUtils::EAknCbaLocationBottom: - p.setY(S60->screenHeightInPixels - height() - cbaRect.Height()); - p.setX((S60->screenWidthInPixels - width()) >> 1); - break; - case AknLayoutUtils::EAknCbaLocationRight: - p.setY((S60->screenHeightInPixels - height()) >> 1); - p.setX(qMax(0,S60->screenWidthInPixels - width() - scrollbarWidth - cbaRect.Width())); - break; - case AknLayoutUtils::EAknCbaLocationLeft: - p.setY((S60->screenHeightInPixels - height()) >> 1); - p.setX(qMax(0,scrollbarWidth + cbaRect.Width())); - break; - } - } else { - p.setY((S60->screenHeightInPixels - height()) >> 1); - p.setX(qMax(0,S60->screenWidthInPixels - width())); - } - } - } - if (oldPos != p || p.y() < 0) - move(p); - return true; -#else - // TODO - check positioning requirement for Symbian, non-s60 - return false; -#endif -} -#endif - /*! \obsolete diff --git a/src/widgets/dialogs/qdialog.h b/src/widgets/dialogs/qdialog.h index 6ab7c12ead..d4171ece47 100644 --- a/src/widgets/dialogs/qdialog.h +++ b/src/widgets/dialogs/qdialog.h @@ -103,7 +103,7 @@ public Q_SLOTS: protected: QDialog(QDialogPrivate &, QWidget *parent, Qt::WindowFlags f = 0); -#if defined(Q_WS_WINCE) || defined(Q_OS_SYMBIAN) +#if defined(Q_WS_WINCE) bool event(QEvent *e); #endif void keyPressEvent(QKeyEvent *); @@ -119,10 +119,6 @@ private: Q_DECLARE_PRIVATE(QDialog) Q_DISABLE_COPY(QDialog) -#if defined(Q_OS_SYMBIAN) - bool symbianAdjustedPosition(); -#endif - #ifdef Q_WS_WINCE_WM Q_PRIVATE_SLOT(d_func(), void _q_doneAction()) diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index c74d56dafc..22d334a1ec 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -58,7 +58,7 @@ #include #include #include -#if !defined(Q_WS_WINCE) && !defined(Q_OS_SYMBIAN) +#if !defined(Q_WS_WINCE) #include "ui_qfiledialog.h" #else #define Q_EMBEDDED_SMALLSCREEN @@ -3422,7 +3422,7 @@ QStringList QFSCompleter::splitPath(const QString &path) const parts[0] = sep[0]; #endif -#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) +#if defined(Q_OS_WIN) bool startsFromRoot = !parts.isEmpty() && parts[0].endsWith(QLatin1Char(':')); #else bool startsFromRoot = pathCopy[0] == sep[0]; @@ -3434,7 +3434,7 @@ QStringList QFSCompleter::splitPath(const QString &path) const else dirModel = sourceModel; QString currentLocation = QDir::toNativeSeparators(dirModel->rootPath()); -#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) +#if defined(Q_OS_WIN) if (currentLocation.endsWith(QLatin1Char(':'))) currentLocation.append(sep); #endif diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h index c820202e75..def25f9b14 100644 --- a/src/widgets/dialogs/qfiledialog_p.h +++ b/src/widgets/dialogs/qfiledialog_p.h @@ -182,10 +182,9 @@ public: static inline QString toInternal(const QString &path) { -#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX) || defined(Q_OS_SYMBIAN) +#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) QString n(path); - for (int i = 0; i < (int)n.length(); ++i) - if (n[i] == QLatin1Char('\\')) n[i] = QLatin1Char('/'); + n.replace(QLatin1Char('\\'), QLatin1Char('/')); #if defined(Q_OS_WINCE) if ((n.size() > 1) && (n.startsWith(QLatin1String("//")))) n = n.mid(1); diff --git a/src/widgets/dialogs/qinputdialog.cpp b/src/widgets/dialogs/qinputdialog.cpp index 1c52282ad5..808858a711 100644 --- a/src/widgets/dialogs/qinputdialog.cpp +++ b/src/widgets/dialogs/qinputdialog.cpp @@ -232,11 +232,7 @@ void QInputDialogPrivate::ensureLayout() mainLayout = new QVBoxLayout(q); //we want to let the input dialog grow to available size on Symbian. -#ifndef Q_OS_SYMBIAN mainLayout->setSizeConstraint(QLayout::SetMinAndMaxSize); -#else - label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); -#endif mainLayout->addWidget(label); mainLayout->addWidget(inputWidget); mainLayout->addWidget(buttonBox); @@ -563,9 +559,6 @@ void QInputDialog::setLabelText(const QString &text) } else { d->label->setText(text); } -#ifdef Q_OS_SYMBIAN - d->label->setWordWrap(true); -#endif } QString QInputDialog::labelText() const diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp index 96b8e46570..93e9a34415 100644 --- a/src/widgets/dialogs/qmessagebox.cpp +++ b/src/widgets/dialogs/qmessagebox.cpp @@ -223,9 +223,6 @@ public: bool autoAddOkButton; QAbstractButton *detectedEscapeButton; QLabel *informativeLabel; -#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) - QTextBrowser *textBrowser; -#endif QPointer receiverToDisconnectOnClose; QByteArray memberToDisconnectOnClose; QByteArray signalToDisconnectOnClose; @@ -307,7 +304,7 @@ void QMessageBoxPrivate::updateSize() return; QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size(); -#if defined(Q_WS_QWS) || defined(Q_WS_WINCE) || defined(Q_OS_SYMBIAN) +#if defined(Q_WS_QWS) || defined(Q_WS_WINCE) // the width of the screen, less the window border. int hardLimit = screenSize.width() - (q->frameGeometry().width() - q->geometry().width()); #else @@ -2498,24 +2495,10 @@ void QMessageBox::setInformativeText(const QString &text) #endif label->setWordWrap(true); QGridLayout *grid = static_cast(layout()); -#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) - label->hide(); - QTextBrowser *textBrowser = new QTextBrowser(this); - textBrowser->setOpenExternalLinks(true); - grid->addWidget(textBrowser, 1, 1, 1, 1); - d->textBrowser = textBrowser; -#else grid->addWidget(label, 1, 1, 1, 1); -#endif d->informativeLabel = label; } d->informativeLabel->setText(text); - -#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) - //We need to put the informative label inside textBrowser to enable scrolling of long texts. - d->textBrowser->setText(d->informativeLabel->text()); -#endif - d->updateSize(); } diff --git a/src/widgets/dialogs/qprogressdialog.cpp b/src/widgets/dialogs/qprogressdialog.cpp index 4e31abf3e4..c38d79e58c 100644 --- a/src/widgets/dialogs/qprogressdialog.cpp +++ b/src/widgets/dialogs/qprogressdialog.cpp @@ -154,12 +154,6 @@ void QProgressDialogPrivate::layout() bool(q->style()->styleHint(QStyle::SH_ProgressDialog_CenterCancelButton, 0, q)); int additionalSpacing = 0; -#ifdef Q_OS_SYMBIAN - //In Symbian, we need to have wider margins for dialog borders, as the actual border is some pixels - //inside the dialog area (to enable transparent borders) - additionalSpacing = mlr; -#endif - QSize cs = cancel ? cancel->sizeHint() : QSize(0,0); QSize bh = bar->sizeHint(); int cspc; diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index 756c2f2aac..060a3da05f 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -7391,7 +7391,7 @@ void QGraphicsItem::setInputMethodHints(Qt::InputMethodHints hints) */ void QGraphicsItem::updateMicroFocus() { -#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) +#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS)) if (QWidget *fw = QApplication::focusWidget()) { if (scene()) { for (int i = 0 ; i < scene()->views().count() ; ++i) { diff --git a/src/widgets/kernel/kernel.pri b/src/widgets/kernel/kernel.pri index c59a0463e0..3cae5e477b 100644 --- a/src/widgets/kernel/kernel.pri +++ b/src/widgets/kernel/kernel.pri @@ -1,8 +1,7 @@ # Qt kernel module # Only used on platforms with CONFIG += precompile_header -PRECOMPILED_HEADER = kernel/qt_gui_pch.h - +PRECOMPILED_HEADER = kernel/qt_widgets_pch.h KERNEL_P= kernel HEADERS += \ @@ -31,8 +30,8 @@ HEADERS += \ kernel/qstackedlayout.h \ kernel/qtooltip.h \ kernel/qwhatsthis.h \ - kernel/qwidget.h \ - kernel/qwidget_p.h \ + kernel/qwidget.h \ + kernel/qwidget_p.h \ kernel/qwidgetaction.h \ kernel/qwidgetaction_p.h \ kernel/qgesture.h \ @@ -41,8 +40,11 @@ HEADERS += \ kernel/qgesturerecognizer.h \ kernel/qgesturemanager_p.h \ kernel/qsoftkeymanager_p.h \ - kernel/qsoftkeymanager_common_p.h \ - kernel/qguiplatformplugin_p.h + kernel/qsoftkeymanager_common_p.h \ + kernel/qguiplatformplugin_p.h \ + kernel/qdesktopwidget_qpa_p.h \ + kernel/qwidgetwindow_qpa_p.h \ + kernel/qplatformmenu_qpa.h SOURCES += \ kernel/qaction.cpp \ @@ -73,90 +75,15 @@ SOURCES += \ kernel/qsoftkeymanager.cpp \ kernel/qdesktopwidget.cpp \ kernel/qguiplatformplugin.cpp \ - kernel/qwidgetsvariant.cpp - -win32: DEFINES += QT_NO_DIRECTDRAW - -win32:!qpa { - HEADERS += \ - kernel/qwinnativepangesturerecognizer_win_p.h - - SOURCES += \ - kernel/qapplication_win.cpp \ - kernel/qclipboard_win.cpp \ - kernel/qcursor_win.cpp \ - kernel/qdesktopwidget_win.cpp \ - kernel/qdnd_win.cpp \ - kernel/qmime_win.cpp \ - kernel/qsound_win.cpp \ - kernel/qwidget_win.cpp \ - kernel/qole_win.cpp \ - kernel/qkeymapper_win.cpp \ - kernel/qwinnativepangesturerecognizer_win.cpp - - !contains(DEFINES, QT_NO_DIRECTDRAW):LIBS += ddraw.lib -} - -unix:x11 { - INCLUDEPATH += ../3rdparty/xorg - HEADERS += \ - kernel/qx11embed_x11.h \ - kernel/qx11info_x11.h \ - kernel/qkde_p.h - - SOURCES += \ - kernel/qapplication_x11.cpp \ - kernel/qclipboard_x11.cpp \ - kernel/qcursor_x11.cpp \ - kernel/qdnd_x11.cpp \ - kernel/qdesktopwidget_x11.cpp \ - kernel/qmotifdnd_x11.cpp \ - kernel/qsound_x11.cpp \ - kernel/qwidget_x11.cpp \ - kernel/qwidgetcreate_x11.cpp \ - kernel/qx11embed_x11.cpp \ - kernel/qx11info_x11.cpp \ - kernel/qkeymapper_x11.cpp \ - kernel/qkde.cpp - - contains(QT_CONFIG, glib) { - SOURCES += \ - kernel/qguieventdispatcher_glib.cpp - HEADERS += \ - kernel/qguieventdispatcher_glib_p.h - QMAKE_CXXFLAGS += $$QT_CFLAGS_GLIB - LIBS_PRIVATE +=$$QT_LIBS_GLIB - } - SOURCES += \ - kernel/qeventdispatcher_x11.cpp - HEADERS += \ - kernel/qeventdispatcher_x11_p.h -} - -!qpa { - HEADERS += \ - kernel/qsound.h \ - kernel/qsound_p.h - - SOURCES += \ - kernel/qsound.cpp -} - -qpa { - HEADERS += \ - kernel/qdesktopwidget_qpa_p.h \ - kernel/qwidgetwindow_qpa_p.h \ - kernel/qplatformmenu_qpa.h \ - - SOURCES += \ - kernel/qapplication_qpa.cpp \ - kernel/qdesktopwidget_qpa.cpp \ - kernel/qwidget_qpa.cpp \ - kernel/qwidgetwindow_qpa.cpp \ - kernel/qplatformmenu_qpa.cpp \ -} - -!qpa:!x11:mac { + kernel/qwidgetsvariant.cpp \ + kernel/qapplication_qpa.cpp \ + kernel/qdesktopwidget_qpa.cpp \ + kernel/qwidget_qpa.cpp \ + kernel/qwidgetwindow_qpa.cpp \ + kernel/qplatformmenu_qpa.cpp + +# TODO +false:!x11:mac { SOURCES += \ kernel/qclipboard_mac.cpp \ kernel/qmime_mac.cpp \ diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index b182399712..e2a7b27430 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -121,18 +121,11 @@ extern bool qt_wince_is_pocket_pc(); //qguifunctions_wince.cpp //#define ALIEN_DEBUG -#if defined(Q_OS_SYMBIAN) -#include "qt_s60_p.h" -#endif - static void initResources() { #if defined(Q_WS_WINCE) Q_INIT_RESOURCE_EXTERN(qstyle_wince) Q_INIT_RESOURCE(qstyle_wince); -#elif defined(Q_OS_SYMBIAN) - Q_INIT_RESOURCE_EXTERN(qstyle_s60) - Q_INIT_RESOURCE(qstyle_s60); #else Q_INIT_RESOURCE_EXTERN(qstyle) Q_INIT_RESOURCE(qstyle); @@ -436,10 +429,6 @@ int QApplicationPrivate::app_cspec = QApplication::NormalColor; QPalette *QApplicationPrivate::sys_pal = 0; // default system palette QPalette *QApplicationPrivate::set_pal = 0; // default palette set by programmer -#ifndef Q_WS_QPA -Q_GLOBAL_STATIC(QMutex, applicationFontMutex) -QFont *QApplicationPrivate::app_font = 0; // default application font -#endif QFont *QApplicationPrivate::sys_font = 0; // default system font QFont *QApplicationPrivate::set_font = 0; // default font set by programmer @@ -467,11 +456,7 @@ bool QApplicationPrivate::animate_toolbox = false; bool QApplicationPrivate::widgetCount = false; bool QApplicationPrivate::load_testability = false; #ifdef QT_KEYPAD_NAVIGATION -# ifdef Q_OS_SYMBIAN -Qt::NavigationMode QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadDirectional; -# else Qt::NavigationMode QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadTabOrder; -# endif QWidget *QApplicationPrivate::oldEditFocus = 0; #endif @@ -504,9 +489,6 @@ FontHash *qt_app_fonts_hash() QWidgetList *QApplicationPrivate::popupWidgets = 0; // has keyboard input focus QDesktopWidget *qt_desktopWidget = 0; // root window widgets -#if !defined(Q_WS_QPA) && !defined(QT_NO_CLIPBOARD) -QClipboard *qt_clipboard = 0; // global clipboard object -#endif QWidgetList * qt_modal_stack = 0; // stack of modal widgets bool app_do_modal = false; @@ -778,22 +760,12 @@ void QApplicationPrivate::construct( qt_gui_eval_init(application_type); #endif -#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SYSTEMLOCALE) - symbianInit(); -#endif - #ifndef QT_NO_LIBRARY if(load_testability) { QLibrary testLib(QLatin1String("qttestability")); if (testLib.load()) { typedef void (*TasInitialize)(void); TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init"); -#ifdef Q_OS_SYMBIAN - // resolving method by name does not work on Symbian OS so need to use ordinal - if(!initFunction) { - initFunction = (TasInitialize)testLib.resolve("1"); - } -#endif if (initFunction) { initFunction(); } else { @@ -1002,14 +974,6 @@ QApplication::~QApplication() { Q_D(QApplication); -#if !defined(Q_WS_QPA) && !defined(QT_NO_CLIPBOARD) - // flush clipboard contents - if (qt_clipboard) { - QEvent event(QEvent::Clipboard); - QApplication::sendEvent(qt_clipboard, &event); - } -#endif - //### this should probable be done even later qt_call_post_routines(); @@ -1017,10 +981,6 @@ QApplication::~QApplication() d->toolTipWakeUp.stop(); d->toolTipFallAsleep.stop(); -#if !defined(Q_WS_QPA) - d->eventDispatcher->closingDown(); - d->eventDispatcher = 0; -#endif QApplicationPrivate::is_app_closing = true; QApplicationPrivate::is_app_running = false; @@ -1042,11 +1002,6 @@ QApplication::~QApplication() delete qt_desktopWidget; qt_desktopWidget = 0; -#if !defined(Q_WS_QPA) && !defined(QT_NO_CLIPBOARD) - delete qt_clipboard; - qt_clipboard = 0; -#endif - #if defined(Q_WS_X11) || defined(Q_WS_WIN) delete d->move_cursor; d->move_cursor = 0; delete d->copy_cursor; d->copy_cursor = 0; @@ -1064,14 +1019,6 @@ QApplication::~QApplication() QApplicationPrivate::set_pal = 0; app_palettes()->clear(); -#ifndef Q_WS_QPA - { - QMutexLocker locker(applicationFontMutex()); - delete QApplicationPrivate::app_font; - QApplicationPrivate::app_font = 0; - } -#endif - delete QApplicationPrivate::sys_font; QApplicationPrivate::sys_font = 0; delete QApplicationPrivate::set_font; @@ -1787,14 +1734,7 @@ void QApplicationPrivate::setSystemPalette(const QPalette &pal) */ QFont QApplication::font() { -#ifndef Q_WS_QPA - QMutexLocker locker(applicationFontMutex()); - if (!QApplicationPrivate::app_font) - QApplicationPrivate::app_font = new QFont(QLatin1String("Helvetica")); - return *QApplicationPrivate::app_font; -#else return QGuiApplication::font(); -#endif } /*! @@ -1873,15 +1813,7 @@ void QApplication::setFont(const QFont &font, const char *className) bool all = false; FontHash *hash = app_fonts(); if (!className) { -#ifndef Q_WS_QPA - QMutexLocker locker(applicationFontMutex()); - if (!QApplicationPrivate::app_font) - QApplicationPrivate::app_font = new QFont(font); - else - *QApplicationPrivate::app_font = font; -#else QGuiApplication::setFont(font); -#endif if (hash && hash->size()) { all = true; hash->clear(); @@ -2071,11 +2003,7 @@ void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason) if (prev) { #ifdef QT_KEYPAD_NAVIGATION if (QApplication::keypadNavigationEnabled()) { - if (prev->hasEditFocus() && reason != Qt::PopupFocusReason -#ifdef Q_OS_SYMBIAN - && reason != Qt::ActiveWindowFocusReason -#endif - ) + if (prev->hasEditFocus() && reason != Qt::PopupFocusReason) prev->setEditFocus(false); } #endif @@ -2238,11 +2166,6 @@ bool QApplication::event(QEvent *e) { Q_D(QApplication); if(e->type() == QEvent::Close) { -#if defined(Q_OS_SYMBIAN) - // In order to have proper application-exit effects on Symbian, certain - // native APIs have to be called _before_ closing/destroying the widgets. - bool effectStarted = qt_beginFullScreenEffect(); -#endif QCloseEvent *ce = static_cast(e); ce->accept(); closeAllWindows(); @@ -2258,11 +2181,6 @@ bool QApplication::event(QEvent *e) } if (ce->isAccepted()) { return true; - } else { -#if defined(Q_OS_SYMBIAN) - if (effectStarted) - qt_abortFullScreenEffect(); -#endif } #ifndef Q_OS_WIN } else if (e->type() == QEvent::LocaleChange) { @@ -2627,8 +2545,7 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave) { // Update cursor for alien/graphics widgets. const bool enterOnAlien = (enter && (isAlien(enter) || enter->testAttribute(Qt::WA_DontShowOnScreen))); -#if defined(Q_WS_X11) || defined(Q_WS_QPA) - //Whenever we leave an alien widget on X11, we need to reset its nativeParentWidget()'s cursor. + // Whenever we leave an alien widget on X11/QPA, we need to reset its nativeParentWidget()'s cursor. // This is not required on Windows as the cursor is reset on every single mouse move. QWidget *parentOfLeavingCursor = 0; for (int i = 0; i < leaveList.size(); ++i) { @@ -2653,16 +2570,14 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave) { { #if defined(Q_WS_X11) qt_x11_enforce_cursor(parentOfLeavingCursor,true); -#elif defined(Q_WS_QPA) +#endif if (enter == QApplication::desktop()) { qt_qpa_set_cursor(enter, true); } else { qt_qpa_set_cursor(parentOfLeavingCursor, true); } -#endif } } -#endif if (enterOnAlien) { QWidget *cursorWidget = enter; while (!cursorWidget->isWindow() && !cursorWidget->isEnabled()) @@ -2681,9 +2596,7 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave) { qt_win_set_cursor(cursorWidget, true); #elif defined(Q_WS_X11) qt_x11_enforce_cursor(cursorWidget, true); -#elif defined(Q_OS_SYMBIAN) - qt_symbian_set_cursor(cursorWidget, true); -#elif defined(Q_WS_QPA) +#else qt_qpa_set_cursor(cursorWidget, true); #endif } @@ -2987,7 +2900,6 @@ bool QApplicationPrivate::sendMouseEvent(QWidget *receiver, QMouseEvent *event, return result; } -#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_WS_MAC) || defined(Q_WS_QPA) /* This function should only be called when the widget changes visibility, i.e. when the \a widget is shown, hidden or deleted. This function does nothing @@ -2999,13 +2911,8 @@ extern QWidget *qt_button_down; void QApplicationPrivate::sendSyntheticEnterLeave(QWidget *widget) { #ifndef QT_NO_CURSOR -#if defined(Q_WS_QWS) || defined(Q_WS_QPA) if (!widget || widget->isWindow()) return; -#else - if (!widget || widget->internalWinId() || widget->isWindow()) - return; -#endif const bool widgetInShow = widget->isVisible() && !widget->data->in_destructor; if (!widgetInShow && widget != qt_last_mouse_receiver) return; // Widget was not under the cursor when it was hidden/deleted. @@ -3046,7 +2953,6 @@ void QApplicationPrivate::sendSyntheticEnterLeave(QWidget *widget) sendMouseEvent(widgetUnderCursor, &e, widgetUnderCursor, tlw, &qt_button_down, qt_last_mouse_receiver); #endif // QT_NO_CURSOR } -#endif // Q_WS_WIN || Q_WS_X11 || Q_WS_MAC /*! Returns the desktop widget (also called the root window). @@ -3068,25 +2974,6 @@ QDesktopWidget *QApplication::desktop() return qt_desktopWidget; } -#if !defined(Q_WS_QPA) && !defined(QT_NO_CLIPBOARD) -/*! - Returns a pointer to the application global clipboard. - - \note The QApplication object should already be constructed before - accessing the clipboard. -*/ -QClipboard *QApplication::clipboard() -{ - if (qt_clipboard == 0) { - if (!qApp) { - qWarning("QApplication: Must construct a QApplication before accessing a QClipboard"); - return 0; - } - qt_clipboard = new QClipboard(0); - } - return qt_clipboard; -} -#endif // Q_WS_QPA && QT_NO_CLIPBOARD /*! Sets whether Qt should use the system's standard colors, fonts, etc., to \a on. By default, this is true. @@ -4824,11 +4711,7 @@ void QApplicationPrivate::emitLastWindowClosed() */ void QApplication::setNavigationMode(Qt::NavigationMode mode) { -#ifdef Q_OS_SYMBIAN - QApplicationPrivate::setNavigationMode(mode); -#else QApplicationPrivate::navigationMode = mode; -#endif } /*! @@ -4871,13 +4754,8 @@ Qt::NavigationMode QApplication::navigationMode() void QApplication::setKeypadNavigationEnabled(bool enable) { if (enable) { -#ifdef Q_OS_SYMBIAN - QApplication::setNavigationMode(Qt::NavigationModeKeypadDirectional); -#else QApplication::setNavigationMode(Qt::NavigationModeKeypadTabOrder); -#endif - } - else { + } else { QApplication::setNavigationMode(Qt::NavigationModeNone); } } diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h index 8fd988f7a8..7ddbe77667 100644 --- a/src/widgets/kernel/qapplication.h +++ b/src/widgets/kernel/qapplication.h @@ -50,20 +50,10 @@ #ifdef QT_INCLUDE_COMPAT # include #endif -#ifdef Q_WS_QWS -# include -# include -#endif -#ifdef Q_WS_QPA -# include -#endif +#include QT_BEGIN_HEADER -#if defined(Q_OS_SYMBIAN) -class CApaApplication; -#endif - QT_BEGIN_NAMESPACE QT_MODULE(Gui) @@ -76,14 +66,7 @@ class QIcon; class QInputContext; template class QList; class QLocale; -#if defined(Q_WS_QWS) -class QDecoration; -#elif defined(Q_WS_QPA) class QPlatformNativeInterface; -#endif -#if defined(Q_OS_SYMBIAN) -class QSymbianEvent; -#endif class QApplication; class QApplicationPrivate; @@ -92,11 +75,7 @@ class QApplicationPrivate; #endif #define qApp (static_cast(QCoreApplication::instance())) -#ifdef Q_WS_QPA #define QApplicationBase QGuiApplication -#else -#define QApplicationBase QCoreApplication -#endif class Q_WIDGETS_EXPORT QApplication : public QApplicationBase { @@ -123,10 +102,6 @@ class Q_WIDGETS_EXPORT QApplication : public QApplicationBase public: enum Type { Tty, GuiClient, GuiServer }; -#ifdef Q_OS_SYMBIAN - typedef CApaApplication * (*QS60MainApplicationFactory)(); -#endif - #ifndef qdoc QApplication(int &argc, char **argv, int = ApplicationFlags); QApplication(int &argc, char **argv, bool GUIenabled, int = ApplicationFlags); @@ -135,9 +110,6 @@ public: QApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0, int = ApplicationFlags); QApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0, int = ApplicationFlags); #endif -#if defined(Q_OS_SYMBIAN) - QApplication(QApplication::QS60MainApplicationFactory factory, int &argc, char **argv, int = ApplicationFlags); -#endif #endif virtual ~QApplication(); @@ -174,9 +146,6 @@ public: static QWidget *activePopupWidget(); static QWidget *activeModalWidget(); -#if !defined(Q_WS_QPA) && !defined(QT_NO_CLIPBOARD) - static QClipboard *clipboard(); -#endif static QWidget *focusWidget(); static QWidget *activeWindow(); @@ -230,10 +199,6 @@ public: virtual int x11ClientMessage(QWidget*, XEvent*, bool passive_only); int x11ProcessEvent(XEvent*); #endif -#if defined(Q_OS_SYMBIAN) - int symbianProcessEvent(const QSymbianEvent *event); - virtual bool symbianEventFilter(const QSymbianEvent *event); -#endif #if defined(Q_WS_QWS) virtual bool qwsEventFilter(QWSEvent *); int qwsProcessEvent(QWSEvent*); @@ -245,10 +210,7 @@ public: #endif #endif -#if defined(Q_WS_QPA) static QPlatformNativeInterface *platformNativeInterface(); -#endif - #if defined(Q_WS_WIN) void winFocus(QWidget *, bool); @@ -321,9 +283,6 @@ protected: QApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0); QApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0); #endif -#if defined(Q_OS_SYMBIAN) || defined(qdoc) - QApplication(QApplication::QS60MainApplicationFactory factory, int &argc, char **argv); -#endif #endif private: @@ -364,9 +323,6 @@ private: #if defined(QT_RX71_MULTITOUCH) Q_PRIVATE_SLOT(d_func(), void _q_readRX71MultiTouchEvents()) #endif -#if defined(Q_OS_SYMBIAN) - Q_PRIVATE_SLOT(d_func(), void _q_aboutToQuit()) -#endif }; QT_END_NAMESPACE diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index ed15135f9f..092eaa35a4 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -72,15 +72,10 @@ #include #include "QtCore/qpoint.h" #include -#ifdef Q_OS_SYMBIAN -#include -#endif -#ifdef Q_WS_QPA #include #include "private/qwindowsysteminterface_qpa_p.h" #include "QtGui/qplatformintegration_qpa.h" #include "private/qguiapplication_p.h" -#endif QT_BEGIN_NAMESPACE @@ -289,11 +284,7 @@ FontHash *qt_app_fonts_hash(); typedef QHash PaletteHash; PaletteHash *qt_app_palettes_hash(); -#ifdef Q_WS_QPA #define QApplicationPrivateBase QGuiApplicationPrivate -#else -#define QApplicationPrivateBase QCoreApplicationPrivate -#endif class Q_WIDGETS_EXPORT QApplicationPrivate : public QApplicationPrivateBase { @@ -393,9 +384,6 @@ public: static QPalette *set_pal; private: -#ifndef Q_WS_QPA - static QFont *app_font; // private for a reason! Always use QApplication::font() instead! -#endif public: static QFont *sys_font; static QFont *set_font; @@ -477,20 +465,7 @@ public: static bool sendMouseEvent(QWidget *receiver, QMouseEvent *event, QWidget *alienWidget, QWidget *native, QWidget **buttonDown, QPointer &lastMouseReceiver, bool spontaneous = true); -#ifdef Q_OS_SYMBIAN - static void setNavigationMode(Qt::NavigationMode mode); - static TUint resolveS60ScanCode(TInt scanCode, TUint keysym); - QSet nativeWindows; - - int symbianProcessWsEvent(const QSymbianEvent *symbianEvent); - int symbianHandleCommand(const QSymbianEvent *symbianEvent); - int symbianResourceChange(const QSymbianEvent *symbianEvent); - - void _q_aboutToQuit(); -#endif -#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined (Q_WS_QWS) || defined(Q_WS_MAC) || defined(Q_WS_QPA) void sendSyntheticEnterLeave(QWidget *widget); -#endif #ifdef Q_OS_WIN static HWND getHWNDForWidget(QWidget *widget) { @@ -602,8 +577,6 @@ Q_WIDGETS_EXPORT void qt_translateRawTouchEvent(QWidget *window, #elif defined(Q_WS_X11) extern void qt_x11_enforce_cursor(QWidget *, bool); extern void qt_x11_enforce_cursor(QWidget *); -#elif defined(Q_OS_SYMBIAN) - extern void qt_symbian_set_cursor(QWidget *, bool); #else extern void qt_qpa_set_cursor(QWidget * w, bool force); #endif diff --git a/src/widgets/kernel/qguiplatformplugin.cpp b/src/widgets/kernel/qguiplatformplugin.cpp index 09a364c150..8acc7ec90d 100644 --- a/src/widgets/kernel/qguiplatformplugin.cpp +++ b/src/widgets/kernel/qguiplatformplugin.cpp @@ -146,14 +146,8 @@ QString QGuiPlatformPlugin::styleName() return QLatin1String("Windows"); // default styles for Windows #elif defined(Q_WS_X11) && defined(Q_OS_SOLARIS) return QLatin1String("CDE"); // default style for X11 on Solaris -#elif defined(Q_WS_S60) - return QLatin1String("S60"); // default style for Symbian with S60 -#elif defined(Q_OS_SYMBIAN) - return QLatin1String("Windows"); // default style for Symbian without S60 #elif defined(Q_WS_X11) && defined(Q_OS_IRIX) return QLatin1String("SGI"); // default style for X11 on IRIX -#elif defined(Q_WS_QWS) || defined(Q_WS_QPA) - return QLatin1String("Plastique"); // default style for X11 and small devices #elif defined(Q_WS_MAC) return QLatin1String("Macintosh"); // default style for all Mac's #elif defined(Q_WS_X11) @@ -184,6 +178,8 @@ QString QGuiPlatformPlugin::styleName() break; } return stylename; +#else + return QLatin1String("Plastique"); // default style for X11 and small devices #endif } diff --git a/src/widgets/kernel/qinputcontext.h b/src/widgets/kernel/qinputcontext.h index 4864c5aea6..8a80d72ac2 100644 --- a/src/widgets/kernel/qinputcontext.h +++ b/src/widgets/kernel/qinputcontext.h @@ -75,9 +75,6 @@ class QWidget; class QFont; class QPopupMenu; class QInputContextPrivate; -#ifdef Q_OS_SYMBIAN -class QSymbianEvent; -#endif class Q_WIDGETS_EXPORT QInputContext : public QObject { diff --git a/src/widgets/kernel/qt_gui_pch.h b/src/widgets/kernel/qt_gui_pch.h deleted file mode 100644 index 012d92ce8c..0000000000 --- a/src/widgets/kernel/qt_gui_pch.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - * This is a precompiled header file for use in Xcode / Mac GCC / - * GCC >= 3.4 / VC to greatly speed the building of Qt. It may also be - * of use to people developing their own project, but it is probably - * better to define your own header. Use of this header is currently - * UNSUPPORTED. - */ - -// from corelib/global/qt_pch.h -#if defined __cplusplus -#include - - -#ifdef Q_WS_WIN -# define _POSIX_ -# include -# undef _POSIX_ -#endif - -#include -#include -#include // All moc genereated code has this include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#endif diff --git a/src/widgets/kernel/qt_widgets_pch.h b/src/widgets/kernel/qt_widgets_pch.h new file mode 100644 index 0000000000..012d92ce8c --- /dev/null +++ b/src/widgets/kernel/qt_widgets_pch.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* + * This is a precompiled header file for use in Xcode / Mac GCC / + * GCC >= 3.4 / VC to greatly speed the building of Qt. It may also be + * of use to people developing their own project, but it is probably + * better to define your own header. Use of this header is currently + * UNSUPPORTED. + */ + +// from corelib/global/qt_pch.h +#if defined __cplusplus +#include + + +#ifdef Q_WS_WIN +# define _POSIX_ +# include +# undef _POSIX_ +#endif + +#include +#include +#include // All moc genereated code has this include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#endif diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 8e3fd48546..ec3523d9b3 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -70,10 +70,8 @@ # include "qtoolbar.h" # include #endif -#if defined(Q_WS_QPA) #include "qplatformwindow_qpa.h" #include "private/qwidgetwindow_qpa_p.h" -#endif #include "qpainter.h" #include "qtooltip.h" #include "qwhatsthis.h" @@ -93,10 +91,6 @@ #endif #include -#if defined(Q_OS_SYMBIAN) -#include "private/qt_s60_p.h" -#endif - #include "qwidget_p.h" #include "qaction_p.h" #include "qlayout_p.h" @@ -291,9 +285,6 @@ QWidgetPrivate::QWidgetPrivate(int version) , needWindowChange(0) , window_event(0) , qd_hd(0) -#elif defined(Q_OS_SYMBIAN) - , symbianScreenNumber(0) - , fixNativeOrientationCalled(false) #endif { if (!qApp) { @@ -1174,19 +1165,12 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f) // programmer specified desktop widget xinfo = desktopWidget->d_func()->xinfo; } -#elif defined(Q_OS_SYMBIAN) - if (desktopWidget) { - symbianScreenNumber = qt_widget_private(desktopWidget)->symbianScreenNumber; - } -#elif defined(Q_WS_QPA) +#endif if (desktopWidget) { const int screen = desktopWidget->d_func()->topData()->screenIndex; if (QWindow *window = q->windowHandle()) window->setScreen(QGuiApplication::screens().value(screen, 0)); } -#else - Q_UNUSED(desktopWidget); -#endif data.fstrut_dirty = true; @@ -1218,17 +1202,7 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f) q->setAttribute(Qt::WA_WState_Hidden); //give potential windows a bigger "pre-initial" size; create_sys() will give them a new size later -#ifdef Q_OS_SYMBIAN - if (isGLWidget) { - // Don't waste GPU mem for unnecessary large egl surface until resized by application - data.crect = QRect(0,0,1,1); - } else { - data.crect = parentWidget ? QRect(0,0,100,30) : QRect(0,0,360,640); - } -#else data.crect = parentWidget ? QRect(0,0,100,30) : QRect(0,0,640,480); -#endif - focus_next = focus_prev = q; if ((f & Qt::WindowType_Mask) == Qt::Desktop) @@ -1484,23 +1458,11 @@ QWidget::~QWidget() else if (!internalWinId() && isVisible()) { qApp->d_func()->sendSyntheticEnterLeave(this); } -#elif defined(Q_WS_QPA) +#endif else if (isVisible()) { qApp->d_func()->sendSyntheticEnterLeave(this); } -#endif -#ifdef Q_OS_SYMBIAN - if (d->extra && d->extra->topextra && d->extra->topextra->backingStore) { - // Okay, we are about to destroy the top-level window that owns - // the backing store. Make sure we delete the backing store right away - // before the window handle is invalid. This is important because - // the backing store will delete its window surface, which may or may - // not have a reference to this widget that will be used later to - // notify the window it no longer has a surface. - d->extra->topextra->backingStore.destroy(); - } -#endif if (QWidgetBackingStore *bs = d->maybeBackingStore()) { bs->removeDirtyWidget(this); if (testAttribute(Qt::WA_StaticContents)) @@ -2144,9 +2106,6 @@ void QWidgetPrivate::setOpaque(bool opaque) #ifdef Q_WS_WIN winUpdateIsOpaque(); #endif -#ifdef Q_OS_SYMBIAN - s60UpdateIsOpaque(); -#endif } void QWidgetPrivate::updateIsTranslucent() @@ -2160,9 +2119,6 @@ void QWidgetPrivate::updateIsTranslucent() #ifdef Q_WS_WIN winUpdateIsOpaque(); #endif -#ifdef Q_OS_SYMBIAN - s60UpdateIsOpaque(); -#endif } static inline void fillRegion(QPainter *painter, const QRegion &rgn, const QBrush &brush) @@ -3161,13 +3117,12 @@ void QWidgetPrivate::setEnabled_helper(bool enable) // disabled widgets qt_x11_enforce_cursor(q); } -#elif defined(Q_WS_QPA) +#endif if (q->testAttribute(Qt::WA_SetCursor) || q->isWindow()) { // enforce the windows behavior of clearing the cursor on // disabled widgets qt_qpa_set_cursor(q, false); } -#endif #if defined(Q_WS_MAC) setEnabled_helper_sys(enable); #endif @@ -5202,10 +5157,6 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP //actually send the paint event QPaintEvent e(toBePainted); QCoreApplication::sendSpontaneousEvent(q, &e); -#if !defined(Q_WS_QPA) - if (backingStore && !onScreen && !asRoot && (q->internalWinId() || !q->nativeParentWidget()->isWindow())) - backingStore->markDirtyOnScreen(toBePainted, q, offset); -#endif //restore if (paintEngine) { @@ -7121,7 +7072,7 @@ void QWidgetPrivate::show_helper() // On Windows, show the popup now so that our own focus handling // stores the correct old focus widget even if it's stolen in the // showevent -#if defined(Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_OS_SYMBIAN) +#if defined(Q_WS_WIN) || defined(Q_WS_MAC) if (!isEmbedded && q->windowType() == Qt::Popup) qApp->d_func()->openPopup(q); #endif @@ -7138,10 +7089,8 @@ void QWidgetPrivate::show_helper() show_sys(); -#if !defined(Q_WS_WIN) && !defined(Q_WS_MAC) && !defined(Q_OS_SYMBIAN) if (!isEmbedded && q->windowType() == Qt::Popup) qApp->d_func()->openPopup(q); -#endif #ifndef QT_NO_ACCESSIBILITY if (q->windowType() != Qt::ToolTip) // Tooltips are read aloud twice in MS narrator. @@ -7220,10 +7169,7 @@ void QWidgetPrivate::hide_helper() // next bit tries to move the focus if the focus widget is now // hidden. if (wasVisible) { -#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QPA) qApp->d_func()->sendSyntheticEnterLeave(q); -#endif - QWidget *fw = QApplication::focusWidget(); while (fw && !fw->isWindow()) { if (fw == q) { @@ -7346,9 +7292,7 @@ void QWidget::setVisible(bool visible) d->show_helper(); -#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QPA) qApp->d_func()->sendSyntheticEnterLeave(this); -#endif } QEvent showToParentEvent(QEvent::ShowToParent); @@ -7473,9 +7417,7 @@ void QWidgetPrivate::hideChildren(bool spontaneous) widget->d_func()->hide_sys(); } } -#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QPA) qApp->d_func()->sendSyntheticEnterLeave(widget); -#endif #ifndef QT_NO_ACCESSIBILITY if (!spontaneous) QAccessible::updateAccessibility(widget, 0, QAccessible::ObjectHide); @@ -7691,7 +7633,7 @@ QSize QWidgetPrivate::adjustedSize() const #else // all others QRect screen = QApplication::desktop()->screenGeometry(q->pos()); #endif -#if defined (Q_WS_WINCE) || defined (Q_OS_SYMBIAN) +#if defined (Q_WS_WINCE) s.setWidth(qMin(s.width(), screen.width())); s.setHeight(qMin(s.height(), screen.height())); #else @@ -9232,18 +9174,16 @@ void QWidget::ensurePolished() const QChildEvent e(QEvent::ChildPolished, const_cast(this)); QCoreApplication::sendEvent(d->parent, &e); } -#ifdef Q_WS_QPA if (d->extra && d->extra->topextra && d->extra->topextra->window && d->extra->topextra->window->objectName().isEmpty()) { QString on = objectName(); if (on.isEmpty()) { on = QString::fromUtf8(metaObject()->className()); - on += QLatin1String("Class"); + on += QStringLiteral("Class"); } - on += QLatin1String("Window"); + on += QStringLiteral("Window"); d->extra->topextra->window->setObjectName(on); } -#endif } /*! @@ -9684,7 +9624,7 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f) desktopWidget = parent; bool newParent = (parent != parentWidget()) || !wasCreated || desktopWidget; -#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_OS_SYMBIAN) +#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_MAC) if (newParent && parent && !desktopWidget) { if (testAttribute(Qt::WA_NativeWindow) && !qApp->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) #ifdef Q_WS_MAC @@ -10250,9 +10190,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) QApplication::sendEvent(this, &e); break; } case Qt::WA_NativeWindow: { -#if defined(Q_WS_QPA) d->createTLExtra(); -#endif #ifndef QT_NO_IM QWidget *focusWidget = d->effectiveFocusWidget(); if (on && !internalWinId() && hasFocus() @@ -10279,7 +10217,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) } case Qt::WA_PaintOnScreen: d->updateIsOpaque(); -#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_OS_SYMBIAN) +#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_MAC) // Recreate the widget if it's already created as an alien widget and // WA_PaintOnScreen is enabled. Paint on screen widgets must have win id. // So must their children. @@ -10381,7 +10319,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) break; case Qt::WA_AcceptTouchEvents: -#if defined(Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_OS_SYMBIAN) +#if defined(Q_WS_WIN) || defined(Q_WS_MAC) if (on) d->registerTouchWindow(); #endif @@ -10792,56 +10730,6 @@ void QWidget::updateMicroFocus() #endif } - -#if defined (Q_WS_WIN) -/*! - Returns the window system handle of the widget, for low-level - access. Using this function is not portable. - - An HDC acquired with getDC() has to be released with releaseDC(). - - \warning Using this function is not portable. -*/ -HDC QWidget::getDC() const -{ - Q_D(const QWidget); - if (d->hd) - return (HDC) d->hd; - return GetDC(winId()); -} - -/*! - Releases the HDC \a hdc acquired by a previous call to getDC(). - - \warning Using this function is not portable. -*/ -void QWidget::releaseDC(HDC hdc) const -{ - Q_D(const QWidget); - // If its the widgets own dc, it will be released elsewhere. If - // its a different HDC we release it and issue a warning if it - // fails. - if (hdc != d->hd && !ReleaseDC(winId(), hdc)) - qErrnoWarning("QWidget::releaseDC(): failed to release HDC"); -} -#else -/*! - Returns the window system handle of the widget, for low-level - access. Using this function is not portable. - - The HANDLE type varies with platform; see \c qwindowdefs.h for - details. -*/ -Qt::HANDLE QWidget::handle() const -{ - Q_D(const QWidget); - if (!internalWinId() && testAttribute(Qt::WA_WState_Created)) - (void)winId(); // enforce native window - return d->hd; -} -#endif - - /*! Raises this widget to the top of the parent widget's stack. @@ -12080,13 +11968,6 @@ void QWidget::clearMask() handle could not be created. */ -#ifdef Q_OS_SYMBIAN -void QWidgetPrivate::_q_delayedDestroy(WId winId) -{ - delete winId; -} -#endif - #ifdef Q_WS_MAC void QWidgetPrivate::syncUnifiedMode() { // The whole purpose of this method is to keep the unifiedToolbar in sync. diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h index fadb330277..d3d7c12a44 100644 --- a/src/widgets/kernel/qwidget.h +++ b/src/widgets/kernel/qwidget.h @@ -56,10 +56,6 @@ #include #include -#ifdef Q_WS_QPA //should this go somewhere else? -#include -#endif - #ifdef QT_INCLUDE_COMPAT #include #endif @@ -75,7 +71,7 @@ class QWSRegionManager; class QStyle; class QAction; class QVariant; - +class QWindow; class QActionEvent; class QMouseEvent; class QWheelEvent; @@ -600,13 +596,6 @@ public: Qt::HANDLE macCGHandle() const; #endif -#if defined(Q_WS_WIN) - HDC getDC() const; - void releaseDC(HDC) const; -#else - Qt::HANDLE handle() const; -#endif - void setAttribute(Qt::WidgetAttribute, bool on = true); inline bool testAttribute(Qt::WidgetAttribute) const; @@ -628,12 +617,10 @@ public: QBackingStore *backingStore() const; -#if defined(Q_WS_QPA) void setWindowHandle(QWindow *window); QWindow *windowHandle() const; friend class QDesktopScreenWidget; -#endif Q_SIGNALS: void customContextMenuRequested(const QPoint &pos); @@ -773,36 +760,12 @@ private: friend class QRasterWindowSurface; friend class QUnifiedToolbarSurface; #endif -#ifdef Q_WS_QWS - friend class QWSBackingStore; - friend class QWSManager; - friend class QWSManagerPrivate; - friend class QDecoration; - friend class QWSWindowSurface; - friend class QScreen; - friend class QVNCScreen; - friend bool isWidgetOpaque(const QWidget *); - friend class QGLWidgetPrivate; -#endif -#ifdef Q_OS_SYMBIAN - friend class QSymbianControl; - friend class QS60WindowSurface; -#endif -#ifdef Q_WS_X11 - friend void qt_net_update_user_time(QWidget *tlw, unsigned long timestamp); - friend void qt_net_remove_user_time(QWidget *tlw); - friend void qt_set_winid_on_widget(QWidget*, Qt::HANDLE); -#endif - friend Q_WIDGETS_EXPORT QWidgetData *qt_qwidget_data(QWidget *widget); friend Q_WIDGETS_EXPORT QWidgetPrivate *qt_widget_private(QWidget *widget); private: Q_DISABLE_COPY(QWidget) Q_PRIVATE_SLOT(d_func(), void _q_showIfNotHidden()) -#ifdef Q_OS_SYMBIAN - Q_PRIVATE_SLOT(d_func(), void _q_delayedDestroy(WId winId)) -#endif QWidgetData *data; }; diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h index 51a76d6ce3..84c1c0b58b 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -69,42 +69,12 @@ #include "QtWidgets/qgraphicsview.h" #include -#ifdef Q_WS_WIN -#include "QtCore/qt_windows.h" -#include -#endif // Q_WS_WIN - -#ifdef Q_WS_X11 -#include "QtGui/qx11info_x11.h" -#endif - -#ifdef Q_WS_MAC -#include -#endif - -#if defined(Q_WS_QWS) -#include "QtGui/qscreen_qws.h" -#endif - -#if defined(Q_OS_SYMBIAN) -class RDrawableWindow; -class CCoeControl; -#endif - QT_BEGIN_NAMESPACE // Extra QWidget data // - to minimize memory usage for members that are seldom used. // - top-level widgets have extra extra data to reduce cost further -#if defined(Q_WS_QWS) -class QWSManager; -#endif -#if defined(Q_WS_MAC) -class QCoreGraphicsPaintEnginePrivate; -#endif -#if defined(Q_WS_QPA) class QWidgetWindow; -#endif class QPaintEngine; class QPixmap; class QWidgetBackingStore; @@ -226,18 +196,9 @@ struct QTLWExtra { // The name is misleading, since this is set when maximizing the window. It is a hint to saveGeometry(..) to record the // starting position as 0,0 instead of the normal starting position. bool wasMaximized; - -#elif defined(Q_WS_QWS) // <--------------------------------------------------------- QWS -#ifndef QT_NO_QWS_MANAGER - QWSManager *qwsManager; #endif -#elif defined(Q_OS_SYMBIAN) - uint inExpose : 1; // Prevents drawing recursion - uint nativeWindowTransparencyEnabled : 1; // Tracks native window transparency -#elif defined(Q_WS_QPA) QWidgetWindow *window; quint32 screenIndex; // index in qplatformscreenlist -#endif }; struct QWExtra { @@ -289,50 +250,6 @@ struct QWExtra { // Cocoa Mask stuff QImage maskBits; CGImageRef imageMask; -#elif defined(Q_OS_SYMBIAN) // <----------------------------------------------------- Symbian - uint activated : 1; // RWindowBase::Activated has been called - - /** - * If this bit is set, each native widget receives the signals from the - * Symbian control immediately before and immediately after draw ops are - * sent to the window server for this control: - * void beginNativePaintEvent(const QRect &paintRect); - * void endNativePaintEvent(const QRect &paintRect); - */ - uint receiveNativePaintEvents : 1; - - /** - * Defines the behaviour of QSymbianControl::Draw. - */ - enum NativePaintMode { - /** - * Normal drawing mode: blits the required region of the backing store - * via WSERV. - */ - Blit, - - /** - * Disable drawing for this widget. - */ - Disable, - - /** - * Paint zeros into the WSERV framebuffer, using BitGDI APIs. For windows - * with an EColor16MU display mode, zero is written only into the R, G and B - * channels of the pixel. - */ - ZeroFill, - - /** - * Blit backing store, propagating alpha channel into the framebuffer. - */ - BlitWriteAlpha, - - Default = Blit - }; - - NativePaintMode nativePaintMode; - #endif }; @@ -414,11 +331,6 @@ public: QPalette naturalWidgetPalette(uint inheritedMask) const; void setMask_sys(const QRegion &); -#ifdef Q_OS_SYMBIAN - void setSoftKeys_sys(const QList &softkeys); - void activateSymbianWindow(WId wid = 0); - void _q_delayedDestroy(WId winId); -#endif void raise_sys(); void lower_sys(); @@ -666,7 +578,6 @@ public: } } -#ifndef Q_WS_QWS // Almost cross-platform :-) void setWSGeometry(bool dontShow=false, const QRect &oldRect = QRect()); inline QPoint mapToWS(const QPoint &p) const @@ -680,7 +591,6 @@ public: inline QRect mapFromWS(const QRect &r) const { QRect rr(r); rr.translate(data.wrect.topLeft()); return rr; } -#endif // Variables. // Regular pointers (keep them together to avoid gaps on 64 bit architectures). @@ -873,21 +783,11 @@ public: static OSStatus qt_widget_event(EventHandlerCallRef er, EventRef event, void *); static bool qt_widget_rgn(QWidget *, short, RgnHandle, bool); void registerTouchWindow(bool enable = true); -#elif defined(Q_WS_QPA) // <--------------------------------------------------------- QPA +#endif void setMaxWindowState_helper(); void setFullScreenSize_helper(); bool stealKeyboardGrab(bool grab); bool stealMouseGrab(bool grab); -#elif defined(Q_OS_SYMBIAN) // <--------------------------------------------------------- SYMBIAN - static QWidget *mouseGrabber; - static QWidget *keyboardGrabber; - int symbianScreenNumber; // only valid for desktop widget and top-levels - bool fixNativeOrientationCalled; - void s60UpdateIsOpaque(); - void reparentChildren(); - void registerTouchWindow(); -#endif - }; struct QWidgetPaintContext diff --git a/src/widgets/styles/styles.pri b/src/widgets/styles/styles.pri index 1b107cc846..dc7f622d73 100644 --- a/src/widgets/styles/styles.pri +++ b/src/widgets/styles/styles.pri @@ -37,7 +37,8 @@ contains( styles, all ) { styles = mac windows windowsxp windowsvista } -x11|qpa|!macx-*:styles -= mac +# TODO +styles -= mac x11{ QMAKE_CXXFLAGS += $$QT_CFLAGS_QGTKSTYLE diff --git a/src/widgets/util/qflickgesture.cpp b/src/widgets/util/qflickgesture.cpp index c92fb94be7..a028b27d72 100644 --- a/src/widgets/util/qflickgesture.cpp +++ b/src/widgets/util/qflickgesture.cpp @@ -510,13 +510,7 @@ QGestureRecognizer::Result QFlickGestureRecognizer::recognize(QGesture *state, } break; case QEvent::MouseMove: -#ifdef Q_OS_SYMBIAN - // Qt on Symbian tracks the button state internally, while Qt on Win/Mac/Unix - // relies on the windowing system to report the current buttons state. - if (me && (me->buttons() == button || !me->buttons())) { -#else if (me && me->buttons() == button) { -#endif point = me->globalPos(); inputType = QScroller::InputMove; } @@ -539,13 +533,7 @@ QGestureRecognizer::Result QFlickGestureRecognizer::recognize(QGesture *state, } break; case QEvent::GraphicsSceneMouseMove: -#ifdef Q_OS_SYMBIAN - // Qt on Symbian tracks the button state internally, while Qt on Win/Mac/Unix - // relies on the windowing system to report the current buttons state. - if (gsme && (gsme->buttons() == button || !me->buttons())) { -#else if (gsme && gsme->buttons() == button) { -#endif point = gsme->scenePos(); inputType = QScroller::InputMove; } diff --git a/src/widgets/util/util.pri b/src/widgets/util/util.pri index 9deb3b5efc..abfb1d86fe 100644 --- a/src/widgets/util/util.pri +++ b/src/widgets/util/util.pri @@ -25,28 +25,11 @@ SOURCES += \ util/qflickgesture.cpp \ util/qundogroup.cpp \ util/qundostack.cpp \ - util/qundoview.cpp + util/qundoview.cpp \ + util/qsystemtrayicon_qpa.cpp - -wince* { - SOURCES += \ - util/qsystemtrayicon_wince.cpp -} else:win32:!qpa { - SOURCES += \ - util/qsystemtrayicon_win.cpp -} - -unix:x11 { - SOURCES += \ - util/qsystemtrayicon_x11.cpp -} - -qpa { - SOURCES += \ - util/qsystemtrayicon_qpa.cpp -} - -!qpa:!x11:mac { +# TODO +false:!x11:mac { OBJECTIVE_SOURCES += util/qsystemtrayicon_mac.mm } diff --git a/src/widgets/widgets.pro b/src/widgets/widgets.pro index 730a0fc63c..17f146b652 100644 --- a/src/widgets/widgets.pro +++ b/src/widgets/widgets.pro @@ -11,8 +11,6 @@ DEFINES += QT_BUILD_WIDGETS_LIB QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x65000000 irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused -!win32:!qpa:!mac:CONFIG += x11 - unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore HEADERS += $$QT_SOURCE_TREE/src/widgets/qtwidgetsversion.h diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp index 95027afb86..82340d15ed 100644 --- a/src/widgets/widgets/qabstractspinbox.cpp +++ b/src/widgets/widgets/qabstractspinbox.cpp @@ -65,11 +65,6 @@ #include #endif -#if defined(Q_OS_SYMBIAN) -#include -#include -#endif - //#define QABSTRACTSPINBOX_QSBDEBUG #ifdef QABSTRACTSPINBOX_QSBDEBUG # define QASBDEBUG qDebug @@ -1176,12 +1171,7 @@ void QAbstractSpinBox::hideEvent(QHideEvent *event) */ static int getKeyboardAutoRepeatRate() { int ret = 30; -#if defined(Q_OS_SYMBIAN) - TTimeIntervalMicroSeconds32 initialTime; - TTimeIntervalMicroSeconds32 time; - S60->wsSession().GetKeyboardRepeatRate(initialTime, time); - ret = time.Int() / 1000; // msecs -#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) DWORD time; if (SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, &time, 0) != FALSE) ret = static_cast(1000 / static_cast(time)); // msecs diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index 2b91601f8c..1412bf547a 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -1665,11 +1665,7 @@ void QLineEdit::focusInEvent(QFocusEvent *e) d->clickCausedFocus = 1; } #ifdef QT_KEYPAD_NAVIGATION - if (!QApplication::keypadNavigationEnabled() || (hasEditFocus() && ( e->reason() == Qt::PopupFocusReason -#ifdef Q_OS_SYMBIAN - || e->reason() == Qt::ActiveWindowFocusReason -#endif - ))) { + if (!QApplication::keypadNavigationEnabled() || (hasEditFocus() && ( e->reason() == Qt::PopupFocusReason))) { #endif d->control->setCursorBlinkPeriod(QApplication::cursorFlashTime()); QStyleOptionFrameV2 opt; diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 43fff6a8cf..8b3af3fb25 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -1760,12 +1760,10 @@ QSize QMenu::sizeHint() const void QMenu::popup(const QPoint &p, QAction *atAction) { Q_D(QMenu); -#ifndef Q_OS_SYMBIAN if (d->scroll) { // reset scroll state from last popup d->scroll->scrollOffset = 0; d->scroll->scrollFlags = QMenuPrivate::QMenuScroller::ScrollNone; } -#endif d->tearoffHighlighted = 0; d->motions = 0; d->doChildEffects = true; diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 68dad9fe7a..b2a38c3c47 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -2025,11 +2025,7 @@ void QWidgetTextControlPrivate::focusEvent(QFocusEvent *e) emit q->updateRequest(q->selectionRect()); if (e->gotFocus()) { #ifdef QT_KEYPAD_NAVIGATION - if (!QApplication::keypadNavigationEnabled() || (hasEditFocus && (e->reason() == Qt::PopupFocusReason -#ifdef Q_OS_SYMBIAN - || e->reason() == Qt::ActiveWindowFocusReason -#endif - ))) { + if (!QApplication::keypadNavigationEnabled() || (hasEditFocus && (e->reason() == Qt::PopupFocusReason))) { #endif cursorOn = (interactionFlags & Qt::TextSelectableByKeyboard); if (interactionFlags & Qt::TextEditable) { diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri index c33408087d..0875ecaa6b 100644 --- a/src/widgets/widgets/widgets.pri +++ b/src/widgets/widgets/widgets.pri @@ -142,7 +142,8 @@ SOURCES += \ widgets/qtoolbararealayout.cpp \ widgets/qplaintextedit.cpp -!qpa:mac { +# TODO +false:mac { HEADERS += widgets/qmacnativewidget_mac.h \ widgets/qmaccocoaviewcontainer_mac.h OBJECTIVE_HEADERS += widgets/qcocoatoolbardelegate_mac_p.h \ -- cgit v1.2.3