Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt - Qml debugging is enabled. Only use this in a safe environment

Tags:

qt

qml

I'm trying to run a very simple program that just closes the window when clicking the `exit button, but get the following output provided that the application window that contains the button does not show up:

Starting C:\Users\Ola\Desktop\signal_slot1-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2008__Qt_SDK__Debug\debug\signal_slot1.exe...
Qml debugging is enabled. Only use this in a safe environment!

What should I do in this case?

like image 822
Simplicity Avatar asked Sep 02 '12 07:09

Simplicity


People also ask

How do I debug QML in Visual Studio?

Setting Up QML Debugging The process of setting up debugging for Qt Quick projects depends on the type of the project: Qt Quick UI or Qt Quick Application. To debug Qt Quick UI projects: Select Projects, and then select the QML check box in the Run Settings, to enable QML debugging.

How to disable QML debugging?

It is possible to disable QML debugging, and revert to native-only debugging, by opening the Qt project settings dialog and setting the "QML Debug" option to "Disable".


2 Answers

You have enabled QML debugging (actually it's on by default), this opens a port to the Javascript interpreter that is running the QML so you can get debug output from it. Obviously this creates a security hole, so it should be turned off when not being used in safe place (it's turned off automatically when you release compile). This warning is to remind you of that.

If you are not using QML, turn it off anyway. You can turn it off in the project's options page, where the build settings are (it's a check box in the qmake area).

like image 174
cmannett85 Avatar answered Sep 26 '22 19:09

cmannett85


Assuming you use Qt Creator:

If you select the Release-Build type the QML debugging will be disabled. To do this, select the build type on the bottom left corner above the "run" button and choose "release".


Manually, there is an option passed to qmake (either in the .pro file or via command line arguments) named

CONFIG+=qml_debug

which enables qml debugging. If you omit that, it should be disabled.

like image 31
Robert Jakob Avatar answered Sep 24 '22 19:09

Robert Jakob