Results 1 to 3 of 3

Thread: Close button in a tab

  1. #1
    Join Date
    Apr 2008
    Location
    Pavlodar, Kazakhstan
    Posts
    22
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Close button in a tab

    Hi all,

    How can I add a close button "x" to a tab in QTabWidget? I want to make it work like in Firefox - when you click it the tab gets closed.

    Thanks in advance, Dmitriy Melnik.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Close button in a tab

    Search the forum for possible solutions, there have been some threads about it. Unfortunately the final effect is far from being perfect.

  3. The following user says thank you to wysota for this useful post:

    mitro (16th May 2008)

  4. #3
    Join Date
    Apr 2008
    Location
    Pavlodar, Kazakhstan
    Posts
    22
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Close button in a tab

    Yes, it really seems to be a hard task. So I found another way the user can close tabs. I called setCornerWidget with QToolButton to place a close button to the corner of the entire tab widget. Not like Firefox but it is suitable for my application. Thanks for the guidance!

Similar Threads

  1. How to hide Close Button "X" on Widget ?
    By merry in forum Qt Programming
    Replies: 8
    Last Post: 25th January 2020, 08:03
  2. Disable Close button (X) of a QDialog
    By BrainB0ne in forum Qt Programming
    Replies: 29
    Last Post: 8th December 2009, 17:01
  3. Replies: 5
    Last Post: 21st April 2008, 07:54
  4. Close Button on Modal Widget?
    By vishal.chauhan in forum Qt Programming
    Replies: 5
    Last Post: 18th February 2008, 11:38
  5. Replies: 3
    Last Post: 16th November 2006, 12:24

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.