Possible bug in QSplitter: sizes set can't be read back
-
I created a tabbed desktop app with QDesigner. On one of the tabs I have a horizontal QSplitter. When the application starts it reads many saved parameters including the splitter sizes, when I exit the app it saves them again. But the sizes I get back from QSplitter::sizes() are not the one I set, unless I visit the tab.
This code sets and displays the splitter sizes on readui.designSplitter->setSizes({ config.splitterLeft, config.splitterRight } ); // DEBUG qDebug("Splitter sizes: %d %d", ui.designSplitter->sizes().at(0), ui.designSplitter->sizes().at(1));
The values read in are for instance 439 and 593, but the sizes I got back is always 47 for both.
This seems to be a bug as I would expect to get back the values set in the QSplitter.
I understand that Qt does not really resize the splitter and the widgets on it unless it is visible, but it could still be the case if I get the values I set back.Am I missing something, or is this a bug?
-
Please provide a minimal, compilable example when you think it's a bug.