Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Stacked and TabWidget
Qt 6.12 LTS is out! See what's new in the release blog

Stacked and TabWidget

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 3.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.
  • K Offline
    K Offline
    krippa
    wrote on last edited by
    #1

    Hi, Im new to development and I have installed -QT- Qt Creator on Ubuntu. Now I have started a app that maybe sometime in the futre can be run on AmigaOS4.

    The thing is: I have a toolbar in the upper mainWindow that contains 14 buttons. And under the toolbar I have a stackedWidget with 14 pages, and in that stack I have 1 tabWidget on each page.

    How do i do to make each button in the toolbar refer to the right tabWidget that is in the stackedWidget?

    http://dl.dropbox.com/u/2893068/aos4sc.png

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goblincoding
      wrote on last edited by
      #2

      The way forward lies with "Signals and Slots":http://doc.qt.nokia.com/stable/signalsandslots.html

      Assuming you're making use of a QStackedWidget, I would personally have assigned the buttons to a QButtonGroup and then all your requirements can basically be met by a single line of code:

      @connect(myButtonGroup, SIGNAL(buttonClicked(int), myStackWidget, SLOT(setCurrentIndex(int)))@

      (obviously you'll just have to ensure that your indices correspond)

      http://www.goblincoding.com

      1 Reply Last reply
      0
      • K Offline
        K Offline
        krippa
        wrote on last edited by
        #3

        OK, THX

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Sounds like you are building some home brewn nested tab structure. In UI terms, even without seeing it, that is probably not a good idea. Try to see if you can think up a different solution for your UI that is less complicated to use.

          1 Reply Last reply
          0
          • K Offline
            K Offline
            krippa
            wrote on last edited by
            #5

            [quote author="Andre" date="1315470086"]Sounds like you are building some home brewn nested tab structure. In UI terms, even without seeing it, that is probably not a good idea. Try to see if you can think up a different solution for your UI that is less complicated to use. [/quote]

            I thought that was a simple beginner thing.

            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
            • Unsolved