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. Change the interface inside the same MainWindow

Change the interface inside the same MainWindow

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 392 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.
  • A Offline
    A Offline
    Andrew23
    wrote on last edited by
    #1

    I need to change the interface of my application inside the main window every time that I push one of three pushbuttons (I have 3 different interfaces). I foud something on the web about the DockWidgets but they seem not to be the right choise for my pourpose because I think that they are usefull when you have to place side by side, in your main windows, two or more "windows" and not only one. Maybe I'm wrong, I'm moving my first steps in Qt framework.

    What's the best method to implement the switch between interfaces in main window? In the following picture an example of what I'm looking for: if I press the button 'A' it must open the 'Innterface A' in the red area, if I press the button 'T' it must close the 'Interface A' and open the 'Innterface T' in the same red area and if I press the button 'E' it must close the 'Interface T' and open the 'Innterface E'...and so on.

    Any suggestions?

    alt text

    jsulmJ JonBJ 2 Replies Last reply
    0
    • A Andrew23

      I need to change the interface of my application inside the main window every time that I push one of three pushbuttons (I have 3 different interfaces). I foud something on the web about the DockWidgets but they seem not to be the right choise for my pourpose because I think that they are usefull when you have to place side by side, in your main windows, two or more "windows" and not only one. Maybe I'm wrong, I'm moving my first steps in Qt framework.

      What's the best method to implement the switch between interfaces in main window? In the following picture an example of what I'm looking for: if I press the button 'A' it must open the 'Innterface A' in the red area, if I press the button 'T' it must close the 'Interface A' and open the 'Innterface T' in the same red area and if I press the button 'E' it must close the 'Interface T' and open the 'Innterface E'...and so on.

      Any suggestions?

      alt text

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

      @Andrew23 Take a look at https://doc.qt.io/qt-5/qstackedwidget.html

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

      A 1 Reply Last reply
      3
      • A Andrew23

        I need to change the interface of my application inside the main window every time that I push one of three pushbuttons (I have 3 different interfaces). I foud something on the web about the DockWidgets but they seem not to be the right choise for my pourpose because I think that they are usefull when you have to place side by side, in your main windows, two or more "windows" and not only one. Maybe I'm wrong, I'm moving my first steps in Qt framework.

        What's the best method to implement the switch between interfaces in main window? In the following picture an example of what I'm looking for: if I press the button 'A' it must open the 'Innterface A' in the red area, if I press the button 'T' it must close the 'Interface A' and open the 'Innterface T' in the same red area and if I press the button 'E' it must close the 'Interface T' and open the 'Innterface E'...and so on.

        Any suggestions?

        alt text

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

        @Andrew23
        All you need for this (common requirement) is QStackedWidget Class. Define each of your separates as widgets, and swap between which one is shown in the QStackedWidget.

        1 Reply Last reply
        1
        • jsulmJ jsulm

          @Andrew23 Take a look at https://doc.qt.io/qt-5/qstackedwidget.html

          A Offline
          A Offline
          Andrew23
          wrote on last edited by
          #4

          @jsulm @JonB Thanks

          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