Python Forum
[PyQt] [Solved]Help Getting Started on Scene Swapping
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] [Solved]Help Getting Started on Scene Swapping
#10
It worked!
Thanks for all the help, I really appreciate it.

I Just had to change:
self.win = Ui_MainDisplay.Ui_MainDisplay()
To:
      self.win = Ui_MainDisplay()
In order to get it to function properly.

I have two more questions (last ones, I promise :)

1) In my AdminMenu I am trying to have it return to the LoginScreen if the Logout buttin is clicked.
I have this:
from LoginScreen import Ui_Loginscreen
    #Logout
    def LogoutClicked(self):
        #Print in terminal for testing:
        print("The Logout Button was clicked")
        #Switch from this screen to the LoginScreen
        #Scene Swap:
        self.win = Ui_Loginscreen()
        self.win.show()
        self.close()
But I get:
Error:
from AdminMenu import Ui_MainDisplay ImportError: cannot import name 'Ui_MainDisplay' from partially initialized module 'AdminMenu' (most likely due to a circular import)
Is there a way to return to the previous screen or not do a circular import?

2) This is a quick side question:

I do: pyuic5 -x {The ui file.ui -> Just drag the ui file into the terminal & it will make the path} -o {output py file.py -> drag the ui file into the terminal and rename it to .py}
to convert my UI file to a Py file. When it does that conversion it uses Object instead of QMainWindow. I'm wondering if there's a way/software that can convert it from Object to QMainWindow, or do you just have to do it by hand?

Just wondering for future reference.

Thanks.
Reply


Messages In This Thread
RE: Help Getting Started on Scene Swapping - by Extra - May-16-2022, 04:56 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020