QObject::connect Error

This commit is contained in:
collecting
2025-09-23 10:40:59 +00:00
parent e05296c798
commit 6d96e778ec

View File

@@ -1124,10 +1124,13 @@ void GRenderWindow::OnEmulationStopping() {
void GRenderWindow::showEvent(QShowEvent* event) {
QWidget::showEvent(event);
// windowHandle() is not initialized until the Window is shown, so we connect it here.
// windowHandle() is not guaranteed to be initialized until after the window is shown.
// We connect here, but check for null to prevent a non-fatal error message on some platforms.
if (windowHandle()) {
connect(windowHandle(), &QWindow::screenChanged, this, &GRenderWindow::OnFramebufferSizeChanged,
Qt::UniqueConnection);
}
}
bool GRenderWindow::eventFilter(QObject* object, QEvent* event) {
if (event->type() == QEvent::HoverMove) {