# Qt Charts with ignition gui plugin

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hello every one :D i had a problem with running Qt Charts on a ignition gui plugin, i mentioned it in a previous question https://answers.gazebosim.org/questio...

but now i found out that it is a common issue in Qt Charts itself, it dose not run with QGuiApplication and requires QApplication and ignition gui uses the QGuiApplication, but i tried to modify it and replace it with QApplication and it worked

....................................................

but of course it might be an invalid solution, as i don't know how it will affect the other parts of the ignition gui so , is there is any other ideas can i do to run qt charts components on QApplication without affecting the other parts of the applicaton ?

## Update

ok, I modified the Application.hh & Application.cc and replaced the QGuiApplication with QApplication and modified the CMakeLists files (QApplication requires the Qt5Widgets library).

it seems to be good, the test cases are fine, i tested the ign-gui & ign-gazebo and this is the results 100% success in ign-gui , 97% success in ign-gazebo (this is the same percentage for me before the modifying)

it tested on version 3 of both of them, ign-gazebo3 & ign-gui3

edit retag close merge delete

( 2020-03-28 11:09:50 -0600 )edit

That sounds great, thank you for testing all that! Unfortunately, that change would break ABI, so we can't add it to Blueprint (ign-gui2) or Citadel (ign-gui3). So you're welcome to open a PR against the next Ignition version, Dome, which is currently the default branch of ign-gui 👍 Thanks!

( 2020-03-28 11:11:45 -0600 )edit

Sort by » oldest newest most voted

Nice! Glad to see you found a workaround!

You're right that QtCharts needs QApplication, I hadn't realized that. I see 2 options:

1. Change ign-gui to use QApplication and test all ign-gazebo plugins to verify things still work. This change breaks ABI and would need to go into the upcoming Ignition release, Dome.
2. If the above doesn't work, we won't be able to use QtCharts and will need to look for another approach.
more