If the article is an original article, please indicate the original source for reprinting.
The blog address of this article: https://blog.csdn.net/qq21497936/article/details/114579748
We will continue to bring more projects and technology sharing for a long time, please add QQ: 21497936, WeChat: yangsir198808 for inquiries
Qt Development Column: Practical Skills
Preface
Basically use QtCreator development, use vs for development, record the attention pits encountered when changing from QtCreator to VS.
VS installs the corresponding Qt version assistant to configure the Qt version
VS Install Tomato Assistant
It should be noted here that if multiple versions of VS are installed, only the last version is recognized. The version installed is VS2017. Only VS2015 is recognized. Tomato Assistant selects the version supported by VS2017.
Code header file and source file switching
First press ctrl without releasing, then press K without releasing, and then press O.
Ctrl + K + O
Qt's ui designer
When the ui file cannot be opened by clicking on it, there is a problem with the default opening, and you need to add it manually, as shown in the following figure:
Updated the interface ui when it does not take effect
It is recommended to compile once after each modification, and then right-click the project to scan the solution again
About automatically generating cpp code
Write the header file code first, and use Pomodoro to generate the corresponding cpp code
About signals and slots
It is not very convenient on VS. After writing the slot function by yourself, use connect to associate
About adding Qt modules
Note: The configuration of the switch version will change, and the module needs to be reconfigured
About packaging
Still use the mingw32 method, but the command line uses the version corresponding to msvc.
Note, please run it once after packaging to prevent lack of libraries
If the article is an original article, please indicate the original source for reprinting.
The blog address of this article: https://blog.csdn.net/qq21497936/article/details/114579748