TRint example with Qt

I am trying to run Root from inside Qt.


[code]#include “mainwindow.h”
#include <TROOT.h>
#include <TRint.h>

int main(int argc, char *argv[])

TRint *theApp = new TRint("Rint", &argc, argv);

//how to do sth likethis: theApp->Execute(“cout “hey””,"");

QApplication a(argc, argv);
MainWindow w;;

return a.exec();


The above code runs on Qt, but I cannot find how to pass commands to the TRint.
I want to create TCanvas and hists, but for now even a cout could work.


Don’t call "theApp->Run();"
See also [url= answer[/url], and please, don’t post several times for the same issue…

Cheers, Bertrand.