1
0

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

This commit is contained in:
Sander van Grieken
2024-01-19 14:57:55 +01:00
parent 17147732fb
commit 9518bd0e68

View File

@@ -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