Qt: StackView does not size the current item properly
This affects the upcoming home page and the browse page, when adjusting the view width (such as changing playlist pane width or window width) the scroll bar starts to appear time to time because stack view's displayed item does not fit into stack view fully at all times (sometimes it is smaller), even if the current item does not have explicit size (so stack view should resize the current item to its own size).
I have attempted to use anchors.fill: parent
, which seemed to work fine when using initialItem
, but then StackView
complained that it does not support that when replace()
is used. I realized the following note that they flat out ban using anchors without proper justification (no transition case)...
Note: Using anchors on the items added to a StackView is not supported. Typically push, pop, and replace transitions animate the position, which is not possible when anchors are applied. Notice that this only applies to the root of the item. Using anchors for its children works as expected.
This is the case even if no transitions are used. This can be considered a Qt bug.
It is not clear why there is such MainViewLoader
, and why it derives from a StackView
. There is already a stack view as page loader.