Skip to content

Add bitcoin address model and address input formatting#500

Merged
hebasto merged 2 commits into
bitcoin-core:qt6from
johnny9:add-bitcoin-address-model
Mar 10, 2026
Merged

Add bitcoin address model and address input formatting#500
hebasto merged 2 commits into
bitcoin-core:qt6from
johnny9:add-bitcoin-address-model

Conversation

@johnny9
Copy link
Copy Markdown
Collaborator

@johnny9 johnny9 commented Feb 16, 2026

Introduces BitcoinAddress model and new BitcoinAddressInputField qml component backed by the model. This formats the address input to have a space between every 4 characters so that the address is easier to read.

Screencast.from.2026-02-15.23-15-26.mp4

@johnny9 johnny9 force-pushed the add-bitcoin-address-model branch from 2f910f5 to 0e2555b Compare February 16, 2026 13:30
@johnny9
Copy link
Copy Markdown
Collaborator Author

johnny9 commented Feb 16, 2026

From 2f910f5 to 0e2555b

  • rebased with qt6 branch

@MarnixCroes
Copy link
Copy Markdown
Contributor

This formats the address input to have a space between every 4 characters so that the address is easier to read.

Isn't this is already the case on main/master?

@johnny9
Copy link
Copy Markdown
Collaborator Author

johnny9 commented Feb 18, 2026

This formats the address input to have a space between every 4 characters so that the address is easier to read.

Isn't this is already the case on main/master?

This is for address inputs, specifically for Send. On master only the label on the Receive page had this spacing.

johnny9 added a commit to johnny9/gui-qml that referenced this pull request Feb 25, 2026
johnny9 and others added 2 commits March 3, 2026 12:26
Add the BitcoinAddress C++ model class that provides:
- Address formatting (space-separated groups of 4 characters)
- Ellipsis truncation for display
- Cursor-aware setAddress() for live editing in text fields
- Base58 character filtering and 62-char cap

Add two new QML input components:
- BitcoinAddressInputField: address input with inline validation
  error display using alert-filled icon
- BitcoinAmountInputField: amount input with unit label, BTC/sat
  flip toggle, regex validation, and inline error display

Register BitcoinAddress as a creatable QML type in bitcoin.cpp
and add the new QML components to bitcoin_qml.qrc.
Switch Send recipient address handling from raw QString to BitcoinAddress
so address formatting/cursor can be managed. This allows the address
input to be spaced every 4 characters so it is easier to read.

- Change SendRecipient.address Q_PROPERTY to BitcoinAddress*
- Instantiate BitcoinAddress in SendRecipient and validate against
  address()->address()
- Use BitcoinAddressInputField in Send.qml instead of inline address input
- Update SendRecipientsListModel and WalletQmlModel call sites for
  recipient->address()->address()
- Update WalletQmlModelTransaction to pull address from BitcoinAddress
- Extend LabeledTextInput with cursor/focus/editingFinished plumbing
  needed by BitcoinAddressInputField
@johnny9 johnny9 force-pushed the add-bitcoin-address-model branch from 9bb55ed to 272105f Compare March 3, 2026 17:27
@johnny9
Copy link
Copy Markdown
Collaborator Author

johnny9 commented Mar 3, 2026

Updated the PR to fix merge conflict and updated the copyright headers to have 2026

Copy link
Copy Markdown
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 272105f, I've skimmed the code, it looks reasonable.

@hebasto hebasto merged commit 5e92e6d into bitcoin-core:qt6 Mar 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants