I have created a Qwizard in PyQT with 5 pages. I can not figure out how to connect signals to them. How it's works to connect to a next button of a certain page?
Any help is appreciated!
If you add the wizard with
QWizard.AddPage(somePage)
The order in which pages are inserted, is also the order in which they will be shown , by pressing the "next" button; you should not need to do anything to set a sequence among pages.
This is because the wizard is initializing default sequential IDs. If you want to change the default behaviour (let's say call page 3 from page 1), you may do so by reimplementing this function:
def nextId(self):
In the class reference, you have an example of the implementation of a non-linear wizard, where they reimplement the nextId():
http://harmattan-dev.nokia.com/docs/library/html/qt4/qwizard.html
you can connect the button clicked signal in this way:
....
def __init__(self):
self.button(QWizard.NextButton).clicked.connect(self.test)
def test(self):
id = self.currentId()
....
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.