Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Insight
  4. Modifying and debugging Qt source files
Forum Updated to NodeBB v4.3 + New Features

Modifying and debugging Qt source files

Scheduled Pinned Locked Moved Unsolved Qt Insight
qt insight
6 Posts 3 Posters 139 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alejandro_qt_
    wrote last edited by Alejandro_qt_
    #1

    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!

    jsulmJ 1 Reply Last reply
    0
    • A Alejandro_qt_

      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!

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote last edited by
      #2

      @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?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply
      0
      • jsulmJ jsulm

        @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?

        A Offline
        A Offline
        Alejandro_qt_
        wrote last edited by
        #3

        @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.

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote last edited by
          #4

          If you modify the Qt source code then you also have to recompile the relevant Qt library. How should this work otherwise?

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          1
          • A Offline
            A Offline
            Alejandro_qt_
            wrote last edited by
            #5

            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.

            jsulmJ 1 Reply Last reply
            0
            • A Alejandro_qt_

              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.

              jsulmJ Online
              jsulmJ Online
              jsulm
              Lifetime Qt Champion
              wrote last edited by
              #6

              @Alejandro_qt_ Here is an example how to build qtbase module: https://stackoverflow.com/questions/50022325/building-qt-module-from-source

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved