Commit 0ad1d318 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[KSplashQML] static_cast QPlatformSurfaceEvent instead of dynamic_cast

We check for QEvent::PlatformSurface so we can assume this is what we get.
parent ea4fb2be
......@@ -83,16 +83,15 @@ void SplashWindow::setStage(int stage)
bool SplashWindow::event(QEvent *e)
{
if (e->type() == QEvent::PlatformSurface) {
if (auto pe = dynamic_cast<QPlatformSurfaceEvent*>(e)) {
switch (pe->surfaceEventType()) {
case QPlatformSurfaceEvent::SurfaceCreated:
setupWaylandIntegration();
break;
case QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed:
delete m_shellSurface;
m_shellSurface = nullptr;
break;
}
auto pe = static_cast<QPlatformSurfaceEvent*>(e);
switch (pe->surfaceEventType()) {
case QPlatformSurfaceEvent::SurfaceCreated:
setupWaylandIntegration();
break;
case QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed:
delete m_shellSurface;
m_shellSurface = nullptr;
break;
}
}
return KQuickAddons::QuickViewSharedEngine::event(e);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment