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. Markers - from C++ to QML
QtWS25 Last Chance

Markers - from C++ to QML

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 248 Views
  • 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.
  • S Offline
    S Offline
    Sajjad Ali
    wrote on last edited by
    #1

    Hello,
    I have a data Model in C++ that is connected to a line chart in QML.
    The chart shows line coming from C++.

    Now I want to add markers in chart that are moveable.
    I want to

    • add
    • delete
    • move them

    How can I get this thing done? I have no idea at all. Please suggest me related links, examples and if possible a description of how the solution may look like.
    Thanks

    B 1 Reply Last reply
    0
    • S Sajjad Ali

      Hello,
      I have a data Model in C++ that is connected to a line chart in QML.
      The chart shows line coming from C++.

      Now I want to add markers in chart that are moveable.
      I want to

      • add
      • delete
      • move them

      How can I get this thing done? I have no idea at all. Please suggest me related links, examples and if possible a description of how the solution may look like.
      Thanks

      B Offline
      B Offline
      Bob64
      wrote on last edited by
      #2

      @Sajjad-Ali the Charts module does not allow for a huge amount of customised behaviour, so unless your use case is explicitly supported by the built-in facilities, it is unlikely you will be able to do this by using Charts directly.

      What you can do is to overlay something on your chart area and implement whatever functionality you need.

      There is an example here where someone wanted some more sophisticated markers than is supported by Charts. The solution in this case was to overlay a Canvas, but perhaps an Item with your marker items laid out within it might work for you.

      The main complication would be in syncing the marker positions with the chart content. Let's say you want to have a label associated with a particular point of a line series. Then you would have to do some work to map that point to the coordinates of the rectangle containing your chart and transfer that to your overlay. If your chart is dynamically updateable, zoomable, etc., this would have to be accounted for.

      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