summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qevent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qevent.cpp')
-rw-r--r--src/gui/kernel/qevent.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index a8539e8013..a0b6256e72 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -1324,6 +1324,55 @@ QExposeEvent::~QExposeEvent()
}
/*!
+ \class QPlatformSurfaceEvent
+ \since 5.5
+ \brief The QPlatformSurfaceEvent class is used to notify about native platform surface events.
+ \inmodule QtGui
+
+ \ingroup events
+
+ Platform window events are synchronously sent to windows and offscreen surfaces when their
+ underlying native surfaces are created or are about to be destroyed.
+
+ Applications can respond to these events to know when the underlying platform
+ surface exists.
+*/
+
+/*!
+ \enum QPlatformSurfaceEvent::SurfaceEventType
+
+ This enum describes the type of platform surface event. The possible types are:
+
+ \value SurfaceCreated The underlying native surface has been created
+ \value SurfaceAboutToBeDestroyed The underlying native surface will be destroyed immediately after this event
+
+ The \c SurfaceAboutToBeDestroyed event type is useful as a means of stopping rendering to
+ a platform window before it is destroyed.
+*/
+
+/*!
+ \fn QPlatformSurfaceEvent::SurfaceEventType QPlatformSurfaceEvent::surfaceEventType() const
+
+ Returns the specific type of platform surface event.
+*/
+
+/*!
+ Constructs a platform surface event for the given \a surfaceEventType.
+*/
+QPlatformSurfaceEvent::QPlatformSurfaceEvent(SurfaceEventType surfaceEventType)
+ : QEvent(PlatformSurface)
+ , m_surfaceEventType(surfaceEventType)
+{
+}
+
+/*!
+ \internal
+*/
+QPlatformSurfaceEvent::~QPlatformSurfaceEvent()
+{
+}
+
+/*!
\fn const QRegion &QExposeEvent::region() const
Returns the window area that has been exposed. The region is given in local coordinates.
@@ -3554,6 +3603,8 @@ static const char *eventClassName(QEvent::Type t)
return "QGraphicsSceneEvent";
case QEvent::Timer:
return "QTimerEvent";
+ case QEvent::PlatformSurface:
+ return "QPlatformSurfaceEvent";
default:
break;
}
@@ -3812,6 +3863,18 @@ QDebug operator<<(QDebug dbg, const QEvent *e)
case QEvent::Timer:
dbg << "QTimerEvent(id=" << static_cast<const QTimerEvent *>(e)->timerId() << ')';
break;
+ case QEvent::PlatformSurface:
+ dbg << "QPlatformSurfaceEvent(surfaceEventType=";
+ switch (static_cast<const QPlatformSurfaceEvent *>(e)->surfaceEventType()) {
+ case QPlatformSurfaceEvent::SurfaceCreated:
+ dbg << "SurfaceCreated";
+ break;
+ case QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed:
+ dbg << "SurfaceAboutToBeDestroyed";
+ break;
+ }
+ dbg << ')';
+ break;
default:
dbg << eventClassName(type) << '(' << eventTypeName(type) << ", "
<< (const void *)e << ", type = " << e->type() << ')';