[英]Closing an .ui file on a click of a button (pyqt5)
I need my dialog box to close when the ok button is clicked.单击确定按钮时,我需要关闭对话框。 How do I do that?
我怎么做?
Assuming you created the button you should be able to just set the button click event as follows:假设您创建了按钮,您应该能够按如下方式设置按钮单击事件:
button.clicked.connect(self.close)
where button
is the button name. button.clicked.connect(self.close)
其中button
是按钮名称。
Although since you did not provide any code with your question it's hard to know if this is what you're asking for...尽管由于您没有为您的问题提供任何代码,所以很难知道这是否是您所要求的......
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.