Results 1 to 5 of 5

Thread: QTabWidget: how to force "no current widget"?

  1. #1
    Join Date
    Apr 2009
    Location
    Italy
    Posts
    70
    Thanks
    23
    Thanked 15 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Question QTabWidget: how to force "no current widget"?

    Hello,
    I have a set of QTabWidgets and I am trying to force only one "current" tab across the multiple QTabWidgets. In order to do this, I need a way to deselect all the tabs in the "inactive" QTabWidgets. How can I do this?

    I tried setCurrentIndex(-1) and setCurrentWidget(0) but got no results. Incidentally, I noticed that removing the current tab from a QTabWidget leaves no current widget (that's good)... but I don't want to remove the current tab. Anything better then adding and removing a fake tab?

    I am using Qt 4.5.0 on Vista sp1 + VS 2008 sp1.

    Thanks.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTabWidget: how to force "no current widget"?

    I have a set of QTabWidgets and I am trying to force only one "current" tab across the multiple QTabWidgets
    Why dont you combine all the tabs from multiple tabwidgets into one QTabWidget ???

  3. #3
    Join Date
    Apr 2009
    Location
    Italy
    Posts
    70
    Thanks
    23
    Thanked 15 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTabWidget: how to force "no current widget"?

    Because I need data from different QTabWidgets pages to be visible at the same time.

  4. #4
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTabWidget: how to force "no current widget"?

    could you explain your use case a little better..maybe there are better solutions for it

  5. #5
    Join Date
    Apr 2009
    Location
    Italy
    Posts
    70
    Thanks
    23
    Thanked 15 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTabWidget: how to force "no current widget"?

    Well, it's a kind of MDI interface.

    I need multiple documents displayed at the same time, but only one must be "current", so when you click a button on the toolbar you know what the target object is. Regularly tabbed documents are welcome as well, because you don't need ALL the documents visibile ALL the time. You can store them for later perusal.

    For those of you who are familiar with wxWidgets, I am trying to mimic a subset of the functionality you can find in the "wxAUINotebook" control, where you can split the tab control, drag and drop tabs across multiple tab controls, detach and attach them, but only one tab is current at any given time.

Similar Threads

  1. Force focus to a QTabWidget page's widget
    By thomaspu in forum Qt Programming
    Replies: 1
    Last Post: 2nd January 2008, 06:54
  2. Distributing QT application for Mac OS
    By mb0 in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2007, 18:59
  3. Replies: 15
    Last Post: 21st April 2007, 17:46

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.