From 71627b91c41f244611aca2792ae14d4f5b3adbd7 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Mon, 23 Jun 2025 14:12:57 +0000 Subject: [PATCH] qml: set BtcField.textAsSats initial value to match its text textAsSats was being set to 0 initially, regardless of actual text, only healing after onTextChanged. fixes https://github.com/spesmilo/electrum/issues/9974 --- electrum/gui/qml/components/controls/BtcField.qml | 2 +- electrum/gui/qml/qeinvoice.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/electrum/gui/qml/components/controls/BtcField.qml b/electrum/gui/qml/components/controls/BtcField.qml index 04f296782..fca0455fd 100644 --- a/electrum/gui/qml/components/controls/BtcField.qml +++ b/electrum/gui/qml/components/controls/BtcField.qml @@ -32,5 +32,5 @@ TextField { } } - Component.onCompleted: textAsSats = Config.unitsToSats('') + Component.onCompleted: amount.textChanged() } diff --git a/electrum/gui/qml/qeinvoice.py b/electrum/gui/qml/qeinvoice.py index a5165067e..2c692a20b 100644 --- a/electrum/gui/qml/qeinvoice.py +++ b/electrum/gui/qml/qeinvoice.py @@ -155,7 +155,7 @@ class QEInvoice(QObject, QtEventListener): return self._amountOverride @amountOverride.setter - def amountOverride(self, new_amount): + def amountOverride(self, new_amount: QEAmount): self._logger.debug(f'set new override amount {repr(new_amount)}') self._amountOverride.copyFrom(new_amount) self.amountOverrideChanged.emit()