Results 1 to 2 of 2

Thread: Disable close button on QTabWidget/QTabBar

  1. #1
    Join Date
    Feb 2007
    Posts
    49
    Thanks
    4
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Disable close button on QTabWidget/QTabBar

    I'm using QTabWidget with close button on each tab (tabsClosable). But I want one or two tabs that can't be closed by the user.

    Is there a way to do it? I searched the documentation and I don't have any clue...

    Thanks in advance,
    Toni

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Disable close button on QTabWidget/QTabBar

    QTabBar has a function called QTabBar::setTabButton. You can create your own close button and set it to the tabs that you want.

  3. The following 2 users say thank you to munna for this useful post:

    mattc (9th May 2009), minimoog (16th March 2009)

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. how to disable X button to close th window
    By raghvendramisra in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2009, 20:01
  4. QDialog not showing close button on Mac
    By manojmka in forum Qt Programming
    Replies: 2
    Last Post: 17th September 2008, 12:56
  5. Disable Checkable Button Question
    By jbpvr in forum Qt Programming
    Replies: 9
    Last Post: 20th March 2007, 17:57

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.