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 <qlibrary.h>
#include <qimage.h> #include <qimage.h>
#include <qwindow.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE

View File

@ -20,7 +20,8 @@ HEADERS += \
dialogs/qfileinfogatherer_p.h \ dialogs/qfileinfogatherer_p.h \
dialogs/qwizard.h dialogs/qwizard.h
!qpa:mac { # TODO
false:mac {
OBJECTIVE_SOURCES += dialogs/qfiledialog_mac.mm \ OBJECTIVE_SOURCES += dialogs/qfiledialog_mac.mm \
dialogs/qfontdialog_mac.mm \ dialogs/qfontdialog_mac.mm \
dialogs/qnspanelproxy_mac.mm dialogs/qnspanelproxy_mac.mm
@ -41,8 +42,6 @@ HEADERS += \
} }
win32 { win32 {
qpa:DEFINES += QT_NO_PRINTDIALOG
HEADERS += dialogs/qwizard_win_p.h \ HEADERS += dialogs/qwizard_win_p.h \
dialogs/qfiledialog_win_p.h dialogs/qfiledialog_win_p.h
SOURCES += dialogs/qdialogsbinarycompat_win.cpp \ 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 extern bool qt_wince_is_smartphone(); //is defined in qguifunctions_wce.cpp
#elif defined(Q_WS_X11) #elif defined(Q_WS_X11)
# include "../kernel/qt_x11_p.h" # 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 #endif
#ifndef SPI_GETSNAPTODEFBUTTON #ifndef SPI_GETSNAPTODEFBUTTON
@ -378,7 +369,7 @@ void QDialogPrivate::resetModalitySetByOpen()
resetModalityTo = -1; resetModalityTo = -1;
} }
#if defined(Q_WS_WINCE) || defined(Q_OS_SYMBIAN) #if defined(Q_WS_WINCE)
#ifdef Q_WS_WINCE_WM #ifdef Q_WS_WINCE_WM
void QDialogPrivate::_q_doneAction() void QDialogPrivate::_q_doneAction()
{ {
@ -514,13 +505,6 @@ int QDialog::exec()
#endif //Q_WS_WINCE_WM #endif //Q_WS_WINCE_WM
bool showSystemDialogFullScreen = false; 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) { if (showSystemDialogFullScreen) {
setWindowFlags(windowFlags() | Qt::WindowSoftkeysVisibleHint); setWindowFlags(windowFlags() | Qt::WindowSoftkeysVisibleHint);
setWindowState(Qt::WindowFullScreen); setWindowState(Qt::WindowFullScreen);
@ -808,13 +792,6 @@ void QDialog::adjustPosition(QWidget* w)
if (X11->isSupportedByWM(ATOM(_NET_WM_FULL_PLACEMENT))) if (X11->isSupportedByWM(ATOM(_NET_WM_FULL_PLACEMENT)))
return; return;
#endif #endif
#ifdef Q_OS_SYMBIAN
if (symbianAdjustedPosition())
//dialog has already been positioned
return;
#endif
QPoint p(0, 0); QPoint p(0, 0);
int extraw = 0, extrah = 0, scrn = 0; int extraw = 0, extrah = 0, scrn = 0;
if (w) if (w)
@ -878,73 +855,6 @@ void QDialog::adjustPosition(QWidget* w)
move(p); 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 \obsolete

View File

@ -103,7 +103,7 @@ public Q_SLOTS:
protected: protected:
QDialog(QDialogPrivate &, QWidget *parent, Qt::WindowFlags f = 0); 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); bool event(QEvent *e);
#endif #endif
void keyPressEvent(QKeyEvent *); void keyPressEvent(QKeyEvent *);
@ -119,10 +119,6 @@ private:
Q_DECLARE_PRIVATE(QDialog) Q_DECLARE_PRIVATE(QDialog)
Q_DISABLE_COPY(QDialog) Q_DISABLE_COPY(QDialog)
#if defined(Q_OS_SYMBIAN)
bool symbianAdjustedPosition();
#endif
#ifdef Q_WS_WINCE_WM #ifdef Q_WS_WINCE_WM
Q_PRIVATE_SLOT(d_func(), void _q_doneAction()) Q_PRIVATE_SLOT(d_func(), void _q_doneAction())

View File

@ -58,7 +58,7 @@
#include <qdebug.h> #include <qdebug.h>
#include <qapplication.h> #include <qapplication.h>
#include <qstylepainter.h> #include <qstylepainter.h>
#if !defined(Q_WS_WINCE) && !defined(Q_OS_SYMBIAN) #if !defined(Q_WS_WINCE)
#include "ui_qfiledialog.h" #include "ui_qfiledialog.h"
#else #else
#define Q_EMBEDDED_SMALLSCREEN #define Q_EMBEDDED_SMALLSCREEN
@ -3422,7 +3422,7 @@ QStringList QFSCompleter::splitPath(const QString &path) const
parts[0] = sep[0]; parts[0] = sep[0];
#endif #endif
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) #if defined(Q_OS_WIN)
bool startsFromRoot = !parts.isEmpty() && parts[0].endsWith(QLatin1Char(':')); bool startsFromRoot = !parts.isEmpty() && parts[0].endsWith(QLatin1Char(':'));
#else #else
bool startsFromRoot = pathCopy[0] == sep[0]; bool startsFromRoot = pathCopy[0] == sep[0];
@ -3434,7 +3434,7 @@ QStringList QFSCompleter::splitPath(const QString &path) const
else else
dirModel = sourceModel; dirModel = sourceModel;
QString currentLocation = QDir::toNativeSeparators(dirModel->rootPath()); QString currentLocation = QDir::toNativeSeparators(dirModel->rootPath());
#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) #if defined(Q_OS_WIN)
if (currentLocation.endsWith(QLatin1Char(':'))) if (currentLocation.endsWith(QLatin1Char(':')))
currentLocation.append(sep); currentLocation.append(sep);
#endif #endif

View File

@ -182,10 +182,9 @@ public:
static inline QString toInternal(const QString &path) 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); QString n(path);
for (int i = 0; i < (int)n.length(); ++i) n.replace(QLatin1Char('\\'), QLatin1Char('/'));
if (n[i] == QLatin1Char('\\')) n[i] = QLatin1Char('/');
#if defined(Q_OS_WINCE) #if defined(Q_OS_WINCE)
if ((n.size() > 1) && (n.startsWith(QLatin1String("//")))) if ((n.size() > 1) && (n.startsWith(QLatin1String("//"))))
n = n.mid(1); n = n.mid(1);

View File

@ -232,11 +232,7 @@ void QInputDialogPrivate::ensureLayout()
mainLayout = new QVBoxLayout(q); mainLayout = new QVBoxLayout(q);
//we want to let the input dialog grow to available size on Symbian. //we want to let the input dialog grow to available size on Symbian.
#ifndef Q_OS_SYMBIAN
mainLayout->setSizeConstraint(QLayout::SetMinAndMaxSize); mainLayout->setSizeConstraint(QLayout::SetMinAndMaxSize);
#else
label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
#endif
mainLayout->addWidget(label); mainLayout->addWidget(label);
mainLayout->addWidget(inputWidget); mainLayout->addWidget(inputWidget);
mainLayout->addWidget(buttonBox); mainLayout->addWidget(buttonBox);
@ -563,9 +559,6 @@ void QInputDialog::setLabelText(const QString &text)
} else { } else {
d->label->setText(text); d->label->setText(text);
} }
#ifdef Q_OS_SYMBIAN
d->label->setWordWrap(true);
#endif
} }
QString QInputDialog::labelText() const QString QInputDialog::labelText() const

