Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Qt Creator, pyside6, QML debuggger
Forum Updated to NodeBB v4.3 + New Features

Qt Creator, pyside6, QML debuggger

Scheduled Pinned Locked Moved Unsolved Qt for Python
10 Posts 3 Posters 1.6k Views 2 Watching
  • 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.
  • C Offline
    C Offline
    CKurdu
    wrote on 3 Oct 2023, 04:34 last edited by CKurdu 10 Mar 2023, 04:34
    #1

    Hello everyone,

    I can't find enough information about how to work the QML debugger in a PySide6 project.

    This is what I found that is related a C++ Qt project.

    [https://doc.qt.io/qtcreator/creator-debugging-qml.html]

    I tried the below link and also tried "attach to QML port" but It didn't work.

    https://doc.qt.io/qtforpython-6/overviews/qtquick-debugging.html

    You reap what you sow it

    C 1 Reply Last reply 3 Oct 2023, 04:57
    0
    • C CKurdu
      3 Oct 2023, 04:34

      Hello everyone,

      I can't find enough information about how to work the QML debugger in a PySide6 project.

      This is what I found that is related a C++ Qt project.

      [https://doc.qt.io/qtcreator/creator-debugging-qml.html]

      I tried the below link and also tried "attach to QML port" but It didn't work.

      https://doc.qt.io/qtforpython-6/overviews/qtquick-debugging.html

      C Offline
      C Offline
      CKurdu
      wrote on 3 Oct 2023, 04:57 last edited by
      #2

      @CKurdu

      I realized that in the console it says

      QML Debugger: Ignoring "-qmljsdebugger=port:12345,block". Debugging has not been enabled.
      

      Should I compile PySide6 or is there a version debugging enabled?

      Window 11 64bit

      You reap what you sow it

      C 1 Reply Last reply 3 Oct 2023, 07:06
      0
      • C CKurdu
        3 Oct 2023, 04:57

        @CKurdu

        I realized that in the console it says

        QML Debugger: Ignoring "-qmljsdebugger=port:12345,block". Debugging has not been enabled.
        

        Should I compile PySide6 or is there a version debugging enabled?

        Window 11 64bit

        C Offline
        C Offline
        CKurdu
        wrote on 3 Oct 2023, 07:06 last edited by
        #3

        When I run from Qt Creator, it doesn't appear. But I cannot connect to the port for QML debugging.

        You reap what you sow it

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jlw_4049
          wrote on 19 Nov 2023, 17:29 last edited by
          #4

          I've been trying to solve this for a few days. There is no issues with the output coming to console in VsCode but QT Creator with pyside6 simply doesn't work.

          1 Reply Last reply
          0
          • F Offline
            F Offline
            friedemannkleint
            wrote on 20 Nov 2023, 12:33 last edited by
            #5

            QML debugging needs to be enabled in the app by something like

            from PySide6.QtQml import QQmlDebuggingEnabler
            
            QQmlDebuggingEnabler.enableDebugging(True)
            

            This should be removed when shipping the code though for security reasons.

            J 2 Replies Last reply 21 Nov 2023, 05:13
            1
            • F friedemannkleint
              20 Nov 2023, 12:33

              QML debugging needs to be enabled in the app by something like

              from PySide6.QtQml import QQmlDebuggingEnabler
              
              QQmlDebuggingEnabler.enableDebugging(True)
              

              This should be removed when shipping the code though for security reasons.

              J Offline
              J Offline
              jlw_4049
              wrote on 21 Nov 2023, 05:13 last edited by
              #6

              @friedemannkleint I'll try it out and get back tomorrow. Thanks!

              1 Reply Last reply
              0
              • F friedemannkleint
                20 Nov 2023, 12:33

                QML debugging needs to be enabled in the app by something like

                from PySide6.QtQml import QQmlDebuggingEnabler
                
                QQmlDebuggingEnabler.enableDebugging(True)
                

                This should be removed when shipping the code though for security reasons.

                J Offline
                J Offline
                jlw_4049
                wrote on 21 Nov 2023, 14:15 last edited by
                #7

                @friedemannkleint said in Qt Creator, pyside6, QML debuggger:

                QQmlDebuggingEnabler.enableDebugging(True)

                Unfortunately this made no difference actually. When you use QTCreator to run in debug mode you will get this message.

                efbdd138-d08d-4485-aac8-97353a872a3c-image.png

                Message might seem self explanatory but turns out QT Creator does not have this option inside of the "Build" under project.

                fa8a81ed-101f-4bab-ab13-01f70059dee1-image.png

                I've searched for this option all over else where through out the program to no avail.

                "Run" does have it, but makes no difference since it wants it in both options checked, but it's impossible to do so for pyside6.

                970555aa-1323-4084-97b4-b5666282075b-image.png

                J 1 Reply Last reply 21 Nov 2023, 15:41
                0
                • J jlw_4049
                  21 Nov 2023, 14:15

                  @friedemannkleint said in Qt Creator, pyside6, QML debuggger:

                  QQmlDebuggingEnabler.enableDebugging(True)

                  Unfortunately this made no difference actually. When you use QTCreator to run in debug mode you will get this message.

                  efbdd138-d08d-4485-aac8-97353a872a3c-image.png

                  Message might seem self explanatory but turns out QT Creator does not have this option inside of the "Build" under project.

                  fa8a81ed-101f-4bab-ab13-01f70059dee1-image.png

                  I've searched for this option all over else where through out the program to no avail.

                  "Run" does have it, but makes no difference since it wants it in both options checked, but it's impossible to do so for pyside6.

                  970555aa-1323-4084-97b4-b5666282075b-image.png

                  J Offline
                  J Offline
                  jlw_4049
                  wrote on 21 Nov 2023, 15:41 last edited by jlw_4049
                  #8

                  Good news is VSCode has no problem at least showing the output in the terminal by default where as QT Creator fails to show anything of relevance at all as far as debugging. Granted this is due to just running the script via python main.py and if I did this manually in QT Creator it would have the same output.

                  a90a8f3d-df21-4b0e-8438-87deae1a0a8b-image.png

                  C 1 Reply Last reply 28 Nov 2023, 00:16
                  0
                  • J jlw_4049
                    21 Nov 2023, 15:41

                    Good news is VSCode has no problem at least showing the output in the terminal by default where as QT Creator fails to show anything of relevance at all as far as debugging. Granted this is due to just running the script via python main.py and if I did this manually in QT Creator it would have the same output.

                    a90a8f3d-df21-4b0e-8438-87deae1a0a8b-image.png

                    C Offline
                    C Offline
                    CKurdu
                    wrote on 28 Nov 2023, 00:16 last edited by
                    #9

                    Hello @jlw_4049 ,
                    Do your breakpoints work in Qt Creator?
                    Two sides, python code and qml code?

                    You reap what you sow it

                    1 Reply Last reply
                    0
                    • F Offline
                      F Offline
                      friedemannkleint
                      wrote on 28 Nov 2023, 07:28 last edited by
                      #10

                      Whether Qt Creator shows sth in the console might be influenced by the buffered output option of python3 (pass -u to python3 [-u : force the stdout and stderr streams to be unbuffered, or set PYTHONUNBUFFERED=1]). This should also be available in the run settings. Are these breakpoints from C++ maybe - Qt Creator sometimes remembers breakpoints.

                      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