Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. How do you handle applications where you need to change the window as per the user
Forum Updated to NodeBB v4.3 + New Features

How do you handle applications where you need to change the window as per the user

Scheduled Pinned Locked Moved Unsolved Qt for Python
qt for python
2 Posts 2 Posters 260 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.
  • K Offline
    K Offline
    krish_garg
    wrote on last edited by
    #1

    Sorry if the Question is lame. I am a beginner and was learning PyQT6. I am building a simple phone directory as a sample test project. It has various windows like editing screen, contact creation screen, all contacts screen etc.

    Initially I used QMainWindow for each of the screen and a central controller. Later I realized that whenever I changed the QMainWindow, It first closed the previous app from the task bar and then created a new instance for the new window which is ofc not intuitive and weird. Moreover I also wanted to implement a back button but couldn't figure out how.

    At the end I just settled by converting all the windows into a QWidgets and then using a stack in the main controller screen to handle to multiple screens and to implement the back button. This approach though working is just a duck tape fix.

    Before starting something new, I want to ask whether there is a way to handle such stuff. I am not following any course so I may have missed something crucial.

    JonBJ 1 Reply Last reply
    0
    • K krish_garg

      Sorry if the Question is lame. I am a beginner and was learning PyQT6. I am building a simple phone directory as a sample test project. It has various windows like editing screen, contact creation screen, all contacts screen etc.

      Initially I used QMainWindow for each of the screen and a central controller. Later I realized that whenever I changed the QMainWindow, It first closed the previous app from the task bar and then created a new instance for the new window which is ofc not intuitive and weird. Moreover I also wanted to implement a back button but couldn't figure out how.

      At the end I just settled by converting all the windows into a QWidgets and then using a stack in the main controller screen to handle to multiple screens and to implement the back button. This approach though working is just a duck tape fix.

      Before starting something new, I want to ask whether there is a way to handle such stuff. I am not following any course so I may have missed something crucial.

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

      @krish_garg
      There are many ways to implement this, depending on what UI you want (e.g separate widgets/windows/dialogs, MDI, QStackedWidget). Since you mention a "back" button, the one Qt class which gives this is QWizard Class if what you want is a step-by-step guiding the user through a number of sequential pages, which allows user to go back to change their answers. That does not address e.g. a separate "all contacts screen" but might be what you want for adding/editing.

      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