Qt practical skills: Qt change from QtCreator to VS development Qt need to pay attention to the pit

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

Red Fatty (Red Imitation)'s blog post: development technology collection (including Qt practical technology, Raspberry Pi, 3D, OpenCV, OpenGL, ffmpeg, OSG, single-chip microcomputer, software and hardware combination, etc.) is being continuously updated... (click on the portal)

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

  Insert picture description here
  Insert picture description here


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.
    Insert picture description here


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:
  Insert picture description here


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
  Insert picture description here


About automatically generating cpp code

  Write the header file code first, and use Pomodoro to generate the corresponding cpp code
  Insert picture description here


About signals and slots

  It is not very convenient on VS. After writing the slot function by yourself, use connect to associate
  Insert picture description here


About adding Qt modules

  Note: The configuration of the switch version will change, and the module needs to be reconfigured
  Insert picture description here


About packaging

  Still use the mingw32 method, but the command line uses the version corresponding to msvc.
  Insert picture description here
  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

Guess you like

Origin blog.csdn.net/qq21497936/article/details/114579748