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] Selecting a Tab in Code
QtWS25 Last Chance

[SOLVED] Selecting a Tab in Code

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 21.7k 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.
  • W Offline
    W Offline
    WilliamU
    wrote on last edited by
    #1

    Hi, I have a QTabWidget in which I have two tabs. The first I use for the application's general UI and the other for errors. When an error occurs I would like to active this tab to bring these errors to the user's attention. However I cannot see, nor find, anything that allows me to do this, so I thought I'd ask here. I am using Qt 4.7.2 if that helps.

    Regards,

    William

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sidewinder
      wrote on last edited by
      #2

      Try changing current tab using setCurrentIndex(int) function.

      "Never memorize what you can look up in books."
      Albert Einstein

      1 Reply Last reply
      0
      • M Offline
        M Offline
        maxim.prishchepa
        wrote on last edited by
        #3

        You can use "tab index":http://doc.qt.nokia.com/4.7/qtabwidget.html#currentIndex-prop to do that. Just call @setCurrentIndex(neededIndex);@

        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz).

        1 Reply Last reply
        0
        • W Offline
          W Offline
          WilliamU
          wrote on last edited by
          #4

          Thanks for the replies and needless to say it was exactly what I was looking for. Just as well no one can't see how embarrassed I look!

          Regards,

          William

          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