From b274f13311ad0b2bce339634a006ba22fbd3379e Mon Sep 17 00:00:00 2001 From: Ken Bloom Date: Fri, 30 Aug 2024 09:17:27 -0400 Subject: [PATCH] Fix MainToolbar, and AppMenuBar in Qt 6.5+ The problem was that a ListView lazily creates delegates as needed to actually display them. If the size of the ListView is 0, then it doesn't need to display anything, so it may not create any of the delegates. If it doesn't create any delegates, then we can't make it size itself to fit its contents. By setting a minimum size of 1, we force the ListView to create a delegate that we can then use to determine the ListView's actual size. Fixes: #24097 --- a/src/appshell/qml/MainToolBar.qml +++ b/src/appshell/qml/MainToolBar.qml @@ -70,8 +70,8 @@ Item { model: toolBarModel - width: contentItem.childrenRect.width - height: contentItem.childrenRect.height + width: Math.max(1, contentItem.childrenRect.width) + height: Math.max(1, contentItem.childrenRect.height) delegate: PageTabButton { id: radioButtonDelegate --- a/src/appshell/qml/platform/AppMenuBar.qml +++ b/src/appshell/qml/platform/AppMenuBar.qml @@ -28,7 +28,7 @@ import MuseScore.AppShell 1.0 ListView { id: root - height: contentItem.childrenRect.height + height: Math.max(1,contentItem.childrenRect.height) width: contentWidth property alias appWindow: appMenuModel.appWindow