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 combine two or more widgets into different layouts?
Forum Updated to NodeBB v4.3 + New Features

How to combine two or more widgets into different layouts?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.8k Views 1 Watching
  • 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.
  • B Offline
    B Offline
    BlazeRifted
    wrote on last edited by
    #1

    I have a tab widget containing a row of toolbuttons. However when any of these buttons are clicked I want it to open another widget with fixed parameters at another part on the screen. For example I have a button in the tab that says Collect. If clicked it opens a table widget outside of the tab on another part of the screen that has a set number of rows columns and labels. If I clicked on a different button it still opens a widget in the same place but with a different widget. Is this possible? Are there any reference code to go along with proof it is possible?

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      Hi,
      Use the QStackedWidget for the 'changable' widget. Add the widgets you need to be shown there. Then when a button is clicked set the widget you need on top in the stacked widget.
      There is an example about a configuration setup dialog, but the idea is the same.

      Greetz, Jeroen

      1 Reply Last reply
      0
      • B Offline
        B Offline
        BlazeRifted
        wrote on last edited by
        #3

        Thanks!!! I just have one question. Can I link certain widgets in the stack to certain buttons so when there clicked, only the widget corresponding to the button pops up.

        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