Extend dummypythonqt to test QWidget parenting and QObject::connect.

This commit is contained in:
Teo Mrnjavac 2016-10-07 19:30:44 +02:00
parent a54f217173
commit b77b4ee7d5

View File

@ -35,11 +35,24 @@ from PythonQt.QtGui import *
@calamares_module @calamares_module
class DummyPythonQtViewStep(): class DummyPythonQtViewStep():
def __init__(self): def __init__(self):
self.main_widget = QLabel() self.main_widget = QFrame()
self.main_widget.setLayout(QVBoxLayout())
label = QLabel()
self.main_widget.layout().addWidget(label)
accumulator = "\nCalamares+PythonQt running embedded Python " +\ accumulator = "\nCalamares+PythonQt running embedded Python " +\
platform.python_version() platform.python_version()
self.main_widget.text = accumulator label.text = accumulator
btn = QPushButton()
btn.setText("Click me!")
self.main_widget.layout().addWidget(btn)
btn.connect("clicked(bool)", self.on_btn_clicked)
def on_btn_clicked(self):
self.main_widget.layout().addWidget(QLabel("A new QLabel."))
def prettyName(self): def prettyName(self):
return "Dummy PythonQt ViewStep" return "Dummy PythonQt ViewStep"