PYQT和Python的接口之间的导航

发布于 2025-02-05 20:27:55 字数 568 浏览 1 评论 0原文

我想在表格之间导航:当我单击按钮转到新接口时,当前一个会自动关闭(如果我在“登录”界面中,我单击一个按钮以转到“注册”我希望“登录”以关闭),但是我遇到的问题是该功能似乎不起作用:两个接口仍然打开。

    def openwindow(self):
        self.nextui = QtWidgets.QWidget()
        self.ui = login.Ui_Login_Dialog()
        self.ui.setupUi(self.nextui)
        self.nextui.show() 

“在此处输入图像说明”

我尝试将mainwndow.hide()添加到代码似乎没有用:添加mainwndow.hide()是:

Error! Error due to 'Ui_Login_Dialog' object has no attribute 'hide'

I want to navigate between forms: when I click on a button to go to a new interface, the current one closes automatically (if I am in the "Sign In" interface and I clicked on a button to go to the "Sign up" I want the "Sign In" in to close), but the problem I face is that the function does not seem to work: both the interfaces are still open.

    def openwindow(self):
        self.nextui = QtWidgets.QWidget()
        self.ui = login.Ui_Login_Dialog()
        self.ui.setupUi(self.nextui)
        self.nextui.show() 

enter image description here

I tried to add MainWndow.hide() to the code but the function does not seem to work: the error I got when I added MainWndow.hide() is:

Error! Error due to 'Ui_Login_Dialog' object has no attribute 'hide'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文