How to reproduce: - pulseview -i wii_nunchuk_data_bottom.sr (or any other .sr file) - Pane position should not be centered. See screenshot.
Created attachment 310 [details] pane centered
Yeah, that's one of the really shitty parts of Qt. It bit me more than once before and the workarounds are never pretty. The thing is that some of the features rely on the widgets having an actual size, e.g. if I assign two widgets to a QSplitter and read back the sizes of the widgets via QSplitter::sizes(), I expect the values to reflect reality. However, because the showEvent() didn't come yet, the geometry of the splitter and the other widgets hasn't been set yet by the layouts. This means in this particular case: - the View instance was just created and isn't visible yet - the Session is adding at least one Signal via View::add_signal() - View::signals_changed() sees that there is a new Signal and calls expand_header_to_fit() - expand_header_to_fit() re-calculates the pane sizes by using the values provided by QSplitter::sizes() - QSplitter::sizes() returns (0, 0) because the widget wasn't shown yet - expand_header_to_fit() sets an invalid value which leads to the QSplitter defaulting to splitting the space 50:50 - expand_header_to_fit() is never called again until the user a) adds a Signal/PD or b) moves the splitter handle An easy workaround is to set a QTimer in one-shot mode in case the size was (0, 0) but that's ugly as heck. A better solution would be to implement View::showEvent() and let it call expand_header_to_fit() in case it didn't succeed before. Still ugly, though. Proper solution? Only perform such things after showEvent() was called but that would require major changes to the rest of the application logic since a call to a function is suddenly no longer guaranteed to succeed since it may simply request to be called again later. Like I said, one of the shitty parts of Qt, unfortunately.
Fixed via workaround in 2a9fcd6212fd54d9589717670824d6bd020c694a, thanks!