View File

@ -223,9 +223,6 @@ public:
bool autoAddOkButton; bool autoAddOkButton;
QAbstractButton *detectedEscapeButton; QAbstractButton *detectedEscapeButton;
QLabel *informativeLabel; QLabel *informativeLabel;
#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5)
QTextBrowser *textBrowser;
#endif
QPointer<QObject> receiverToDisconnectOnClose; QPointer<QObject> receiverToDisconnectOnClose;
QByteArray memberToDisconnectOnClose; QByteArray memberToDisconnectOnClose;
QByteArray signalToDisconnectOnClose; QByteArray signalToDisconnectOnClose;
@ -307,7 +304,7 @@ void QMessageBoxPrivate::updateSize()
return; return;
QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size(); 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. // the width of the screen, less the window border.
int hardLimit = screenSize.width() - (q->frameGeometry().width() - q->geometry().width()); int hardLimit = screenSize.width() - (q->frameGeometry().width() - q->geometry().width());
#else #else
@ -2498,24 +2495,10 @@ void QMessageBox::setInformativeText(const QString &text)
#endif #endif
label->setWordWrap(true); label->setWordWrap(true);
QGridLayout *grid = static_cast<QGridLayout *>(layout()); 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); grid->addWidget(label, 1, 1, 1, 1);
#endif
d->informativeLabel = label; d->informativeLabel = label;
} }
d->informativeLabel->setText(text); 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(); d->updateSize();
} }

View File

@ -154,12 +154,6 @@ void QProgressDialogPrivate::layout()
bool(q->style()->styleHint(QStyle::SH_ProgressDialog_CenterCancelButton, 0, q)); bool(q->style()->styleHint(QStyle::SH_ProgressDialog_CenterCancelButton, 0, q));
int additionalSpacing = 0; 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 cs = cancel ? cancel->sizeHint() : QSize(0,0);
QSize bh = bar->sizeHint(); QSize bh = bar->sizeHint();
int cspc; int cspc;

View File

