tags:

views:

279

answers:

2

Is it possible to completely hide handles from QSplitter widget? I've tried to hide() them but it doesn't work — handles are still on the screen and isVisible() reporting false.

QSplitter::setHandleWidth doesn't work as expected — it doesn't hide handles when calling it with 0.

A: 

The inability to set a zero-width handle seems odd and might be considered a bug - but then again why would you want to? You won't be able to grab a zero-width handle so it seems to be that you really want to use a vertical/horizontal layout.

Henrik Hartz
I want to “lock” layout, like locking toolbars feature in many apps.
Sergei Stolyarov
Try; handle->splitter(num)->setEnabled(false)
Henrik Hartz
I've tried it, it disables handles but no hides them unfortunately.
Sergei Stolyarov
A: 

How bout subclassing QSplitter and overriding paintEvent(QPaintEvent*) to block actual painting of the widget?

larsm
It looks like QSplitter subclassing is the only method.
Sergei Stolyarov