[ROOT] TQtWidget problem - correction in code example

From: H.-Gerd Rosarius (rosarius@getit.de)
Date: Mon Jul 28 2003 - 17:10:27 MEST


There have been some mistakes in the code I sent in my first
message. Here the correct version:

//--- 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 ----------------------------------------------

H.-Gerd



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:14 MET