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.
  • martial123M Offline
    martial123M Offline
    martial123
    wrote on 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

    jsulmJ 1 Reply Last reply
    0
    • martial123M martial123

      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

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on 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
      • martial123M Offline
        martial123M Offline
        martial123
        wrote on last edited by
        #3

        How you do that ?
        in main.cpp ?

        jsulmJ 1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 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
          • martial123M martial123

            How you do that ?
            in main.cpp ?

            jsulmJ Online
            jsulmJ Online
            jsulm
            Lifetime Qt Champion
            wrote on 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

            • Login

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