dash/src/qt
Jonas Schnelli 118794dfb4
Merge #18424: qt: Use parent-child relation to manage lifetime of OptionsModel object
8e08d005989c6b5f7f05e0a1e0ba84f544a76d01 qt: Use parent-child relation to manage lifetime of OptionsModel object (Hennadii Stepanov)

Pull request description:

  Both `BitcoinApplication` and `OptionsModel` classes are derived from the `QObject` class, therefore a parent-child relation could be established to manage the lifetime of an `OptionsModel` object:
  5236b2e267/src/qt/optionsmodel.cpp (L29-L30)

  This PR does not change behavior.

ACKs for top commit:
  jonasschnelli:
    utACK 8e08d005989c6b5f7f05e0a1e0ba84f544a76d01
  promag:
    ACK 8e08d005989c6b5f7f05e0a1e0ba84f544a76d01.

Tree-SHA512: 0223dddf5ba28b0bfaefeda1b03b4ff95bf7e7d0c1e7b32368171e561813e22129f2a664f09279fa3b4fa63259b7680d55aa3fe66db9c7ae0039b7f529777ec3
2024-01-10 12:07:53 -06:00
..
android
forms Merge #17597: qt: Fix height of QR-less ReceiveRequestDialog 2024-01-06 19:41:00 -06:00
locale ru 2023-11-14 09:08:39 -06:00
res Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
test refactor: working with raw pointer of coinjoin_loader instead reference to unique_ptr 2024-01-10 12:06:04 -06:00
addressbookpage.cpp Merge #15768: gui: Add close window shortcut 2024-01-06 19:41:00 -06:00
addressbookpage.h
addresstablemodel.cpp
addresstablemodel.h
appearancewidget.cpp
appearancewidget.h
askpassphrasedialog.cpp Merge #15768: gui: Add close window shortcut 2024-01-06 19:41:00 -06:00
askpassphrasedialog.h Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
bantablemodel.cpp Merge bitcoin-core/gui#137: refactor: Replace deprecated Qt::SystemLocale{Short,Long}Date 2023-11-07 07:44:05 -06:00
bantablemodel.h
bitcoin.cpp Merge #18424: qt: Use parent-child relation to manage lifetime of OptionsModel object 2024-01-10 12:07:53 -06:00
bitcoin.h Merge bitcoin-core/gui#547: Override BitcoinApplication::event() to handle QEvent::Quit 2024-01-01 17:48:17 -06:00
bitcoinaddressvalidator.cpp
bitcoinaddressvalidator.h
bitcoinamountfield.cpp Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
bitcoinamountfield.h
bitcoingui.cpp Merge #19331: build: Do not include server symbols in wallet 2024-01-10 12:06:05 -06:00
bitcoingui.h Merge #16432: qt: Add privacy to the Overview page 2024-01-06 19:41:00 -06:00
bitcoinunits.cpp Merge #16432: qt: Add privacy to the Overview page 2024-01-06 19:41:00 -06:00
bitcoinunits.h Merge #16432: qt: Add privacy to the Overview page 2024-01-06 19:41:00 -06:00
clientmodel.cpp Merge bitcoin-core/gui#183: Add include for std::bind. 2023-12-03 20:44:55 -06:00
clientmodel.h Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
coincontroldialog.cpp Merge #15768: gui: Add close window shortcut 2024-01-06 19:41:00 -06:00
coincontroldialog.h
coincontroltreewidget.cpp
coincontroltreewidget.h
createwalletdialog.cpp
createwalletdialog.h
csvmodelwriter.cpp
csvmodelwriter.h
dash_locale.qrc
dash.qrc
dashstrings.cpp make translate 2023-11-14 09:08:39 -06:00
editaddressdialog.cpp Merge #15768: gui: Add close window shortcut 2024-01-06 19:41:00 -06:00
editaddressdialog.h
governancelist.cpp fix: possible assert call if nHeight in CDeterministicMNList is higher then Tip (#5590) 2023-10-27 19:53:27 -05:00
governancelist.h
guiconstants.h
guiutil.cpp Merge #17956: gui: Disable unavailable context menu items in transactions tab 2024-01-10 12:07:53 -06:00
guiutil.h Merge #17956: gui: Disable unavailable context menu items in transactions tab 2024-01-10 12:07:53 -06:00
intro.cpp
intro.h Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
macdockiconhandler.h
macdockiconhandler.mm
macnotificationhandler.h
macnotificationhandler.mm
macos_appnap.h
macos_appnap.mm
main.cpp merge bitcoin#25251: Consolidate Windows ASLR workarounds for upstream secp256k1 changes 2023-11-21 07:59:03 -06:00
masternodelist.cpp fix: possible assert call if nHeight in CDeterministicMNList is higher then Tip (#5590) 2023-10-27 19:53:27 -05:00
masternodelist.h
modaloverlay.cpp Merge #17968: qt: Ensure that ModalOverlay is resized properly 2024-01-10 12:07:53 -06:00
modaloverlay.h Merge #17968: qt: Ensure that ModalOverlay is resized properly 2024-01-10 12:07:53 -06:00
networkstyle.cpp Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
networkstyle.h Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
notificator.cpp
notificator.h
openuridialog.cpp Merge #15768: gui: Add close window shortcut 2024-01-06 19:41:00 -06:00
openuridialog.h Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
optionsdialog.cpp refactor: use coinjoin interfaces in qt 2024-01-10 12:06:03 -06:00
optionsdialog.h
optionsmodel.cpp Merge bitcoin-core/gui#46: refactor: Fix deprecation warnings when building against Qt 5.15 2023-11-07 07:44:05 -06:00
optionsmodel.h
overviewpage.cpp refactor: use coinjoin interfaces in qt 2024-01-10 12:06:03 -06:00
overviewpage.h Merge #16432: qt: Add privacy to the Overview page 2024-01-06 19:41:00 -06:00
paymentserver.cpp Merge #19331: build: Do not include server symbols in wallet 2024-01-10 12:06:05 -06:00
paymentserver.h Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
peertablemodel.cpp Merge bitcoin-core/gui#162: Add network to peers window and peer details 2023-12-08 21:16:00 +03:00
peertablemodel.h Merge bitcoin-core/gui#162: Add network to peers window and peer details 2023-12-08 21:16:00 +03:00
qrdialog.cpp
qrdialog.h
qrimagewidget.cpp Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
qrimagewidget.h Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
qvalidatedlineedit.cpp
qvalidatedlineedit.h
qvaluecombobox.cpp
qvaluecombobox.h
README.md
receivecoinsdialog.cpp Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
receivecoinsdialog.h
receiverequestdialog.cpp Merge #17597: qt: Fix height of QR-less ReceiveRequestDialog 2024-01-06 19:41:00 -06:00
receiverequestdialog.h Merge #17597: qt: Fix height of QR-less ReceiveRequestDialog 2024-01-06 19:41:00 -06:00
recentrequeststablemodel.cpp Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
recentrequeststablemodel.h Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
rpcconsole.cpp Merge #17908: qt: Remove QFont warnings with QT_QPA_PLATFORM=minimal 2024-01-10 12:07:52 -06:00
rpcconsole.h Merge bitcoin-core/gui#46: refactor: Fix deprecation warnings when building against Qt 5.15 2023-11-07 07:44:05 -06:00
sendcoinsdialog.cpp Merge #19331: build: Do not include server symbols in wallet 2024-01-10 12:06:05 -06:00
sendcoinsdialog.h Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
sendcoinsentry.cpp Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
sendcoinsentry.h Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
sendcoinsrecipient.h
signverifymessagedialog.cpp Merge #15768: gui: Add close window shortcut 2024-01-06 19:41:00 -06:00
signverifymessagedialog.h
splashscreen.cpp Merge #19331: build: Do not include server symbols in wallet 2024-01-10 12:06:05 -06:00
splashscreen.h Merge bitcoin-core/gui#46: refactor: Fix deprecation warnings when building against Qt 5.15 2023-11-07 07:44:05 -06:00
trafficgraphdata.cpp
trafficgraphdata.h
trafficgraphwidget.cpp Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
trafficgraphwidget.h
transactiondesc.cpp Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
transactiondesc.h
transactiondescdialog.cpp Merge #15768: gui: Add close window shortcut 2024-01-06 19:41:00 -06:00
transactiondescdialog.h
transactionfilterproxy.cpp
transactionfilterproxy.h
transactionrecord.cpp Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
transactionrecord.h
transactiontablemodel.cpp Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
transactiontablemodel.h
transactionview.cpp Merge #17956: gui: Disable unavailable context menu items in transactions tab 2024-01-10 12:07:53 -06:00
transactionview.h Merge #17956: gui: Disable unavailable context menu items in transactions tab 2024-01-10 12:07:53 -06:00
utilitydialog.cpp Merge #15768: gui: Add close window shortcut 2024-01-06 19:41:00 -06:00
utilitydialog.h
walletcontroller.cpp refactor: introduce and use CoinJoin::Loader interface 2024-01-10 12:06:02 -06:00
walletcontroller.h Merge #15202: gui: Add Close All Wallets action 2024-01-06 19:40:58 -06:00
walletframe.cpp Merge #16432: qt: Add privacy to the Overview page 2024-01-06 19:41:00 -06:00
walletframe.h Merge #15054: Update copyright headers to 2018 2023-12-06 11:40:14 -06:00
walletmodel.cpp Merge #19331: build: Do not include server symbols in wallet 2024-01-10 12:06:05 -06:00
walletmodel.h refactor: use coinjoin interfaces in qt 2024-01-10 12:06:03 -06:00
walletmodeltransaction.cpp Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
walletmodeltransaction.h Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
walletview.cpp Merge #19331: build: Do not include server symbols in wallet 2024-01-10 12:06:05 -06:00
walletview.h Merge #16432: qt: Add privacy to the Overview page 2024-01-06 19:41:00 -06:00
winshutdownmonitor.cpp Merge #17829: scripted-diff: Bump copyright of files changed in 2019 2023-12-06 11:40:14 -06:00
winshutdownmonitor.h

This directory contains the DashQT graphical user interface (GUI). It uses the cross-platform framework Qt.

The current precise version for Qt 5 is specified in qt.mk. Qt 4 is not supported.

Compile and run

See build instructions (macOS, Windows, Unix, etc).

To run:

./src/qt/dash-qt

Files and directories

forms

Contains Designer UI files. They are created with Qt Creator, but can be edited using any text editor.

locale

Contains translations. They are periodically updated. The process is described here.

res

Resources such as the icon.

test

Tests.

bitcoingui.(h/cpp)

Represents the main window of the Dash UI.

*model.(h/cpp)

The model. When it has a corresponding controller, it generally inherits from QAbstractTableModel. Models that are used by controllers as helpers inherit from other Qt classes like QValidator.

ClientModel is used by the main application bitcoingui and several models like peertablemodel.

*page.(h/cpp)

A controller. :NAMEpage.cpp generally includes :NAMEmodel.h and forms/:NAME.page.ui with a similar :NAME.

*dialog.(h/cpp)

Various dialogs, e.g. to open a URL. Inherit from QDialog.

paymentserver.(h/cpp)

Used to process BIP21 payment URI requests. Also handles URI based application switching (e.g. when following a dash:... link from a browser).

walletview.(h/cpp)

Represents the view to a single wallet.

Other .h/cpp files

  • UI elements like BitcoinAmountField, which inherit from QWidget.
  • bitcoinstrings.cpp: automatically generated
  • bitcoinunits.(h/cpp): BTC / mBTC / etc handling
  • callback.h
  • guiconstants.h: UI colors, app name, etc
  • guiutil.h: several helper functions
  • macdockiconhandler.(h/mm): macOS dock icon handler
  • macnotificationhandler.(h/mm): display notifications in macOS

Contribute

See CONTRIBUTING.md for general guidelines. Specifically for Qt:

Using Qt Creator as IDE

You can use Qt Creator as an IDE. This is especially useful if you want to change the UI layout.

Download and install the community edition of Qt Creator. Uncheck everything except Qt Creator during the installation process.

Instructions for macOS:

  1. Make sure you installed everything through Homebrew mentioned in the macOS build instructions
  2. Use ./configure with the --enable-debug flag
  3. In Qt Creator do "New Project" -> Import Project -> Import Existing Project
  4. Enter "dash-qt" as project name, enter src/qt as location
  5. Leave the file selection as it is
  6. Confirm the "summary page"
  7. In the "Projects" tab select "Manage Kits..."
  8. Select the default "Desktop" kit and select "Clang (x86 64bit in /usr/bin)" as compiler
  9. Select LLDB as debugger (you might need to set the path to your installation)
  10. Start debugging with Qt Creator (you might need to the executable to "dash-qt" under "Run", which is where you can also add command line arguments)