Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1// Copyright (c) 2011-present The Bitcoin Core developers2// Distributed under the MIT software license, see the accompanying3// file COPYING or http://www.opensource.org/licenses/mit-license.php.5#ifndef BITCOIN_QT_WALLETVIEW_H6#define BITCOIN_QT_WALLETVIEW_H8#include <consensus/amount.h>9#include <qt/bitcoinunits.h>11#include <QStackedWidget>13class ClientModel;14class OverviewPage;15class PlatformStyle;16class ReceiveCoinsDialog;17class SendCoinsDialog;18class SendCoinsRecipient;19class TransactionView;20class WalletModel;21class AddressBookPage;23QT_BEGIN_NAMESPACE24class QModelIndex;25class QProgressDialog;26QT_END_NAMESPACE28/*29WalletView class. This class represents the view to a single wallet.30It was added to support multiple wallet functionality. Each wallet gets its own WalletView instance.31It communicates with both the client and the wallet models to give the user an up-to-date view of the32current core state.33*/34class WalletView : public QStackedWidget35{36Q_OBJECT38public:39explicit WalletView(WalletModel* wallet_model, const PlatformStyle* platformStyle, QWidget* parent);40~WalletView();42/** Set the client model.43The client model represents the part of the core that communicates with the P2P network, and is wallet-agnostic.44*/45void setClientModel(ClientModel *clientModel);46WalletModel* getWalletModel() const noexcept { return walletModel; }48bool handlePaymentRequest(const SendCoinsRecipient& recipient);50void showOutOfSyncWarning(bool fShow);52private:53ClientModel* clientModel{nullptr};55//!56//! The wallet model represents a bitcoin wallet, and offers access to57//! the list of transactions, address book and sending functionality.58//!59WalletModel* const walletModel;61OverviewPage *overviewPage;62QWidget *transactionsPage;63ReceiveCoinsDialog *receiveCoinsPage;64SendCoinsDialog *sendCoinsPage;65AddressBookPage *usedSendingAddressesPage;66AddressBookPage *usedReceivingAddressesPage;68TransactionView *transactionView;70QProgressDialog* progressDialog{nullptr};71const PlatformStyle *platformStyle;73public Q_SLOTS:74/** Switch to overview (home) page */75void gotoOverviewPage();76/** Switch to history (transactions) page */77void gotoHistoryPage();78/** Switch to receive coins page */79void gotoReceiveCoinsPage();80/** Switch to send coins page */81void gotoSendCoinsPage(QString addr = "");83/** Show Sign/Verify Message dialog and switch to sign message tab */84void gotoSignMessageTab(QString addr = "");85/** Show Sign/Verify Message dialog and switch to verify message tab */86void gotoVerifyMessageTab(QString addr = "");88/** Show incoming transaction notification for new transactions.90The new items are those between start and end inclusive, under the given parent item.91*/92void processNewTransaction(const QModelIndex& parent, int start, int /*end*/);93/** Encrypt the wallet */94void encryptWallet();95/** Backup the wallet */96void backupWallet();97/** Change encrypted wallet passphrase */98void changePassphrase();99/** Ask for passphrase to unlock wallet temporarily */100void unlockWallet();102/** Show used sending addresses */103void usedSendingAddresses();104/** Show used receiving addresses */105void usedReceivingAddresses();107/** Show progress dialog e.g. for rescan */108void showProgress(const QString &title, int nProgress);110private Q_SLOTS:111void disableTransactionView(bool disable);113Q_SIGNALS:114void setPrivacy(bool privacy);115void transactionClicked();116void coinsSent();117/** Fired when a message should be reported to the user */118void message(const QString &title, const QString &message, unsigned int style);119/** Encryption status of wallet changed */120void encryptionStatusChanged();121/** Notify that a new transaction appeared */122void incomingTransaction(const QString& date, BitcoinUnit unit, const CAmount& amount, const QString& type, const QString& address, const QString& label, const QString& walletName);123/** Notify that the out of sync warning icon has been pressed */124void outOfSyncWarningClicked();125};127#endif // BITCOIN_QT_WALLETVIEW_H
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.