summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-04-17 12:58:41 +0200
committerLars Knoll <lars.knoll@nokia.com>2012-04-17 12:58:52 +0200
commit64255ef6502b1144f7b0aa4b2bf62803e0d4788b (patch)
tree29bf116bfda2ccf61057115690d14f85cc9b085b /src/gui/kernel
parent4a9fb41a7947d0bb7a47a9625603a436df288b24 (diff)
parent7e0beba891cb963a1d535bd45b0be78b43b8d07f (diff)
Merge remote-tracking branch 'origin/api_changes'
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qclipboard.h2
-rw-r--r--src/gui/kernel/qevent.cpp118
-rw-r--r--src/gui/kernel/qevent.h49
-rw-r--r--src/gui/kernel/qevent_p.h20
-rw-r--r--src/gui/kernel/qguiapplication.cpp55
-rw-r--r--src/gui/kernel/qguiapplication.h2
-rw-r--r--src/gui/kernel/qguiapplication_p.h3
-rw-r--r--src/gui/kernel/qguivariant.cpp49
-rw-r--r--src/gui/kernel/qkeysequence.cpp10
-rw-r--r--src/gui/kernel/qkeysequence.h4
-rw-r--r--src/gui/kernel/qopenglcontext.cpp13
-rw-r--r--src/gui/kernel/qopenglcontext.h4
-rw-r--r--src/gui/kernel/qplatformsharedgraphicscache_qpa.h2
-rw-r--r--src/gui/kernel/qplatformsurface_qpa.h2
-rw-r--r--src/gui/kernel/qplatformwindow_qpa.cpp6
-rw-r--r--src/gui/kernel/qplatformwindow_qpa.h2
-rw-r--r--src/gui/kernel/qscreen.cpp12
-rw-r--r--src/gui/kernel/qscreen.h14
-rw-r--r--src/gui/kernel/qsurface.h2
-rw-r--r--src/gui/kernel/qsurfaceformat.h2
-rw-r--r--src/gui/kernel/qwindow.cpp36
-rw-r--r--src/gui/kernel/qwindow.h9
-rw-r--r--src/gui/kernel/qwindow_p.h5
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa.cpp22
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa.h6
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa_p.h24
26 files changed, 200 insertions, 273 deletions
diff --git a/src/gui/kernel/qclipboard.h b/src/gui/kernel/qclipboard.h
index 5a251dd0ef..5c88764d88 100644
--- a/src/gui/kernel/qclipboard.h
+++ b/src/gui/kernel/qclipboard.h
@@ -59,7 +59,7 @@ class Q_GUI_EXPORT QClipboard : public QObject
{
Q_OBJECT
private:
- QClipboard(QObject *parent);
+ explicit QClipboard(QObject *parent);
~QClipboard();
public:
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 436ed56ea0..505e89b44d 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -717,11 +717,41 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
*/
QKeyEvent::QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const QString& text,
bool autorep, ushort count)
- : QInputEvent(type, modifiers), txt(text), k(key), c(count), autor(autorep)
+ : QInputEvent(type, modifiers), txt(text), k(key),
+ nScanCode(0), nVirtualKey(0), nModifiers(0),
+ c(count), autor(autorep)
{
}
/*!
+ Constructs a key event object.
+
+ The \a type parameter must be QEvent::KeyPress, QEvent::KeyRelease,
+ or QEvent::ShortcutOverride.
+
+ Int \a key is the code for the Qt::Key that the event loop should listen
+ for. If \a key is 0, the event is not a result of a known key; for
+ example, it may be the result of a compose sequence or keyboard macro.
+ The \a modifiers holds the keyboard modifiers, and the given \a text
+ is the Unicode text that the key generated. If \a autorep is true,
+ isAutoRepeat() will be true. \a count is the number of keys involved
+ in the event.
+
+ In addition to the normal key event data, also contains \a nativeScanCode,
+ \a nativeVirtualKey and \a nativeModifiers. This extra data is used by the
+ shortcut system, to determine which shortcuts to trigger.
+*/
+QKeyEvent::QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
+ quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
+ const QString &text, bool autorep, ushort count)
+ : QInputEvent(type, modifiers), txt(text), k(key),
+ nScanCode(nativeScanCode), nVirtualKey(nativeVirtualKey), nModifiers(nativeModifiers),
+ c(count), autor(autorep)
+{
+}
+
+
+/*!
\internal
*/
QKeyEvent::~QKeyEvent()
@@ -729,16 +759,9 @@ QKeyEvent::~QKeyEvent()
}
/*!
+ \fn QKeyEvent *QKeyEvent::createExtendedKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, const QString& text, bool autorep, ushort count)
\internal
*/
-QKeyEvent *QKeyEvent::createExtendedKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
- quint32 nativeScanCode, quint32 nativeVirtualKey,
- quint32 nativeModifiers,
- const QString& text, bool autorep, ushort count)
-{
- return new QKeyEventEx(type, key, modifiers, text, autorep, count,
- nativeScanCode, nativeVirtualKey, nativeModifiers);
-}
/*!
\fn bool QKeyEvent::hasExtendedInfo() const
@@ -746,6 +769,7 @@ QKeyEvent *QKeyEvent::createExtendedKeyEvent(Type type, int key, Qt::KeyboardMod
*/
/*!
+ \fn quint32 QKeyEvent::nativeScanCode() const
\since 4.2
Returns the native scan code of the key event. If the key event
@@ -758,13 +782,9 @@ QKeyEvent *QKeyEvent::createExtendedKeyEvent(Type type, int key, Qt::KeyboardMod
way to get the scan code from Carbon or Cocoa. The function always
returns 1 (or 0 in the case explained above).
*/
-quint32 QKeyEvent::nativeScanCode() const
-{
- return (reinterpret_cast<const QKeyEvent*>(d) != this
- ? 0 : reinterpret_cast<const QKeyEventEx*>(this)->nScanCode);
-}
/*!
+ \fn quint32 QKeyEvent::nativeVirtualKey() const
\since 4.2
Returns the native virtual key, or key sym of the key event.
@@ -772,13 +792,9 @@ quint32 QKeyEvent::nativeScanCode() const
Note: The native virtual key may be 0, even if the key event contains extended information.
*/
-quint32 QKeyEvent::nativeVirtualKey() const
-{
- return (reinterpret_cast<const QKeyEvent*>(d) != this
- ? 0 : reinterpret_cast<const QKeyEventEx*>(this)->nVirtualKey);
-}
/*!
+ \fn quint32 QKeyEvent::nativeModifiers() const
\since 4.2
Returns the native modifiers of a key event.
@@ -786,44 +802,6 @@ quint32 QKeyEvent::nativeVirtualKey() const
Note: The native modifiers may be 0, even if the key event contains extended information.
*/
-quint32 QKeyEvent::nativeModifiers() const
-{
- return (reinterpret_cast<const QKeyEvent*>(d) != this
- ? 0 : reinterpret_cast<const QKeyEventEx*>(this)->nModifiers);
-}
-
-/*!
- \internal
- Creates an extended key event object, which in addition to the normal key event data, also
- contains the native scan code, virtual key and modifiers. This extra data is used by the
- shortcut system, to determine which shortcuts to trigger.
-*/
-QKeyEventEx::QKeyEventEx(Type type, int key, Qt::KeyboardModifiers modifiers,
- const QString &text, bool autorep, ushort count,
- quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers)
- : QKeyEvent(type, key, modifiers, text, autorep, count),
- nScanCode(nativeScanCode), nVirtualKey(nativeVirtualKey), nModifiers(nativeModifiers)
-{
- d = reinterpret_cast<QEventPrivate*>(this);
-}
-
-/*!
- \internal
- Creates a copy of an other extended key event.
-*/
-QKeyEventEx::QKeyEventEx(const QKeyEventEx &other)
- : QKeyEvent(QEvent::Type(other.t), other.k, other.modState, other.txt, other.autor, other.c),
- nScanCode(other.nScanCode), nVirtualKey(other.nVirtualKey), nModifiers(other.nModifiers)
-{
- d = reinterpret_cast<QEventPrivate*>(this);
-}
-
-/*!
- \internal
-*/
-QKeyEventEx::~QKeyEventEx()
-{
-}
/*!
\fn int QKeyEvent::key() const
@@ -3627,7 +3605,7 @@ QTouchEvent::TouchPoint::TouchPoint(const QTouchEvent::TouchPoint &other)
*/
QTouchEvent::TouchPoint::~TouchPoint()
{
- if (!d->ref.deref())
+ if (d && !d->ref.deref())
delete d;
}
@@ -3869,10 +3847,11 @@ QTouchEvent::TouchPoint::InfoFlags QTouchEvent::TouchPoint::flags() const
}
/*!
+ \since 5.0
Returns the raw, unfiltered positions for the touch point. The positions are in native screen coordinates.
To get local coordinates you can use mapFromGlobal() of the QWindow returned by QTouchEvent::window().
- \note Returns an empty list if the touch device's capabilities do not include QTouchDevice::RawPositions.
+ \note Returns an empty vector if the touch device's capabilities do not include QTouchDevice::RawPositions.
\note Native screen coordinates refer to the native orientation of the screen which, in case of
mobile devices, is typically portrait. This means that on systems capable of screen orientation
@@ -3881,7 +3860,7 @@ QTouchEvent::TouchPoint::InfoFlags QTouchEvent::TouchPoint::flags() const
\sa QTouchDevice::capabilities(), device(), window()
*/
-QList<QPointF> QTouchEvent::TouchPoint::rawScreenPositions() const
+QVector<QPointF> QTouchEvent::TouchPoint::rawScreenPositions() const
{
return d->rawScreenPositions;
}
@@ -4039,7 +4018,7 @@ void QTouchEvent::TouchPoint::setVelocity(const QVector2D &v)
}
/*! \internal */
-void QTouchEvent::TouchPoint::setRawScreenPositions(const QList<QPointF> &positions)
+void QTouchEvent::TouchPoint::setRawScreenPositions(const QVector<QPointF> &positions)
{
if (d->ref.load() != 1)
d = d->detach();
@@ -4054,16 +4033,15 @@ void QTouchEvent::TouchPoint::setFlags(InfoFlags flags)
d->flags = flags;
}
-/*! \internal */
-QTouchEvent::TouchPoint &QTouchEvent::TouchPoint::operator=(const QTouchEvent::TouchPoint &other)
-{
- other.d->ref.ref();
- if (!d->ref.deref())
- delete d;
- d = other.d;
- return *this;
-}
+/*!
+ \fn QTouchEvent::TouchPoint &QTouchEvent::TouchPoint::operator=(const QTouchEvent::TouchPoint &other)
+ \internal
+ */
+/*!
+ \fn void QTouchEvent::TouchPoint::swap(TouchPoint &other);
+ \internal
+*/
/*!
\class QScrollPrepareEvent
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index a042922f61..7761bab944 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -243,6 +243,9 @@ class Q_GUI_EXPORT QKeyEvent : public QInputEvent
public:
QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const QString& text = QString(),
bool autorep = false, ushort count = 1);
+ QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
+ quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
+ const QString &text = QString(), bool autorep = false, ushort count = 1);
~QKeyEvent();
int key() const { return k; }
@@ -254,22 +257,35 @@ public:
inline bool isAutoRepeat() const { return autor; }
inline int count() const { return int(c); }
+ inline quint32 nativeScanCode() const { return nScanCode; }
+ inline quint32 nativeVirtualKey() const { return nVirtualKey; }
+ inline quint32 nativeModifiers() const { return nModifiers; }
+
// Functions for the extended key event information
- static QKeyEvent *createExtendedKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
+#if QT_DEPRECATED_SINCE(5, 0)
+ static inline QKeyEvent *createExtendedKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
quint32 nativeScanCode, quint32 nativeVirtualKey,
quint32 nativeModifiers,
const QString& text = QString(), bool autorep = false,
- ushort count = 1);
- inline bool hasExtendedInfo() const { return reinterpret_cast<const QKeyEvent*>(d) == this; }
- quint32 nativeScanCode() const;
- quint32 nativeVirtualKey() const;
- quint32 nativeModifiers() const;
+ ushort count = 1)
+ {
+ return new QKeyEvent(type, key, modifiers,
+ nativeScanCode, nativeVirtualKey, nativeModifiers,
+ text, autorep, count);
+ }
+
+ inline bool hasExtendedInfo() const { return true; }
+#endif
protected:
QString txt;
int k;
+ quint32 nScanCode;
+ quint32 nVirtualKey;
+ quint32 nModifiers;
ushort c;
- uint autor:1;
+ ushort autor:1;
+ // ushort reserved:15;
};
@@ -713,9 +729,19 @@ public:
Q_DECLARE_FLAGS(InfoFlags, InfoFlag)
explicit TouchPoint(int id = -1);
- TouchPoint(const QTouchEvent::TouchPoint &other);
+ TouchPoint(const TouchPoint &other);
+#ifdef Q_COMPILER_RVALUE_REFS
+ TouchPoint(TouchPoint &&other) : d(other.d) { other.d = 0; }
+ TouchPoint &operator=(TouchPoint &&other)
+ { qSwap(d, other.d); return *this; }
+#endif
~TouchPoint();
+ TouchPoint &operator=(const TouchPoint &other)
+ { if ( d != other.d ) { TouchPoint copy(other); swap(copy); } return *this; }
+
+ void swap(TouchPoint &other) { qSwap(d, other.d); }
+
int id() const;
Qt::TouchPointState state() const;
@@ -743,7 +769,7 @@ public:
qreal pressure() const;
QVector2D velocity() const;
InfoFlags flags() const;
- QList<QPointF> rawScreenPositions() const;
+ QVector<QPointF> rawScreenPositions() const;
// internal
void setId(int id);
@@ -766,8 +792,7 @@ public:
void setPressure(qreal pressure);
void setVelocity(const QVector2D &v);
void setFlags(InfoFlags flags);
- void setRawScreenPositions(const QList<QPointF> &positions);
- QTouchEvent::TouchPoint &operator=(const QTouchEvent::TouchPoint &other);
+ void setRawScreenPositions(const QVector<QPointF> &positions);
private:
QTouchEventTouchPointPrivate *d;
@@ -819,7 +844,7 @@ protected:
friend class QApplication;
friend class QApplicationPrivate;
};
-
+Q_DECLARE_TYPEINFO(QTouchEvent::TouchPoint, Q_MOVABLE_TYPE);
Q_DECLARE_OPERATORS_FOR_FLAGS(QTouchEvent::TouchPoint::InfoFlags)
class QScrollPrepareEventPrivate;
diff --git a/src/gui/kernel/qevent_p.h b/src/gui/kernel/qevent_p.h
index 3f354c14e4..18a13b73f5 100644
--- a/src/gui/kernel/qevent_p.h
+++ b/src/gui/kernel/qevent_p.h
@@ -60,24 +60,6 @@ QT_BEGIN_NAMESPACE
// We mean it.
//
-// ### Qt 5: remove
-class QKeyEventEx : public QKeyEvent
-{
-public:
- QKeyEventEx(Type type, int key, Qt::KeyboardModifiers modifiers,
- const QString &text, bool autorep, ushort count,
- quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers);
- QKeyEventEx(const QKeyEventEx &other);
-
- ~QKeyEventEx();
-
-protected:
- quint32 nScanCode;
- quint32 nVirtualKey;
- quint32 nModifiers;
- friend class QKeyEvent;
-};
-
class QTouchEventTouchPointPrivate
{
public:
@@ -107,7 +89,7 @@ public:
qreal pressure;
QVector2D velocity;
QTouchEvent::TouchPoint::InfoFlags flags;
- QList<QPointF> rawScreenPositions;
+ QVector<QPointF> rawScreenPositions;
};
class QFileOpenEventPrivate
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 2c2d833209..f7675f5267 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -148,7 +148,6 @@ bool QGuiApplicationPrivate::obey_desktop_settings = true;
static qreal fontSmoothingGamma = 1.7;
extern void qRegisterGuiVariant();
-extern void qUnregisterGuiVariant();
extern void qInitDrawhelperAsm();
extern void qInitImageConversions();
@@ -363,8 +362,6 @@ QGuiApplication::~QGuiApplication()
clearPalette();
- qUnregisterGuiVariant();
-
#ifndef QT_NO_CURSOR
d->cursor_list.clear();
#endif
@@ -1127,12 +1124,6 @@ void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePriv
QGuiApplicationPrivate::processThemeChanged(
static_cast<QWindowSystemInterfacePrivate::ThemeChangeEvent *>(e));
break;
- case QWindowSystemInterfacePrivate::Map:
- QGuiApplicationPrivate::processMapEvent(static_cast<QWindowSystemInterfacePrivate::MapEvent *>(e));
- break;
- case QWindowSystemInterfacePrivate::Unmap:
- QGuiApplicationPrivate::processUnmapEvent(static_cast<QWindowSystemInterfacePrivate::UnmapEvent *>(e));
- break;
case QWindowSystemInterfacePrivate::Expose:
QGuiApplicationPrivate::processExposeEvent(static_cast<QWindowSystemInterfacePrivate::ExposeEvent *>(e));
break;
@@ -1295,8 +1286,9 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
return;
}
- QKeyEventEx ev(e->keyType, e->key, e->modifiers, e->unicode, e->repeat, e->repeatCount,
- e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers);
+ QKeyEvent ev(e->keyType, e->key, e->modifiers,
+ e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers,
+ e->unicode, e->repeat, e->repeatCount);
ev.setTimestamp(e->timestamp);
QGuiApplication::sendSpontaneousEvent(window, &ev);
}
@@ -1788,30 +1780,28 @@ void QGuiApplicationPrivate::reportLogicalDotsPerInchChange(QWindowSystemInterfa
emit s->logicalDotsPerInchChanged(s->logicalDotsPerInch());
}
-void QGuiApplicationPrivate::processMapEvent(QWindowSystemInterfacePrivate::MapEvent *e)
+void QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent *e)
{
- if (!e->mapped)
+ if (!e->exposed)
return;
- QEvent event(QEvent::Map);
- QCoreApplication::sendSpontaneousEvent(e->mapped.data(), &event);
-}
+ QWindow *window = e->exposed.data();
+ QWindowPrivate *p = qt_window_private(window);
-void QGuiApplicationPrivate::processUnmapEvent(QWindowSystemInterfacePrivate::UnmapEvent *e)
-{
- if (!e->unmapped)
- return;
+ if (!p->receivedExpose) {
+ if (p->resizeEventPending) {
+ // as a convenience for plugins, send a resize event before the first expose event if they haven't done so
+ QSize size = p->geometry.size();
+ QResizeEvent e(size, size);
+ QGuiApplication::sendSpontaneousEvent(window, &e);
- QEvent event(QEvent::Unmap);
- QCoreApplication::sendSpontaneousEvent(e->unmapped.data(), &event);
-}
+ p->resizeEventPending = false;
+ }
-void QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent *e)
-{
- if (!e->exposed)
- return;
+ p->receivedExpose = true;
+ }
- QWindow *window = e->exposed.data();
+ p->exposed = e->isExposed;
QExposeEvent exposeEvent(e->region);
QCoreApplication::sendSpontaneousEvent(window, &exposeEvent);
@@ -2160,12 +2150,11 @@ void QGuiApplication::restoreOverrideCursor()
\sa QStyleHints
*/
-QStyleHints *QGuiApplication::styleHints() const
+QStyleHints *QGuiApplication::styleHints()
{
- Q_D(const QGuiApplication);
- if (!d->styleHints)
- const_cast<QGuiApplicationPrivate *>(d)->styleHints = new QStyleHints();
- return d->styleHints;
+ if (!qGuiApp->d_func()->styleHints)
+ qGuiApp->d_func()->styleHints = new QStyleHints();
+ return qGuiApp->d_func()->styleHints;
}
/*!
diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h
index 8ae0e6dfc5..75a0f6cd4b 100644
--- a/src/gui/kernel/qguiapplication.h
+++ b/src/gui/kernel/qguiapplication.h
@@ -126,7 +126,7 @@ public:
static inline bool isRightToLeft() { return layoutDirection() == Qt::RightToLeft; }
static inline bool isLeftToRight() { return layoutDirection() == Qt::LeftToRight; }
- QStyleHints *styleHints() const;
+ static QStyleHints *styleHints();
static void setDesktopSettingsAware(bool on);
static bool desktopSettingsAware();
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index 35bf8570ea..78641de55b 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -119,9 +119,6 @@ public:
static void reportLogicalDotsPerInchChange(QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *e);
static void processThemeChanged(QWindowSystemInterfacePrivate::ThemeChangeEvent *tce);
- static void processMapEvent(QWindowSystemInterfacePrivate::MapEvent *e);
- static void processUnmapEvent(QWindowSystemInterfacePrivate::UnmapEvent *e);
-
static void processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent *e);
static QPlatformDragQtResponse processDrag(QWindow *w, const QMimeData *dropData, const QPoint &p, Qt::DropActions supportedActions);
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp
index 50d3f0b7d1..436688a295 100644
--- a/src/gui/kernel/qguivariant.cpp
+++ b/src/gui/kernel/qguivariant.cpp
@@ -98,52 +98,13 @@ QT_BEGIN_NAMESPACE
Q_CORE_EXPORT const QVariant::Handler *qcoreVariantHandler();
namespace {
-template<typename T>
-struct TypeDefinition {
- static const bool IsAvailable = true;
-};
-// Ignore these types, as incomplete
-#ifdef QT_NO_GEOM_VARIANT
-template<> struct TypeDefinition<QRect> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QRectF> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QSize> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QSizeF> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QLine> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QLineF> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QPoint> { static const bool IsAvailable = false; };
-template<> struct TypeDefinition<QPointF> { static const bool IsAvailable = false; };
-#endif
-#ifdef QT_NO_SHORTCUT
-template<> struct TypeDefinition<QKeySequence> { static const bool IsAvailable = false; };
-#endif
-#ifdef QT_NO_CURSOR
-template<> struct TypeDefinition<QCursor> { static const bool IsAvailable = false; };
-#endif
-#ifdef QT_NO_MATRIX4X4
-template<> struct TypeDefinition<QMatrix4x4> { static const bool IsAvailable = false; };
-#endif
-#ifdef QT_NO_VECTOR2D
-template<> struct TypeDefinition<QVector2D> { static const bool IsAvailable = false; };
-#endif
-#ifdef QT_NO_VECTOR3D
-template<> struct TypeDefinition<QVector3D> { static const bool IsAvailable = false; };
-#endif
-#ifdef QT_NO_VECTOR4D
-template<> struct TypeDefinition<QVector4D> { static const bool IsAvailable = false; };
-#endif
-#ifdef QT_NO_QUATERNION
-template<> struct TypeDefinition<QQuaternion> { static const bool IsAvailable = false; };
-#endif
-
struct GuiTypesFilter {
template<typename T>
struct Acceptor {
- static const bool IsAccepted = QTypeModuleInfo<T>::IsGui && TypeDefinition<T>::IsAvailable;
+ static const bool IsAccepted = QTypeModuleInfo<T>::IsGui && QtMetaTypePrivate::TypeDefinition<T>::IsAvailable;
};
};
-} // namespace used to hide TypeDefinition
-namespace {
static void construct(QVariant::Private *x, const void *copy)
{
const int type = x->type;
@@ -389,12 +350,4 @@ void qRegisterGuiVariant()
}
Q_CONSTRUCTOR_FUNCTION(qRegisterGuiVariant)
-void qUnregisterGuiVariant()
-{
- QVariantPrivate::unregisterHandler(QModulesPrivate::Gui);
- qMetaTypeGuiHelper = 0;
-}
-Q_DESTRUCTOR_FUNCTION(qUnregisterGuiVariant)
-
-
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 6b1f3534ba..c616681b64 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -934,16 +934,6 @@ QKeySequence::QKeySequence()
Note the "File|Open" translator comment. It is by no means
necessary, but it provides some context for the human translator.
*/
-QKeySequence::QKeySequence(const QString &key)
-{
- d = new QKeySequencePrivate();
- assign(key);
-}
-
-/*!
- \since 4.7
- Creates a key sequence from the \a key string based on \a format.
-*/
QKeySequence::QKeySequence(const QString &key, QKeySequence::SequenceFormat format)
{
d = new QKeySequencePrivate();
diff --git a/src/gui/kernel/qkeysequence.h b/src/gui/kernel/qkeysequence.h
index d1e7d06653..c926e8de1a 100644
--- a/src/gui/kernel/qkeysequence.h
+++ b/src/gui/kernel/qkeysequence.h
@@ -146,8 +146,7 @@ public:
};
QKeySequence();
- QKeySequence(const QString &key);
- QKeySequence(const QString &key, SequenceFormat format);
+ QKeySequence(const QString &key, SequenceFormat format = NativeText);
QKeySequence(int k1, int k2 = 0, int k3 = 0, int k4 = 0);
QKeySequence(const QKeySequence &ks);
QKeySequence(StandardKey key);
@@ -204,7 +203,6 @@ private:
friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &in, const QKeySequence &ks);
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &in, QKeySequence &ks);
- friend class Q3AccelManager;
friend class QShortcutMap;
friend class QShortcut;
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index eaff417f15..4668f9e750 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -49,6 +49,7 @@
#include <QtCore/QThread>
#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/private/qwindow_p.h>
#include <QtGui/QScreen>
#include <private/qopenglextensions_p.h>
@@ -502,7 +503,13 @@ void QOpenGLContext::swapBuffers(QSurface *surface)
if (surface->surfaceType() != QSurface::OpenGLSurface) {
qWarning() << "QOpenGLContext::swapBuffers() called with non-opengl surface";
return;
- }
+ }
+
+ if (surface->surfaceClass() == QSurface::Window
+ && !qt_window_private(static_cast<QWindow *>(surface))->receivedExpose)
+ {
+ qWarning() << "QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined";
+ }
QPlatformSurface *surfaceHandle = surface->surfaceHandle();
if (!surfaceHandle)
@@ -534,9 +541,9 @@ void QOpenGLContext::swapBuffers(QSurface *surface)
Returns 0 if no such function can be found.
*/
-QFunctionPointer QOpenGLContext::getProcAddress(const QByteArray &procName)
+QFunctionPointer QOpenGLContext::getProcAddress(const QByteArray &procName) const
{
- Q_D(QOpenGLContext);
+ Q_D(const QOpenGLContext);
if (!d->platformGLContext)
return 0;
return d->platformGLContext->getProcAddress(procName);
diff --git a/src/gui/kernel/qopenglcontext.h b/src/gui/kernel/qopenglcontext.h
index 2dc4357b00..b9a47a54b8 100644
--- a/src/gui/kernel/qopenglcontext.h
+++ b/src/gui/kernel/qopenglcontext.h
@@ -96,7 +96,7 @@ class Q_GUI_EXPORT QOpenGLContext : public QObject
Q_OBJECT
Q_DECLARE_PRIVATE(QOpenGLContext)
public:
- QOpenGLContext(QObject *parent = 0);
+ explicit QOpenGLContext(QObject *parent = 0);
~QOpenGLContext();
void setFormat(const QSurfaceFormat &format);
@@ -117,7 +117,7 @@ public:
void doneCurrent();
void swapBuffers(QSurface *surface);
- QFunctionPointer getProcAddress(const QByteArray &procName);
+ QFunctionPointer getProcAddress(const QByteArray &procName) const;
QSurface *surface() const;
diff --git a/src/gui/kernel/qplatformsharedgraphicscache_qpa.h b/src/gui/kernel/qplatformsharedgraphicscache_qpa.h
index b8de1c4ef5..679b8ab7de 100644
--- a/src/gui/kernel/qplatformsharedgraphicscache_qpa.h
+++ b/src/gui/kernel/qplatformsharedgraphicscache_qpa.h
@@ -76,7 +76,7 @@ public:
OpenGLTexture
};
- QPlatformSharedGraphicsCache(QObject *parent = 0) : QObject(parent) {}
+ explicit QPlatformSharedGraphicsCache(QObject *parent = 0) : QObject(parent) {}
Q_INVOKABLE virtual void ensureCacheInitialized(const QByteArray &cacheId, BufferType bufferType,
PixelFormat pixelFormat) = 0;
diff --git a/src/gui/kernel/qplatformsurface_qpa.h b/src/gui/kernel/qplatformsurface_qpa.h
index e629f1183f..f64a697fc5 100644
--- a/src/gui/kernel/qplatformsurface_qpa.h
+++ b/src/gui/kernel/qplatformsurface_qpa.h
@@ -71,7 +71,7 @@ public:
QSurface::SurfaceClass surfaceClass() const;
private:
- QPlatformSurface(QSurface::SurfaceClass type);
+ explicit QPlatformSurface(QSurface::SurfaceClass type);
QSurface::SurfaceClass m_type;
diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp
index e07ed78615..4aa46722de 100644
--- a/src/gui/kernel/qplatformwindow_qpa.cpp
+++ b/src/gui/kernel/qplatformwindow_qpa.cpp
@@ -142,11 +142,13 @@ QMargins QPlatformWindow::frameMargins() const
/*!
Reimplemented in subclasses to show the surface
if \a visible is \c true, and hide it if \a visible is \c false.
+
+ The default implementation sends a synchronous expose event.
*/
void QPlatformWindow::setVisible(bool visible)
{
- Q_UNUSED(visible);
- QWindowSystemInterface::handleSynchronousExposeEvent(window(), QRect(QPoint(), geometry().size()));
+ QRect rect(QPoint(), geometry().size());
+ QWindowSystemInterface::handleSynchronousExposeEvent(window(), rect);
}
/*!
Requests setting the window flags of this surface
diff --git a/src/gui/kernel/qplatformwindow_qpa.h b/src/gui/kernel/qplatformwindow_qpa.h
index aa4d7f5054..729f35e025 100644
--- a/src/gui/kernel/qplatformwindow_qpa.h
+++ b/src/gui/kernel/qplatformwindow_qpa.h
@@ -74,7 +74,7 @@ class Q_GUI_EXPORT QPlatformWindow : public QPlatformSurface
{
Q_DECLARE_PRIVATE(QPlatformWindow)
public:
- QPlatformWindow(QWindow *window);
+ explicit QPlatformWindow(QWindow *window);
virtual ~QPlatformWindow();
QWindow *window() const;
diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp
index ce26b9dd93..3546ce01dd 100644
--- a/src/gui/kernel/qscreen.cpp
+++ b/src/gui/kernel/qscreen.cpp
@@ -401,7 +401,7 @@ static int log2(uint i)
Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().
*/
-int QScreen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b)
+int QScreen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b) const
{
if (a == Qt::PrimaryOrientation)
a = primaryOrientation();
@@ -436,7 +436,7 @@ int QScreen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b)
Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().
*/
-QTransform QScreen::transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target)
+QTransform QScreen::transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target) const
{
if (a == Qt::PrimaryOrientation)
a = primaryOrientation();
@@ -477,7 +477,7 @@ QTransform QScreen::transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientat
Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().
*/
-QRect QScreen::mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect)
+QRect QScreen::mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect) const
{
if (a == Qt::PrimaryOrientation)
a = primaryOrientation();
@@ -503,7 +503,7 @@ QRect QScreen::mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, cons
Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().
*/
-bool QScreen::isPortrait(Qt::ScreenOrientation o)
+bool QScreen::isPortrait(Qt::ScreenOrientation o) const
{
return o == Qt::PortraitOrientation || o == Qt::InvertedPortraitOrientation
|| (o == Qt::PrimaryOrientation && primaryOrientation() == Qt::PortraitOrientation);
@@ -515,7 +515,7 @@ bool QScreen::isPortrait(Qt::ScreenOrientation o)
Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().
*/
-bool QScreen::isLandscape(Qt::ScreenOrientation o)
+bool QScreen::isLandscape(Qt::ScreenOrientation o) const
{
return o == Qt::LandscapeOrientation || o == Qt::InvertedLandscapeOrientation
|| (o == Qt::PrimaryOrientation && primaryOrientation() == Qt::LandscapeOrientation);
@@ -580,7 +580,7 @@ void QScreenPrivate::updatePrimaryOrientation()
safe. This depends on the underlying window system.
*/
-QPixmap QScreen::grabWindow(WId window, int x, int y, int w, int h) const
+QPixmap QScreen::grabWindow(WId window, int x, int y, int w, int h)
{
const QPlatformScreen *platformScreen = handle();
if (!platformScreen) {
diff --git a/src/gui/kernel/qscreen.h b/src/gui/kernel/qscreen.h
index 111e10d340..f69e04a595 100644
--- a/src/gui/kernel/qscreen.h
+++ b/src/gui/kernel/qscreen.h
@@ -118,14 +118,14 @@ public:
Qt::ScreenOrientation primaryOrientation() const;
Qt::ScreenOrientation orientation() const;
- int angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b);
- QTransform transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target);
- QRect mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect);
+ int angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b) const;
+ QTransform transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target) const;
+ QRect mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect) const;
- bool isPortrait(Qt::ScreenOrientation orientation);
- bool isLandscape(Qt::ScreenOrientation orientation);
+ bool isPortrait(Qt::ScreenOrientation orientation) const;
+ bool isLandscape(Qt::ScreenOrientation orientation) const;
- QPixmap grabWindow(WId window, int x, int y, int w, int h) const;
+ QPixmap grabWindow(WId window, int x, int y, int w, int h);
Q_SIGNALS:
void sizeChanged(const QSize &size);
@@ -142,7 +142,7 @@ Q_SIGNALS:
void orientationChanged(Qt::ScreenOrientation orientation);
private:
- QScreen(QPlatformScreen *screen);
+ explicit QScreen(QPlatformScreen *screen);
Q_DISABLE_COPY(QScreen)
friend class QGuiApplicationPrivate;
diff --git a/src/gui/kernel/qsurface.h b/src/gui/kernel/qsurface.h
index a8900fde33..befb771129 100644
--- a/src/gui/kernel/qsurface.h
+++ b/src/gui/kernel/qsurface.h
@@ -80,7 +80,7 @@ public:
virtual QSize size() const = 0;
protected:
- QSurface(SurfaceClass type);
+ explicit QSurface(SurfaceClass type);
SurfaceClass m_type;
diff --git a/src/gui/kernel/qsurfaceformat.h b/src/gui/kernel/qsurfaceformat.h
index 6daa08095e..a4224bbedd 100644
--- a/src/gui/kernel/qsurfaceformat.h
+++ b/src/gui/kernel/qsurfaceformat.h
@@ -75,7 +75,7 @@ public:
};
QSurfaceFormat();
- QSurfaceFormat(FormatOptions options);
+ /*implicit*/ QSurfaceFormat(FormatOptions options);
QSurfaceFormat(const QSurfaceFormat &other);
QSurfaceFormat &operator=(const QSurfaceFormat &other);
~QSurfaceFormat();
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 856dcd8426..b042283071 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -109,6 +109,18 @@ QT_BEGIN_NAMESPACE
called whenever the windows exposure in the windowing system changes. On
windowing systems that do not make this information visible to the
application, isExposed() will simply return the same value as isVisible().
+
+ \section1 Rendering
+
+ There are two Qt APIs that can be used to render content into a window,
+ QBackingStore for rendering with a QPainter and flushing the contents
+ to a window with type QSurface::RasterSurface, and QOpenGLContext for
+ rendering with OpenGL to a window with type QSurface::OpenGLSurface.
+
+ The application can start rendering as soon as isExposed() returns true,
+ and can keep rendering until it isExposed() returns false. To find out when
+ isExposed() changes, reimplement exposeEvent(). The window will always get
+ a resize event before the first expose event.
*/
/*!
@@ -593,9 +605,7 @@ void QWindow::requestActivateWindow()
bool QWindow::isExposed() const
{
Q_D(const QWindow);
- if (d->platformWindow)
- return d->platformWindow->isExposed();
- return false;
+ return d->exposed;
}
/*!
@@ -1084,6 +1094,9 @@ void QWindow::destroy()
}
setVisible(false);
delete d->platformWindow;
+ d->resizeEventPending = true;
+ d->receivedExpose = false;
+ d->exposed = false;
d->platformWindow = 0;
}
@@ -1343,12 +1356,19 @@ bool QWindow::close()
The expose event is sent by the window system whenever the window's
exposure on screen changes.
+ The application can start rendering into the window with QBackingStore
+ and QOpenGLContext as soon as it gets an exposeEvent() such that
+ isExposed() is true.
+
If the window is moved off screen, is made totally obscured by another
window, iconified or similar, this function might be called and the
value of isExposed() might change to false. When this happens,
an application should stop its rendering as it is no longer visible
to the user.
+ A resize event will always be sent before the expose event the first time
+ a window is shown.
+
\sa isExposed()
*/
void QWindow::exposeEvent(QExposeEvent *ev)
@@ -1379,7 +1399,10 @@ void QWindow::resizeEvent(QResizeEvent *ev)
/*!
Override this to handle show events.
- This function is called when the window becomes visible in the windowing system.
+ The function is called when the window has requested becoming visible.
+
+ If the window is successfully shown by the windowing system, this will
+ be followed by a resize and an expose event.
*/
void QWindow::showEvent(QShowEvent *ev)
{
@@ -1387,9 +1410,10 @@ void QWindow::showEvent(QShowEvent *ev)
}
/*!
- Override this to handle hide events.
+ Override this to handle hide evens.
- This function is called when the window becomes hidden in the windowing system.
+ The function is called when the window has requested being hidden in the
+ windowing system.
*/
void QWindow::hideEvent(QHideEvent *ev)
{
diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h
index 71ae9686b3..118e3ec25f 100644
--- a/src/gui/kernel/qwindow.h
+++ b/src/gui/kernel/qwindow.h
@@ -95,8 +95,8 @@ class Q_GUI_EXPORT QWindow : public QObject, public QSurface
public:
- QWindow(QScreen *screen = 0);
- QWindow(QWindow *parent);
+ explicit QWindow(QScreen *screen = 0);
+ explicit QWindow(QWindow *parent);
virtual ~QWindow();
void setSurfaceType(SurfaceType surfaceType);
@@ -183,11 +183,6 @@ public:
inline QSize size() const { return geometry().size(); }
inline QPoint pos() const { return geometry().topLeft(); }
-#ifdef QT_DEPRECATED
- QT_DEPRECATED inline void move(const QPoint &pt) { setPos(pt); }
- QT_DEPRECATED inline void move(int posx, int posy) { setPos(posx, posy); }
-#endif
-
inline void setPos(const QPoint &pt) { setGeometry(QRect(pt, size())); }
inline void setPos(int posx, int posy) { setPos(QPoint(posx, posy)); }
diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h
index b665298ce0..375bd1e729 100644
--- a/src/gui/kernel/qwindow_p.h
+++ b/src/gui/kernel/qwindow_p.h
@@ -72,8 +72,10 @@ public:
, parentWindow(0)
, platformWindow(0)
, visible(false)
+ , exposed(false)
, windowState(Qt::WindowNoState)
, resizeEventPending(true)
+ , receivedExpose(false)
, positionPolicy(WindowFrameExclusive)
, contentOrientation(Qt::PrimaryOrientation)
, windowOrientation(Qt::PrimaryOrientation)
@@ -100,17 +102,18 @@ public:
return offset;
}
-
QWindow::SurfaceType surfaceType;
Qt::WindowFlags windowFlags;
QWindow *parentWindow;
QPlatformWindow *platformWindow;
bool visible;
+ bool exposed;
QSurfaceFormat requestedFormat;
QString windowTitle;
QRect geometry;
Qt::WindowState windowState;
bool resizeEventPending;
+ bool receivedExpose;
PositionPolicy positionPolicy;
Qt::ScreenOrientation contentOrientation;
Qt::ScreenOrientation windowOrientation;
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp
index 0aa9251642..a0b77b8208 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp
+++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp
@@ -39,6 +39,7 @@
**
****************************************************************************/
#include "qwindowsysteminterface_qpa.h"
+#include "qplatformwindow_qpa.h"
#include "qwindowsysteminterface_qpa_p.h"
#include "private/qguiapplication_p.h"
#include "private/qevent_p.h"
@@ -179,7 +180,7 @@ bool QWindowSystemInterface::tryHandleSynchronousExtendedShortcutEvent(QWindow *
{
QGuiApplicationPrivate::modifier_buttons = mods;
- QKeyEventEx qevent(QEvent::ShortcutOverride, k, mods, text, autorep, count, nativeScanCode, nativeVirtualKey, nativeModifiers);
+ QKeyEvent qevent(QEvent::ShortcutOverride, k, mods, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, count);
qevent.setTimestamp(timestamp);
return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(w, &qevent);
}
@@ -278,6 +279,15 @@ void QWindowSystemInterface::handleWheelEvent(QWindow *tlw, ulong timestamp, con
QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
}
+
+QWindowSystemInterfacePrivate::ExposeEvent::ExposeEvent(QWindow *exposed, const QRegion &region)
+ : WindowSystemEvent(Expose)
+ , exposed(exposed)
+ , isExposed(exposed && exposed->handle() ? exposed->handle()->isExposed() : false)
+ , region(region)
+{
+}
+
int QWindowSystemInterfacePrivate::windowSystemEventsQueued()
{
queueMutex.lock();
@@ -430,15 +440,9 @@ void QWindowSystemInterface::handleThemeChange(QWindow *tlw)
QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
}
-void QWindowSystemInterface::handleMapEvent(QWindow *tlw)
-{
- QWindowSystemInterfacePrivate::MapEvent *e = new QWindowSystemInterfacePrivate::MapEvent(tlw);
- QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
-}
-
-void QWindowSystemInterface::handleUnmapEvent(QWindow *tlw)
+void QWindowSystemInterface::handleExposeEvent(QWindow *tlw, const QRegion &region)
{
- QWindowSystemInterfacePrivate::UnmapEvent *e = new QWindowSystemInterfacePrivate::UnmapEvent(tlw);
+ QWindowSystemInterfacePrivate::ExposeEvent *e = new QWindowSystemInterfacePrivate::ExposeEvent(tlw, region);
QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
}
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.h b/src/gui/kernel/qwindowsysteminterface_qpa.h
index 4cdd33b49f..1fbf430bf9 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa.h
+++ b/src/gui/kernel/qwindowsysteminterface_qpa.h
@@ -110,7 +110,7 @@ public:
Qt::TouchPointState state; //Qt::TouchPoint{Pressed|Moved|Stationary|Released}
QVector2D velocity; // in screen coordinate system, pixels / seconds
QTouchEvent::TouchPoint::InfoFlags flags;
- QList<QPointF> rawPositions; // in screen coordinates
+ QVector<QPointF> rawPositions; // in screen coordinates
};
static void registerTouchDevice(QTouchDevice *device);
@@ -130,9 +130,7 @@ public:
static void handleWindowActivated(QWindow *w);
static void handleWindowStateChanged(QWindow *w, Qt::WindowState newState);
- static void handleMapEvent(QWindow *w);
- static void handleUnmapEvent(QWindow *w);
-
+ static void handleExposeEvent(QWindow *tlw, const QRegion &region);
static void handleSynchronousExposeEvent(QWindow *tlw, const QRegion &region);
// Drag and drop. These events are sent immediately.
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa_p.h b/src/gui/kernel/qwindowsysteminterface_qpa_p.h
index fe97b486ad..d7be7699e9 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa_p.h
+++ b/src/gui/kernel/qwindowsysteminterface_qpa_p.h
@@ -42,6 +42,7 @@
#define QWINDOWSYSTEMINTERFACE_QPA_P_H
#include "qwindowsysteminterface_qpa.h"
+
#include <QElapsedTimer>
QT_BEGIN_HEADER
@@ -66,8 +67,6 @@ public:
ScreenAvailableGeometry,
ScreenLogicalDotsPerInch,
ThemeChange,
- Map,
- Unmap,
Expose
};
@@ -241,28 +240,11 @@ public:
QWeakPointer<QWindow> window;
};
- class MapEvent : public WindowSystemEvent {
- public:
- MapEvent(QWindow *mapped)
- : WindowSystemEvent(Map), mapped(mapped)
- { }
- QWeakPointer<QWindow> mapped;
- };
-
- class UnmapEvent : public WindowSystemEvent {
- public:
- UnmapEvent(QWindow *unmapped)
- : WindowSystemEvent(Unmap), unmapped(unmapped)
- { }
- QWeakPointer<QWindow> unmapped;
- };
-
class ExposeEvent : public WindowSystemEvent {
public:
- ExposeEvent(QWindow *exposed, const QRegion &region)
- : WindowSystemEvent(Expose), exposed(exposed), region(region)
- { }
+ ExposeEvent(QWindow *exposed, const QRegion &region);
QWeakPointer<QWindow> exposed;
+ bool isExposed;
QRegion region;
};