15 February 2022
Wow I just had a bit of a brainfart moment and almost banned @pysidebot from this Telegram group for spam
@insertaliashere I recommend you not to use context properties, in case you are already on pyside6 you can check the few examples we have that use QmlElement or setInitialProperty https://doc.qt.io/qtforpython/examples/example_declarative__objectlistmodel.html
context properties are considered a bad practice in QML
Sr. Sdoes anybody know how are Series stored in ChartView object tree? I'm trying to find the LineSeries defined inside PolarChartView (qt creator), but I cannot find it. I've checked properties, QGrapchisScene, Margins and Material, but is not there. However, in properties "axes" are present.
I don't think you can access it via a property right now.
There should be an accessor method that will return you all QAbstractSeries'. I guess in Python the type doesn't matter, so what is returned should be the line series.
Sr. SI tried that, but I can't access the series due to RuntimeError: Can't find converter for 'DeclarativeLineSeries*', I'm looking the doc but I don't know if I can cast it myself instead of using QObject, i read about qobject_cast, but I can't find it in pyside
https://gist.github.com/keithel/e0b47eaedeecfa2bab77756842bbed79
This is with a Pie series. I expect LineSeries will be similar
Sr. SThank you very much, sir
I'm not sure how your way was going wrong — how were you trying to access it?
Keith Kyzivathttps://gist.github.com/keithel/e0b47eaedeecfa2bab77756842bbed79
This is with a Pie series. I expect LineSeries will be similar
but you aren't exposing the QML to python, no? You accessed it directly from qml
Sr. Sbut you aren't exposing the QML to python, no? You accessed it directly from qml
Ahh yes.. This is all done in QML.
Let me see if I can alter the example and expose the series' to Python.
Sr. Sbut you aren't exposing the QML to python, no? You accessed it directly from qml
Ok - have a look at it now:
https://gist.github.com/keithel/e0b47eaedeecfa2bab77756842bbed79
It's a bit convoluted (there are better ways to achieve this), but I think it illustrates what you're trying to do.
Keith KyzivatOk - have a look at it now:
https://gist.github.com/keithel/e0b47eaedeecfa2bab77756842bbed79
It's a bit convoluted (there are better ways to achieve this), but I think it illustrates what you're trying to do.
thank you very much, there are lot of elements that didn't know what they do, but I understand with your example. I didn't know you could create a python class element in QML.