我是QML的新手,必须从事由同事发起的项目。 启动应用程序时,我收到以下消息:
QML debugging is enabled. Only use this in a safe environment.
QML Debugger: Unable to listen to port 34567.
由于这是一个ROS项目,我必须用cmake进行工作。
CMakeLists.txt:
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG ")
set(TEMPLATE_QT_VERSION "5.8.0" CACHE STRING "Qt Version")
set(TEMPLATE_QT_MODULES Core Gui Widgets Quick Qml Concurrent Network DBus PrintSupport)
find_package(Qt5 ${TEMPLATE_QT_VERSION} EXACT CONFIG REQUIRED ${TEMPLATE_QT_MODULES})
main.cpp:
#include <QGuiApplication>
#include <QQmlDebuggingEnabler>
#include "ros/ros.h"
#include "heartbeat/heartbeat.h"
#include <string.h>
#include <iostream>
#include "message_handler/ros2tag.h"
#include <QQmlContext>
#include <QtCore/QDir>
#include <QtQuick/QQuickView>
#include <QtQml/QQmlEngine>
#include <QQmlApplicationEngine>
#include "imageprovider.h"
#include "qmlprox.h"
#include <QtGui/QGuiApplication>
#include <QtCore/QDir>
#include <QQmlEngine>
#include <QList>
#include <QString>
#include "geodataprovider.h"
#include "georeferenceddatalistmodel.h"
#include "georeferenceddatatriplelistmodel.h"
#include "parameterdatalistmodel.h"
#include "parameterdata.h"
#include "beetImageHandler.h"
int main(int argc, char **argv)
{
QGuiApplication app(argc, argv);
QQmlDebuggingEnabler enabler;
//Initialisierung Knoten
ros::init(argc, argv, "hmi");
ros::NodeHandle n;
ROS启动文件:
<launch>
<arg name="externParameters" default="0" />
<group ns="hmi">
<node name="hmi" pkg="hmi" type="hmi" respawn="true" respawn_delay="10" args="-qmljsdebugger=port:34567" />
</group>
</launch>
由于使用ROS启动文件,因此应用程序使用参数“ -qmljsdebugger = port:34567”启动。
任何人都可以给我提示或解决我的问题吗?
提前谢谢