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. How to create multi windows Qt project
Forum Updated to NodeBB v4.3 + New Features

How to create multi windows Qt project

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 379 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.
  • M Offline
    M Offline
    martial123
    wrote on 4 Feb 2020, 13:08 last edited by
    #1

    Hi everyone,

    My question is :
    How we can create project on Qt in order to have different windows show like this example:

    //program start by main.cpp
    
    First_window.show() //configuration window for example
    do something... 
    First_window.close()
    
    Second_window.show() //this is the main window
    do something 
    Second_window.close()
    
    //program finish
    

    I know this is possible to do that with Hide() and show() but this technique not convince me because 2 process running in the same time and this is not optimize . Imagine we have more windows, this is just not viable..

    So exist a good solution to do that ? like a good practice

    Thank you

    J 1 Reply Last reply 4 Feb 2020, 13:12
    0
    • M martial123
      4 Feb 2020, 13:08

      Hi everyone,

      My question is :
      How we can create project on Qt in order to have different windows show like this example:

      //program start by main.cpp
      
      First_window.show() //configuration window for example
      do something... 
      First_window.close()
      
      Second_window.show() //this is the main window
      do something 
      Second_window.close()
      
      //program finish
      

      I know this is possible to do that with Hide() and show() but this technique not convince me because 2 process running in the same time and this is not optimize . Imagine we have more windows, this is just not viable..

      So exist a good solution to do that ? like a good practice

      Thank you

      J Online
      J Online
      jsulm
      Lifetime Qt Champion
      wrote on 4 Feb 2020, 13:12 last edited by
      #2

      @martial123 said in How to create multi windows Qt project:

      because 2 process running in the same time

      Just a note: there are no two processes at the same time.

      You can do it like this: show your first window. When it finished with it's work it can create the second window show it and close itself.

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

      1 Reply Last reply
      1
      • M Offline
        M Offline
        martial123
        wrote on 4 Feb 2020, 14:49 last edited by
        #3

        How you do that ?
        in main.cpp ?

        J 1 Reply Last reply 5 Feb 2020, 05:40
        0
        • C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 4 Feb 2020, 16:44 last edited by
          #4

          @martial123 said in How to create multi windows Qt project:

          How you do that ?

          For instance with signals and slots - emit a signal when the first window is closed and open the second in your slot.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          3
          • M martial123
            4 Feb 2020, 14:49

            How you do that ?
            in main.cpp ?

            J Online
            J Online
            jsulm
            Lifetime Qt Champion
            wrote on 5 Feb 2020, 05:40 last edited by
            #5

            @martial123 said in How to create multi windows Qt project:

            in main.cpp ?

            The first window is created in main as usual. The second can be created in the first window as I wrote before.

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

            1 Reply Last reply
            3

            5/5

            5 Feb 2020, 05:40

            • Login

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