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. [SOLVED]How to open specific tab on pushbutton clicked in tabwidget?

[SOLVED]How to open specific tab on pushbutton clicked in tabwidget?

Scheduled Pinned Locked Moved General and Desktop
tabspush button
4 Posts 3 Posters 4.2k 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.
  • R Offline
    R Offline
    Ratzz
    wrote on 16 Jul 2015, 05:04 last edited by Ratzz
    #1

    I have a tabwidget . Which has Tab1 and Tab2. each tab has a Tableview.
    How to make the tab1 to be opened on the pushbutton clicked ?
    Is this the right way?

       ui->tab1->setFocus();

    --Alles ist gut.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jeroen3
      wrote on 16 Jul 2015, 06:01 last edited by
      #2

      I think that will put the focus on the tab name.
      Try setCurrentIndex(int index)

      1 Reply Last reply
      1
      • C Offline
        C Offline
        Christopher
        wrote on 16 Jul 2015, 06:02 last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • R Offline
          R Offline
          Ratzz
          wrote on 16 Jul 2015, 06:03 last edited by
          #4

          @Jeroen3
          Thanks for the reply.
          I tried using setCurrentIndex which helped me out .

              ui->tabWidget->setCurrentWidget(ui->tab);

          --Alles ist gut.

          1 Reply Last reply
          0

          2/4

          16 Jul 2015, 06:01

          • Login

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