if you want to reverse the behaviour so that you can drag handle 3 (or 2 in your drawing) to the left, use something like this:
@
void CMyWidgetW::SlotSplitterMoved(int iPos, int iIndex)
{
QList<int> sizeList = sizes();
if (2 == iIndex && 0 == sizeList[1])
{
sizeList.clear();
sizeList << 0 << 0 << size().width();
pSplitter->setSizes(sizeList);
}
}
@
sizeList contains the width for all the widgets contained within the splitter, ordered in a left-to-right fashion.
So if you want to hide the leftmost widget, your first width in 'sizeList' has to be 0, the second size has to be 0 as well (since that's the one you've actually collapsed), and the last one has to span the whole width of the splitter (theoretically, you'd have to subtract the handle sizes).