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. Add ready widget into widget
QtWS25 Last Chance

Add ready widget into widget

Scheduled Pinned Locked Moved Solved General and Desktop
widgetui formform editorformdesign
2 Posts 2 Posters 242 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.
  • J Offline
    J Offline
    Joe von Habsburg
    wrote on 9 Sept 2024, 14:32 last edited by
    #1

    Hello I am working on a project. in this project there will be menus on the left side and when clicked, the content of that menu will open on the right side. but I have no idea how it should be done. I am leaving an example

    b16bd35e-d820-43ba-be63-849a28832f02-image.png

    c6e87ad9-5755-4337-94c6-7a333180dc28-image.png

    when device is selected there is something else on the right hand side and when text editor is selected there is something else on the right hand side. how does this happen? what is added there?
    Is it Qt designer form class (.cpp && .h && .ui)?

    P 1 Reply Last reply 9 Sept 2024, 15:16
    0
    • J Joe von Habsburg
      9 Sept 2024, 14:32

      Hello I am working on a project. in this project there will be menus on the left side and when clicked, the content of that menu will open on the right side. but I have no idea how it should be done. I am leaving an example

      b16bd35e-d820-43ba-be63-849a28832f02-image.png

      c6e87ad9-5755-4337-94c6-7a333180dc28-image.png

      when device is selected there is something else on the right hand side and when text editor is selected there is something else on the right hand side. how does this happen? what is added there?
      Is it Qt designer form class (.cpp && .h && .ui)?

      P Offline
      P Offline
      Pl45m4
      wrote on 9 Sept 2024, 15:16 last edited by Pl45m4 9 Sept 2024, 15:56
      #2

      @Joe-von-Habsburg said in Add ready widget into widget:

      I am leaving an example

      QtCreator Preferences is your example?!
      So you want something similar?!

      You could dig into QtCreator source code and check out how it's done.
      For this I would use QToolButton to populate the "menu bar" on the left and a QStackedWidget to display the content pages on the right. Actually the QStackedWidget is more like centered, as the whole window you see is divided into two sections (~15% / ~85%) for the menu and the "rest" (the QStackedWidget for the content).

      Is it Qt designer form class (.cpp && .h && .ui)?

      The "right side" is the content widget... In case of QtCreator a custom QWidget containing a QTabWidget for the Text Editor settings among many other things.
      The parent of all this is probably a QStackedWidget as I presumed above.

      What approach (with or without Designer Form) you pick to implement this has nothing to do with how it works.
      Both ways are possible.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      1
      • J Joe von Habsburg has marked this topic as solved on 10 Sept 2024, 05:47

      2/2

      9 Sept 2024, 15:16

      • Login

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