Hi everybody,
I’m asking for help because I’m writing an acquisition program that controls some digitizers, and I need to show and update a couple of histograms while the data keeps coming. The problem is that I can not have a reliable update of the histograms, they are all stacked and trasparent (N histos for N seconds, all visible) or they have a black background that hides axes.
The problem is similar as the one discussed here Test other language but the workaround described there doesn’t work anymore.
I tested the problem on two systems: Ubuntu 12.04, Qt4, root 5.34.14, and Ubuntu 13.10, Qt4, root 5.34.14. As you can see from the discussion linked above, the problem was present also in root 5.30 and probably 5.32.
I’m attaching a small working example of my interface. The makefile is the same as generated by qmake, with the only addition of root-config --glibs and root-config --cflags.
Some more details: without the workaround described in the other topic, I can not clear the canvas and the histos are superimposed, as you can see with the attachments. With the workaround (SetFillStyle and SetFillColor) everything works for TH1F but the first histo drawn after a TH2F has a black background. I mean, if I draw TH1F, then TH2F, then TH1F again, the last TH1F has a black background. If I draw TH1F, TH1F, TH2F, TH2F, TH1F, the second TH2F and the last TH1F will be black, and so on. I couldn’t find any way to remove this black, except for drawing one fake TH1F after each TH2F (sounds crazy, I know).
What I’m looking for is either an affordable way to clear the canvas (Erase, Clean, Update, GetPad(0)->Modified() do not work!) or a workaround that do not cause black backgrounds.
What is the correct sequence of declaring a TQtWidget, cleaning the canvas and updating a histo?
Any help would be REALLY appreciated!
PS: I googled a lot on the subject and I played with SetFillStyle, SetFillColor, Update, Modified, in several combinations. Sometimes I was simply shooting in the dark, I admit… but with no results.
testGUI.zip (3.75 KB)