From 9518bd0e68c0e6049c2749e4c0798d5a8a4b3c7f Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Fri, 19 Jan 2024 14:57:55 +0100 Subject: [PATCH] qt: replace timer based delayed call with a less confusing event loop queued call --- electrum/gui/qt/wizard/wizard.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/electrum/gui/qt/wizard/wizard.py b/electrum/gui/qt/wizard/wizard.py index f29c88a85..f1ea2a1a5 100644 --- a/electrum/gui/qt/wizard/wizard.py +++ b/electrum/gui/qt/wizard/wizard.py @@ -3,7 +3,7 @@ import threading from abc import abstractmethod from typing import TYPE_CHECKING -from PyQt5.QtCore import Qt, QTimer, pyqtSignal, pyqtSlot, QSize +from PyQt5.QtCore import Qt, QTimer, pyqtSignal, pyqtSlot, QSize, QMetaObject from PyQt5.QtGui import QPixmap from PyQt5.QtWidgets import (QDialog, QPushButton, QWidget, QLabel, QVBoxLayout, QScrollArea, QHBoxLayout, QLayout) @@ -110,11 +110,12 @@ class QEAbstractWizard(QDialog, MessageBoxMixin): self.show() self.raise_() - QTimer.singleShot(40, self.strt) + QMetaObject.invokeMethod(self, 'strt', Qt.QueuedConnection) # call strt after subclass constructor(s) def sizeHint(self) -> QSize: return QSize(600, 400) + @pyqtSlot() def strt(self): if self.start_viewstate is not None: viewstate = self._current = self.start_viewstate