Browse Source

qt: replace timer based delayed call with a less confusing event loop queued call

master
Sander van Grieken 2 years ago
parent
commit
9518bd0e68
No known key found for this signature in database
GPG Key ID: 9BCF8209EA402EBA
  1. 5
      electrum/gui/qt/wizard/wizard.py

5
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

Loading…
Cancel
Save