Dear QtROOT experts,
I’ve been spending the last days to set up a new GUI project based in Qt and QtROOT. After a lot of struggles finally everything seems to be fine, except one last technical thing:
To have one common build system for the rather large project I am using cmake (the GUI is set up using designer, the .ui XML files are converted by a cmake plugin into classes and inherited for the actual implementation). I have installed the BNL QtROOT extensions since I never got the built-in QtLayer stuff to work correctly (context menus never worked, for example).
I can compile everything and I get a nice UI containing a TQtWidget. However, I cannot draw anything in the canvas, nor can I change its properties (e.g. SetBorderMode()):
TestQtGUI::TestQtGUI(QWidget* parent)
: QMainWindow(parent)
{
TCanvas* canv = fTQtWidget->GetCanvas();
canv->cd();
canv->Update();
TH1D* hist = new TH1D("bla","blub",100,0,10);
hist->Draw();
canv->Update();
canv->SetBorderMode(0);
canv->Update();
canv->Dump();
}
The calls are simply ignored, except for the Dump() though - I can see the text output. Clicking the Widget and setting e.g. the BorderMode manually works as well. Please excuse the abundance of Update() calls, they are there just in case
If I take the code just for the TQtWidget and compile it with qmake (like in chapter 26 of the ROOT documentation) including the rootcint.pri everything works.
Somehow I seem to get a wrong pointer to the canvas… Or could this be some nasty dictionary thing? Am I overlooking something extremely trivial? Is some elementary call missing?
Thanks in advance for the support