- use a QValidatedLineEdit in editaddressdialog.ui
- small constructor formating changes
[Qt] make address field in editaddressdialog validated #3375
pull Diapolo wants to merge 1 commits into bitcoin:master from Diapolo:editaddressdialog changing 2 files +20 −10-
Diapolo commented at 4:17 PM on December 9, 2013: none
-
c0807892b1
[Qt] make address field in editaddressdialog validated
- use a QValidatedLineEdit in editaddressdialog.ui - small constructor formating changes
-
BitcoinPullTester commented at 4:58 PM on December 9, 2013: none
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/c0807892b1462101c590e023f94f172a973e0e94 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.
-
laanwj commented at 3:01 PM on December 11, 2013: member
I don't grasp it entirely. What is the behavioral change here?
-
Diapolo commented at 3:19 PM on December 11, 2013: none
As it's a btc address input, we can use the btc address validator ;).
-
laanwj commented at 12:38 PM on December 18, 2013: member
What does this change? You make it a ValidatedLineInput but you don't set a validator, or use setValid anywhere.
-
Diapolo commented at 12:42 PM on December 18, 2013: none
You are wrong, we use
GUIUtil::setupAddressWidget(ui->addressEdit, this);... in editaddressdialog.cpp. -
laanwj commented at 12:48 PM on December 18, 2013: member
Ok, but does this have any change in the behavior?
Let me word it differently: How to test this?
-
Diapolo commented at 12:51 PM on December 18, 2013: none
The address validator kicks in and doesn't let you enter dissallowed characters and such things... we should use that for every btc-address input field. I think it's just plain right to use QValidatedLineEdit here (even if it my have worked before, which I didn't test).
-
laanwj commented at 1:03 PM on December 18, 2013: member
Sure, I also think that this isn't a very bad idea. But I do think you're confusing two things:
setValidator
ValidatedLineEdit
setValidator works for every LineEdit, not just ValidatedLineEdit. The Validator filters everything that is entered into the field, and prevents anything non-validated from ending up in the field in the first place.
ValidatedLineEdit is an alternative approach at validation. It is there to support validation at form submit time, ie by turning invalid fields red to point the user at their mistake. This is done by using the setValid call.
I think approach (2) is usually better, at least for non-trivial validations such as checking whether an address is correct. However, it requires more work than just changing the field class :)
-
Diapolo commented at 1:10 PM on December 18, 2013: none
I'm re-working the validator-stuff currently, remember that onFocusOut check I added there. This pull ensures all btc address input fields work the same, even if there is currently no obvious benefit or behavioural change. All other address fields are also using ValidatedLineEdits.
- Diapolo closed this on Jan 17, 2014
- Diapolo deleted the branch on Jan 17, 2014
- Bushstar referenced this in commit b6bdb8be9e on Apr 8, 2020
- DrahtBot locked this on Sep 8, 2021