@ -7391,7 +7391,7 @@ void QGraphicsItem::setInputMethodHints(Qt::InputMethodHints hints)
*/ */
void QGraphicsItem::updateMicroFocus() 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 (QWidget *fw = QApplication::focusWidget()) {
if (scene()) { if (scene()) {
for (int i = 0 ; i < scene()->views().count() ; ++i) { for (int i = 0 ; i < scene()->views().count() ; ++i) {

View File

@ -1,8 +1,7 @@
# Qt kernel module # Qt kernel module
# Only used on platforms with CONFIG += precompile_header # 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 KERNEL_P= kernel
HEADERS += \ HEADERS += \
@ -31,8 +30,8 @@ HEADERS += \
kernel/qstackedlayout.h \ kernel/qstackedlayout.h \
kernel/qtooltip.h \ kernel/qtooltip.h \
kernel/qwhatsthis.h \ kernel/qwhatsthis.h \
kernel/qwidget.h \ kernel/qwidget.h \
kernel/qwidget_p.h \ kernel/qwidget_p.h \
kernel/qwidgetaction.h \ kernel/qwidgetaction.h \
kernel/qwidgetaction_p.h \ kernel/qwidgetaction_p.h \
kernel/qgesture.h \ kernel/qgesture.h \
@ -41,8 +40,11 @@ HEADERS += \
kernel/qgesturerecognizer.h \ kernel/qgesturerecognizer.h \
kernel/qgesturemanager_p.h \ kernel/qgesturemanager_p.h \
kernel/qsoftkeymanager_p.h \ kernel/qsoftkeymanager_p.h \
kernel/qsoftkeymanager_common_p.h \ kernel/qsoftkeymanager_common_p.h \
kernel/qguiplatformplugin_p.h kernel/qguiplatformplugin_p.h \
kernel/qdesktopwidget_qpa_p.h \
kernel/qwidgetwindow_qpa_p.h \
kernel/qplatformmenu_qpa.h
SOURCES += \ SOURCES += \
kernel/qaction.cpp \ kernel/qaction.cpp \
@ -73,90 +75,15 @@ SOURCES += \
kernel/qsoftkeymanager.cpp \ kernel/qsoftkeymanager.cpp \
kernel/qdesktopwidget.cpp \ kernel/qdesktopwidget.cpp \
kernel/qguiplatformplugin.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 # TODO
false:!x11:mac {
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 {
SOURCES += \ SOURCES += \
kernel/qclipboard_mac.cpp \ kernel/qclipboard_mac.cpp \
kernel/qmime_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 //#define ALIEN_DEBUG
#if defined(Q_OS_SYMBIAN)
#include "qt_s60_p.h"
#endif
static void initResources() static void initResources()
{ {
#if defined(Q_WS_WINCE) #if defined(Q_WS_WINCE)
Q_INIT_RESOURCE_EXTERN(qstyle_wince) Q_INIT_RESOURCE_EXTERN(qstyle_wince)
Q_INIT_RESOURCE(qstyle_wince); Q_INIT_RESOURCE(qstyle_wince);
#elif defined(Q_OS_SYMBIAN)
Q_INIT_RESOURCE_EXTERN(qstyle_s60)
Q_INIT_RESOURCE(qstyle_s60);
#else #else
Q_INIT_RESOURCE_EXTERN(qstyle) Q_INIT_RESOURCE_EXTERN(qstyle)
Q_INIT_RESOURCE(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::sys_pal = 0; // default system palette
QPalette *QApplicationPrivate::set_pal = 0; // default palette set by programmer 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::sys_font = 0; // default system font
QFont *QApplicationPrivate::set_font = 0; // default font set by programmer 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::widgetCount = false;
bool QApplicationPrivate::load_testability = false; bool QApplicationPrivate::load_testability = false;
#ifdef QT_KEYPAD_NAVIGATION #ifdef QT_KEYPAD_NAVIGATION
# ifdef Q_OS_SYMBIAN
Qt::NavigationMode QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadDirectional;
# else
Qt::NavigationMode QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadTabOrder; Qt::NavigationMode QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadTabOrder;
# endif
QWidget *QApplicationPrivate::oldEditFocus = 0; QWidget *QApplicationPrivate::oldEditFocus = 0;
#endif #endif
@ -504,9 +489,6 @@ FontHash *qt_app_fonts_hash()
QWidgetList *QApplicationPrivate::popupWidgets = 0; // has keyboard input focus QWidgetList *QApplicationPrivate::popupWidgets = 0; // has keyboard input focus
QDesktopWidget *qt_desktopWidget = 0; // root window widgets 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 QWidgetList * qt_modal_stack = 0; // stack of modal widgets
bool app_do_modal = false; bool app_do_modal = false;
@ -778,22 +760,12 @@ void QApplicationPrivate::construct(
qt_gui_eval_init(application_type); qt_gui_eval_init(application_type);
#endif #endif
#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SYSTEMLOCALE)
symbianInit();
#endif
#ifndef QT_NO_LIBRARY #ifndef QT_NO_LIBRARY
if(load_testability) { if(load_testability) {
QLibrary testLib(QLatin1String("qttestability")); QLibrary testLib(QLatin1String("qttestability"));
if (testLib.load()) { if (testLib.load()) {
typedef void (*TasInitialize)(void); typedef void (*TasInitialize)(void);
TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init"); 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) { if (initFunction) {
initFunction(); initFunction();
} else { } else {
@ -1002,14 +974,6 @@ QApplication::~QApplication()
{ {
Q_D(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 //### this should probable be done even later
qt_call_post_routines(); qt_call_post_routines();
@ -1017,10 +981,6 @@ QApplication::~QApplication()
d->toolTipWakeUp.stop(); d->toolTipWakeUp.stop();
d->toolTipFallAsleep.stop(); d->toolTipFallAsleep.stop();
#if !defined(Q_WS_QPA)
d->eventDispatcher->closingDown();
d->eventDispatcher = 0;
#endif
QApplicationPrivate::is_app_closing = true; QApplicationPrivate::is_app_closing = true;
QApplicationPrivate::is_app_running = false; QApplicationPrivate::is_app_running = false;
@ -1042,11 +1002,6 @@ QApplication::~QApplication()
delete qt_desktopWidget; delete qt_desktopWidget;
qt_desktopWidget = 0; 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) #if defined(Q_WS_X11) || defined(Q_WS_WIN)
delete d->move_cursor; d->move_cursor = 0; delete d->move_cursor; d->move_cursor = 0;
delete d->copy_cursor; d->copy_cursor = 0; delete d->copy_cursor; d->copy_cursor = 0;
@ -1064,14 +1019,6 @@ QApplication::~QApplication()
QApplicationPrivate::set_pal = 0; QApplicationPrivate::set_pal = 0;
app_palettes()->clear(); app_palettes()->clear();
#ifndef Q_WS_QPA
{
QMutexLocker locker(applicationFontMutex());
delete QApplicationPrivate::app_font;
QApplicationPrivate::app_font = 0;
}
#endif
delete QApplicationPrivate::sys_font; delete QApplicationPrivate::sys_font;
QApplicationPrivate::sys_font = 0; QApplicationPrivate::sys_font = 0;
delete QApplicationPrivate::set_font; delete QApplicationPrivate::set_font;
@ -1787,14 +1734,7 @@ void QApplicationPrivate::setSystemPalette(const QPalette &pal)
*/ */
QFont QApplication::font() 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(); return QGuiApplication::font();
#endif
} }
/*! /*!
@ -1873,15 +1813,7 @@ void QApplication::setFont(const QFont &font, const char *className)
bool all = false; bool all = false;
FontHash *hash = app_fonts(); FontHash *hash = app_fonts();
if (!className) { 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); QGuiApplication::setFont(font);
#endif
if (hash && hash->size()) { if (hash && hash->size()) {
all = true; all = true;
hash->clear(); hash->clear();
@ -2071,11 +2003,7 @@ void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason)
if (prev) { if (prev) {
#ifdef QT_KEYPAD_NAVIGATION #ifdef QT_KEYPAD_NAVIGATION
if (QApplication::keypadNavigationEnabled()) { if (QApplication::keypadNavigationEnabled()) {
if (prev->hasEditFocus() && reason != Qt::PopupFocusReason if (prev->hasEditFocus() && reason != Qt::PopupFocusReason)
#ifdef Q_OS_SYMBIAN
&& reason != Qt::ActiveWindowFocusReason
#endif
)
prev->setEditFocus(false); prev->setEditFocus(false);
} }
#endif #endif
@ -2238,11 +2166,6 @@ bool QApplication::event(QEvent *e)
{ {
Q_D(QApplication); Q_D(QApplication);
if(e->type() == QEvent::Close) { 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); QCloseEvent *ce = static_cast<QCloseEvent*>(e);
ce->accept(); ce->accept();
closeAllWindows(); closeAllWindows();
@ -2258,11 +2181,6 @@ bool QApplication::event(QEvent *e)
} }
if (ce->isAccepted()) { if (ce->isAccepted()) {
return true; return true;
} else {
#if defined(Q_OS_SYMBIAN)
if (effectStarted)
qt_abortFullScreenEffect();
#endif
} }
#ifndef Q_OS_WIN #ifndef Q_OS_WIN
} else if (e->type() == QEvent::LocaleChange) { } else if (e->type() == QEvent::LocaleChange) {
@ -2627,8 +2545,7 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave) {
// Update cursor for alien/graphics widgets. // Update cursor for alien/graphics widgets.
const bool enterOnAlien = (enter && (isAlien(enter) || enter->testAttribute(Qt::WA_DontShowOnScreen))); 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/QPA, we need to reset its nativeParentWidget()'s cursor.
//Whenever we leave an alien widget on X11, we need to reset its nativeParentWidget()'s cursor.
// This is not required on Windows as the cursor is reset on every single mouse move. // This is not required on Windows as the cursor is reset on every single mouse move.
QWidget *parentOfLeavingCursor = 0; QWidget *parentOfLeavingCursor = 0;
for (int i = 0; i < leaveList.size(); ++i) { for (int i = 0; i < leaveList.size(); ++i) {
@ -2653,16 +2570,14 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave) {
{ {
#if defined(Q_WS_X11) #if defined(Q_WS_X11)
qt_x11_enforce_cursor(parentOfLeavingCursor,true); qt_x11_enforce_cursor(parentOfLeavingCursor,true);
#elif defined(Q_WS_QPA) #endif
if (enter == QApplication::desktop()) { if (enter == QApplication::desktop()) {
qt_qpa_set_cursor(enter, true); qt_qpa_set_cursor(enter, true);
} else { } else {
qt_qpa_set_cursor(parentOfLeavingCursor, true); qt_qpa_set_cursor(parentOfLeavingCursor, true);
} }
#endif
} }
} }
#endif
if (enterOnAlien) { if (enterOnAlien) {
QWidget *cursorWidget = enter; QWidget *cursorWidget = enter;
while (!cursorWidget->isWindow() && !cursorWidget->isEnabled()) while (!cursorWidget->isWindow() && !cursorWidget->isEnabled())
@ -2681,9 +2596,7 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave) {
qt_win_set_cursor(cursorWidget, true); qt_win_set_cursor(cursorWidget, true);
#elif defined(Q_WS_X11) #elif defined(Q_WS_X11)
qt_x11_enforce_cursor(cursorWidget, true); qt_x11_enforce_cursor(cursorWidget, true);
#elif defined(Q_OS_SYMBIAN) #else
qt_symbian_set_cursor(cursorWidget, true);
#elif defined(Q_WS_QPA)
qt_qpa_set_cursor(cursorWidget, true); qt_qpa_set_cursor(cursorWidget, true);
#endif #endif
} }
@ -2987,7 +2900,6 @@ bool QApplicationPrivate::sendMouseEvent(QWidget *receiver, QMouseEvent *event,
return result; 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. 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 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) void QApplicationPrivate::sendSyntheticEnterLeave(QWidget *widget)
{ {
#ifndef QT_NO_CURSOR #ifndef QT_NO_CURSOR
#if defined(Q_WS_QWS) || defined(Q_WS_QPA)
if (!widget || widget->isWindow()) if (!widget || widget->isWindow())
return; return;
#else
if (!widget || widget->internalWinId() || widget->isWindow())
return;
#endif
const bool widgetInShow = widget->isVisible() && !widget->data->in_destructor; const bool widgetInShow = widget->isVisible() && !widget->data->in_destructor;
if (!widgetInShow && widget != qt_last_mouse_receiver) if (!widgetInShow && widget != qt_last_mouse_receiver)
return; // Widget was not under the cursor when it was hidden/deleted. 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); sendMouseEvent(widgetUnderCursor, &e, widgetUnderCursor, tlw, &qt_button_down, qt_last_mouse_receiver);
#endif // QT_NO_CURSOR #endif // QT_NO_CURSOR
} }
#endif // Q_WS_WIN || Q_WS_X11 || Q_WS_MAC
/*! /*!
Returns the desktop widget (also called the root window). Returns the desktop widget (also called the root window).
@ -3068,25 +2974,6 @@ QDesktopWidget *QApplication::desktop()
return qt_desktopWidget; 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 Sets whether Qt should use the system's standard colors, fonts, etc., to
\a on. By default, this is true. \a on. By default, this is true.
@ -4824,11 +4711,7 @@ void QApplicationPrivate::emitLastWindowClosed()
*/ */
void QApplication::setNavigationMode(Qt::NavigationMode mode) void QApplication::setNavigationMode(Qt::NavigationMode mode)
{ {
#ifdef Q_OS_SYMBIAN
QApplicationPrivate::setNavigationMode(mode);
#else
QApplicationPrivate::navigationMode = mode; QApplicationPrivate::navigationMode = mode;
#endif
} }
/*! /*!
@ -4871,13 +4754,8 @@ Qt::NavigationMode QApplication::navigationMode()
void QApplication::setKeypadNavigationEnabled(bool enable) void QApplication::setKeypadNavigationEnabled(bool enable)
{ {
if (enable) { if (enable) {
#ifdef Q_OS_SYMBIAN
QApplication::setNavigationMode(Qt::NavigationModeKeypadDirectional);
#else
QApplication::setNavigationMode(Qt::NavigationModeKeypadTabOrder); QApplication::setNavigationMode(Qt::NavigationModeKeypadTabOrder);
#endif } else {
}
else {
QApplication::setNavigationMode(Qt::NavigationModeNone); QApplication::setNavigationMode(Qt::NavigationModeNone);
} }
} }

View File

@ -50,20 +50,10 @@
#ifdef QT_INCLUDE_COMPAT #ifdef QT_INCLUDE_COMPAT
# include <QtWidgets/qdesktopwidget.h> # include <QtWidgets/qdesktopwidget.h>
#endif #endif
#ifdef Q_WS_QWS #include <QtGui/qguiapplication.h>
# include <QtGui/qrgb.h>
# include <QtGui/qtransportauth_qws.h>
#endif
#ifdef Q_WS_QPA
# include <QtGui/qguiapplication.h>
#endif
QT_BEGIN_HEADER QT_BEGIN_HEADER
#if defined(Q_OS_SYMBIAN)
class CApaApplication;
#endif
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
QT_MODULE(Gui) QT_MODULE(Gui)
@ -76,14 +66,7 @@ class QIcon;
class QInputContext; class QInputContext;
template <typename T> class QList; template <typename T> class QList;
class QLocale; class QLocale;
#if defined(Q_WS_QWS)
class QDecoration;
#elif defined(Q_WS_QPA)
class QPlatformNativeInterface; class QPlatformNativeInterface;
#endif
#if defined(Q_OS_SYMBIAN)
class QSymbianEvent;
#endif
class QApplication; class QApplication;
class QApplicationPrivate; class QApplicationPrivate;
@ -92,11 +75,7 @@ class QApplicationPrivate;
#endif #endif
#define qApp (static_cast<QApplication *>(QCoreApplication::instance())) #define qApp (static_cast<QApplication *>(QCoreApplication::instance()))
#ifdef Q_WS_QPA
#define QApplicationBase QGuiApplication #define QApplicationBase QGuiApplication
#else
#define QApplicationBase QCoreApplication
#endif
class Q_WIDGETS_EXPORT QApplication : public QApplicationBase class Q_WIDGETS_EXPORT QApplication : public QApplicationBase
{ {
@ -123,10 +102,6 @@ class Q_WIDGETS_EXPORT QApplication : public QApplicationBase
public: public:
enum Type { Tty, GuiClient, GuiServer }; enum Type { Tty, GuiClient, GuiServer };
#ifdef Q_OS_SYMBIAN
typedef CApaApplication * (*QS60MainApplicationFactory)();
#endif
#ifndef qdoc #ifndef qdoc
QApplication(int &argc, char **argv, int = ApplicationFlags); QApplication(int &argc, char **argv, int = ApplicationFlags);
QApplication(int &argc, char **argv, bool GUIenabled, 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, 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); QApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0, int = ApplicationFlags);
#endif #endif
#if defined(Q_OS_SYMBIAN)
QApplication(QApplication::QS60MainApplicationFactory factory, int &argc, char **argv, int = ApplicationFlags);
#endif
#endif #endif
virtual ~QApplication(); virtual ~QApplication();
@ -174,9 +146,6 @@ public:
static QWidget *activePopupWidget(); static QWidget *activePopupWidget();
static QWidget *activeModalWidget(); static QWidget *activeModalWidget();
#if !defined(Q_WS_QPA) && !defined(QT_NO_CLIPBOARD)
static QClipboard *clipboard();
#endif
static QWidget *focusWidget(); static QWidget *focusWidget();
static QWidget *activeWindow(); static QWidget *activeWindow();
@ -230,10 +199,6 @@ public:
virtual int x11ClientMessage(QWidget*, XEvent*, bool passive_only); virtual int x11ClientMessage(QWidget*, XEvent*, bool passive_only);
int x11ProcessEvent(XEvent*); int x11ProcessEvent(XEvent*);
#endif #endif
#if defined(Q_OS_SYMBIAN)
int symbianProcessEvent(const QSymbianEvent *event);
virtual bool symbianEventFilter(const QSymbianEvent *event);
#endif
#if defined(Q_WS_QWS) #if defined(Q_WS_QWS)
virtual bool qwsEventFilter(QWSEvent *); virtual bool qwsEventFilter(QWSEvent *);
int qwsProcessEvent(QWSEvent*); int qwsProcessEvent(QWSEvent*);
@ -245,10 +210,7 @@ public:
#endif #endif
#endif #endif
#if defined(Q_WS_QPA)
static QPlatformNativeInterface *platformNativeInterface(); static QPlatformNativeInterface *platformNativeInterface();
#endif
#if defined(Q_WS_WIN) #if defined(Q_WS_WIN)
void winFocus(QWidget *, bool); void winFocus(QWidget *, bool);
@ -321,9 +283,6 @@ protected:
QApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0); 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); QApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0);
#endif #endif
#if defined(Q_OS_SYMBIAN) || defined(qdoc)
QApplication(QApplication::QS60MainApplicationFactory factory, int &argc, char **argv);
#endif
#endif #endif
private: private:
@ -364,9 +323,6 @@ private:
#if defined(QT_RX71_MULTITOUCH) #if defined(QT_RX71_MULTITOUCH)
Q_PRIVATE_SLOT(d_func(), void _q_readRX71MultiTouchEvents()) Q_PRIVATE_SLOT(d_func(), void _q_readRX71MultiTouchEvents())
#endif #endif
#if defined(Q_OS_SYMBIAN)
Q_PRIVATE_SLOT(d_func(), void _q_aboutToQuit())
#endif
}; };
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -72,15 +72,10 @@
#include <private/qthread_p.h> #include <private/qthread_p.h>
#include "QtCore/qpoint.h" #include "QtCore/qpoint.h"
#include <QTime> #include <QTime>
#ifdef Q_OS_SYMBIAN
#include <w32std.h>
#endif
#ifdef Q_WS_QPA
#include <QWindowSystemInterface> #include <QWindowSystemInterface>
#include "private/qwindowsysteminterface_qpa_p.h" #include "private/qwindowsysteminterface_qpa_p.h"
#include "QtGui/qplatformintegration_qpa.h" #include "QtGui/qplatformintegration_qpa.h"
#include "private/qguiapplication_p.h" #include "private/qguiapplication_p.h"
#endif
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -289,11 +284,7 @@ FontHash *qt_app_fonts_hash();
typedef QHash<QByteArray, QPalette> PaletteHash; typedef QHash<QByteArray, QPalette> PaletteHash;
PaletteHash *qt_app_palettes_hash(); PaletteHash *qt_app_palettes_hash();
#ifdef Q_WS_QPA
#define QApplicationPrivateBase QGuiApplicationPrivate #define QApplicationPrivateBase QGuiApplicationPrivate
#else
#define QApplicationPrivateBase QCoreApplicationPrivate
#endif
class Q_WIDGETS_EXPORT QApplicationPrivate : public QApplicationPrivateBase class Q_WIDGETS_EXPORT QApplicationPrivate : public QApplicationPrivateBase
{ {
@ -393,9 +384,6 @@ public:
static QPalette *set_pal; static QPalette *set_pal;
private: private:
#ifndef Q_WS_QPA
static QFont *app_font; // private for a reason! Always use QApplication::font() instead!
#endif
public: public:
static QFont *sys_font; static QFont *sys_font;
static QFont *set_font; static QFont *set_font;
@ -477,20 +465,7 @@ public:
static bool sendMouseEvent(QWidget *receiver, QMouseEvent *event, QWidget *alienWidget, static bool sendMouseEvent(QWidget *receiver, QMouseEvent *event, QWidget *alienWidget,
QWidget *native, QWidget **buttonDown, QPointer<QWidget> &lastMouseReceiver, QWidget *native, QWidget **buttonDown, QPointer<QWidget> &lastMouseReceiver,
bool spontaneous = true); 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); void sendSyntheticEnterLeave(QWidget *widget);
#endif
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
static HWND getHWNDForWidget(QWidget *widget) static HWND getHWNDForWidget(QWidget *widget)
{ {
@ -602,8 +577,6 @@ Q_WIDGETS_EXPORT void qt_translateRawTouchEvent(QWidget *window,
#elif defined(Q_WS_X11) #elif defined(Q_WS_X11)
extern void qt_x11_enforce_cursor(QWidget *, bool); extern void qt_x11_enforce_cursor(QWidget *, bool);
extern void qt_x11_enforce_cursor(QWidget *); extern void qt_x11_enforce_cursor(QWidget *);
#elif defined(Q_OS_SYMBIAN)
extern void qt_symbian_set_cursor(QWidget *, bool);
#else #else
extern void qt_qpa_set_cursor(QWidget * w, bool force); extern void qt_qpa_set_cursor(QWidget * w, bool force);
#endif #endif

View File

@ -146,14 +146,8 @@ QString QGuiPlatformPlugin::styleName()
return QLatin1String("Windows"); // default styles for Windows return QLatin1String("Windows"); // default styles for Windows
#elif defined(Q_WS_X11) && defined(Q_OS_SOLARIS) #elif defined(Q_WS_X11) && defined(Q_OS_SOLARIS)
return QLatin1String("CDE"); // default style for X11 on 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) #elif defined(Q_WS_X11) && defined(Q_OS_IRIX)
return QLatin1String("SGI"); // default style for X11 on 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) #elif defined(Q_WS_MAC)
return QLatin1String("Macintosh"); // default style for all Mac's return QLatin1String("Macintosh"); // default style for all Mac's
#elif defined(Q_WS_X11) #elif defined(Q_WS_X11)
@ -184,6 +178,8 @@ QString QGuiPlatformPlugin::styleName()
break; break;
} }
return stylename; return stylename;
#else
return QLatin1String("Plastique"); // default style for X11 and small devices
#endif #endif
} }

View File

@ -75,9 +75,6 @@ class QWidget;
class QFont; class QFont;
class QPopupMenu; class QPopupMenu;
class QInputContextPrivate; class QInputContextPrivate;
#ifdef Q_OS_SYMBIAN
class QSymbianEvent;
#endif
class Q_WIDGETS_EXPORT QInputContext : public QObject class Q_WIDGETS_EXPORT QInputContext : public QObject
{ {

View File

@ -70,10 +70,8 @@
# include "qtoolbar.h" # include "qtoolbar.h"
# include <private/qmainwindowlayout_p.h> # include <private/qmainwindowlayout_p.h>
#endif #endif
#if defined(Q_WS_QPA)
#include "qplatformwindow_qpa.h" #include "qplatformwindow_qpa.h"
#include "private/qwidgetwindow_qpa_p.h" #include "private/qwidgetwindow_qpa_p.h"
#endif
#include "qpainter.h" #include "qpainter.h"
#include "qtooltip.h" #include "qtooltip.h"
#include "qwhatsthis.h" #include "qwhatsthis.h"
@ -93,10 +91,6 @@
#endif #endif
#include <private/qpaintengine_raster_p.h> #include <private/qpaintengine_raster_p.h>
#if defined(Q_OS_SYMBIAN)
#include "private/qt_s60_p.h"
#endif
#include "qwidget_p.h" #include "qwidget_p.h"
#include "qaction_p.h" #include "qaction_p.h"
#include "qlayout_p.h" #include "qlayout_p.h"
@ -291,9 +285,6 @@ QWidgetPrivate::QWidgetPrivate(int version)
, needWindowChange(0) , needWindowChange(0)
, window_event(0) , window_event(0)
, qd_hd(0) , qd_hd(0)
#elif defined(Q_OS_SYMBIAN)
, symbianScreenNumber(0)
, fixNativeOrientationCalled(false)
#endif #endif
{ {
if (!qApp) { if (!qApp) {
@ -1174,19 +1165,12 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
// programmer specified desktop widget // programmer specified desktop widget
xinfo = desktopWidget->d_func()->xinfo; xinfo = desktopWidget->d_func()->xinfo;
} }
#elif defined(Q_OS_SYMBIAN) #endif
if (desktopWidget) {
symbianScreenNumber = qt_widget_private(desktopWidget)->symbianScreenNumber;
}
#elif defined(Q_WS_QPA)
if (desktopWidget) { if (desktopWidget) {
const int screen = desktopWidget->d_func()->topData()->screenIndex; const int screen = desktopWidget->d_func()->topData()->screenIndex;
if (QWindow *window = q->windowHandle()) if (QWindow *window = q->windowHandle())
window->setScreen(QGuiApplication::screens().value(screen, 0)); window->setScreen(QGuiApplication::screens().value(screen, 0));
} }
#else
Q_UNUSED(desktopWidget);
#endif
data.fstrut_dirty = true; data.fstrut_dirty = true;
@ -1218,17 +1202,7 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
q->setAttribute(Qt::WA_WState_Hidden); q->setAttribute(Qt::WA_WState_Hidden);
//give potential windows a bigger "pre-initial" size; create_sys() will give them a new size later //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); data.crect = parentWidget ? QRect(0,0,100,30) : QRect(0,0,640,480);
#endif
focus_next = focus_prev = q; focus_next = focus_prev = q;
if ((f & Qt::WindowType_Mask) == Qt::Desktop) if ((f & Qt::WindowType_Mask) == Qt::Desktop)
@ -1484,23 +1458,11 @@ QWidget::~QWidget()
else if (!internalWinId() && isVisible()) { else if (!internalWinId() && isVisible()) {
qApp->d_func()->sendSyntheticEnterLeave(this); qApp->d_func()->sendSyntheticEnterLeave(this);
} }
#elif defined(Q_WS_QPA) #endif
else if (isVisible()) { else if (isVisible()) {
qApp->d_func()->sendSyntheticEnterLeave(this); 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()) { if (QWidgetBackingStore *bs = d->maybeBackingStore()) {
bs->removeDirtyWidget(this); bs->removeDirtyWidget(this);
if (testAttribute(Qt::WA_StaticContents)) if (testAttribute(Qt::WA_StaticContents))
@ -2144,9 +2106,6 @@ void QWidgetPrivate::setOpaque(bool opaque)
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
winUpdateIsOpaque(); winUpdateIsOpaque();
#endif #endif
#ifdef Q_OS_SYMBIAN
s60UpdateIsOpaque();
#endif
} }
void QWidgetPrivate::updateIsTranslucent() void QWidgetPrivate::updateIsTranslucent()
@ -2160,9 +2119,6 @@ void QWidgetPrivate::updateIsTranslucent()
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
winUpdateIsOpaque(); winUpdateIsOpaque();
#endif #endif
#ifdef Q_OS_SYMBIAN
s60UpdateIsOpaque();
#endif
} }
static inline void fillRegion(QPainter *painter, const QRegion &rgn, const QBrush &brush) static inline void fillRegion(QPainter *painter, const QRegion &rgn, const QBrush &brush)
@ -3161,13 +3117,12 @@ void QWidgetPrivate::setEnabled_helper(bool enable)
// disabled widgets // disabled widgets
qt_x11_enforce_cursor(q); qt_x11_enforce_cursor(q);
} }
#elif defined(Q_WS_QPA) #endif
if (q->testAttribute(Qt::WA_SetCursor) || q->isWindow()) { if (q->testAttribute(Qt::WA_SetCursor) || q->isWindow()) {
// enforce the windows behavior of clearing the cursor on // enforce the windows behavior of clearing the cursor on
// disabled widgets // disabled widgets
qt_qpa_set_cursor(q, false); qt_qpa_set_cursor(q, false);
} }
#endif
#if defined(Q_WS_MAC) #if defined(Q_WS_MAC)
setEnabled_helper_sys(enable); setEnabled_helper_sys(enable);
#endif #endif
@ -5202,10 +5157,6 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
//actually send the paint event //actually send the paint event
QPaintEvent e(toBePainted); QPaintEvent e(toBePainted);
QCoreApplication::sendSpontaneousEvent(q, &e); 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 //restore
if (paintEngine) { if (paintEngine) {
@ -7121,7 +7072,7 @@ void QWidgetPrivate::show_helper()
// On Windows, show the popup now so that our own focus handling // 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 // stores the correct old focus widget even if it's stolen in the
// showevent // 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) if (!isEmbedded && q->windowType() == Qt::Popup)
qApp->d_func()->openPopup(q); qApp->d_func()->openPopup(q);
#endif #endif
@ -7138,10 +7089,8 @@ void QWidgetPrivate::show_helper()
show_sys(); show_sys();
#if !defined(Q_WS_WIN) && !defined(Q_WS_MAC) && !defined(Q_OS_SYMBIAN)
if (!isEmbedded && q->windowType() == Qt::Popup) if (!isEmbedded && q->windowType() == Qt::Popup)
qApp->d_func()->openPopup(q); qApp->d_func()->openPopup(q);
#endif
#ifndef QT_NO_ACCESSIBILITY #ifndef QT_NO_ACCESSIBILITY
if (q->windowType() != Qt::ToolTip) // Tooltips are read aloud twice in MS narrator. 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 // next bit tries to move the focus if the focus widget is now
// hidden. // hidden.
if (wasVisible) { if (wasVisible) {
#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QPA)
qApp->d_func()->sendSyntheticEnterLeave(q); qApp->d_func()->sendSyntheticEnterLeave(q);
#endif
QWidget *fw = QApplication::focusWidget(); QWidget *fw = QApplication::focusWidget();
while (fw && !fw->isWindow()) { while (fw && !fw->isWindow()) {
if (fw == q) { if (fw == q) {
@ -7346,9 +7292,7 @@ void QWidget::setVisible(bool visible)
d->show_helper(); 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); qApp->d_func()->sendSyntheticEnterLeave(this);
#endif
} }
QEvent showToParentEvent(QEvent::ShowToParent); QEvent showToParentEvent(QEvent::ShowToParent);
@ -7473,9 +7417,7 @@ void QWidgetPrivate::hideChildren(bool spontaneous)
widget->d_func()->hide_sys(); 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); qApp->d_func()->sendSyntheticEnterLeave(widget);
#endif
#ifndef QT_NO_ACCESSIBILITY #ifndef QT_NO_ACCESSIBILITY
if (!spontaneous) if (!spontaneous)
QAccessible::updateAccessibility(widget, 0, QAccessible::ObjectHide); QAccessible::updateAccessibility(widget, 0, QAccessible::ObjectHide);
@ -7691,7 +7633,7 @@ QSize QWidgetPrivate::adjustedSize() const
#else // all others #else // all others
QRect screen = QApplication::desktop()->screenGeometry(q->pos()); QRect screen = QApplication::desktop()->screenGeometry(q->pos());
#endif #endif
#if defined (Q_WS_WINCE) || defined (Q_OS_SYMBIAN) #if defined (Q_WS_WINCE)
s.setWidth(qMin(s.width(), screen.width())); s.setWidth(qMin(s.width(), screen.width()));
s.setHeight(qMin(s.height(), screen.height())); s.setHeight(qMin(s.height(), screen.height()));
#else #else
@ -9232,18 +9174,16 @@ void QWidget::ensurePolished() const
QChildEvent e(QEvent::ChildPolished, const_cast<QWidget *>(this)); QChildEvent e(QEvent::ChildPolished, const_cast<QWidget *>(this));
QCoreApplication::sendEvent(d->parent, &e); QCoreApplication::sendEvent(d->parent, &e);
} }
#ifdef Q_WS_QPA
if (d->extra && d->extra->topextra && d->extra->topextra->window if (d->extra && d->extra->topextra && d->extra->topextra->window
&& d->extra->topextra->window->objectName().isEmpty()) { && d->extra->topextra->window->objectName().isEmpty()) {
QString on = objectName(); QString on = objectName();
if (on.isEmpty()) { if (on.isEmpty()) {
on = QString::fromUtf8(metaObject()->className()); on = QString::fromUtf8(metaObject()->className());
on += QLatin1String("Class"); on += QStringLiteral("Class");
} }
on += QLatin1String("Window"); on += QStringLiteral("Window");
d->extra->topextra->window->setObjectName(on); d->extra->topextra->window->setObjectName(on);
} }
#endif
} }
/*! /*!
@ -9684,7 +9624,7 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
desktopWidget = parent; desktopWidget = parent;
bool newParent = (parent != parentWidget()) || !wasCreated || desktopWidget; 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 (newParent && parent && !desktopWidget) {
if (testAttribute(Qt::WA_NativeWindow) && !qApp->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) if (testAttribute(Qt::WA_NativeWindow) && !qApp->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings)
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
@ -10250,9 +10190,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
QApplication::sendEvent(this, &e); QApplication::sendEvent(this, &e);
break; } break; }
case Qt::WA_NativeWindow: { case Qt::WA_NativeWindow: {
#if defined(Q_WS_QPA)
d->createTLExtra(); d->createTLExtra();
#endif
#ifndef QT_NO_IM #ifndef QT_NO_IM
QWidget *focusWidget = d->effectiveFocusWidget(); QWidget *focusWidget = d->effectiveFocusWidget();
if (on && !internalWinId() && hasFocus() if (on && !internalWinId() && hasFocus()
@ -10279,7 +10217,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
} }
case Qt::WA_PaintOnScreen: case Qt::WA_PaintOnScreen:
d->updateIsOpaque(); 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 // 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. // WA_PaintOnScreen is enabled. Paint on screen widgets must have win id.
// So must their children. // So must their children.
@ -10381,7 +10319,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
break; break;
case Qt::WA_AcceptTouchEvents: 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) if (on)
d->registerTouchWindow(); d->registerTouchWindow();
#endif #endif
@ -10792,56 +10730,6 @@ void QWidget::updateMicroFocus()
#endif #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. Raises this widget to the top of the parent widget's stack.
@ -12080,13 +11968,6 @@ void QWidget::clearMask()
handle could not be created. handle could not be created.
*/ */
#ifdef Q_OS_SYMBIAN
void QWidgetPrivate::_q_delayedDestroy(WId winId)
{
delete winId;
}
#endif
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
void QWidgetPrivate::syncUnifiedMode() { void QWidgetPrivate::syncUnifiedMode() {
// The whole purpose of this method is to keep the unifiedToolbar in sync. // 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/qcursor.h>
#include <QtGui/qkeysequence.h> #include <QtGui/qkeysequence.h>
#ifdef Q_WS_QPA //should this go somewhere else?
#include <QtGui/qwindow.h>
#endif
#ifdef QT_INCLUDE_COMPAT #ifdef QT_INCLUDE_COMPAT
#include <QtGui/qevent.h> #include <QtGui/qevent.h>
#endif #endif
@ -75,7 +71,7 @@ class QWSRegionManager;
class QStyle; class QStyle;
class QAction; class QAction;
class QVariant; class QVariant;
class QWindow;
class QActionEvent; class QActionEvent;
class QMouseEvent; class QMouseEvent;
class QWheelEvent; class QWheelEvent;
@ -600,13 +596,6 @@ public:
Qt::HANDLE macCGHandle() const; Qt::HANDLE macCGHandle() const;
#endif #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); void setAttribute(Qt::WidgetAttribute, bool on = true);
inline bool testAttribute(Qt::WidgetAttribute) const; inline bool testAttribute(Qt::WidgetAttribute) const;
@ -628,12 +617,10 @@ public:
QBackingStore *backingStore() const; QBackingStore *backingStore() const;
#if defined(Q_WS_QPA)
void setWindowHandle(QWindow *window); void setWindowHandle(QWindow *window);
QWindow *windowHandle() const; QWindow *windowHandle() const;
friend class QDesktopScreenWidget; friend class QDesktopScreenWidget;
#endif
Q_SIGNALS: Q_SIGNALS:
void customContextMenuRequested(const QPoint &pos); void customContextMenuRequested(const QPoint &pos);
@ -773,36 +760,12 @@ private:
friend class QRasterWindowSurface; friend class QRasterWindowSurface;
friend class QUnifiedToolbarSurface; friend class QUnifiedToolbarSurface;
#endif #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 QWidgetData *qt_qwidget_data(QWidget *widget);
friend Q_WIDGETS_EXPORT QWidgetPrivate *qt_widget_private(QWidget *widget); friend Q_WIDGETS_EXPORT QWidgetPrivate *qt_widget_private(QWidget *widget);
private: private:
Q_DISABLE_COPY(QWidget) Q_DISABLE_COPY(QWidget)
Q_PRIVATE_SLOT(d_func(), void _q_showIfNotHidden()) 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; QWidgetData *data;
}; };

View File

@ -69,42 +69,12 @@
#include "QtWidgets/qgraphicsview.h" #include "QtWidgets/qgraphicsview.h"
#include <private/qgesture_p.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 QT_BEGIN_NAMESPACE
// Extra QWidget data // Extra QWidget data
// - to minimize memory usage for members that are seldom used. // - to minimize memory usage for members that are seldom used.
// - top-level widgets have extra extra data to reduce cost further // - 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; class QWidgetWindow;
#endif
class QPaintEngine; class QPaintEngine;
class QPixmap; class QPixmap;
class QWidgetBackingStore; 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 // 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. // starting position as 0,0 instead of the normal starting position.
bool wasMaximized; bool wasMaximized;
#elif defined(Q_WS_QWS) // <--------------------------------------------------------- QWS
#ifndef QT_NO_QWS_MANAGER
QWSManager *qwsManager;
#endif #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; QWidgetWindow *window;
quint32 screenIndex; // index in qplatformscreenlist quint32 screenIndex; // index in qplatformscreenlist
#endif
}; };
struct QWExtra { struct QWExtra {
@ -289,50 +250,6 @@ struct QWExtra {
// Cocoa Mask stuff // Cocoa Mask stuff
QImage maskBits; QImage maskBits;
CGImageRef imageMask; 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 #endif
}; };
@ -414,11 +331,6 @@ public:
QPalette naturalWidgetPalette(uint inheritedMask) const; QPalette naturalWidgetPalette(uint inheritedMask) const;
void setMask_sys(const QRegion &); 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 raise_sys();
void lower_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()); void setWSGeometry(bool dontShow=false, const QRect &oldRect = QRect());
inline QPoint mapToWS(const QPoint &p) const inline QPoint mapToWS(const QPoint &p) const
@ -680,7 +591,6 @@ public:
inline QRect mapFromWS(const QRect &r) const inline QRect mapFromWS(const QRect &r) const
{ QRect rr(r); rr.translate(data.wrect.topLeft()); return rr; } { QRect rr(r); rr.translate(data.wrect.topLeft()); return rr; }
#endif
// Variables. // Variables.
// Regular pointers (keep them together to avoid gaps on 64 bit architectures). // 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 OSStatus qt_widget_event(EventHandlerCallRef er, EventRef event, void *);
static bool qt_widget_rgn(QWidget *, short, RgnHandle, bool); static bool qt_widget_rgn(QWidget *, short, RgnHandle, bool);
void registerTouchWindow(bool enable = true); void registerTouchWindow(bool enable = true);
#elif defined(Q_WS_QPA) // <--------------------------------------------------------- QPA #endif
void setMaxWindowState_helper(); void setMaxWindowState_helper();
void setFullScreenSize_helper(); void setFullScreenSize_helper();
bool stealKeyboardGrab(bool grab); bool stealKeyboardGrab(bool grab);
bool stealMouseGrab(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 struct QWidgetPaintContext

View File

@ -37,7 +37,8 @@ contains( styles, all ) {
styles = mac windows windowsxp windowsvista styles = mac windows windowsxp windowsvista
} }
x11|qpa|!macx-*:styles -= mac # TODO
styles -= mac
x11{ x11{
QMAKE_CXXFLAGS += $$QT_CFLAGS_QGTKSTYLE QMAKE_CXXFLAGS += $$QT_CFLAGS_QGTKSTYLE

View File

@ -510,13 +510,7 @@ QGestureRecognizer::Result QFlickGestureRecognizer::recognize(QGesture *state,
} }
break; break;
case QEvent::MouseMove: 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) { if (me && me->buttons() == button) {
#endif
point = me->globalPos(); point = me->globalPos();
inputType = QScroller::InputMove; inputType = QScroller::InputMove;
} }
@ -539,13 +533,7 @@ QGestureRecognizer::Result QFlickGestureRecognizer::recognize(QGesture *state,
} }
break; break;
case QEvent::GraphicsSceneMouseMove: 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) { if (gsme && gsme->buttons() == button) {
#endif
point = gsme->scenePos(); point = gsme->scenePos();
inputType = QScroller::InputMove; inputType = QScroller::InputMove;
} }

View File

@ -25,28 +25,11 @@ SOURCES += \
util/qflickgesture.cpp \ util/qflickgesture.cpp \
util/qundogroup.cpp \ util/qundogroup.cpp \
util/qundostack.cpp \ util/qundostack.cpp \
util/qundoview.cpp util/qundoview.cpp \
util/qsystemtrayicon_qpa.cpp
# TODO
wince* { false:!x11:mac {
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 {
OBJECTIVE_SOURCES += util/qsystemtrayicon_mac.mm 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 win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x65000000
irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused
!win32:!qpa:!mac:CONFIG += x11
unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore
HEADERS += $$QT_SOURCE_TREE/src/widgets/qtwidgetsversion.h HEADERS += $$QT_SOURCE_TREE/src/widgets/qtwidgetsversion.h

View File

@ -65,11 +65,6 @@
#include <limits.h> #include <limits.h>
#endif #endif
#if defined(Q_OS_SYMBIAN)
#include <w32std.h>
#include <private/qt_s60_p.h>
#endif
//#define QABSTRACTSPINBOX_QSBDEBUG //#define QABSTRACTSPINBOX_QSBDEBUG
#ifdef QABSTRACTSPINBOX_QSBDEBUG #ifdef QABSTRACTSPINBOX_QSBDEBUG
# define QASBDEBUG qDebug # define QASBDEBUG qDebug
@ -1176,12 +1171,7 @@ void QAbstractSpinBox::hideEvent(QHideEvent *event)
*/ */
static int getKeyboardAutoRepeatRate() { static int getKeyboardAutoRepeatRate() {
int ret = 30; int ret = 30;
#if defined(Q_OS_SYMBIAN) #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
TTimeIntervalMicroSeconds32 initialTime;
TTimeIntervalMicroSeconds32 time;
S60->wsSession().GetKeyboardRepeatRate(initialTime, time);
ret = time.Int() / 1000; // msecs
#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
DWORD time; DWORD time;
if (SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, &time, 0) != FALSE) if (SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, &time, 0) != FALSE)
ret = static_cast<int>(1000 / static_cast<int>(time)); // msecs ret = static_cast<int>(1000 / static_cast<int>(time)); // msecs

View File

@ -1665,11 +1665,7 @@ void QLineEdit::focusInEvent(QFocusEvent *e)
d->clickCausedFocus = 1; d->clickCausedFocus = 1;
} }
#ifdef QT_KEYPAD_NAVIGATION #ifdef QT_KEYPAD_NAVIGATION
if (!QApplication::keypadNavigationEnabled() || (hasEditFocus() && ( e->reason() == Qt::PopupFocusReason if (!QApplication::keypadNavigationEnabled() || (hasEditFocus() && ( e->reason() == Qt::PopupFocusReason))) {
#ifdef Q_OS_SYMBIAN
|| e->reason() == Qt::ActiveWindowFocusReason
#endif
))) {
#endif #endif
d->control->setCursorBlinkPeriod(QApplication::cursorFlashTime()); d->control->setCursorBlinkPeriod(QApplication::cursorFlashTime());
QStyleOptionFrameV2 opt; QStyleOptionFrameV2 opt;

View File

@ -1760,12 +1760,10 @@ QSize QMenu::sizeHint() const
void QMenu::popup(const QPoint &p, QAction *atAction) void QMenu::popup(const QPoint &p, QAction *atAction)
{ {
Q_D(QMenu); Q_D(QMenu);
#ifndef Q_OS_SYMBIAN
if (d->scroll) { // reset scroll state from last popup if (d->scroll) { // reset scroll state from last popup
d->scroll->scrollOffset = 0; d->scroll->scrollOffset = 0;
d->scroll->scrollFlags = QMenuPrivate::QMenuScroller::ScrollNone; d->scroll->scrollFlags = QMenuPrivate::QMenuScroller::ScrollNone;
} }
#endif
d->tearoffHighlighted = 0; d->tearoffHighlighted = 0;
d->motions = 0; d->motions = 0;
d->doChildEffects = true; d->doChildEffects = true;

View File

@ -2025,11 +2025,7 @@ void QWidgetTextControlPrivate::focusEvent(QFocusEvent *e)
emit q->updateRequest(q->selectionRect()); emit q->updateRequest(q->selectionRect());
if (e->gotFocus()) { if (e->gotFocus()) {
#ifdef QT_KEYPAD_NAVIGATION #ifdef QT_KEYPAD_NAVIGATION
if (!QApplication::keypadNavigationEnabled() || (hasEditFocus && (e->reason() == Qt::PopupFocusReason if (!QApplication::keypadNavigationEnabled() || (hasEditFocus && (e->reason() == Qt::PopupFocusReason))) {
#ifdef Q_OS_SYMBIAN
|| e->reason() == Qt::ActiveWindowFocusReason
#endif
))) {
#endif #endif
cursorOn = (interactionFlags & Qt::TextSelectableByKeyboard); cursorOn = (interactionFlags & Qt::TextSelectableByKeyboard);
if (interactionFlags & Qt::TextEditable) { if (interactionFlags & Qt::TextEditable) {

View File

@ -142,7 +142,8 @@ SOURCES += \
widgets/qtoolbararealayout.cpp \ widgets/qtoolbararealayout.cpp \
widgets/qplaintextedit.cpp widgets/qplaintextedit.cpp
!qpa:mac { # TODO
false:mac {
HEADERS += widgets/qmacnativewidget_mac.h \ HEADERS += widgets/qmacnativewidget_mac.h \
widgets/qmaccocoaviewcontainer_mac.h widgets/qmaccocoaviewcontainer_mac.h
OBJECTIVE_HEADERS += widgets/qcocoatoolbardelegate_mac_p.h \ OBJECTIVE_HEADERS += widgets/qcocoatoolbardelegate_mac_p.h \