Skip to content

Class PositioningDeviceModel

ClassList > PositioningDeviceModel

Inherits the following classes: QAbstractListModel

Classes

Type Name
struct Device

Public Types

Type Name
enum Role
enum Type

Public Functions

Type Name
PositioningDeviceModel (QObject * parent=nullptr)
Q_INVOKABLE int addDevice (const Type & type, const QString & name, const QVariantMap & deviceSettings)
QVariant data (const QModelIndex & index, int role) override const
Q_INVOKABLE const QString deviceId (const Device & device) const
Q_INVOKABLE int findIndexFromDeviceId (const QString & id)
Q_INVOKABLE void reloadModel ()
Q_INVOKABLE void removeDevice (const QString & name)
QHash< int, QByteArray > roleNames () override const
int rowCount (const QModelIndex & parent) override const

Public Types Documentation

enum Role

enum PositioningDeviceModel::Role {
    DeviceType = Qt::UserRole,
    DeviceId,
    DeviceName,
    DeviceSettings
};

enum Type

enum PositioningDeviceModel::Type {
    InternalDevice,
    BluetoothDevice,
    TcpDevice,
    UdpDevice,
    EgenioussDevice,
    SerialPortDevice,
    FileDevice
};

Public Functions Documentation

function PositioningDeviceModel

explicit PositioningDeviceModel::PositioningDeviceModel (
    QObject * parent=nullptr
) 

function addDevice

Q_INVOKABLE int PositioningDeviceModel::addDevice (
    const Type & type,
    const QString & name,
    const QVariantMap & deviceSettings
) 

Adds a positioning device to the user settings

Parameters:

  • type device type
  • name friendly device name used as identifier in the user interface
  • deviceSettings settings map (used to generate the positioning device ID, editing, etc.)

Returns:

returns index of the added device


function data

QVariant PositioningDeviceModel::data (
    const QModelIndex & index,
    int role
) override const

function deviceId

Q_INVOKABLE const QString PositioningDeviceModel::deviceId (
    const Device & device
) const

Returns the device ID string for a specific device

Note:

this is the string to be used with the Positioning deviceId property


function findIndexFromDeviceId

Q_INVOKABLE int PositioningDeviceModel::findIndexFromDeviceId (
    const QString & id
) 

Returns the row index for a given device ID


function reloadModel

Q_INVOKABLE void PositioningDeviceModel::reloadModel () 

Reloads the model from the user settings


function removeDevice

Q_INVOKABLE void PositioningDeviceModel::removeDevice (
    const QString & name
) 

Removes the positioning device name from the user settings


function roleNames

QHash< int, QByteArray > PositioningDeviceModel::roleNames () override const

function rowCount

int PositioningDeviceModel::rowCount (
    const QModelIndex & parent
) override const


The documentation for this class was generated from the following file src/core/positioning/positioningdevicemodel.h