Skip to content

Comments

Add bitcoin address model and address input formatting#500

Open
johnny9 wants to merge 2 commits intobitcoin-core:qt6from
johnny9:add-bitcoin-address-model
Open

Add bitcoin address model and address input formatting#500
johnny9 wants to merge 2 commits intobitcoin-core:qt6from
johnny9:add-bitcoin-address-model

Conversation

@johnny9
Copy link
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 and others added 2 commits February 16, 2026 08:29
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 2f910f5 to 0e2555b Compare February 16, 2026 13:30
@johnny9
Copy link
Collaborator Author

johnny9 commented Feb 16, 2026

From 2f910f5 to 0e2555b

  • rebased with qt6 branch

@MarnixCroes
Copy link
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
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.

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.

2 participants