connecting cpp to qml
-
void Connection_Handler::deviceDiscovered(const QBluetoothDeviceInfo &device)
{
deviceList = device.name();
qDebug() << "Device Name:" << deviceList;
}In this function I'm getting all the bluetooth devices discovered, the deviceList is a type of qvariant
how to show it in qml list view I don't know about that. Please help me with the connection. -
Please format your code, using the code formatting tags.
In this function I'm getting all the bluetooth devices discovered
No. You get the name of the device, the info of which has been passed as the
device
argument.the deviceList is a type of qvariant
No.
deviceList
is aQString
. It's neither a list (as the name wrongfully suggests), nor aQVariant
.how to show it in qml list view I don't know about that. Please help me with the connection.
A connection from what to what?
IsConnection_Handler
a slot, aQ_INVOKABLE
, or the getter of aQ_PROPERTY
?
Have you actually tried to access it from QML?