Skip to content

Commit ba883c5

Browse files
MarcoFalkeknst
authored andcommitted
Merge bitcoin-core/gui#139: doc: Improve gui/src/qt README.md
5d1f260 Improve gui/src/qt README.md (Jarol Rodriguez) Pull request description: **Master/Before:** [Render of Master](https://github.com/bitcoin-core/gui/blob/master/src/qt/README.md) **PR/After:** [Render of PR](https://github.com/bitcoin-core/gui/blob/5d1f260713f9f1d29c0db68f2917dfe7368d4ba0/src/qt/README.md) **Changes:** The README.md found in `gui/src/qt` seems to not have gotten any love in a while. This PR fixes some grammatical errors, makes it easier to follow, and modernizes the logic of using Qt Creator. 1. Makes several sections more informative 2. Directories under `Files and Directories` now end with a forward slash denoting that they are a directory 3. Modernize the Qt Creator Logic for the current setup flow 4. Add UNIX Qt Creator Setup Instructions (Ubuntu & Debian) ACKs for top commit: RandyMcMillan: ACK 5d1f260 👍🏼 jonatack: ACK 5d1f260 Tree-SHA512: bd5cc24b95460f34a1efa489a6acc10d7632c84eabdcdc5729ef077d8303cf037ed664aae033af8883252433ea0999d8ec7d92e8b03d03a873d32b041a94f813
1 parent 368c65d commit ba883c5

File tree

1 file changed

+75
-45
lines changed

1 file changed

+75
-45
lines changed

src/qt/README.md

Lines changed: 75 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,125 @@
1-
This directory contains the DashQT graphical user interface (GUI). It uses the cross-platform framework [Qt](https://www1.qt.io/developers/).
1+
This directory contains the source code for the Dash Core graphical user interface (GUI). It uses the [Qt](https://www1.qt.io/developers/) cross-platform framework.
22

33
The current precise version for Qt 5 is specified in [qt.mk](/depends/packages/qt.mk). Qt 4 is not supported.
44

55
## Compile and run
66

7-
See build instructions ([macOS](/doc/build-osx.md), [Windows](/doc/build-windows.md), [Unix](/doc/build-unix.md), etc).
7+
See build instructions: [Unix](/doc/build-unix.md), [macOS](/doc/build-osx.md), [Windows](/doc/build-windows.md), [FreeBSD](/doc/build-freebsd.md), [NetBSD](/doc/build-netbsd.md), [OpenBSD](/doc/build-openbsd.md)
8+
9+
When following your systems build instructions, make sure to install the `Qt` dependencies.
810

911
To run:
1012

1113
```sh
1214
./src/qt/dash-qt
1315
```
1416

15-
## Files and directories
16-
17-
### forms
17+
## Files and Directories
1818

19-
Contains [Designer UI](http://doc.qt.io/qt-5.9/designer-using-a-ui-file.html) files. They are created with [Qt Creator](#using-qt-creator-as-ide), but can be edited using any text editor.
19+
#### forms/
2020

21-
### locale
21+
- A directory that contains [Designer UI](https://doc.qt.io/qt-5.9/designer-using-a-ui-file.html) files. These files specify the characteristics of form elements in XML. Qt UI files can be edited with [Qt Creator](#using-qt-creator-as-ide) or using any text editor.
2222

23-
Contains translations. They are periodically updated. The process is described [here](/doc/translation_process.md).
23+
#### locale/
2424

25-
### res
25+
- 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](/doc/translation_process.md).
2626

27-
Resources such as the icon.
27+
#### res/
2828

29-
### test
29+
- Contains graphical resources used to enhance the UI experience.
3030

31-
Tests.
31+
#### test/
3232

33-
### bitcoingui.(h/cpp)
33+
- Functional tests used to ensure proper functionality of the GUI. Significant changes to the GUI code normally require new or updated tests.
3434

35-
Represents the main window of the Dash UI.
35+
#### bitcoingui.(h/cpp)
3636

37-
### \*model.(h/cpp)
37+
- Represents the main window of the Dash UI.
3838

39-
The model. When it has a corresponding controller, it generally inherits from [QAbstractTableModel](http://doc.qt.io/qt-5/qabstracttablemodel.html). Models that are used by controllers as helpers inherit from other Qt classes like [QValidator](http://doc.qt.io/qt-5/qvalidator.html).
39+
#### \*model.(h/cpp)
4040

41-
ClientModel is used by the main application `bitcoingui` and several models like `peertablemodel`.
41+
- The model. When it has a corresponding controller, it generally inherits from [QAbstractTableModel](https://doc.qt.io/qt-5/qabstracttablemodel.html). Models that are used by controllers as helpers inherit from other Qt classes like [QValidator](https://doc.qt.io/qt-5/qvalidator.html).
42+
- ClientModel is used by the main application `dashgui` and several models like `peertablemodel`.
4243

43-
### \*page.(h/cpp)
44+
#### \*page.(h/cpp)
4445

45-
A controller. `:NAMEpage.cpp` generally includes `:NAMEmodel.h` and `forms/:NAME.page.ui` with a similar `:NAME`.
46+
- A controller. `:NAMEpage.cpp` generally includes `:NAMEmodel.h` and `forms/:NAME.page.ui` with a similar `:NAME`.
4647

47-
### \*dialog.(h/cpp)
48+
#### \*dialog.(h/cpp)
4849

49-
Various dialogs, e.g. to open a URL. Inherit from [QDialog](http://doc.qt.io/qt-4.8/qdialog.html).
50+
- Various dialogs, e.g. to open a URL. Inherit from [QDialog](https://doc.qt.io/qt-5/qdialog.html).
5051

51-
### paymentserver.(h/cpp)
52+
#### paymentserver.(h/cpp)
53+
- (Deprecated) Used to process BIP21 payment URI requests. Also handles URI-based application switching (e.g. when following a dash:... link from a browser).
5254

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

55-
### walletview.(h/cpp)
57+
#### walletview.(h/cpp)
5658

57-
Represents the view to a single wallet.
59+
- Represents the view to a single wallet.
5860

59-
### Other .h/cpp files
61+
#### Other .h/cpp files
6062

6163
* UI elements like BitcoinAmountField, which inherit from QWidget.
6264
* `bitcoinstrings.cpp`: automatically generated
63-
* `bitcoinunits.(h/cpp)`: BTC / mBTC / etc handling
65+
* `bitcoinunits.(h/cpp)`: BTC / mBTC / etc. handling
6466
* `callback.h`
65-
* `guiconstants.h`: UI colors, app name, etc
67+
* `guiconstants.h`: UI colors, app name, etc.
6668
* `guiutil.h`: several helper functions
6769
* `macdockiconhandler.(h/mm)`: macOS dock icon handler
6870
* `macnotificationhandler.(h/mm)`: display notifications in macOS
6971

7072
## Contribute
7173

72-
See [CONTRIBUTING.md](/CONTRIBUTING.md) for general guidelines. Specifically for Qt:
74+
See [CONTRIBUTING.md](/CONTRIBUTING.md) for general guidelines.
75+
76+
**Note:** Do not change `local/dash_en.ts`. It is updated [automatically](/doc/translation_process.md#writing-code-with-translations).
77+
78+
## Using Qt Creator as an IDE
79+
80+
[Qt Creator](https://www.qt.io/product/development-tools) 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.
81+
82+
#### Download Qt Creator
83+
84+
On Unix and macOS, Qt Creator can be installed through your package manager. Alternatively, you can download a binary from the [Qt Website](https://www.qt.io/download/).
85+
86+
**Note:** If installing from a binary grabbed from the Qt Website: During the installation process, uncheck everything except for `Qt Creator`.
87+
88+
##### macOS
89+
90+
```sh
91+
brew install qt-creator
92+
```
93+
94+
##### Ubuntu & Debian
95+
96+
```sh
97+
sudo apt-get install qtcreator
98+
```
99+
100+
#### Setup Qt Creator
73101

74-
* don't change `local/dash_en.ts`; this happens [automatically](/doc/translation_process.md#writing-code-with-translations)
102+
1. Make sure you've installed all dependencies specified in your systems build instructions
103+
2. Follow the compile instructions for your system, run `./configure` with the `--enable-debug` flag
104+
3. Start Qt Creator. At the start page, do: `New` -> `Import Project` -> `Import Existing Project`
105+
4. Enter `dash-qt` as the Project Name and enter the absolute path to `src/qt` as Location
106+
5. Check over the file selection, you may need to select the `forms` directory (necessary if you intend to edit *.ui files)
107+
6. Confirm the `Summary` page
108+
7. In the `Projects` tab, select `Manage Kits...`
75109

76-
## Using Qt Creator as IDE
110+
**macOS**
111+
- Under `Kits`: select the default "Desktop" kit
112+
- Under `Compilers`: select `"Clang (x86 64bit in /usr/bin)"`
113+
- Under `Debuggers`: select `"LLDB"` as debugger (you might need to set the path to your LLDB installation)
77114

78-
You can use Qt Creator as an IDE. This is especially useful if you want to change
79-
the UI layout.
115+
**Ubuntu & Debian**
80116

81-
Download and install the community edition of [Qt Creator](https://www.qt.io/download/).
82-
Uncheck everything except Qt Creator during the installation process.
117+
Note: Some of these options may already be set
83118

84-
Instructions for macOS:
119+
- Under `Kits`: select the default "Desktop" kit
120+
- Under `Compilers`: select `"GCC (x86 64bit in /usr/bin)"`
121+
- Under `Debuggers`: select `"GDB"` as debugger
85122

86-
1. Make sure you installed everything through Homebrew mentioned in the [macOS build instructions](/doc/build-osx.md)
87-
2. Use `./configure` with the `--enable-debug` flag
88-
3. In Qt Creator do "New Project" -> Import Project -> Import Existing Project
89-
4. Enter "dash-qt" as project name, enter src/qt as location
90-
5. Leave the file selection as it is
91-
6. Confirm the "summary page"
92-
7. In the "Projects" tab select "Manage Kits..."
93-
8. Select the default "Desktop" kit and select "Clang (x86 64bit in /usr/bin)" as compiler
94-
9. Select LLDB as debugger (you might need to set the path to your installation)
95-
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)
123+
8. While in the `Projects` tab, ensure that you have the `dash-qt` executable specified under `Run`
124+
- If the executable is not specified: click `"Choose..."`, navigate to `src/qt`, and select `dash-qt`
125+
9. You're all set! Start developing, building, and debugging the Dash Core GUI

0 commit comments

Comments
 (0)