Results 1 to 2 of 2

Thread: movable QTabBar or QTabWidget set some tabs fixed

  1. #1
    Join Date
    Nov 2012
    Posts
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default movable QTabBar or QTabWidget set some tabs fixed

    When i called QTabBar::setMovable i got that all tabs can be moved by mouse - how to prevent some tabs from moving?

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: movable QTabBar or QTabWidget set some tabs fixed

    I think you could handle the QTabBar::tabBarClicked() signal. If the index of the tab that is clicked is one that you do not want to be movable, then set movable to false in the slot, otherwise set it to true. You should also handle the QTabBar::tabMoved() signal, and set movable to false there. You should start out with movable set to false.

    This might not work if the tabBarClicked() signal is only emitted on an actual click (mouse down then up).

Similar Threads

  1. Replies: 1
    Last Post: 12th June 2014, 08:27
  2. QTabWidget movable tabs behavior
    By berchio in forum Qt Programming
    Replies: 0
    Last Post: 23rd October 2012, 21:18
  3. Replies: 1
    Last Post: 8th January 2012, 23:37
  4. QTabBar make all tabs out of focus
    By migel in forum Newbie
    Replies: 1
    Last Post: 24th August 2011, 13:38
  5. QTabBar color in space inbetween tabs
    By AwDogsgo2Heaven in forum Newbie
    Replies: 1
    Last Post: 12th March 2010, 09:44

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.