Modifying and debugging Qt source files
-
I'm having some problems doing a bluetooth pairing in Windows 11 with Qt 6.9.0.
To try different solutions I'm modifying the following source file:Qt\6.9.0\Src\qtconnectivity\src\bluetooth\qbluetoothlocaldevice_winrt.cpp
The problem is that I can't compile including the changes. Qt seems to maintain the old code of the file instead the one with my changes, despite of the file has the same name and is in the same location. I think it is something about dll's generation but I don't know how to get Qt includes the modified file.
As a curiosity, in debug mode the execution cursor (yellow arrow pointing to the next line to run) goes in the modified file but it doesn't match with the correct line. The execution cursor goes through the old code when I'm seeing the changed code.
Thanks in advance!
-
I'm having some problems doing a bluetooth pairing in Windows 11 with Qt 6.9.0.
To try different solutions I'm modifying the following source file:Qt\6.9.0\Src\qtconnectivity\src\bluetooth\qbluetoothlocaldevice_winrt.cpp
The problem is that I can't compile including the changes. Qt seems to maintain the old code of the file instead the one with my changes, despite of the file has the same name and is in the same location. I think it is something about dll's generation but I don't know how to get Qt includes the modified file.
As a curiosity, in debug mode the execution cursor (yellow arrow pointing to the next line to run) goes in the modified file but it doesn't match with the correct line. The execution cursor goes through the old code when I'm seeing the changed code.
Thanks in advance!
@Alejandro_qt_ Not clear to me: did you manage to compile and install this Qt module with your changes and only debugging doesn't work properly? Or you can't compile that module with your changes?
-
@Alejandro_qt_ Not clear to me: did you manage to compile and install this Qt module with your changes and only debugging doesn't work properly? Or you can't compile that module with your changes?
@jsulm
I compile and debug my own app that includes #include <qbluetoothlocaldevice.h> in Qt\6.9.0\msvc2022_64\include\QtBluetooth and it finally makes use of the Qt\6.9.0\Src\qtconnectivity\src\bluetooth\qbluetoothlocaldevice_winrt.cpp that is the file I changed.
The problem is that my app doesn't compile the file with my changes. When I debug my app I can go to the file with my changes (I see my modified code) but the execution cursor doesn´t match with my code and seems to match with the old code.
In addition, if I rename the file (qbluetoothlocaldevice_winrt___.cpp) my app compiles and runs well althoug when I debug it can't go into the file (it doesn't exist!) but execute the old code (I see debug traces in Application Output).
I think my app use a dll (not the real file) and the debugging machine only goes into the file (if it finds it) to show the user the execution step.What I really want to do is modify a Qt source file and my app (that includes indirectly the Qt source file) take the changes into account.
-
If you modify the Qt source code then you also have to recompile the relevant Qt library. How should this work otherwise?
-
OK, but how can I do it?
It would only be the bluetooth module or the minimun part corresponding the file Qt\6.9.0\Src\qtconnectivity\src\bluetooth\qbluetoothlocaldevice_winrt.cpp. -
OK, but how can I do it?
It would only be the bluetooth module or the minimun part corresponding the file Qt\6.9.0\Src\qtconnectivity\src\bluetooth\qbluetoothlocaldevice_winrt.cpp.@Alejandro_qt_ Here is an example how to build qtbase module: https://stackoverflow.com/questions/50022325/building-qt-module-from-source