diff options
Diffstat (limited to 'src/gui/kernel')
28 files changed, 323 insertions, 1 deletions
diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri index b0fe871741..3c1b6b4e48 100644 --- a/src/gui/kernel/kernel.pri +++ b/src/gui/kernel/kernel.pri @@ -105,7 +105,7 @@ SOURCES += \ kernel/qplatformservices_qpa.cpp \ kernel/qplatformscreenpageflipper_qpa.cpp -contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2)|contains(QT_CONFIG, egl) { +contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) { HEADERS += \ kernel/qplatformopenglcontext_qpa.h \ kernel/qopenglcontext.h \ diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 9ffc35a608..f7675f5267 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -68,6 +68,7 @@ #include <QtGui/QGenericPluginFactory> #include <QtGui/qstylehints.h> #include <QtGui/qinputpanel.h> +#include <QtGui/qpixmapcache.h> #include <QtGui/qplatformtheme_qpa.h> #include <QtGui/qplatforminputcontext_qpa.h> #include <private/qplatforminputcontext_qpa_p.h> @@ -889,6 +890,8 @@ QGuiApplicationPrivate::~QGuiApplicationPrivate() qt_cleanupFontDatabase(); + QPixmapCache::clear(); + delete platform_theme; delete platform_integration; platform_integration = 0; @@ -1026,6 +1029,7 @@ bool QGuiApplication::notify(QObject *object, QEvent *event) } #endif + QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(qobject_cast<QWindow *>(object), event); return QCoreApplication::notify(object, event); } @@ -1047,6 +1051,20 @@ bool QGuiApplication::compressEvent(QEvent *event, QObject *receiver, QPostEvent return QCoreApplication::compressEvent(event, receiver, postedEvents); } +void QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(QWindow *window, QEvent *event) +{ + if (!window) + return; + QPlatformWindow *platformWindow = window->handle(); + if (!platformWindow) + return; + // spontaneous events come from the platform integration already, we don't need to send the events back + if (event->spontaneous()) + return; + // let the platform window do any handling it needs to as well + platformWindow->windowEvent(event); +} + bool QGuiApplicationPrivate::processNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result) { return window->nativeEvent(eventType, message, result); diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index 435994cdd3..78641de55b 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -126,6 +126,8 @@ public: static bool processNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result); + static void sendQWindowEventToQPlatformWindow(QWindow *window, QEvent *event); + static inline Qt::Alignment visualAlignment(Qt::LayoutDirection direction, Qt::Alignment alignment) { if (!(alignment & Qt::AlignHorizontal_Mask)) diff --git a/src/gui/kernel/qplatformclipboard_qpa.cpp b/src/gui/kernel/qplatformclipboard_qpa.cpp index bc08a73a7f..7273450077 100644 --- a/src/gui/kernel/qplatformclipboard_qpa.cpp +++ b/src/gui/kernel/qplatformclipboard_qpa.cpp @@ -79,6 +79,16 @@ QClipboardData::~QClipboardData() Q_GLOBAL_STATIC(QClipboardData,q_clipboardData); +/*! + \class QPlatformClipboard + \since 5.0 + \internal + \preliminary + \ingroup qpa + + \brief The QPlatformClipboard class provides an abstraction for the system clipboard. + */ + QPlatformClipboard::~QPlatformClipboard() { diff --git a/src/gui/kernel/qplatformclipboard_qpa.h b/src/gui/kernel/qplatformclipboard_qpa.h index 4dd672b21e..95c8103b7e 100644 --- a/src/gui/kernel/qplatformclipboard_qpa.h +++ b/src/gui/kernel/qplatformclipboard_qpa.h @@ -42,6 +42,17 @@ #ifndef QPLATFORMCLIPBOARD_QPA_H #define QPLATFORMCLIPBOARD_QPA_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qplatformdefs.h> #ifndef QT_NO_CLIPBOARD diff --git a/src/gui/kernel/qplatformcursor_qpa.cpp b/src/gui/kernel/qplatformcursor_qpa.cpp index a4e998ddbc..5ea080c40a 100644 --- a/src/gui/kernel/qplatformcursor_qpa.cpp +++ b/src/gui/kernel/qplatformcursor_qpa.cpp @@ -62,6 +62,10 @@ QList<QPlatformCursor *> QPlatformCursorPrivate::getInstances() /*! \class QPlatformCursor + \since 5.0 + \internal + \preliminary + \ingroup qpa \brief The QPlatformCursor class provides information about pointer device events (movement, buttons), and requests to change @@ -124,6 +128,10 @@ void QPlatformCursor::setPos(const QPoint &pos) /*! \class QPlatformCursorImage + \since 5.0 + \internal + \preliminary + \ingroup qpa \brief The QPlatformCursorImage class provides a set of graphics intended to be used as cursors. diff --git a/src/gui/kernel/qplatformcursor_qpa.h b/src/gui/kernel/qplatformcursor_qpa.h index c1a572b27d..fb3e4604d2 100644 --- a/src/gui/kernel/qplatformcursor_qpa.h +++ b/src/gui/kernel/qplatformcursor_qpa.h @@ -41,6 +41,17 @@ #ifndef QPLATFORMCURSOR_QPA_H #define QPLATFORMCURSOR_QPA_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QList> #include <QtGui/QImage> #include <QtGui/QMouseEvent> diff --git a/src/gui/kernel/qplatformdialoghelper_qpa.cpp b/src/gui/kernel/qplatformdialoghelper_qpa.cpp index 385484828a..f2114d17e0 100644 --- a/src/gui/kernel/qplatformdialoghelper_qpa.cpp +++ b/src/gui/kernel/qplatformdialoghelper_qpa.cpp @@ -54,6 +54,8 @@ QT_BEGIN_NAMESPACE \class QPlatformDialogHelper \since 5.0 \internal + \ingroup qpa + \brief The QPlatformDialogHelper class allows for platform-specific customization of dialogs. */ @@ -159,6 +161,15 @@ QFontDialogOptions::FontDialogOptions QFontDialogOptions::options() const return d->options; } +/*! + \class QPlatformFontDialogHelper + \since 5.0 + \internal + \ingroup qpa + + \brief The QPlatformFontDialogHelper class allows for platform-specific customization of font dialogs. + +*/ const QSharedPointer<QFontDialogOptions> &QPlatformFontDialogHelper::options() const { return m_options; @@ -327,6 +338,15 @@ void QColorDialogOptions::setStandardColor(int index, QRgb color) qColorDialogStaticData()->standardRgb[index] = color; } +/*! + \class QPlatformColorDialogHelper + \since 5.0 + \internal + \ingroup qpa + + \brief The QPlatformColorDialogHelper class allows for platform-specific customization of color dialogs. + +*/ const QSharedPointer<QColorDialogOptions> &QPlatformColorDialogHelper::options() const { return m_options; @@ -543,6 +563,15 @@ void QFileDialogOptions::setInitiallySelectedFiles(const QStringList &files) d->initiallySelectedFiles = files; } +/*! + \class QPlatformFileDialogHelper + \since 5.0 + \internal + \ingroup qpa + + \brief The QPlatformFileDialogHelper class allows for platform-specific customization of file dialogs. + +*/ const QSharedPointer<QFileDialogOptions> &QPlatformFileDialogHelper::options() const { return m_options; diff --git a/src/gui/kernel/qplatformdialoghelper_qpa.h b/src/gui/kernel/qplatformdialoghelper_qpa.h index 5fdffae5cb..80a9f0efaf 100644 --- a/src/gui/kernel/qplatformdialoghelper_qpa.h +++ b/src/gui/kernel/qplatformdialoghelper_qpa.h @@ -42,6 +42,17 @@ #ifndef QPLATFORMDIALOGHELPER_H #define QPLATFORMDIALOGHELPER_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QtGlobal> #include <QtCore/QObject> #include <QtCore/QList> diff --git a/src/gui/kernel/qplatformdrag_qpa.cpp b/src/gui/kernel/qplatformdrag_qpa.cpp index 0e7b0f41cc..d9fc3a2ab8 100644 --- a/src/gui/kernel/qplatformdrag_qpa.cpp +++ b/src/gui/kernel/qplatformdrag_qpa.cpp @@ -82,6 +82,15 @@ public: Qt::DropAction cursor_drop_action; }; +/*! + \class QPlatformDrag + \since 5.0 + \internal + \preliminary + \ingroup qpa + + \brief The QPlatformDrag class provides an abstraction for drag. + */ QPlatformDrag::QPlatformDrag() : d_ptr(new QPlatformDragPrivate) { } diff --git a/src/gui/kernel/qplatformdrag_qpa.h b/src/gui/kernel/qplatformdrag_qpa.h index 22133706d1..14282c5a21 100644 --- a/src/gui/kernel/qplatformdrag_qpa.h +++ b/src/gui/kernel/qplatformdrag_qpa.h @@ -42,6 +42,17 @@ #ifndef QPLATFORMDRAG_H #define QPLATFORMDRAG_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qglobal.h> #include <QtGui/QPixmap> diff --git a/src/gui/kernel/qplatforminputcontext_qpa.cpp b/src/gui/kernel/qplatforminputcontext_qpa.cpp index 8612b4b42f..53839088c5 100644 --- a/src/gui/kernel/qplatforminputcontext_qpa.cpp +++ b/src/gui/kernel/qplatforminputcontext_qpa.cpp @@ -49,6 +49,10 @@ QT_BEGIN_NAMESPACE /*! \class QPlatformInputContext + \since 5.0 + \internal + \preliminary + \ingroup qpa \brief The QPlatformInputContext class abstracts the input method dependent data and composing state. An input method is responsible for inputting complex text that cannot diff --git a/src/gui/kernel/qplatforminputcontext_qpa.h b/src/gui/kernel/qplatforminputcontext_qpa.h index 5e8060c6e0..696146b859 100644 --- a/src/gui/kernel/qplatforminputcontext_qpa.h +++ b/src/gui/kernel/qplatforminputcontext_qpa.h @@ -42,6 +42,17 @@ #ifndef QPLATFORMINPUTCONTEXT_H #define QPLATFORMINPUTCONTEXT_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtGui/qinputpanel.h> QT_BEGIN_HEADER diff --git a/src/gui/kernel/qplatformintegration_qpa.h b/src/gui/kernel/qplatformintegration_qpa.h index fe40fd3dad..a44f4343ef 100644 --- a/src/gui/kernel/qplatformintegration_qpa.h +++ b/src/gui/kernel/qplatformintegration_qpa.h @@ -42,6 +42,17 @@ #ifndef QPLATFORMINTEGRATION_H #define QPLATFORMINTEGRATION_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtGui/qwindowdefs.h> #include <QtGui/qplatformscreen_qpa.h> #include <QtGui/qsurfaceformat.h> diff --git a/src/gui/kernel/qplatformnativeinterface_qpa.cpp b/src/gui/kernel/qplatformnativeinterface_qpa.cpp index 48e43f5226..2a06a29d5d 100644 --- a/src/gui/kernel/qplatformnativeinterface_qpa.cpp +++ b/src/gui/kernel/qplatformnativeinterface_qpa.cpp @@ -43,6 +43,17 @@ QT_BEGIN_NAMESPACE +/*! + \class QPlatformNativeInterface + \since 5.0 + \internal + \preliminary + \ingroup qpa + + \brief The QPlatformNativeInterface class provides an abstraction for retrieving native + resource handles. + */ + void *QPlatformNativeInterface::nativeResourceForIntegration(const QByteArray &resource) { Q_UNUSED(resource); diff --git a/src/gui/kernel/qplatformnativeinterface_qpa.h b/src/gui/kernel/qplatformnativeinterface_qpa.h index dd1ef22354..68dd991988 100644 --- a/src/gui/kernel/qplatformnativeinterface_qpa.h +++ b/src/gui/kernel/qplatformnativeinterface_qpa.h @@ -42,6 +42,17 @@ #ifndef QPLATFORMNATIVEINTERFACE_QPA_H #define QPLATFORMNATIVEINTERFACE_QPA_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtGui/qwindowdefs.h> #include <QtCore/QObject> #include <QtCore/QVariant> diff --git a/src/gui/kernel/qplatformopenglcontext_qpa.h b/src/gui/kernel/qplatformopenglcontext_qpa.h index af70368f5e..ddcb87ad5a 100644 --- a/src/gui/kernel/qplatformopenglcontext_qpa.h +++ b/src/gui/kernel/qplatformopenglcontext_qpa.h @@ -42,6 +42,17 @@ #ifndef QPLATFORMGLCONTEXT_H #define QPLATFORMGLCONTEXT_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #ifndef QT_NO_OPENGL #include <QtCore/qnamespace.h> diff --git a/src/gui/kernel/qplatformscreen_qpa.h b/src/gui/kernel/qplatformscreen_qpa.h index b6eb91f9b2..71d734867e 100644 --- a/src/gui/kernel/qplatformscreen_qpa.h +++ b/src/gui/kernel/qplatformscreen_qpa.h @@ -42,6 +42,17 @@ #ifndef QPLATFORMSCREEN_H #define QPLATFORMSCREEN_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qmetatype.h> #include <QtCore/qnamespace.h> #include <QtCore/qcoreevent.h> diff --git a/src/gui/kernel/qplatformscreenpageflipper_qpa.cpp b/src/gui/kernel/qplatformscreenpageflipper_qpa.cpp index d652e34e5e..b912c6055e 100644 --- a/src/gui/kernel/qplatformscreenpageflipper_qpa.cpp +++ b/src/gui/kernel/qplatformscreenpageflipper_qpa.cpp @@ -43,6 +43,15 @@ QT_BEGIN_NAMESPACE +/*! + \class QPlatformScreenBuffer + \since 5.0 + \internal + \preliminary + \ingroup qpa + + \brief The QPlatformScreenBuffer class provides an abstraction for screen buffers. + */ QPlatformScreenBuffer::QPlatformScreenBuffer() : m_destroyed(false) , m_ready(true) @@ -73,6 +82,18 @@ void QPlatformScreenBuffer::displayed() { } + +/*! + \class QPlatformScreenPageFlipper + \since 5.0 + \internal + \preliminary + \ingroup qpa + + \brief The QPlatformScreenPageFlipper class provides an abstraction for flipping the screen + page. + */ + QPlatformScreenPageFlipper::QPlatformScreenPageFlipper(QObject *parent) :QObject(parent) { diff --git a/src/gui/kernel/qplatformscreenpageflipper_qpa.h b/src/gui/kernel/qplatformscreenpageflipper_qpa.h index 850f9d8d2f..116d2dbf82 100644 --- a/src/gui/kernel/qplatformscreenpageflipper_qpa.h +++ b/src/gui/kernel/qplatformscreenpageflipper_qpa.h @@ -42,6 +42,17 @@ #ifndef QPLATFORMSCREENPAGEFLIPPER_QPA_H #define QPLATFORMSCREENPAGEFLIPPER_QPA_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QObject> QT_BEGIN_HEADER diff --git a/src/gui/kernel/qplatformservices_qpa.h b/src/gui/kernel/qplatformservices_qpa.h index aff2e5d6fe..c9bfe020ab 100644 --- a/src/gui/kernel/qplatformservices_qpa.h +++ b/src/gui/kernel/qplatformservices_qpa.h @@ -42,6 +42,17 @@ #ifndef QPLATFORMSERVICES_QPA_H #define QPLATFORMSERVICES_QPA_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QtGlobal> QT_BEGIN_HEADER diff --git a/src/gui/kernel/qplatformsharedgraphicscache_qpa.h b/src/gui/kernel/qplatformsharedgraphicscache_qpa.h index 8a92dbdd31..679b8ab7de 100644 --- a/src/gui/kernel/qplatformsharedgraphicscache_qpa.h +++ b/src/gui/kernel/qplatformsharedgraphicscache_qpa.h @@ -42,6 +42,17 @@ #ifndef QPLATFORMSHAREDGRAPHICSCACHE_QPA_H #define QPLATFORMSHAREDGRAPHICSCACHE_QPA_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qobject.h> #include <QtGui/qimage.h> diff --git a/src/gui/kernel/qplatformsurface_qpa.cpp b/src/gui/kernel/qplatformsurface_qpa.cpp index 6d3b6503d7..1f752fe3e2 100644 --- a/src/gui/kernel/qplatformsurface_qpa.cpp +++ b/src/gui/kernel/qplatformsurface_qpa.cpp @@ -43,6 +43,15 @@ QT_BEGIN_NAMESPACE +/*! + \class QPlatformSurface + \since 5.0 + \internal + \preliminary + \ingroup qpa + + \brief The QPlatformSurface class provides an abstraction for a surface. + */ QPlatformSurface::~QPlatformSurface() { diff --git a/src/gui/kernel/qplatformsurface_qpa.h b/src/gui/kernel/qplatformsurface_qpa.h index 80ee99c899..f64a697fc5 100644 --- a/src/gui/kernel/qplatformsurface_qpa.h +++ b/src/gui/kernel/qplatformsurface_qpa.h @@ -42,6 +42,17 @@ #ifndef QPLATFORMSURFACE_H #define QPLATFORMSURFACE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qnamespace.h> #include <QtGui/qsurface.h> #include <QtGui/qsurfaceformat.h> diff --git a/src/gui/kernel/qplatformtheme_qpa.h b/src/gui/kernel/qplatformtheme_qpa.h index 6ac6a0f573..8d936e8267 100644 --- a/src/gui/kernel/qplatformtheme_qpa.h +++ b/src/gui/kernel/qplatformtheme_qpa.h @@ -42,6 +42,17 @@ #ifndef QPLATFORMTHEME_H #define QPLATFORMTHEME_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QtGlobal> QT_BEGIN_HEADER diff --git a/src/gui/kernel/qplatformthemeplugin_qpa.cpp b/src/gui/kernel/qplatformthemeplugin_qpa.cpp index 8383c9b948..da2743d6e3 100644 --- a/src/gui/kernel/qplatformthemeplugin_qpa.cpp +++ b/src/gui/kernel/qplatformthemeplugin_qpa.cpp @@ -43,6 +43,15 @@ QT_BEGIN_NAMESPACE +/*! + \class QPlatformThemePlugin + \since 5.0 + \internal + \preliminary + \ingroup qpa + + \brief The QPlatformScreen class provides an abstraction for theme plugins. + */ QPlatformThemePlugin::QPlatformThemePlugin(QObject *parent) : QObject(parent) { diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp index a9dfbba788..4aa46722de 100644 --- a/src/gui/kernel/qplatformwindow_qpa.cpp +++ b/src/gui/kernel/qplatformwindow_qpa.cpp @@ -313,6 +313,29 @@ bool QPlatformWindow::setMouseGrabEnabled(bool grab) } /*! + Reimplement to be able to let Qt indicate that the window has been + modified. Return true if the native window supports setting the modified + flag, false otherwise. +*/ +bool QPlatformWindow::setWindowModified(bool modified) +{ + Q_UNUSED(modified); + return false; +} + +/*! + Reimplement this method to be able to do any platform specific event + handling. All events for window() are passed to this function before being + sent to QWindow::event(). + + The default implementation is empty and does nothing with \a event. +*/ +void QPlatformWindow::windowEvent(QEvent *event) +{ + Q_UNUSED(event); +} + +/*! \class QPlatformWindow \since 4.8 \internal diff --git a/src/gui/kernel/qplatformwindow_qpa.h b/src/gui/kernel/qplatformwindow_qpa.h index a72de7b547..729f35e025 100644 --- a/src/gui/kernel/qplatformwindow_qpa.h +++ b/src/gui/kernel/qplatformwindow_qpa.h @@ -41,6 +41,17 @@ #ifndef QPLATFORMWINDOW_H #define QPLATFORMWINDOW_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qscopedpointer.h> #include <QtCore/qrect.h> #include <QtCore/qmargins.h> @@ -102,6 +113,10 @@ public: virtual bool setKeyboardGrabEnabled(bool grab); virtual bool setMouseGrabEnabled(bool grab); + virtual bool setWindowModified(bool modified); + + virtual void windowEvent(QEvent *event); + protected: QScopedPointer<QPlatformWindowPrivate> d_ptr; private: |