Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Bind value to dynamic Chartview series name

Bind value to dynamic Chartview series name

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 302 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.
  • G Offline
    G Offline
    Gogoalshop
    wrote on last edited by
    #1

    HI all,

    I am creating chart series in loop as follows:

    chart.createSeries(ChartView.SeriesTypeLine, collection.aliases[i], axisX, axisY);
    But unlike

    LineSeries{
    name: collection.aliases[i]
    }
    dynamically created serie will not bind series.name to collection.aliases[i]
    I've tried to use Qt.binding(), but it won't save the context even in nested function and all series get same name when binding is triggered. Clojure is able to save the context, but there is an extra function inside it (I mean Qt.binding(function))
    My question is:
    Is there a way to dynamically create Binding via Qt.createObject or maybe there is a more elegant way to bind dynamically created serie?

    Thanks ahead!!!

    J.HilkJ 1 Reply Last reply
    0
    • G Gogoalshop

      HI all,

      I am creating chart series in loop as follows:

      chart.createSeries(ChartView.SeriesTypeLine, collection.aliases[i], axisX, axisY);
      But unlike

      LineSeries{
      name: collection.aliases[i]
      }
      dynamically created serie will not bind series.name to collection.aliases[i]
      I've tried to use Qt.binding(), but it won't save the context even in nested function and all series get same name when binding is triggered. Clojure is able to save the context, but there is an extra function inside it (I mean Qt.binding(function))
      My question is:
      Is there a way to dynamically create Binding via Qt.createObject or maybe there is a more elegant way to bind dynamically created serie?

      Thanks ahead!!!

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      hi @Gogoalshop and welcome

      this should work as you expect it

      can you show more of your class/file is i known to the LineSeries object?


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      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