dash/src/qt
pasta 242dc519ca
Merge #6404: fix(qt): avoid potential precision loss in amounts on Governance Tab
c48efdac83 fix(qt): avoid potential precision loss in amounts on Governance Tab (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  https://github.com/dashpay/dash/pull/6403#discussion_r1847834174

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

  ## Checklist:
  - [ ] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  knst:
    utACK c48efdac83
  PastaPastaPasta:
    utACK c48efdac83

Tree-SHA512: 705bc154e10150e32e3ff04d4a90de14e29ffd195cc9f94a753dd1b4588f2730d6526cd66d851005b956e0d074d39250d142baa946bea8df95dbc92718931762
2024-11-20 23:24:36 -06:00
..
android
forms Merge #6337: backport: merge bitcoin-core/gui#337, #354, #317, #349, #403, #418, #416, #449, #477, #563, #554, #615 (qt backports: part 2) 2024-10-26 12:26:29 -05:00
locale 60%+: bg, ro, vi 2024-07-18 13:35:16 +03:00
res Merge bitcoin/bitcoin#22724: windres: use PACKAGE_VERSION rather than building more version numbers 2024-09-27 15:35:12 -05:00
test Merge #6337: backport: merge bitcoin-core/gui#337, #354, #317, #349, #403, #418, #416, #449, #477, #563, #554, #615 (qt backports: part 2) 2024-10-26 12:26:29 -05:00
addressbookpage.cpp (partial)Merge bitcoin-core/gui#420: Ensure translator comments end in full stop 2024-09-21 18:35:22 +05:30
addressbookpage.h Merge bitcoin-core/gui#263: Revamp context menus 2024-08-05 17:51:09 +07:00
addresstablemodel.cpp
addresstablemodel.h
appearancewidget.cpp
appearancewidget.h
askpassphrasedialog.cpp
askpassphrasedialog.h
bantablemodel.cpp
bantablemodel.h
bitcoin.cpp refactor: more of 24306 (GetPathArg in Dash-specific code) 2024-11-18 12:20:38 -06:00
bitcoin.h Merge bitcoin-core/gui#381: refactor: Make BitcoinCore class reusable 2024-10-25 20:51:20 +07:00
bitcoinaddressvalidator.cpp
bitcoinaddressvalidator.h
bitcoinamountfield.cpp
bitcoinamountfield.h merge bitcoin#22951: move amount.h into consensus 2024-10-25 16:00:12 +00:00
bitcoingui.cpp merge bitcoin-core/gui#403: Make paths to update Encryption and HD wallet statuses simpler 2024-10-25 21:26:02 +00:00
bitcoingui.h merge bitcoin#22951: move amount.h into consensus 2024-10-25 16:00:12 +00:00
bitcoinunits.cpp merge bitcoin#22951: move amount.h into consensus 2024-10-25 16:00:12 +00:00
bitcoinunits.h merge bitcoin#22951: move amount.h into consensus 2024-10-25 16:00:12 +00:00
clientmodel.cpp merge bitcoin-core/gui#349: replace QDateTime::fromTime_t with QDateTime::fromSecsSinceEpoch 2024-10-24 10:51:44 +00:00
clientmodel.h chore: run contrib/devtools/copyright_header.py update . 2024-10-05 23:17:41 +03:00
coincontroldialog.cpp Merge bitcoin-core/gui#436: Include vout when copying transaction ID from coin selection 2024-10-08 17:33:49 -05:00
coincontroldialog.h merge bitcoin#22951: move amount.h into consensus 2024-10-25 16:00:12 +00:00
coincontroltreewidget.cpp
coincontroltreewidget.h
createwalletdialog.cpp
createwalletdialog.h
csvmodelwriter.cpp
csvmodelwriter.h
dash_locale.qrc
dash.qrc
dashstrings.cpp dashstrings 2024-07-18 12:45:48 +03:00
editaddressdialog.cpp
editaddressdialog.h
governancelist.cpp Merge #6404: fix(qt): avoid potential precision loss in amounts on Governance Tab 2024-11-20 23:24:36 -06:00
governancelist.h Merge #6404: fix(qt): avoid potential precision loss in amounts on Governance Tab 2024-11-20 23:24:36 -06:00
guiconstants.h
guiutil.cpp merge bitcoin-core/gui#349: replace QDateTime::fromTime_t with QDateTime::fromSecsSinceEpoch 2024-10-24 10:51:44 +00:00
guiutil.h merge bitcoin#22951: move amount.h into consensus 2024-10-25 16:00:12 +00:00
initexecutor.cpp Merge bitcoin-core/gui#381: refactor: Make BitcoinCore class reusable 2024-10-25 20:51:20 +07:00
initexecutor.h Merge bitcoin-core/gui#381: refactor: Make BitcoinCore class reusable 2024-10-25 20:51:20 +07:00
intro.cpp merge bitcoin-core/gui#615: If -prune=0 is set, Uncheck Prune on Intro page 2024-10-25 21:26:06 +00:00
intro.h merge bitcoin#21850: Remove GetDataDir(net_specific) function 2024-07-23 17:45:24 +00:00
macdockiconhandler.h
macdockiconhandler.mm
macnotificationhandler.h
macnotificationhandler.mm
macos_appnap.h
macos_appnap.mm
main.cpp
masternodelist.cpp refactor: trim and document assumptions for Get*MN* and friends 2024-11-14 10:08:05 +00:00
masternodelist.h
modaloverlay.cpp Merge bitcoin-core/gui#795: Keep focus on "Hide" while ModalOverlay is visible 2024-10-26 19:14:06 -05:00
modaloverlay.h
networkstyle.cpp
networkstyle.h
notificator.cpp
notificator.h
openuridialog.cpp
openuridialog.h
optionsdialog.cpp Merge #6337: backport: merge bitcoin-core/gui#337, #354, #317, #349, #403, #418, #416, #449, #477, #563, #554, #615 (qt backports: part 2) 2024-10-26 12:26:29 -05:00
optionsdialog.h
optionsmodel.cpp fix: force correct -disablegovernance and -txindex values when pruning is requested via init dialog 2024-10-28 22:30:30 +03:00
optionsmodel.h Merge #6337: backport: merge bitcoin-core/gui#337, #354, #317, #349, #403, #418, #416, #449, #477, #563, #554, #615 (qt backports: part 2) 2024-10-26 12:26:29 -05:00
overviewpage.cpp Merge bitcoin-core/gui#365: Draw "eye" sign at the beginning of watch-only addresses 2024-10-24 16:34:25 +07:00
overviewpage.h Merge bitcoin-core/gui#333: refactor: Signal-slot connections cleanup 2024-09-26 12:55:50 +07:00
paymentserver.cpp merge bitcoin-core/gui#563: Remove network detection based on address in BIP21 2024-10-25 21:26:06 +00:00
paymentserver.h
peertablemodel.cpp Merge #6337: backport: merge bitcoin-core/gui#337, #354, #317, #349, #403, #418, #416, #449, #477, #563, #554, #615 (qt backports: part 2) 2024-10-26 12:26:29 -05:00
peertablemodel.h Merge #6337: backport: merge bitcoin-core/gui#337, #354, #317, #349, #403, #418, #416, #449, #477, #563, #554, #615 (qt backports: part 2) 2024-10-26 12:26:29 -05:00
peertablesortproxy.cpp merge bitcoin-core/gui#317: Add Direction column to Peers Tab 2024-10-24 10:51:43 +00:00
peertablesortproxy.h Merge bitcoin-core/gui#18: Add peertablesortproxy module 2024-08-05 17:51:09 +07:00
psbtoperationsdialog.cpp merge bitcoin#23499: Add interfaces::Node::broadCastTransaction method 2024-10-28 10:44:39 +00:00
psbtoperationsdialog.h
qrdialog.cpp
qrdialog.h
qrimagewidget.cpp (partial)Merge bitcoin-core/gui#420: Ensure translator comments end in full stop 2024-09-21 18:35:22 +05:30
qrimagewidget.h
qvalidatedlineedit.cpp
qvalidatedlineedit.h
qvaluecombobox.cpp Merge bitcoin-core/gui#257: refactor: Use template function qOverload in signal-slot connections 2024-08-05 17:51:09 +07:00
qvaluecombobox.h
README.md
receivecoinsdialog.cpp Merge bitcoin-core/gui#362: Add keyboard shortcuts to context menus 2024-08-15 10:45:42 +07:00
receivecoinsdialog.h
receiverequestdialog.cpp
receiverequestdialog.h
recentrequeststablemodel.cpp merge bitcoin-core/gui#349: replace QDateTime::fromTime_t with QDateTime::fromSecsSinceEpoch 2024-10-24 10:51:44 +00:00
recentrequeststablemodel.h merge bitcoin-core/gui#349: replace QDateTime::fromTime_t with QDateTime::fromSecsSinceEpoch 2024-10-24 10:51:44 +00:00
rpcconsole.cpp Merge #6337: backport: merge bitcoin-core/gui#337, #354, #317, #349, #403, #418, #416, #449, #477, #563, #554, #615 (qt backports: part 2) 2024-10-26 12:26:29 -05:00
rpcconsole.h Merge bitcoin-core/gui#256: Save/restore column sizes of the tables in the Peers tab 2024-09-26 12:55:50 +07:00
sendcoinsdialog.cpp chore: run contrib/devtools/copyright_header.py update . 2024-10-05 23:17:41 +03:00
sendcoinsdialog.h
sendcoinsentry.cpp Merge bitcoin-core/gui#390: Add SubFeeFromAmount to options 2024-10-25 20:51:20 +07:00
sendcoinsentry.h
sendcoinsrecipient.h merge bitcoin#22951: move amount.h into consensus 2024-10-25 16:00:12 +00:00
signverifymessagedialog.cpp
signverifymessagedialog.h
splashscreen.cpp Merge bitcoin-core/gui#454: Use only Qt translation primitives in GUI code 2024-10-15 09:25:08 -05:00
splashscreen.h
trafficgraphdata.cpp
trafficgraphdata.h
trafficgraphwidget.cpp Merge bitcoin-core/gui#248: Fix: For values of "Bytes transferred" and "Bytes/s" with 1000-based prefix names use 1000-based divisor instead of 1024-based 2024-07-23 13:08:39 +07:00
trafficgraphwidget.h
transactiondesc.cpp chore: run contrib/devtools/copyright_header.py update . 2024-10-05 23:17:41 +03:00
transactiondesc.h
transactiondescdialog.cpp
transactiondescdialog.h
transactionfilterproxy.cpp merge bitcoin-core/gui#349: replace QDateTime::fromTime_t with QDateTime::fromSecsSinceEpoch 2024-10-24 10:51:44 +00:00
transactionfilterproxy.h Merge #6337: backport: merge bitcoin-core/gui#337, #354, #317, #349, #403, #418, #416, #449, #477, #563, #554, #615 (qt backports: part 2) 2024-10-26 12:26:29 -05:00
transactionoverviewwidget.h Merge bitcoin-core/gui#176: Fix TxViewDelegate layout 2024-07-23 13:08:39 +07:00
transactionrecord.cpp chore: run contrib/devtools/copyright_header.py update . 2024-10-05 23:17:41 +03:00
transactionrecord.h merge bitcoin#22951: move amount.h into consensus 2024-10-25 16:00:12 +00:00
transactiontablemodel.cpp Merge #6337: backport: merge bitcoin-core/gui#337, #354, #317, #349, #403, #418, #416, #449, #477, #563, #554, #615 (qt backports: part 2) 2024-10-26 12:26:29 -05:00
transactiontablemodel.h
transactionview.cpp merge bitcoin-core/gui#354: Refactor open date range to use std::optional 2024-10-24 10:51:43 +00:00
transactionview.h
utilitydialog.cpp Merge bitcoin/bitcoin#29658: Bugfix: GUI: Help messages already have a trailing newline, so don't add an extra one 2024-10-26 12:29:53 -05:00
utilitydialog.h
walletcontroller.cpp (partial) Merge bitcoin-core/gui#409: Fix window title of wallet loading window 2024-09-12 18:57:20 +05:30
walletcontroller.h (partial) Merge bitcoin-core/gui#409: Fix window title of wallet loading window 2024-09-12 18:57:20 +05:30
walletframe.cpp merge bitcoin-core/gui#403: Make paths to update Encryption and HD wallet statuses simpler 2024-10-25 21:26:02 +00:00
walletframe.h merge bitcoin-core/gui#403: Make paths to update Encryption and HD wallet statuses simpler 2024-10-25 21:26:02 +00:00
walletmodel.cpp
walletmodel.h
walletmodeltransaction.cpp
walletmodeltransaction.h merge bitcoin#22951: move amount.h into consensus 2024-10-25 16:00:12 +00:00
walletview.cpp merge bitcoin-core/gui#403: Make paths to update Encryption and HD wallet statuses simpler 2024-10-25 21:26:02 +00:00
walletview.h Merge #6337: backport: merge bitcoin-core/gui#337, #354, #317, #349, #403, #418, #416, #449, #477, #563, #554, #615 (qt backports: part 2) 2024-10-26 12:26:29 -05:00
winshutdownmonitor.cpp Merge bitcoin-core/gui#755: Silence -Wcast-function-type warning 2024-10-24 11:18:39 -05:00
winshutdownmonitor.h Merge #6360: backport: bitcoin#11909, #20586, #21090, #21500, #21562, #22232, #22378, #22688, bitcoin-core/gui#381, #390 2024-10-25 10:16:03 -05:00

This directory contains the source code for the Dash Core graphical user interface (GUI). It uses the Qt cross-platform framework.

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

Compile and run

See build instructions: Unix, macOS, Windows, FreeBSD, NetBSD, OpenBSD

When following your systems build instructions, make sure to install the Qt dependencies.

To run:

./src/qt/dash-qt

Files and Directories

forms/

  • A directory that contains Designer UI files. These files specify the characteristics of form elements in XML. Qt UI files can be edited with Qt Creator or using any text editor.

locale/

  • Contains translations. They are periodically updated and an effort is made to support as many languages as possible. The process of contributing translations is described in doc/translation_process.md.

res/

  • Contains graphical resources used to enhance the UI experience.

test/

  • Functional tests used to ensure proper functionality of the GUI. Significant changes to the GUI code normally require new or updated 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 dashgui 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)

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

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.

