fix: workaround to crash on startup with Qt 5.15.11

the most recent Qt upstream version introduced a regression that causes
our app to crash right on startup when a grouped property is assigned to
inside a `PropertyChanges` handler

upstream issue: https://bugreports.qt.io/browse/QTBUG-107795

Upstream fix will be released with Qt 5.15.12, code being at
https://codereview.qt-project.org/c/qt/qtdeclarative/+/424702
This commit is contained in:
Lukáš Tinkl 2023-11-14 00:16:36 +01:00 committed by Lukáš Tinkl
parent 90cfc0842a
commit 81d99c44e9
2 changed files with 13 additions and 22 deletions

View File

@ -287,6 +287,13 @@ Rectangle {
bottomPadding: 0
leftPadding: 8
rightPadding: 5
input.edit.color: { // crash workaround, https://bugreports.qt.io/browse/QTBUG-107795
if (root.state === "error")
return Theme.palette.dangerColor1
if (root.locked)
return Theme.palette.directColor5
return Theme.palette.directColor1
}
input.edit.font.pixelSize: 13
input.edit.readOnly: disabled
input.background.radius: 4
@ -422,11 +429,6 @@ Rectangle {
target: advancedInput
visible: advancedMode
}
PropertyChanges {
target: advancedInput
input.edit.color: input.edit.activeFocus || !root.locked ?
Theme.palette.directColor1 : Theme.palette.directColor5
}
PropertyChanges {
target: basicInput
visible: !advancedMode && !(root.loading && !disabled)
@ -496,10 +498,6 @@ Rectangle {
target: advancedInput
visible: advancedMode
}
PropertyChanges {
target: advancedInput
input.edit.color: Theme.palette.dangerColor1
}
PropertyChanges {
target: basicInput
visible: !advancedMode && !(root.loading && !disabled)
@ -569,10 +567,6 @@ Rectangle {
target: advancedInput
visible: advancedMode
}
PropertyChanges {
target: advancedInput
input.edit.color: root.locked ? Theme.palette.directColor5 : Theme.palette.directColor1
}
PropertyChanges {
target: basicInput
visible: !advancedMode && !(root.loading && !disabled)
@ -640,10 +634,6 @@ Rectangle {
target: advancedInput
visible: false
}
PropertyChanges {
target: advancedInput
input.edit.color: Theme.palette.directColor1
}
PropertyChanges {
target: basicInput
visible: true
@ -653,4 +643,5 @@ Rectangle {
active: false
}
}
]}
]
}

View File

@ -22,7 +22,7 @@ Item {
property var selectedAccount
property string ensAddressOrEmpty: ""
property var selectedAsset
property var amountToSend
property double amountToSend
property int minSendCryptoDecimals: 0
property int minReceiveCryptoDecimals: 0
property bool isLoading: false
@ -39,7 +39,7 @@ Item {
QtObject {
id: d
readonly property int backgroundRectRadius: 13
readonly property string backgroundRectColor: Theme.palette.indirectColor1
readonly property color backgroundRectColor: Theme.palette.indirectColor1
}
StatusSwitchTabBar {