Hello dear H.-Gerd Rosarius First let me mention Qt-edition is not a part of the official ROOT distribution yet. (It will be released as soon as all ROOT feature including TG classes will be supported. It is coming . . :-) What you did is not correct. You created Qt application. However to use ROOT you should create the ROOT application. To use ROOT you have to create the ROOT application follow ROOT documentation. What you did is a pure "Qt" application. If you want to know how to create ROOT that uses the Qt widgets you should follow the examples provided with the Qt-edition under $ROOTSYS/test/qt and $ROOTSYS/test/qtRootShower directories. My best regards, Valeri > -----Original Message----- > From: owner-roottalk@pcroot.cern.ch [mailto:owner-roottalk@pcroot.cern.ch] > On Behalf Of H.-Gerd Rosarius > Sent: Monday, July 28, 2003 11:05 AM > To: roottalk@pcroot.cern.ch > Subject: [ROOT] TQtWidget problem > > Hello Rooters, > > I am going to build a standalone application for MS Windows > which is able to display Root objects like TCanvas or TH1F. > > If I understood right the Root-GUI-classes (the TG*-Classes) > only work properly under Windows if I use the Root-Interpreter-Mode. > It is not possible to built a "real" windows GUI application > with 'em. (At least that is what I understood from this URL: > http://root.cern.ch/root/roottalk/roottalk02/2324.html > Please correct me if I am wrong) > > Because of that fact I tested the Root-Qt-Edition for my > application. The documentation sais it is possible to embbed > a TCanvas-Object by use of the class TQtWidget that is shipped with > the package. > > However, my application simply crashes at runtime each time TQt-Widget- > Object is reached. My compiler (MS VC6) does not complain about > anything at compile-time. The debugger is no help, too. > Here's the code for a simple application: > > //--- Qt-Root-App ---------------------------------------------- > // Qt-Libraries > #include <qapplication.h> > #include <qmainwindow.h> > > // Root-Qt-Library > #include "TQtWidget.h" > > int main( int argc, char **argv ) > { > QApplication a( argc, argv ); > QMainWindow* mw = new QMainWindow(); > mw->setCaption( "Qt Root Application" ); > a.setMainWidget( mw ); > > // Here it crashes at runtime > TQtWidget wg = new TQtWidget( mw, "Hello" ); > > // Following code not reached > mw->setCentralWidget( &wg ); > mw->resize( 800, 600 ); > mw->show(); > > int exitStatus = a.exec(); > delete mw; > return exitStatus; > } > //--- End ---------------------------------------------- > > Am I doing something completely wrong or is it a bug in TQtWidget? > What about QT-Libs? Using v2.3 for Windows. If that's the problem, > I would expect it at compile-time. > > Is some friendly person out there who is able to help me? > > Thanks a lot > > H.-Gerd Rosarius > > Tech: Using Root 3.05/05 (Qt-Edition) from BNL on a Win 2000 OS and > MSVC6 as compiler.
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:14 MET