How to debug AppStudio apps in Qt Creator

7979
2
Jump to solution
04-03-2015 11:52 AM
RiverTaig1
Occasional Contributor

Pardon the newbie question - I've managed to install App Studio / Qt Creator and am getting up to speed using the "ArcGIS Runtime QML Sample App".  I copy/pasted the code from the "Mouse coordinates" sample into Qt Creator, and I modified a line or two.  I can run my tweaked out code by going to: Tools>External>AppStudio>Player (Alt-P is the short-cut).  That works great!

But now...

What I want to do now is add an onMouseClicked handler to the map...unfortunately, something in my code isn't working. So i'd like to debug. How do you do that? Setting a break point in Qt Creator doesn't seem to do anything.  In Qt Creator, there are options under Debug > Start Debugging, but I'm not sure how to use those tools (is that even the way to go??).  There's  mention in the documentation about using Visual Studio and WinDBG - I have Visual Studio on my machine for ArcMap development, I should already have WinDBG, right?  Is WinDBG the way to go, and if so is there some more info on how to use it in an ESRI AppStudio context?

Perhaps the problem I'm having is that I'm getting "QML Module not Found" squiggles in my .qml file (although the AppStudio player seems to not care). 

A.PNG

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
LucasDanzinger
Esri Frequent Contributor

Hi River,

I recommend you put this same post in the Beta forum for AppStudio. You can get there from this page AppStudio for ArcGIS | ArcGIS.​ That way, the AppStudio team will see it, and other AppStudio users can benefit from the question/answer.

You can place breakpoints like this if you are building natively with the SDK, but if you use this AppStudio external Player tool, I'm not sure that you will be able to debug. However, I will leave that up to the AppStudio team to tell you for sure.

Thanks,

Luke

View solution in original post

2 Replies
LucasDanzinger
Esri Frequent Contributor

Hi River,

I recommend you put this same post in the Beta forum for AppStudio. You can get there from this page AppStudio for ArcGIS | ArcGIS.​ That way, the AppStudio team will see it, and other AppStudio users can benefit from the question/answer.

You can place breakpoints like this if you are building natively with the SDK, but if you use this AppStudio external Player tool, I'm not sure that you will be able to debug. However, I will leave that up to the AppStudio team to tell you for sure.

Thanks,

Luke

MarikaVertzonis
Esri Regular Contributor

Hi, just wanted to follow up on debugging in AppStudio.

The red squiggles in your screenshot are the first issue. They shouldn't be there and it might be to do with version. At beta 2 we did change the name of modules so

    import ArcGIS.Runtime 10.2.5

should be changed to to

    import ArcGIS.AppFramework.Runtime 1.0

(ie: you don't need both).

Regarding debugging, the preferred method is to use console.log messaging in your QML code, as these messages are displayed in the Qt Creator console and is the same for all platforms. This works without the installation of the Qt kit; only AppStudio is required. However there is a catch. At beta 2, you will need to set an environment variable to see the console logs on Windows. To do this:

  • Close Qt Creator
  • Add a new system environment variable "QT_LOGGING_TO_CONSOLE" with value 1 on your windows machine
  • Relaunch QtCreator.

QML console.log messages will now appear in the "General Messages" tab of Qt Creator when running Player as an external tool. When Beta 3 is release (very soon), you will not need to manually set the variable.

To set breakpoints and debug JavaScript functions using Qt Creator, you must install the Qt kit relevant to your operating system as well as a debugging environment (eg: Visual Studio and WinDbg). A topic on this specifically is coming in the Beta 3 help update.