Qt Positioning Serial NMEA plugin

概述

Included with Qt Location is a position plugin which parses NMEA sentences streamed over a serial port into position updates.

This plugin can be loaded by using the provider name serialnmea .

参数

The following table lists parameters that can be passed to the serialnmea plugin.

参数 描述
serialnmea.serial_port The serial port where the NMEA stream is coming.

参数用法范例

The following examples show how to create a serialnmea PositionSource listening on a specific serial port

QML

PositionSource {
    name: "serialnmea"
    PluginParameter { name: "serialnmea.serial_port"; value: "tnt1" }
}
					
					

C++

QVariantMap params;
params["serialnmea.serial_port"] = "tnt1";
QGeoPositionInfoSource *positionSource = QGeoPositionInfoSource::createSource("serialnmea", params, this);