Results 1 to 3 of 3

Thread: QTabWidget or QWidget signals

  1. #1
    Join Date
    May 2009
    Posts
    75
    Thanks
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QTabWidget or QWidget signals

    Hi,
    I need to know when a specific tab of QTabWidget becomes active and when another tab is selected.
    I found some signals QTabWidget::currentChanged(int index) or QTabWidget::tabBarClicked(int index), but I wonder if exist something more specific, maybe some signals in inner widget. This because tab are dynamic and the "target tab" can change index, so I shoud implement a messy logic to chose the right index

    best regards

  2. #2
    Join Date
    Mar 2014
    Posts
    23
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default Re: QTabWidget or QWidget signals

    When it comes to dynamic UIs in most cases it's up to you to keep track of indices and stuff. You could easily react on insert, move and remove events of QTabWidget/QTabBar to keep your tabs organized.

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,403
    Thanks
    37
    Thanked 1,542 Times in 1,493 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTabWidget or QWidget signals

    You can also always ask for the widget at a given index, so if you know how to handle a specific widget rather than an index, do that.

    Cheers,
    _

Similar Threads

  1. Replies: 2
    Last Post: 10th May 2013, 10:20
  2. Replies: 0
    Last Post: 14th October 2011, 10:03
  3. How to get the size of a QWidget in QTabWidget
    By xiangxw in forum Qt Programming
    Replies: 1
    Last Post: 4th May 2011, 00:45
  4. Replies: 0
    Last Post: 30th March 2010, 14:49
  5. QThread and signals (linux/UNIX signals not Qt Signals)
    By Micawber in forum Qt Programming
    Replies: 1
    Last Post: 28th November 2007, 22:18

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.