| OLD | NEW |
| 1 # Use Qt Creator as IDE or GUI Debugger | 1 # Use Qt Creator as IDE or GUI Debugger |
| 2 | 2 |
| 3 [Qt Creator](https://www.qt.io/ide/) | 3 [Qt Creator](https://www.qt.io/ide/) |
| 4 ([Wiki](https://en.wikipedia.org/wiki/Qt_Creator)) is a cross-platform C++ IDE. | 4 ([Wiki](https://en.wikipedia.org/wiki/Qt_Creator)) is a cross-platform C++ IDE. |
| 5 | 5 |
| 6 You can use Qt Creator as a daily IDE or just as a GDB frontend and that does | 6 You can use Qt Creator as a daily IDE or just as a GDB frontend and that does |
| 7 not require project configuration. | 7 not require project configuration. |
| 8 | 8 |
| 9 [TOC] | 9 [TOC] |
| 10 | 10 |
| 11 ## IDE | 11 ## IDE |
| 12 | 12 |
| 13 ### Workflow | 13 ### Workflow |
| 14 | 14 |
| 15 1. `ctrl+k` Activate Locator, you can open file(not support sublime-like-search)
or type `. ` go to symbol. | 15 1. `ctrl+k` Activate Locator, you can open file(not support sublime-like-search) |
| 16 or type `. ` go to symbol. |
| 16 2. `ctrl+r` Build and Run, `F5` Debug. | 17 2. `ctrl+r` Build and Run, `F5` Debug. |
| 17 3. `F4` switch between header file and cpp file. | 18 3. `F4` switch between header file and cpp file. |
| 18 4. `ctrl+shift+r` rename symbol under cursor. | 19 4. `ctrl+shift+r` rename symbol under cursor. |
| 19 5. Code completion is built-in. And you can add your snippets. | 20 5. Code completion is built-in. And you can add your snippets. |
| 20 | 21 |
| 21 ### Setup as IDE | 22 ### Setup as IDE |
| 22 | 23 |
| 23 1. Install latest Qt Creator | 24 1. Install latest Qt Creator |
| 24 2. under chromium/src `gn gen out/Default --ide=qtcreator` | 25 2. under chromium/src `gn gen out/Default --ide=qtcreator` |
| 25 3. qtcreator out/Default/qtcreator_project/all.creator | 26 3. qtcreator out/Default/qtcreator_project/all.creator |
| 26 | 27 |
| 27 It takes 3 minutes to parsing C++ files in my workstation!!! And It will not | 28 It takes 3 minutes to parsing C++ files in my workstation!!! And It will not |
| 28 block you while parsing. | 29 block you while parsing. |
| 29 | 30 |
| 30 #### Code Style | 31 #### Code Style |
| 31 | 32 |
| 32 1. Help - About Plugins enable Beautifier. | 33 1. Help - About Plugins enable Beautifier. |
| 33 2. Tools - Options - Beautifier - Clang Format, select use predefined style: | 34 2. Tools - Options - Beautifier - Clang Format, |
| 34 chromium. You can also set a keyboard shortcut for it. | 35 change Clang format command: `$depot_tools_dir/clang-format`, select use |
| 36 predefined style: file. You can also set a keyboard shortcut for it. |
| 35 3. Tools - Options - Code Style import this xml file | 37 3. Tools - Options - Code Style import this xml file |
| 36 | 38 |
| 37 ``` | 39 ``` |
| 38 <?xml version="1.0" encoding="UTF-8"?> | 40 <?xml version="1.0" encoding="UTF-8"?> |
| 39 <!DOCTYPE QtCreatorCodeStyle> | 41 <!DOCTYPE QtCreatorCodeStyle> |
| 40 <!-- Written by QtCreator 4.2.1, 2017-02-08T19:07:34. --> | 42 <!-- Written by QtCreator 4.2.1, 2017-02-08T19:07:34. --> |
| 41 <qtcreator> | 43 <qtcreator> |
| 42 <data> | 44 <data> |
| 43 <variable>CodeStyleData</variable> | 45 <variable>CodeStyleData</variable> |
| 44 <valuemap type="QVariantMap"> | 46 <valuemap type="QVariantMap"> |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 Ensure yama allow you to attach another process. | 113 Ensure yama allow you to attach another process. |
| 112 | 114 |
| 113 #### Debugger do not stop in break point | 115 #### Debugger do not stop in break point |
| 114 | 116 |
| 115 Ensure you are using GDB not LLDB in Linux. | 117 Ensure you are using GDB not LLDB in Linux. |
| 116 | 118 |
| 117 #### More | 119 #### More |
| 118 | 120 |
| 119 See | 121 See |
| 120 https://chromium.googlesource.com/chromium/src/+/master/docs/linux_debugging.md | 122 https://chromium.googlesource.com/chromium/src/+/master/docs/linux_debugging.md |
| OLD | NEW |