Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. connecting cpp to qml
Forum Updated to NodeBB v4.3 + New Features

connecting cpp to qml

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 178 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ragul kumar
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by
      #2

      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 a QString. It's neither a list (as the name wrongfully suggests), nor a QVariant.

      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?
      Is Connection_Handler a slot, a Q_INVOKABLE, or the getter of a Q_PROPERTY?
      Have you actually tried to access it from QML?

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved