-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
6.9.2
-
None
-
Windows 11
Hello Qt Team,
I am a Python developer transitioning from the Qt Widgets framework to Qt Quick, and I am currently exploring the best way to implement advanced charting features in my new projects.
In my previous work with Qt Widgets, I successfully used the pyqtgraph library to create highly interactive and custom plots, including financial charts like candlestick graphs. The performance and flexibility of pyqtgraph met my needs well.
Now, for my Qt Quick application, I am very interested in using the Qt Graphs module due to its native integration and potential performance benefits. My core requirements are:
- To render stock-style candlestick charts.
- To create other, more flexible custom visualizations.
- To ensure all charts are highly interactive, supporting features like hover events on data points, click actions, and so on.
For maximum flexibility and to handle other custom plotting needs, I am exploring the most robust and recommended development patterns.
I have considered two primary approaches and would greatly appreciate your guidance on them:
- Creating a Custom Series by Subclassing AbstractSeries:
My first thought is to create a new series type by inheriting from AbstractSeries (QML type). This seems like a powerful way to integrate deeply with the Qt Graphs module, but I am unsure of the complexity involved, especially when integrating with a Python application environment.
- Embedding a Custom QQuickItem within a GraphsView:
My second idea is to leverage the rendering capabilities of a custom QQuickItem. This approach seems to offer maximum rendering flexibility, but I foresee challenges in correctly mapping my item's coordinates to the chart's axes and ensuring seamless interaction with the rest of the GraphsView (like responding to zoom/pan events).
Given this context, I would like to ask for your advice:
- For creating highly interactive and custom-styled financial charts in a Qt Quick (and Python) environment, what is the officially recommended approach?
- Between the two approaches I've outlined—subclassing AbstractSeries vs. creating a custom QQuickItem—what are the primary trade-offs regarding performance, implementation complexity, and ease of integration?
- Is there another, more effective method that I might have overlooked?
Thank you for your time and for the excellent work you do on the Qt framework. Any advice or examples you can provide would be immensely helpful.