Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    General and Desktop
    tabs push button
    3
    4
    3718
    Loading More Posts
    • 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.
    • Ratzz
      Ratzz last edited by Ratzz

      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 Reply Quote 0
      • J
        Jeroen3 last edited by

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

        1 Reply Last reply Reply Quote 1
        • C
          Christopher last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • Ratzz
            Ratzz last edited by

            @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 Reply Quote 0
            • First post
              Last post