View Full Version : movable QTabBar or QTabWidget set some tabs fixed

21st November 2014, 16:01
When i called QTabBar::setMovable i got that all tabs can be moved by mouse - how to prevent some tabs from moving?

22nd November 2014, 02:24
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).