If anyone has wanted to debug their QCAD C++ Plugin using the released Pro version of QCAD then the following may be of interest.
An issue I had was I use custom properties in my plugin that need to be saved out with the file, however if I try loading the file back into QCAD using a debug build of my plugin the pro features no longer work and so I no longer see the custom properties.
The way around this is to build a release version of my plugin with debug info, I can then copy the plugin and associated debug files to the release version of QCAD, start QCAD and use Qt Creator to attach to the version of QCAD that is running. From there I can set breakpoints etc. in my plugins code and debug like normal. Because it is a release build you may see a few issues while debugging such as the debugger appearing to run lines of code which it shouldn't but these are not normally an issue.
Okay so how do we achieve this? Simple, add the following two lines to your plugins .pro file and run qmake then rebuild.
Code: Select all
QMAKE_CXXFLAGS_RELEASE += /Zi
QMAKE_LFLAGS_RELEASE += /DEBUG
Hope that is helpful to someone.
Thanks,
Andrew.