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. QML Bar Chart with live-updating data from C++
Forum Updated to NodeBB v4.3 + New Features

QML Bar Chart with live-updating data from C++

Scheduled Pinned Locked Moved QML and Qt Quick
chartqmlc++
2 Posts 2 Posters 1.5k Views 2 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.
  • H Offline
    H Offline
    Hedge
    wrote on last edited by
    #1

    I want to visualize data coming from an Arduino in a Bar Chart and am scratching my head on how to get any data from C++ into the bar chart.

    Is there an easy example somewhere? All I could find were outdated or overly complicated.

    p3c0P 1 Reply Last reply
    0
    • H Hedge

      I want to visualize data coming from an Arduino in a Bar Chart and am scratching my head on how to get any data from C++ into the bar chart.

      Is there an easy example somewhere? All I could find were outdated or overly complicated.

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi @Hedge,
      You have following ways to do it:

      • Defining QML Types from C++
        In short create a QObject derived class and register it using qmlRegisterType so that it is available in QML.
      • Exposing Attributes of C++ Types to QML
        Create a QObject derived class , add some public slots or Q_INVOKABLE functions and make these available by setting that class as a contextProperty.

      In both the cases it will be good idea to provide some properties defined as Q_PROPERTY with their respective signals so that QML gets notified on changes in the values of these properties from C++.

      157

      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