This was a regression from 2a31f80d09,
before which, when using the default `QRCodeWidget()` constructor,
there had been a min size set on the widget. I like that old behaviour:
reasonable size should be set by default, and if you want to set the
size manually, opt-in to that.
fixes https://github.com/spesmilo/electrum/issues/8071
In commit 9bba65199e,
the QRCodeWidget was put inside a BoxLayout as a workaround to avoid the "copy to clipboard" and
"save as file" functionality grabbing extra whitespace/stretch/padding and putting it into the
exported image.
However, in turn that commit introduced a bug, where making the dialog larger does not make the
QRCodeWidget larger (which worked prior).
This commit tries to fix the regression and also the original bug.
Sometimes we want its "remember path" behaviour but it does not make sense to
parent the dialog from main window. When so, caller code no longer needs to
get a reference to a main window.
Also rm last usages of get_parent_main_window().
...\electrum\electrum\gui\qt\qrcodewidget.py:88: DeprecationWarning: an integer is required (got type float). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
qp.drawRect(left+c*boxsize, top+r*boxsize, boxsize - 1, boxsize - 1)
The few other cases that used SimpleConfig.get_instance() now
either get passed a config instance, or they try to get a reference
to something else that has a reference to a config.
(see lnsweep, qt/qrcodewidget, qt/qrtextedit)
Probably speeds it up by about a factor of two.
Unfortunately it needs to be another 5x faster
for sluggishness to disappear in the GUI when
typing a description in the receive tab.
Note the old code was off-by-one.
New classes ScanQRTextEdit and ShowQRTextEdit.
Reason: dependencies on zbar availability and issues with the QRTextEdit constructor.
- ScanQRTextEdit needs access to the config (fetch camera). It needs to load
the zbar processor properly before trying to scan. Keeping a reference to
the processor in qrscaner fixes the crashes on windows.
- ShowQRTextEdit should not have access to scan_qr().
- no need to setReadOnly anymore. It is clear from the class name.
Show master pub keys now has a Combobox if multiple accounts are
available.