Plotting TCanvas in Qt5

Hello,

I have a simple question: How do I plot a TCanvas inside a Qt5 program?

I have searched this forum and ROOT docs and found that Qt5 was not supported and TQtWidget from QtRoot is the only way to do it. But then I found a year old ticket in the ROOT JIRA, where QtRoot was marked deprecated (and not maintained) and the reporter was suggested to use TVirtualX. These pieces of information confuse me.

With that in mind, I ask explicitly: Can anybody say with certainty whether Qt is supported by ROOT at the moment, and what is the preferred way for me to simply plot a TH1F inside an embedded widget?

Thanks in advance,
Petr

Hi,

If not on Mac OS X, you can simply embed your TCanvas inside your Qt application (any version), without need of any QtRoot or QtGSI, as described here

Cheers, Bertrand.

1 Like

See also this very simple example: simple_canvas.tar.gz (2.9 KB)

3 Likes

Thanks for a quick response!

The simple_canvas example works for me. Saved me a ton of time.

Cheers, Petr

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.