Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt splitter disable

Tags:

c++

qt

I want to be able to stop a user from moving a QSplitter at runtime. Calling setEnabled(false) does this, but it also disables all child widgets - which isn't what I want. Is there a way to achieve this? Do I have to disable the splitter, and then manually re-enable all child widgets? That seems rather cumbersome, for something that must be a reasonably common practise.

Can anyone suggest anything?

like image 954
Thomi Avatar asked Oct 20 '09 13:10

Thomi


1 Answers

Do this:

for (int i = 0; i < splitter->count(); i++)
{
    QSplitterHandle *hndl = splitter->handle(i);
    hndl->setEnabled(false);
}
like image 154
luca Avatar answered Sep 19 '22 17:09

luca