Ignore:
Timestamp:
Oct 30, 2008, 5:48:40 PM (16 years ago)
Author:
garnier
Message:

update to G4 DEBUG official messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/interfaces/common/src/G4Qt.cc

    r867 r874  
    2525//
    2626//
    27 // $Id: G4Qt.cc,v 1.9 2008/10/15 09:09:47 lgarnier Exp $
     27// $Id: G4Qt.cc,v 1.10 2008/10/24 13:23:22 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    5656/***************************************************************************/
    5757G4Qt* G4Qt::getInstance (
    58  int*    a_argn
     58 int    a_argn
    5959,char** a_args
    6060,char*  a_class
     
    7070/***************************************************************************/
    7171G4Qt::G4Qt (
    72  int*    a_argn
     72 int    a_argn
    7373,char** a_args
    7474,char*  a_class
     
    7777/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    7878{
    79 #ifdef GEANT4_QT_DEBUG
     79#ifdef G4DEBUG
    8080  printf("G4Qt::G4Qt try to inited Qt\n");
    8181#endif
     
    8888      SetMainInteractor (qApp);
    8989      //#endif
    90       SetArguments      (*a_argn,a_args);
    91 #ifdef GEANT4_QT_DEBUG
     90      SetArguments      (a_argn,a_args);
     91
     92#ifdef G4DEBUG
    9293      printf("G4Qt::G4Qt alredy inited in external \n");
    9394#endif
     
    9596
    9697    if(QtInited==FALSE) {  //Qt should be Inited once !
    97 #ifdef GEANT4_QT_DEBUG
    98       printf("G4Qt::G4Qt inited Qt\n");
    99 #endif
     98      // Then two cases :
     99      // - It is the first time we create G4UI  (argc!=0)
     100      //   -> Inited and register
     101      // - It is the first time we create G4VIS  (arc == 0)
     102      //   -> Inited and NOT register
     103
     104      int argc;
     105      char ** test;
     106      if (a_argn != 0) {
     107        SetArguments      (a_argn,a_args);
     108#ifdef G4DEBUG
     109      printf("G4Qt::G4Qt inited, first time creating UI \n");
     110#endif
     111      } else { //argc = 0
     112        test = GetArguments(&argc);
     113
     114#ifdef G4DEBUG
     115
     116        printf("G4Qt::G4Qt inited, create new QtVis\n");
     117        printf("G4Qt::G4Qt arguments avant %s\n",a_args[0]);
     118        printf("G4Qt::G4Qt arguments avant %s\n",a_args[1]);
     119        printf("G4Qt::G4Qt arguments avant %s\n",a_args[2]);
     120        printf("G4Qt::G4Qt arguments avant %s\n",a_args[3]);
     121        printf("G4Qt::G4Qt arguments apres %d\n",argc);
     122        printf("G4Qt::G4Qt arguments apres %s \n",test[0]);
     123        printf("G4Qt::G4Qt arguments apres %s \n",test[1]);
     124        printf("G4Qt::G4Qt arguments apres %s \n",test[2]);
     125        printf("G4Qt::G4Qt arguments apres %s \n",test[3]);
     126#endif
     127        if (argc == 0) {
     128          G4cout        << "G4Qt : Unable to init Qt." << G4endl;
     129          return;
     130        }
     131      }
    100132#if QT_VERSION < 0x040000
    101       qApp = new QApplication (*a_argn, a_args);
     133      qApp = new QApplication (a_argn, a_args);
    102134      //    QApplication qApp(a_argn, a_args);
    103135      //    if(&qApp == NULL) {
    104136#else
    105       new QApplication (*a_argn, a_args);
    106 #endif
     137      new QApplication (a_argn, a_args);
     138#endif
     139     
    107140      if(!qApp) {
    108141       
    109142        G4cout        << "G4Qt : Unable to init Qt." << G4endl;
    110143      } else {
     144        if (a_argn != 0) {
     145          SetMainInteractor (qApp);
     146          SetArguments      (a_argn,a_args);
     147        }
    111148        QtInited  = TRUE;
    112         //#if QT_VERSION < 0x040000
    113         //      SetMainInteractor (&qApp);
    114         //#else
    115         SetMainInteractor (qApp);
    116         //#endif
    117         SetArguments      (*a_argn,a_args);
    118 #ifdef GEANT4_QT_DEBUG
     149#ifdef G4DEBUG
    119150        printf("G4Qt::G4Qt inited Qt END\n");
    120151#endif
     
    122153    }
    123154  }
    124 #ifdef GEANT4_QT_DEBUG
     155#ifdef G4DEBUG
    125156  if (qApp) {
    126157    printf("G4Qt::qApp exist\n");
Note: See TracChangeset for help on using the changeset viewer.