Solution for Debug QtCreator Plugins with QtCreator from source
-
Referring to this topic:
Re: How to debug QtCreator plugins?i was also trying to debug a QtCreator Plugin and found the idea of tobias.hunger to run an instance of qtc from qtc source within an instance of installed qtc.
@tobias-hunger said in How to debug QtCreator plugins?:
Blessed Greek: Let's do this step by step then:
- Open Qt Creator (use the -color "#ff0000" parameter to tint the UI red, makes things easier later;)
- Grab the Qt Creator sources from gitorious.org
- Open qtcreator.pro
- Build
- Debug
Voila: Qt Creator run by/in a Qt Creator debugger. Is this clearer?
PS: We can kind of run "a browser" inside Qt Creator, too. Hit Ctrl-K, r search-term, use cursor keys to select the search engine you want;-)
So i downloaded master branch from https://github.com/qt-creator/qt-creator/tree/master
But there i got an other issue getting the message "Cannot determine clang version. Set LLVM_CONFIG to build the Clang Code Model".
Here i will give you some ideas on how you can solve this for yourself if you get the same problem as me. But this is just a solution for the Linux users because that was just the way i went.
First check if you have any llvm version installed.
Referring to clang files within QT you need at least LLVM version 9.
btw: you can have a similar error ,if you have a lower version.
The message would be like "...llvm version>=9..."to get the llvm version go to https://releases.llvm.org/download.html and make sure you download the matching version for your distribution.
after download unzip the archive and keep directories.
rename the top directory from the archive to "llvm" (reason will follow)
now copy this folder to /usr so that you have after copy /usr/llvmopen a terminal and enter: $ export LLVM_INSTALL_DIR=/usr/llvm
according to: https://wiki.qt.io/Building_Qt_5_from_Git#Getting_the_source_codethis way you register an environment variable in your system to set the info what version of llvm is installed.
now you should switch to your /qtcreator/bin folder and start ./qtcreator.sh -color "#ff0000" so you get a difference for later between the source instance and your development instance of qtc.
load now the qtcreator.pro from source code
and you should be fine, having the llvm issue gone.
.
-
Or, in latest versions of QT (6.9.x), you could just build with MinGW...