qml: add close no-op to QEQRScanner to fix type error
What changed, and why it matters
This is a tiny user-interface fix for the Electrum mobile app's QR-code scanner. A QML screen was trying to call a 'close' method that did not exist, causing a harmless JavaScript type error in the log. The developer added an empty 'close' method so the call succeeds and no error is printed. There is no security issue here.
No security action required. Treat as a normal UI bug fix.
Security signals we found
No security-relevant code changed
No input parsing, cryptography, networking, or privilege changes
Fix is purely a QML/JavaScript interface stub to silence a runtime type error
Evidence from the diff
The commit adds a no-op close() pyqtSlot to QEQRScanner in electrum/gui/qml/qeqrscanner.py. The QML component SweepDialog.qml (and possibly others) invokes close() on the scanner object, which previously raised a QML TypeError because the method was missing. The patch simply satisfies the expected interface; it does not change scanner behavior, permissions, data handling, or trust boundaries.
Changed components
electrum/gui/qml/qeqrscanner.pyQEQRScanner classInspect captured patch +5 / −0
diff --git a/electrum/gui/qml/qeqrscanner.py b/electrum/gui/qml/qeqrscanner.py
index 297479b..7900a20 100644
--- a/electrum/gui/qml/qeqrscanner.py
+++ b/electrum/gui/qml/qeqrscanner.py
@@ -56,6 +56,11 @@ class QEQRScanner(QObject):
activity.bind(on_activity_result=self.on_qr_activity_result)
jpythonActivity.startActivityForResult(intent, 0)
+ @pyqtSlot()
+ def close(self):
+ # no-op to prevent qml type error
+ pass
+
def on_qr_activity_result(self, requestCode, resultCode, intent):
try:
if resultCode == -1: # RESULT_OK:
Why this scored 17/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.