Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Facing problems with switching through multiple windows in my GUI
Forum Updated to NodeBB v4.3 + New Features

Facing problems with switching through multiple windows in my GUI

Scheduled Pinned Locked Moved Solved General and Desktop
pyqt5
11 Posts 5 Posters 2.6k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi and welcome to devnet,

    Are you doing some kind of wizard ?

    Or do you want to go back and forth with them ?

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    A 1 Reply Last reply
    0
    • SGaistS SGaist

      Hi and welcome to devnet,

      Are you doing some kind of wizard ?

      Or do you want to go back and forth with them ?

      A Offline
      A Offline
      Ahmed Zeid
      wrote on last edited by
      #3

      Hello, @SGaist, thank you for your reply.
      No, It's not a wizard. I should be able to go back and forth.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #4

        Then it looks like you should rather use a QStackedWidget rather than re-create the widgets all the time and handle the switching at a higher level.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        A 1 Reply Last reply
        2
        • SGaistS SGaist

          Then it looks like you should rather use a QStackedWidget rather than re-create the widgets all the time and handle the switching at a higher level.

          A Offline
          A Offline
          Ahmed Zeid
          wrote on last edited by
          #5

          @SGaist You're absolutely right. The transition is much smoother now.

          One more question please, my first window is a loading screen like the one shown in the picture attached, and then the software windows themselves are in the QStackedWidget.

          In many other software, while the loading screen is showing, the software icon doesn't actually appear in the taskbar, instead it only appears once the actual software has started (The QStackedWidget in my case).
          Do you happen to know how to hide the icon from the taskbar while showing my loading screen (which is a QMainWindow btw) and then showing it later on?
          Thanks a lot.

          icepak-launch-workbench.3ea599da.png

          jsulmJ 1 Reply Last reply
          0
          • A Ahmed Zeid

            @SGaist You're absolutely right. The transition is much smoother now.

            One more question please, my first window is a loading screen like the one shown in the picture attached, and then the software windows themselves are in the QStackedWidget.

            In many other software, while the loading screen is showing, the software icon doesn't actually appear in the taskbar, instead it only appears once the actual software has started (The QStackedWidget in my case).
            Do you happen to know how to hide the icon from the taskbar while showing my loading screen (which is a QMainWindow btw) and then showing it later on?
            Thanks a lot.

            icepak-launch-workbench.3ea599da.png

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #6

            @Ahmed-Zeid Take a look at https://stackoverflow.com/questions/4055506/qt-hide-taskbar-item

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            2
            • B Offline
              B Offline
              Bonnie
              wrote on last edited by
              #7

              I think loading screen should be separated from other windows.
              Are you aware that there is a QSplashScreen class?
              https://doc.qt.io/qt-5/qsplashscreen.html

              A 1 Reply Last reply
              4
              • B Bonnie

                I think loading screen should be separated from other windows.
                Are you aware that there is a QSplashScreen class?
                https://doc.qt.io/qt-5/qsplashscreen.html

                A Offline
                A Offline
                Ahmed Zeid
                wrote on last edited by
                #8

                Hey @Bonnie, I did not know of this class. I started reading about it, and I believe that this would be better for my software. Here's another useful example for PyQt5 if someone is interested:
                https://stackoverflow.com/questions/58661539/create-splash-screen-in-pyqt5

                Quick question though, I am planing on building my loading screen (QSplashScreen) on MainWindow1 and then have the rest of my windows in QStackedWidget built on MainWindow2. I have read in an article that using multiple Mainwindows in your software is bad practice. Is this correct? or I can just go forward with my plan?

                B JonBJ 2 Replies Last reply
                0
                • A Ahmed Zeid

                  Hey @Bonnie, I did not know of this class. I started reading about it, and I believe that this would be better for my software. Here's another useful example for PyQt5 if someone is interested:
                  https://stackoverflow.com/questions/58661539/create-splash-screen-in-pyqt5

                  Quick question though, I am planing on building my loading screen (QSplashScreen) on MainWindow1 and then have the rest of my windows in QStackedWidget built on MainWindow2. I have read in an article that using multiple Mainwindows in your software is bad practice. Is this correct? or I can just go forward with my plan?

                  B Offline
                  B Offline
                  Bonnie
                  wrote on last edited by Bonnie
                  #9

                  @Ahmed-Zeid said in Facing problems with switching through multiple windows in my GUI:

                  using multiple Mainwindows in your software is bad practice. Is this correct?

                  In my opinion, yes.
                  Don't put QSplashScreen in any window. Itself is a window, just without title bar / window frame / taskbar item.

                  1 Reply Last reply
                  4
                  • A Ahmed Zeid

                    Hey @Bonnie, I did not know of this class. I started reading about it, and I believe that this would be better for my software. Here's another useful example for PyQt5 if someone is interested:
                    https://stackoverflow.com/questions/58661539/create-splash-screen-in-pyqt5

                    Quick question though, I am planing on building my loading screen (QSplashScreen) on MainWindow1 and then have the rest of my windows in QStackedWidget built on MainWindow2. I have read in an article that using multiple Mainwindows in your software is bad practice. Is this correct? or I can just go forward with my plan?

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by JonB
                    #10

                    @Ahmed-Zeid
                    You should only need one main window. (Splash screen is outside of main window, as @Bonnie said.)

                    and then have the rest of my windows in QStackedWidget built on MainWindow2

                    What do you mean by "built on"? Your main window should have a QStackedWidget as its main/central widget, and then your various "pages" should just be QWidgets placed in the stacked widget, not QMainWindows themselves. The main window's framework is around the outside of the stacked widget.

                    A 1 Reply Last reply
                    2
                    • JonBJ JonB

                      @Ahmed-Zeid
                      You should only need one main window. (Splash screen is outside of main window, as @Bonnie said.)

                      and then have the rest of my windows in QStackedWidget built on MainWindow2

                      What do you mean by "built on"? Your main window should have a QStackedWidget as its main/central widget, and then your various "pages" should just be QWidgets placed in the stacked widget, not QMainWindows themselves. The main window's framework is around the outside of the stacked widget.

                      A Offline
                      A Offline
                      Ahmed Zeid
                      wrote on last edited by
                      #11

                      Hello, @JonB, thanks a lot for your reply. Yes, this is exactly what I meant.
                      Sorry for being unclear before.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved