Add debug output for QPlatformSurfaceEvent.

[ChangeLog][QtGui][QPlatformSurfaceEvent] Added event class
QPlatformSurfaceEvent, which is sent to QWindow and QOffscreenSurface
when native surface is created or about to be destroyed.

Task-number: QTBUG-42476
Task-number: QTBUG-42483
Change-Id: If62e2c2a1f2a94fd310bbf7cf22b94c70125ba7a
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
bb10
Friedemann Kleint 2014-11-17 13:56:06 +01:00
parent 801c532636
commit 34cab65e8d
2 changed files with 15 additions and 1 deletions

View File

@ -183,7 +183,7 @@ QT_BEGIN_NAMESPACE
\value ParentAboutToChange The widget parent is about to change.
\value ParentChange The widget parent has changed.
\value PlatformPanel A platform specific panel has been requested.
\value PlatformSurface A native platform surface has been created or is about to be destroyed.
\value PlatformSurface A native platform surface has been created or is about to be destroyed (QPlatformSurfaceEvent).
\value Polish The widget is polished.
\value PolishRequest The widget should be polished.
\value QueryWhatsThis The widget should accept the event if it has "What's This?" help.

View File

@ -3603,6 +3603,8 @@ static const char *eventClassName(QEvent::Type t)
return "QGraphicsSceneEvent";
case QEvent::Timer:
return "QTimerEvent";
case QEvent::PlatformSurface:
return "QPlatformSurfaceEvent";
default:
break;
}
@ -3861,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() << ')';