diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 95331a2415e..9eb011abb14 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -123,7 +123,18 @@ void QWindow::setVisible(bool visible) if (!d->platformWindow) create(); + + if (visible) { + QShowEvent showEvent; + QGuiApplication::sendEvent(this, &showEvent); + } + d->platformWindow->setVisible(visible); + + if (!visible) { + QHideEvent hideEvent; + QGuiApplication::sendEvent(this, &hideEvent); + } } bool QWindow::visible() const @@ -515,12 +526,10 @@ void QWindow::resizeEvent(QResizeEvent *) void QWindow::showEvent(QShowEvent *) { - qDebug() << "unimplemented:" << __FILE__ << __LINE__; } void QWindow::hideEvent(QHideEvent *) { - qDebug() << "unimplemented:" << __FILE__ << __LINE__; } bool QWindow::event(QEvent *event) @@ -568,6 +577,14 @@ bool QWindow::event(QEvent *event) exposeEvent(static_cast(event)); break; + case QEvent::Show: + showEvent(static_cast(event)); + break; + + case QEvent::Hide: + hideEvent(static_cast(event)); + break; + default: return QObject::event(event); } diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp index 298592bae3f..a6115cc8290 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp @@ -74,14 +74,4 @@ WId QEglFSWindow::winId() const return m_winid; } -void QEglFSWindow::setVisible(bool visible) -{ - if (visible) { - QWindowSystemInterface::handleMapEvent(window()); - } else { - QWindowSystemInterface::handleUnmapEvent(window()); - } - -} - QT_END_NAMESPACE diff --git a/src/plugins/platforms/eglfs/qeglfswindow.h b/src/plugins/platforms/eglfs/qeglfswindow.h index 32a6e716831..09f553d3b78 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.h +++ b/src/plugins/platforms/eglfs/qeglfswindow.h @@ -58,8 +58,6 @@ public: void setGeometry(const QRect &); WId winId() const; - void setVisible(bool visible); - private: WId m_winid; };