Hi fellow Rooters,
In my Root-based Qt application I use a TQtWidget in a Qt popup window. It uses a class with two pointers,
[code]class frmroot : public QWidget {
public:
frmroot(QWidget *parent = 0, const char *name = 0, WFlags fl = 0);
~frmroot();
TQtWidget *rootwidget;
TCanvas *rootcanvas;
protected:
QHBoxLayout *layout;
private:
int h,v; // window size in pixels
int qrecth0,qrectv0; // origin for setGeometry(QRect()) on TQtWidget
// etc…
[/code]
In this class’ constructor I’m doing:
[code]frmroot::frmroot(QWidget *parent, const char *name, WFlags fl)
: QWidget(parent, name, fl)
{
this->h=600; this->v=480;
this->qrecth0=0; this->qrectv0=0;
if(!name) setName(“frmroot”);
layout = new QHBoxLayout(this, 0,0, "layout");
resize(QSize(this->h,this->v).expandedTo(minimumSizeHint()));
// Set resource variable to prevent QtROOT from crashing
gEnv->SetValue("ktidbexplorer.Gui.Backend","qt");
gStyle->SetPalette(1);
rootwidget = new TQtWidget(this,"rootwidget");
rootwidget->cd();
rootcanvas = rootwidget->GetCanvas();
layout->addWidget(rootwidget);
clearWState( WState_Polished );
[/code]
It works well, in the sense that after constructing one such object and invoking a histogram Draw(), it shows it. But I’d like to use TCanvas’ “default” menubar (the one showing up when creating a new TCanvas). I’ve just started looking at guitest.C for hints but didn’t get too far (other than having to create a menubar from scratch, which I’m still struggling).
So: how can I use TCanvas’ menu bar in my TQtWidget?
Thanks in advance for your help!