PDA

View Full Version : QSplitter not moving programatically [SOLVED]



jeanremi
28th May 2011, 13:22
Hi

I'm trying to move the splitter handle to its left with the following code, but it's not moving:
QSplitter::setHandleWidth(1);
QSplitterHandle* psh1 = QSplitter::handle(1);
QRect qr = psh1->geometry();
psh1->move(qr.x()-60, qr.y());

Is it even possible? (See attached picture)

Jean

6489

I solved it with:
QList<int> sizes;
sizes.append(desired_left_width);
sizes.append(parentwidth - desired_left_width);
QSplitter::setSizes(sizes);

mvuori
28th May 2011, 23:26
Thank you for telling how you solved it -- that is so rare, but usefull, and polite to those who spent their time trying to figure it out.