Results 1 to 3 of 3

Thread: tabWidget tabs closebutton always closes the current tab

  1. #1
    Join Date
    Jul 2009
    Posts
    92
    Thanks
    7
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default tabWidget tabs closebutton always closes the current tab

    Hi,
    I have a tabWidget with tabs that have red close buttons. If I hover with my mouse over the non current tabs they highlight and I can press the red close button. However, instead of closing the tab that is highlighted, the current tab is closed.
    Is that normal ? How can I prevent this?
    thanx

  2. #2
    Join Date
    Sep 2009
    Location
    Finland
    Posts
    63
    Thanks
    1
    Thanked 22 Times in 19 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: tabWidget tabs closebutton always closes the current tab

    Can you show your method to where tabCloseRequested signal is connected? Maybe you are removing current tab instead of the one that is requested i.e. to where the index points to?

  3. #3
    Join Date
    Jul 2009
    Posts
    92
    Thanks
    7
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: tabWidget tabs closebutton always closes the current tab

    there was the problem, I ignored the 'int' in

    connect(tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));
    thanks

Similar Threads

  1. Last dialog closes app
    By been_1990 in forum Qt Programming
    Replies: 2
    Last Post: 12th April 2010, 15:17
  2. Remove tabs from TabWidget
    By jmrbcu in forum Qt Programming
    Replies: 9
    Last Post: 8th April 2010, 00:24
  3. Replies: 2
    Last Post: 14th July 2009, 14:25
  4. Creating empty TabWidget (without any tabs)
    By momesana in forum Qt Tools
    Replies: 2
    Last Post: 2nd December 2007, 10:22
  5. QTabWidget and closeButton
    By !Ci in forum Qt Programming
    Replies: 2
    Last Post: 24th January 2007, 11:12

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.