Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Debug Script with Creator 4.4.1
Forum Updated to NodeBB v4.3 + New Features

Debug Script with Creator 4.4.1

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
6 Posts 4 Posters 1.5k Views 1 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
    coltrane58
    wrote on last edited by
    #1

    I am new to QT and I'm working on a mac c++ app with javascript. How can I debug script. I don't see a QT Debug app and I can't step into script functions. I thought maybe into the moc file but that doesn't work.

    any help would be appreciated

    John

    jsulmJ 1 Reply Last reply
    0
    • C coltrane58

      I am new to QT and I'm working on a mac c++ app with javascript. How can I debug script. I don't see a QT Debug app and I can't step into script functions. I thought maybe into the moc file but that doesn't work.

      any help would be appreciated

      John

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @coltrane58 I don't think you can debug JavaScript in QtCreator. How do you execute these scripts?

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

      1 Reply Last reply
      0
      • C Offline
        C Offline
        coltrane58
        wrote on last edited by
        #3

        I am working on a mac app which is a combo of c++ and javascript. I have been debugging the c++ portion in Creator. I thought I could just add console.info type functions in the javascript but I just get errors. I'm not the original author of the code so I have been trying to come up to speed using QT. If the javascript wasn't so complex I would just convert the whole thing to c++. argh!

        any help would be really be appreciated. I'm going bonkers

        thanks
        john

        JonBJ 1 Reply Last reply
        0
        • C coltrane58

          I am working on a mac app which is a combo of c++ and javascript. I have been debugging the c++ portion in Creator. I thought I could just add console.info type functions in the javascript but I just get errors. I'm not the original author of the code so I have been trying to come up to speed using QT. If the javascript wasn't so complex I would just convert the whole thing to c++. argh!

          any help would be really be appreciated. I'm going bonkers

          thanks
          john

          JonBJ Online
          JonBJ Online
          JonB
          wrote on last edited by
          #4

          @coltrane58

          I thought I could just add console.info type functions in the javascript but I just get errors

          What functions and what errors?

          P.S.
          You aren't The John Coltrane, are you?

          1 Reply Last reply
          0
          • C Offline
            C Offline
            coltrane58
            wrote on last edited by
            #5

            First, I don't know why I put 4.4.1 in the title. Must have been a brain hic-up. I am running QT Creator 5.9.3.
            I have tried 4.4.1 and 4.4.8 but I can't build with either of those versions because my XCode is close to the latest. The code I am trying to fix was written with QT 4.8.4, at least that was what was communicated to me.

            I am trying to use
            >>console.info("yada yada yada");
            in a key handling function. When I press a key I get:

            ReferenceError: Can't find variable: console2984

            I can use

            alert("nada nada nada");
            successfully

            I am not well versed in javascript. I can read it an understand it to some extent but I wouldn't try to create anything more complicated than HelloWorld.js. And i am totally clueless on how to debug it. I am for the most part a c++ developer with some java under my belt.

            and yes, I am THE john coltrane. Neighbors hate when I blow my sax at 2am 🎷;-)
            john

            1 Reply Last reply
            0
            • mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by mrjj
              #6

              Hi
              Just to be clear
              QtCreator is version 4.4.1.(newest) And it the IDE/editor
              Qt version is not tied to creator. you can use any Qt version with it.
              Like Qt4.8 (old gen) or Qt.5.9/10 (newest)

              If you have Qt4.8 based code, it might need some porting to run in Qt5.9
              Some classes have changed.
              Also, QtScript is deprecated and superseded with QJSEngine but still fully functional in
              later Qt version. ( whole of 5.X as i understand it)

              There is a tool to debug QScript
              http://doc.qt.io/qt-5/qtscriptdebugger-manual.html
              And you can use
              http://doc.qt.io/qt-5/qscriptenginedebugger.html
              to embed into the app.

              I assume this is how you use js ?
              I mean via QScript ?

              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