[QSplitter] How to prevent splitter snapping?
Hi all,
I can't seem to find the right method to disable QSplitter handle from snapping to the edge of the geometry when it's close to it. This snapping doesn't happen if one uses Designer instead of coding by hand. Also already tried to look into the code generated by Designer but there's nothing there to indicate the right method to prevent this.
Any pointers as to what method should I be looking for?
TIA.
Best Regards,
Faizol
Re: [QSplitter] How to prevent splitter snapping?
Re: [QSplitter] How to prevent splitter snapping?
I realized now that the snapping behavior is totally depending on the child widget. The snapping doesn't occur if the child widget is a QFrame object, but will happen if it's a QTextEdit object, for example.
Thanks.
Re: [QSplitter] How to prevent splitter snapping?
QTextEdit is also a QFrame it inherits QFrame.
Using something like
Code:
splitter.setCollapsible(index,false);
to prevent the effect.
Re: [QSplitter] How to prevent splitter snapping?
Thanks. I actually did try that, but the handle just stop at certain percentage instead of collapsing. What I wanted to do was to be able to drag the handle to the edge of the area without snapping. I could achieve this with QFrame.
Again, thanks.
Re: [QSplitter] How to prevent splitter snapping?
It depends on the size hint and size policy of the widget, not its class.