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 <Friedemann.Kleint@nokia.com>
This commit is contained in:
Friedemann Kleint 2011-10-20 16:36:05 +02:00 committed by Qt by Nokia
parent c7df1af337
commit fc14bd2c92
29 changed files with 59 additions and 762 deletions

View File

@ -49,6 +49,7 @@
#include <qlibrary.h>
#include <qimage.h>
#include <qwindow.h>
QT_BEGIN_NAMESPACE

View File

@ -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 \

View File

@ -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 <AknUtils.h> // 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<QFileDialog *>(this) || qobject_cast<QFontDialog *>(this) ||
qobject_cast<QWizard *>(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

View File

@ -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())

View File

@ -58,7 +58,7 @@
#include <qdebug.h>
#include <qapplication.h>
#include <qstylepainter.h>
#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

View File

@ -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);

View File

@ -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

View File

@ -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<QObject> 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<QGridLayout *>(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();
}

View File

@ -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;

View File

@ -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) {

View File

@ -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
kernel/qwidgetsvariant.cpp \
kernel/qapplication_qpa.cpp \
kernel/qdesktopwidget_qpa.cpp \
kernel/qwidget_qpa.cpp \
kernel/qwidgetwindow_qpa.cpp \
kernel/qplatformmenu_qpa.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 {
# TODO
false:!x11:mac {
SOURCES += \
kernel/qclipboard_mac.cpp \
kernel/qmime_mac.cpp \

View File

@ -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<QCloseEvent*>(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);
}
}

View File

@ -50,20 +50,10 @@
#ifdef QT_INCLUDE_COMPAT
# include <QtWidgets/qdesktopwidget.h>
#endif
#ifdef Q_WS_QWS
# include <QtGui/qrgb.h>
# include <QtGui/qtransportauth_qws.h>
#endif
#ifdef Q_WS_QPA
# include <QtGui/qguiapplication.h>
#endif
#include <QtGui/qguiapplication.h>
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 <typename T> 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<QApplication *>(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

View File

@ -72,15 +72,10 @@
#include <private/qthread_p.h>
#include "QtCore/qpoint.h"
#include <QTime>
#ifdef Q_OS_SYMBIAN
#include <w32std.h>
#endif
#ifdef Q_WS_QPA
#include <QWindowSystemInterface>
#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<QByteArray, QPalette> 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<QWidget> &lastMouseReceiver,
bool spontaneous = true);
#ifdef Q_OS_SYMBIAN
static void setNavigationMode(Qt::NavigationMode mode);
static TUint resolveS60ScanCode(TInt scanCode, TUint keysym);
QSet<WId> 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

View File

@ -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
}

View File

@ -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
{

View File

@ -70,10 +70,8 @@
# include "qtoolbar.h"
# include <private/qmainwindowlayout_p.h>
#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 <private/qpaintengine_raster_p.h>
#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<QWidget *>(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.

View File

@ -56,10 +56,6 @@
#include <QtGui/qcursor.h>
#include <QtGui/qkeysequence.h>
#ifdef Q_WS_QPA //should this go somewhere else?
#include <QtGui/qwindow.h>
#endif
#ifdef QT_INCLUDE_COMPAT
#include <QtGui/qevent.h>
#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;
};

View File

@ -69,42 +69,12 @@
#include "QtWidgets/qgraphicsview.h"
#include <private/qgesture_p.h>
#ifdef Q_WS_WIN
#include "QtCore/qt_windows.h"
#include <private/qdnd_p.h>
#endif // Q_WS_WIN
#ifdef Q_WS_X11
#include "QtGui/qx11info_x11.h"
#endif
#ifdef Q_WS_MAC
#include <private/qt_mac_p.h>
#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<QAction*> &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

View File

@ -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

View File

@ -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;
}

View File

@ -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
}

View File

@ -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

View File

@ -65,11 +65,6 @@
#include <limits.h>
#endif
#if defined(Q_OS_SYMBIAN)
#include <w32std.h>
#include <private/qt_s60_p.h>
#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<int>(1000 / static_cast<int>(time)); // msecs

View File

@ -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;

View File

@ -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;

View File

@ -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) {

View File

@ -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 \