[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
  1. Diapolo commented at 4:17 PM on December 9, 2013: none
    • use a QValidatedLineEdit in editaddressdialog.ui
    • small constructor formating changes
  2. [Qt] make address field in editaddressdialog validated
    - use a QValidatedLineEdit in editaddressdialog.ui
    - small constructor formating changes
    c0807892b1
  3. 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.

  4. Diapolo commented at 1:47 PM on December 11, 2013: none

    @laanwj Do you agree?

  5. laanwj commented at 3:01 PM on December 11, 2013: member

    I don't grasp it entirely. What is the behavioral change here?

  6. 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 ;).

  7. Diapolo commented at 12:33 PM on December 18, 2013: none

    @laanwj Merge-Ping ;)

  8. 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.

  9. Diapolo commented at 12:42 PM on December 18, 2013: none

    You are wrong, we use GUIUtil::setupAddressWidget(ui->addressEdit, this);... in editaddressdialog.cpp.

  10. 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?

  11. 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).

  12. 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:

    1. setValidator

    2. ValidatedLineEdit

    3. 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.

    4. 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 :)

  13. 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.

  14. Diapolo commented at 3:00 PM on January 17, 2014: none

    Integrated in #3286, closing.

  15. Diapolo closed this on Jan 17, 2014

  16. Diapolo deleted the branch on Jan 17, 2014
  17. Bushstar referenced this in commit b6bdb8be9e on Apr 8, 2020
  18. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me