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. Best way to have multiple pyqt GUIs? First page determines inputs of second page?
Forum Update on Monday, May 27th 2025

Best way to have multiple pyqt GUIs? First page determines inputs of second page?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 773 Views
  • 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.
  • P Offline
    P Offline
    poordev123
    wrote on last edited by
    #1

    I have a GUI that changes based on which version the user wants. For example the first page has the user enter if they want to look at cars or trucks, the second page then will have different characteristics of each. If the user hits car then it shows buttons for sedans, convertibles, etc. vs if the user hits trucks then it has options for truck beds and torque, etc. Initially I was creating the original GUI and then either hiding or showing certain characteristics based on the choice but that doesn't seem like the best way to go about this.

    My question basically is, would it be better to have 3 separate pages? The intro page, the car page, and the truck page, and only show the specific page I want? Or would it be better to have one single page and hide or show specific options?

    jsulmJ 1 Reply Last reply
    0
    • P poordev123

      I have a GUI that changes based on which version the user wants. For example the first page has the user enter if they want to look at cars or trucks, the second page then will have different characteristics of each. If the user hits car then it shows buttons for sedans, convertibles, etc. vs if the user hits trucks then it has options for truck beds and torque, etc. Initially I was creating the original GUI and then either hiding or showing certain characteristics based on the choice but that doesn't seem like the best way to go about this.

      My question basically is, would it be better to have 3 separate pages? The intro page, the car page, and the truck page, and only show the specific page I want? Or would it be better to have one single page and hide or show specific options?

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

      @poordev123 Take a look at https://doc.qt.io/qt-5/qstackedwidget.html
      With that approach you would have different pages and show only one which is currently needed.

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

      1 Reply Last reply
      3
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        I would use a QStackedWidget and have a full page for each item unless we talk about very minor
        change in characteristics.
        I would prefer a page for each due to:

        • Easier to maintain if you add new characteristics later
        • More clean code not having to hide/show depending on the type and hence easier to reuse
          say for preview for an orderlist
        • Qt allows easy reuse of Widgets components so I can share a setup even across pages.
        1 Reply Last reply
        3
        • P Offline
          P Offline
          poordev123
          wrote on last edited by
          #4

          @jsulm @mrjj Thanks guys, I appreciate it. I'll look into both of them :]

          mrjjM 1 Reply Last reply
          0
          • P poordev123

            @jsulm @mrjj Thanks guys, I appreciate it. I'll look into both of them :]

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @poordev123

            Its actually the same widget :)
            Its perfect for designs with multiple pages, but only one visible at a time.

            1 Reply Last reply
            1

            • Login

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