-
Notifications
You must be signed in to change notification settings - Fork 3
Change QGuiApplication to QApplication. Because we use QtCharts. #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
AndrewSazonov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should still discuss this, but I think the more sustainable direction is to migrate from QtCharts to QtGraphs. QtGraphs looks like the newer, better-performing QML alternative, and this would also let us avoid mixing QML with QWidget-based components, so we can keep using QGuiApplication.
By the way, are you already using QtGraphs in EasyImaging?
Indeed, but as far as I remember, we can't upgrade to QtGraphs yet due to it lacking functionality such as logarithmic axes. And you can still use QtGraphs in a QApplication. So until we upgrade to QtGraphs, we should be using QApplication rather than QGuiApplication (the latter doesn't even work when trying to extend the templates using code from EasyReflectometry or EasyDiffraction). In EasyImaging I am using QtGraphs and hence QGuiApplication because I don't need logarithmic axes, but for this reason I also can't re-use most of the code from EasyReflectometry or EasyDiffraction. |
|
From what I see in the QtGraphs migration guide (https://doc.qt.io/qt-6/qtgraphs-migration-guide-2d.html), the two main missing features for us are:
Log scaling isn’t currently used in diffraction, while legends are. But given the performance improvements and the richer set of replace methods in QtGraphs, I’m planning to switch EasyDiffraction to QtGraphs once I return to app development. I also expect that QtGraphs will eventually gain missing features. This makes the migration more technique-dependent and not something we need to force across all EasyScience apps at once. EasyApp itself is just a collection of reusable UI components. It currently includes "templates" for both QtCharts and Plotly. I’ll add QtGraphs components too, so each project can choose what fits best. So I think the EasyApp examples should remain QGuiApplication-based by default. If needed, we can add an additional example demonstrating QtCharts explicitly (which would document the need for QApplication). I’m also in the process of updating the AdvancedPy example to include a simple QtGraphs plot. And just to clarify, when you said
was the limitation specifically related to QtCharts requiring QApplication, or were there other components that didn’t function under QGuiApplication as well? |
|
6.10 is apparently still missing both, so more wait |
Hmm, as far as I remember, the only issue I ran into was with QtCharts, but I also did not test the full scope of EasyDiffraction or EasyReflectometry, I simply tried to copy over the plots to have a starting point to work from. |
No description provided.