QSplitter: Disable "magnetic" behavior of the handles
Unsolved
General and Desktop
-
I created a sample app using a vertical splitter containing 4 QListWidgets (see snippet below).
That works as expected but if i move a splitter handle closer to the handle above or below it behaves in the following way:- If it drag it closer to the next handle, it will move away the next and also all following handles (OK)
- At a certain point no handles will move any more
- If i move it further (more than half the size of the next handle) it will collapse automatically
What i want is, that i can resize the 4 QListWidgets without a limit - they should be shrinkable to a controllable number of pixels or at least one line. Currently i am unable to shrink them smaller than 4 Lines. I tried to use setMinimumHeight/setMinimumSize for the QListWidget - but this has no effect.
How can this behavior be modified?
How can i set the threshold where resizing is stopped?MainWindow::MainWindow(QWidget *parent) : QWidget(parent) { QSplitter *vSplitter = new QSplitter; vSplitter->setOrientation(Qt::Vertical); QListWidget *p = new QListWidget; p->addItems({"1", "2", "3", "4"}); vSplitter->addWidget(p); p = new QListWidget; p->addItems({"1", "2", "3", "4"}); vSplitter->addWidget(p); p = new QListWidget; p->addItems({"1", "2", "3", "4"}); vSplitter->addWidget(p); p = new QListWidget; p->addItems({"1", "2", "3", "4"}); vSplitter->addWidget(p); QHBoxLayout *layout = new QHBoxLayout; layout->addWidget(vSplitter); setLayout(layout); }