Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. clarification on debugging QML

clarification on debugging QML

Scheduled Pinned Locked Moved Solved QML and Qt Quick
12 Posts 5 Posters 1.2k 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.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by
    #1

    Hi all -

    According to this page, I believe I should be able to set a breakpoint within a function declared in a QML file.

    True?

    So, I attempted to do so here:

    qml.png

    But the app doesn't stop here. Any idea what step I've missed?

    Thanks...

    J.HilkJ 1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      I suspect you need to place it either before or after that line, but it's only a guess. I haven't used QML debugger in ages.

      (Z(:^

      1 Reply Last reply
      0
      • mzimmersM mzimmers

        Hi all -

        According to this page, I believe I should be able to set a breakpoint within a function declared in a QML file.

        True?

        So, I attempted to do so here:

        qml.png

        But the app doesn't stop here. Any idea what step I've missed?

        Thanks...

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        @mzimmers said in clarification on debugging QML:

        According to this page, I believe I should be able to set a breakpoint within a function declared in a QML file.
        True?

        True and it works as you can see, I'm breaking inside the function:

        350bf03e-9985-4324-b7a9-feb008391245-image.png

        have you set "QML debugging and profiling" to Enabled, inside the project settings?
        Are you building and running a debug build, are you sure the debugger is attached?


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        mzimmersM 1 Reply Last reply
        2
        • J.HilkJ J.Hilk

          @mzimmers said in clarification on debugging QML:

          According to this page, I believe I should be able to set a breakpoint within a function declared in a QML file.
          True?

          True and it works as you can see, I'm breaking inside the function:

          350bf03e-9985-4324-b7a9-feb008391245-image.png

          have you set "QML debugging and profiling" to Enabled, inside the project settings?
          Are you building and running a debug build, are you sure the debugger is attached?

          mzimmersM Offline
          mzimmersM Offline
          mzimmers
          wrote on last edited by
          #4

          @J-Hilk "QML debugging and profiling" is set to Enabled.
          I'm building and running a debug configuration.
          I was under the impression that the debugger was already invoked when I pressed the debug button in Creator. I tried attaching after-the-fact, and got this message:

          process 14947 is already traced by process 14945
          08:03:57: Debugging has finished
          

          I'd assume from the message that the debugger is already "attached."

          Thanks...

          1 Reply Last reply
          0
          • mzimmersM Offline
            mzimmersM Offline
            mzimmers
            wrote on last edited by
            #5

            BTT...anyone have any ideas on this? Thanks...

            fcarneyF 1 Reply Last reply
            0
            • mzimmersM mzimmers

              BTT...anyone have any ideas on this? Thanks...

              fcarneyF Offline
              fcarneyF Offline
              fcarney
              wrote on last edited by
              #6

              @mzimmers
              I put a breakpoint in my qml in my project and ran the project under debug. When the function was called it broke execution at that point. I have never adjusted anything in Qt Creator for this.

              Considering that you cannot get refactoring to work either, maybe try updating Qt Creator? I don't know what the problem might be as it "just worked" for me. Sorry I cannot be more helpful.

              C++ is a perfectly valid school of magic.

              mzimmersM 1 Reply Last reply
              0
              • fcarneyF fcarney

                @mzimmers
                I put a breakpoint in my qml in my project and ran the project under debug. When the function was called it broke execution at that point. I have never adjusted anything in Qt Creator for this.

                Considering that you cannot get refactoring to work either, maybe try updating Qt Creator? I don't know what the problem might be as it "just worked" for me. Sorry I cannot be more helpful.

                mzimmersM Offline
                mzimmersM Offline
                mzimmers
                wrote on last edited by
                #7

                @fcarney I'm already running 4.14.0 of Creator, so that's not the problem.

                I'm wondering whether there's some plugin or option or something that I need, that I don't have. I'll just leave this open for a bit, and see if any of the other mavens have ideas.

                Thanks...

                1 Reply Last reply
                0
                • fcarneyF Offline
                  fcarneyF Offline
                  fcarney
                  wrote on last edited by
                  #8

                  I am running Qt Creator 4.13.3. So your version is even newer. Hmmm...
                  The project I tested was a Qt 5.15.2 project. What version of Qt is your project running? Trying to look for differences in setup.

                  C++ is a perfectly valid school of magic.

                  1 Reply Last reply
                  0
                  • GabrielRRG Offline
                    GabrielRRG Offline
                    GabrielRR
                    wrote on last edited by GabrielRR
                    #9

                    Hello,

                    I think you might have created a release build that does not contain debug information. A GNU Compiler Collection (GCC) debug build has the -g option on the compiler command line. Check the option is present in the Compile Output. In the case it does not, go to build settings in the proyects mode and set this option.

                    Lic-Ing. Jose Gabriel Lopez Villalobos
                    Embedded Software Engineer
                    RidgeRun Engineering Ltd.
                    www.ridgerun.com
                    Email: gabriel.lopez@ridgerun.com

                    1 Reply Last reply
                    0
                    • mzimmersM Offline
                      mzimmersM Offline
                      mzimmers
                      wrote on last edited by
                      #10

                      I'm running Qt 5.14.2. I tried to use 5.15.2, but this app has some deprecated syntax, so it won't build.

                      GabrielRR: breakpoints in C++ work fine; it's just those in QML files that don't work.

                      When I hover over the breakpoint, the message box refers to it as an "unclaimed breakpoint," FWIW.

                      mzimmersM 1 Reply Last reply
                      0
                      • mzimmersM mzimmers

                        I'm running Qt 5.14.2. I tried to use 5.15.2, but this app has some deprecated syntax, so it won't build.

                        GabrielRR: breakpoints in C++ work fine; it's just those in QML files that don't work.

                        When I hover over the breakpoint, the message box refers to it as an "unclaimed breakpoint," FWIW.

                        mzimmersM Offline
                        mzimmersM Offline
                        mzimmers
                        wrote on last edited by mzimmers
                        #11

                        BTT...I'll take any suggestions, no matter how far-fetched. Thanks...

                        EDIT: I don't think I mentioned that this is a CMake project. I just tried a qmake project, and the debugger and other tools work fine. Do CMake projects need special attention for using the deubgger?

                        1 Reply Last reply
                        0
                        • mzimmersM Offline
                          mzimmersM Offline
                          mzimmers
                          wrote on last edited by
                          #12

                          I discovered my error: I hadn't enabled QML debugging in the run settings for my project. (The documentation does say to do this, though it's kind of subtle.) Now I can break and examine variables.

                          Thanks to all who looked at this.

                          1 Reply Last reply
                          1

                          • Login

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