Note: Do not change local/dash_en.ts. It is updated automatically.

Using Qt Creator as an IDE

Qt Creator is a powerful tool which packages a UI designer tool (Qt Designer) and a C++ IDE into one application. This is especially useful if you want to change the UI layout.

Download Qt Creator

On Unix and macOS, Qt Creator can be installed through your package manager. Alternatively, you can download a binary from the Qt Website.

Note: If installing from a binary grabbed from the Qt Website: During the installation process, uncheck everything except for Qt Creator.

macOS
brew install qt-creator
Ubuntu & Debian
sudo apt-get install qtcreator

Setup Qt Creator

  1. Make sure you've installed all dependencies specified in your systems build instructions
  2. Follow the compile instructions for your system, run ./configure with the --enable-debug flag
  3. Start Qt Creator. At the start page, do: New -> Import Project -> Import Existing Project
  4. Enter dash-qt as the Project Name and enter the absolute path to src/qt as Location
  5. Check over the file selection, you may need to select the forms directory (necessary if you intend to edit *.ui files)
  6. Confirm the Summary page
  7. In the Projects tab, select Manage Kits...

macOS

  • Under Kits: select the default "Desktop" kit
  • Under Compilers: select "Clang (x86 64bit in /usr/bin)"
  • Under Debuggers: select "LLDB" as debugger (you might need to set the path to your LLDB installation)

Ubuntu & Debian

Note: Some of these options may already be set

  • Under Kits: select the default "Desktop" kit
  • Under Compilers: select "GCC (x86 64bit in /usr/bin)"
  • Under Debuggers: select "GDB" as debugger
  1. While in the Projects tab, ensure that you have the dash-qt executable specified under Run
  • If the executable is not specified: click "Choose...", navigate to src/qt, and select dash-qt
  1. You're all set! Start developing, building, and debugging the Dash Core GUI