简体   繁体   English

PyQT向导按钮

[英]PyQT Wizard buttons

I have created a Qwizard in PyQT with 5 pages. 我在PyQT中创建了一个有3页的Qwizard。 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. 这是因为向导正在初始化默认顺序ID。 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: 如果你想改变默认行为(让我们说第1页的第3页调用),你可以通过重新实现这个功能来实现:

    def nextId(self):

In the class reference, you have an example of the implementation of a non-linear wizard, where they reimplement the nextId(): 在类引用中,您有一个非线性向导实现的示例,它们重新实现nextId():

http://harmattan-dev.nokia.com/docs/library/html/qt4/qwizard.html 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()
    ....

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM