Index: /trunk/source/interfaces/History
===================================================================
--- /trunk/source/interfaces/History	(revision 875)
+++ /trunk/source/interfaces/History	(revision 876)
@@ -1,3 +1,3 @@
-$Id: History,v 1.102 2008/10/24 13:23:22 lgarnier Exp $
+$Id: History,v 1.103 2008/11/06 10:06:33 lgarnier Exp $
 -------------------------------------------------------------------
 
@@ -18,4 +18,8 @@
      ----------------------------------------------------------
 
+6 November, Laurent Garnier
+ - G4Qt : Re-fix problem on some linux with QApplication, should be better
+ - G4Qt : Add availabity to launch a G4Qt without a G4UIQt
+
 24 October, Laurent Garnier
  - Change GEANT4_QT_DEBUG flag by QTDEBUG
@@ -25,5 +29,4 @@
  - Fix a problem on some linux with QApplication. But this is NOT the good way to do it...
  - Fix a qt3 backward compatibility on G4UIQt.cc
-
 
 7 October, Laurent Garnier
Index: /trunk/source/interfaces/basic/include/G4UIQt.hh
===================================================================
--- /trunk/source/interfaces/basic/include/G4UIQt.hh	(revision 875)
+++ /trunk/source/interfaces/basic/include/G4UIQt.hh	(revision 876)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4UIQt.hh,v 1.14 2008/10/15 09:09:47 lgarnier Exp $
+// $Id: G4UIQt.hh,v 1.15 2008/11/06 10:06:33 lgarnier Exp $
 // GEANT4 tag $Name:  $
 //
Index: /trunk/source/interfaces/basic/src/G4UIQt.cc
===================================================================
--- /trunk/source/interfaces/basic/src/G4UIQt.cc	(revision 875)
+++ /trunk/source/interfaces/basic/src/G4UIQt.cc	(revision 876)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4UIQt.cc,v 1.21 2008/10/24 13:23:22 lgarnier Exp $
+// $Id: G4UIQt.cc,v 1.22 2008/11/06 10:06:33 lgarnier Exp $
 // GEANT4 tag $Name:  $
 //
Index: /trunk/source/interfaces/basic/src/G4UIXm.cc
===================================================================
--- /trunk/source/interfaces/basic/src/G4UIXm.cc	(revision 875)
+++ /trunk/source/interfaces/basic/src/G4UIXm.cc	(revision 876)
@@ -26,5 +26,5 @@
 //
 // $Id: G4UIXm.cc,v 1.14 2006/06/29 19:09:49 gunter Exp $
-// GEANT4 tag $Name: HEAD $
+// GEANT4 tag $Name:  $
 //
 // G.Barrand
Index: /trunk/source/interfaces/common/include/G4Qt.hh
===================================================================
--- /trunk/source/interfaces/common/include/G4Qt.hh	(revision 875)
+++ /trunk/source/interfaces/common/include/G4Qt.hh	(revision 876)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4Qt.hh,v 1.3 2008/10/15 09:09:47 lgarnier Exp $
+// $Id: G4Qt.hh,v 1.4 2008/11/06 10:06:33 lgarnier Exp $
 // GEANT4 tag $Name:  $
 //
@@ -59,4 +59,6 @@
   G4Qt (int,char**,char*);                     
   static G4Qt* instance; // Pointer to single instance.
+  int    argn;
+  char** args;
 };
 
Index: /trunk/source/interfaces/common/src/G4Qt.cc
===================================================================
--- /trunk/source/interfaces/common/src/G4Qt.cc	(revision 875)
+++ /trunk/source/interfaces/common/src/G4Qt.cc	(revision 876)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4Qt.cc,v 1.10 2008/10/24 13:23:22 lgarnier Exp $
+// $Id: G4Qt.cc,v 1.11 2008/11/06 10:06:33 lgarnier Exp $
 // GEANT4 tag $Name:  $
 //
@@ -77,4 +77,7 @@
 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
 {
+  argn = 0;
+  args = NULL;
+
 #ifdef G4DEBUG
   printf("G4Qt::G4Qt try to inited Qt\n");
@@ -82,69 +85,54 @@
   // Check if Qt already init in another external app
   if(qApp) {
-      QtInited  = TRUE;
-      //#if QT_VERSION < 0x040000
-      //      SetMainInteractor (&qApp);
-      //#else
-      SetMainInteractor (qApp);
-      //#endif
-      SetArguments      (a_argn,a_args);
-
-#ifdef G4DEBUG
-      printf("G4Qt::G4Qt alredy inited in external \n");
+    QtInited  = TRUE;
+    //#if QT_VERSION < 0x040000
+    //      SetMainInteractor (&qApp);
+    //#else
+    SetMainInteractor (qApp);
+    //#endif
+    SetArguments      (a_argn,a_args);
+    
+#ifdef G4DEBUG
+    printf("G4Qt::G4Qt alredy inited in external \n");
 #endif
   } else {
-
+    
     if(QtInited==FALSE) {  //Qt should be Inited once !
       // Then two cases :
       // - It is the first time we create G4UI  (argc!=0)
       //   -> Inited and register
-      // - It is the first time we create G4VIS  (arc == 0)
+      // - It is the first time we create G4VIS  (argc == 0)
       //   -> Inited and NOT register
-
-      int argc;
-      char ** test;
+      
       if (a_argn != 0) {
-        SetArguments      (a_argn,a_args);
-#ifdef G4DEBUG
-      printf("G4Qt::G4Qt inited, first time creating UI \n");
-#endif
+        argn = a_argn;
+        args = a_args;
+
       } else { //argc = 0
-        test = GetArguments(&argc);
-
-#ifdef G4DEBUG
-
-        printf("G4Qt::G4Qt inited, create new QtVis\n");
-        printf("G4Qt::G4Qt arguments avant %s\n",a_args[0]);
-        printf("G4Qt::G4Qt arguments avant %s\n",a_args[1]);
-        printf("G4Qt::G4Qt arguments avant %s\n",a_args[2]);
-        printf("G4Qt::G4Qt arguments avant %s\n",a_args[3]);
-        printf("G4Qt::G4Qt arguments apres %d\n",argc);
-        printf("G4Qt::G4Qt arguments apres %s \n",test[0]);
-        printf("G4Qt::G4Qt arguments apres %s \n",test[1]);
-        printf("G4Qt::G4Qt arguments apres %s \n",test[2]);
-        printf("G4Qt::G4Qt arguments apres %s \n",test[3]);
-#endif
-        if (argc == 0) {
-          G4cout        << "G4Qt : Unable to init Qt." << G4endl;
-          return;
-        }
+
+        // FIXME : That's not the good arguments, but I don't know how to get args from other Interactor.
+        // Ex: How to get them from G4Xt ?
+        argn = 1;
+        args = (char **)malloc( 1 * sizeof(char *) );
+        args[0] = (char *)malloc(10 * sizeof(char));
+        strncpy(args[0], "my_app \0", 9);
       }
+
+      int *p_argn = (int*)malloc(sizeof(int));
+      *p_argn = argn;
 #if QT_VERSION < 0x040000
-      qApp = new QApplication (a_argn, a_args);
-      //    QApplication qApp(a_argn, a_args);
-      //    if(&qApp == NULL) {
+      qApp = new QApplication (argn, args);
 #else
-      new QApplication (a_argn, a_args);
-#endif
-      
+      new QApplication (argn, args);
+#endif
       if(!qApp) {
         
         G4cout        << "G4Qt : Unable to init Qt." << G4endl;
       } else {
+        QtInited  = TRUE;
         if (a_argn != 0) {
           SetMainInteractor (qApp);
-          SetArguments      (a_argn,a_args);
         }
-        QtInited  = TRUE;
+        SetArguments      (a_argn,a_args);
 #ifdef G4DEBUG
         printf("G4Qt::G4Qt inited Qt END\n");
Index: /trunk/source/interfaces/common/src/G4Xt.cc
===================================================================
--- /trunk/source/interfaces/common/src/G4Xt.cc	(revision 875)
+++ /trunk/source/interfaces/common/src/G4Xt.cc	(revision 876)
@@ -26,5 +26,5 @@
 //
 // $Id: G4Xt.cc,v 1.11 2006/06/29 19:10:28 gunter Exp $
-// GEANT4 tag $Name: HEAD $
+// GEANT4 tag $Name:  $
 //
 // G.Barrand
