Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.3.0, 6.4.1
-
None
Description
The following code works fine in Qt5, however fails in Qt6:
SettingsPanel.qml:
import QtQuick import QtQuick.Controls import QtQuick.Layouts Rectangle { id: settingsPanel x: -width width: parent.width / 4 property bool isSlideOut: settingsPanel.state == "slideOut" Behavior on x { PropertyAnimation {} } function toggleSlide() { if (isSlideOut) { state = "slideIn"; } else { state = "slideOut" } return isSlideOut; } states: [ State { name: "slideOut" PropertyChanges { target: settingsPanel; x: 0 } }, State { name: "slideIn" PropertyChanges { target: settingsPanel; x: -width } } ] }
Main Window has the following code:
Button { checkable: true checked: false onCheckedChanged: { settingsPanel.toggleSlide() } } SettingsPanel { id: settingsPanel anchors { top: parent.top; bottom: parent.bottom; topMargin: 1 } }
Issues observed:
- Panel slides in on application start while on start it should be hidden:
x: -width
- On button checked panel slides out, however
- On uncheck it does not slides in - x: remains 0.