Index: /trunk/geant4/interfaces/basic/src/G4UIQt.cc
===================================================================
--- /trunk/geant4/interfaces/basic/src/G4UIQt.cc	(revision 495)
+++ /trunk/geant4/interfaces/basic/src/G4UIQt.cc	(revision 496)
@@ -56,4 +56,6 @@
 #include <QtGui/qlabel.h>
 #include <QtGui/qsplitter.h>
+#include <QtGui/qlistview.h> // en test
+#include <QtGui/qtreeview.h> // en test
 
 #include <stdlib.h>
@@ -93,49 +95,87 @@
 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
 {
+  G4Qt* interactorManager = G4Qt::getInstance ();
   G4UImanager* UI = G4UImanager::GetUIpointer(); // TO KEEP
   if(UI!=NULL) UI->SetSession(this); // TO KEEP
 
-  G4Qt* interactorManager = G4Qt::getInstance (argc,argv,(char*)"Qt");  // TO KEEP ?
-
   fMainWindow = new QMainWindow();
   fMainWindow->setWindowTitle( "G4UI Session" ); 
-  fMainWindow->resize(600,400);
+
   QWidget* central = new QWidget();
-  QWidget* topWidget = new QWidget();
-  QWidget* bottomWidget = new QWidget();
-  QVBoxLayout* vBox1 = new QVBoxLayout();
-  QVBoxLayout* vBox2 = new QVBoxLayout();
-
-  QSplitter *splitter = new QSplitter(Qt::Vertical, central);
-  fTextArea = new QTextEdit();
-  fCommandHistoryArea = new QTextEdit();
-  fCommandLabel = new QLabel();
-
+
+  /*
+    QSplitter *splitter = new QSplitter(Qt::Vertical,central);
+    splitter->setMaximumSize(800,800); 
+    QListView *listview = new QListView;
+    listview->setMaximumSize(800,800); 
+    QTreeView *treeview = new QTreeView;
+    treeview->setMaximumSize(800,800); 
+  */
+  QTextEdit *textedit = new QTextEdit;
+  //  textedit->setMaximumSize(800,800); 
   QPushButton *clearButton = new QPushButton("clear");
-  connect(clearButton, SIGNAL(clicked()), SLOT(clearButtonCallback()));
-
-  fTextArea->setReadOnly(true);
-  fCommandHistoryArea->setReadOnly(true);
-
-//  QMenu *menuFile = new QMenu("File");
-//  fMainWindow->menuBar()->addMenu(menuFile); 
-
-  fCommandArea = new QLineEdit();
-  connect(fCommandArea, SIGNAL(returnPressed()), SLOT(commandEnteredCallback()));
-
-  vBox1->addWidget(fTextArea);
-  vBox1->addWidget(clearButton);
-
-  vBox2->addWidget(fCommandHistoryArea);
-  vBox2->addWidget(fCommandLabel);
-  vBox2->addWidget(fCommandArea);
-
-  topWidget->setLayout(vBox1);
-  bottomWidget->setLayout(vBox2);
-
-  splitter->addWidget(topWidget);
-  splitter->addWidget(bottomWidget);
-
+  
+  QVBoxLayout *layout = new QVBoxLayout;
+  layout->addWidget(textedit);
+  layout->addWidget(clearButton);
+  central->setLayout(layout);
+  /*
+    QSizePolicy *test = new QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
+    if (splitter->sizePolicy().horizontalPolicy () == test->horizontalPolicy () ) {
+    printf ("splitter H is fixed\n");
+    }
+    
+    printf("list SP H: %d\n",listview->sizePolicy().horizontalPolicy ());
+    printf("list SP V: %d\n",listview->sizePolicy().verticalPolicy ());
+    printf("tree SP H: %d\n",treeview->sizePolicy().horizontalPolicy ());
+    printf("tree SP V: %d\n",treeview->sizePolicy().verticalPolicy ());
+    printf("text SP H: %d\n",textedit->sizePolicy().horizontalPolicy ());
+    printf("text SP V: %d\n",textedit->sizePolicy().verticalPolicy ());
+    
+    splitter->addWidget(listview);
+    splitter->addWidget(treeview);
+    splitter->addWidget(textedit);
+  */
   fMainWindow->setCentralWidget(central);
+
+  //////////////
+//  fMainWindow->resize(600,400);
+//   QWidget* central = new QWidget();
+//   QWidget* topWidget = new QWidget();
+//   QWidget* bottomWidget = new QWidget();
+//   QVBoxLayout* vBox1 = new QVBoxLayout(topWidget);
+//   QVBoxLayout* vBox2 = new QVBoxLayout(bottomWidget);
+
+//   QSplitter *splitter = new QSplitter(Qt::Vertical);
+//   fTextArea = new QTextEdit();
+//   fCommandHistoryArea = new QTextEdit();
+//   fCommandLabel = new QLabel();
+
+//   QPushButton *clearButton = new QPushButton("clear");
+//   connect(clearButton, SIGNAL(clicked()), SLOT(clearButtonCallback()));
+
+//   fTextArea->setReadOnly(true);
+//   fCommandHistoryArea->setReadOnly(true);
+
+// //  QMenu *menuFile = new QMenu("File");
+// //  fMainWindow->menuBar()->addMenu(menuFile); 
+
+//   fCommandArea = new QLineEdit();
+//   connect(fCommandArea, SIGNAL(returnPressed()), SLOT(commandEnteredCallback()));
+
+//   vBox1->addWidget(fTextArea);
+//   vBox1->addWidget(clearButton);
+//   vBox1->setStretchFactor(fTextArea,1);
+
+//   vBox2->addWidget(fCommandHistoryArea);
+//   vBox2->addWidget(fCommandLabel);
+//   vBox2->addWidget(fCommandArea);
+//   vBox2->setStretchFactor(fCommandHistoryArea,1);
+
+//   splitter->addWidget(topWidget);
+//   splitter->addWidget(bottomWidget);
+
+//   fMainWindow->setCentralWidget(central);
+////////////////
 
 //  QMainWindow top = (QMainWindow)interactorManager->GetMainInteractor();
@@ -238,10 +278,20 @@
 {
 
+  G4Qt* interactorManager = G4Qt::getInstance ();
   fMainWindow->show();
   Prompt("session");
   exitSession = false;
-  qApp->exec();
-
-//   interactorManager->DisableSecondaryLoop (); // TO KEEP
+
+
+  printf("disable secondary loop\n");
+  interactorManager->DisableSecondaryLoop (); // TO KEEP
+  ((QApplication*)interactorManager->GetMainInteractor())->exec(); 
+  // on ne passe pas le dessous ? FIXME ????
+
+
+
+
+
+
 //   void* event; // TO KEEP
 //   while((event = interactorManager->GetEvent())!=NULL) {  // TO KEEP
@@ -249,5 +299,6 @@
 //     if(exitSession==true) break; // TO KEEP
 //   } // TO KEEP
-//   interactorManager->EnableSecondaryLoop (); // TO KEEP
+   interactorManager->EnableSecondaryLoop (); // TO KEEP
+  printf("enable secondary loop\n");
   return this; // TO KEEP
 }
@@ -263,5 +314,5 @@
 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
 {
-  fCommandLabel->setText((char*)aPrompt.data());
+  //  fCommandLabel->setText((char*)aPrompt.data());
 }
 /***************************************************************************/
@@ -315,5 +366,5 @@
 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
 {
-  fTextArea->append((char*)a_string.data());
+  //  fTextArea->append((char*)a_string.data());
   return 0;
 }
@@ -328,5 +379,5 @@
 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
 {
-  fTextArea->append((char*)a_string.data());
+  //  fTextArea->append((char*)a_string.data());
   return 0;
 }
@@ -430,5 +481,5 @@
 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
 {
-   fCommandHistoryArea->append(fCommandArea->text());
+  /*   fCommandHistoryArea->append(fCommandArea->text());
    G4String command (fCommandArea->text().toStdString().c_str());
    if(fHelp==true) {
@@ -439,4 +490,5 @@
    }
    fCommandArea->setText("");
+  */
 }
 // /***************************************************************************/
@@ -467,5 +519,5 @@
 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
 {
-  fTextArea->clear();
+  //  fTextArea->clear();
 }
 
Index: /trunk/geant4/interfaces/common/src/G4Qt.cc
===================================================================
--- /trunk/geant4/interfaces/common/src/G4Qt.cc	(revision 495)
+++ /trunk/geant4/interfaces/common/src/G4Qt.cc	(revision 496)
@@ -52,5 +52,5 @@
 //static char** args      = NULL;
 // static QtAppContext appContext = NULL;
-static QMainWindow *mainWidget = NULL;
+//static QApplication app = NULL;
 
 /***************************************************************************/
@@ -88,14 +88,13 @@
 
     new QApplication (a_argn, a_args);
-    mainWidget = new QMainWindow();
 
-    if(mainWidget==NULL) {
+    if(qApp==NULL) {
       G4cout        << "G4Qt : Unable to init Qt." << G4endl;
     }
     QtInited  = TRUE;
-    mainWidget->show();
-    qApp->exec();
+    SetMainInteractor (qApp);
   }
-//  AddDispatcher     ((G4DispatchFunction)QtDispatchEvent); // FIXME
+  SetArguments      (a_argn,a_args);
+  //  AddDispatcher     ((G4DispatchFunction)XtDispatchEvent);
 }
 /***************************************************************************/
@@ -118,4 +117,7 @@
 }
 /***************************************************************************/
+/**
+  Si j'ai bien compris, cette fonction ne sert à rien
+ */
 void* G4Qt::GetEvent (
 ) 
@@ -124,5 +126,5 @@
 {
 //FIXME
-   G4cout        << "G4Qt : Rien compris a cette fonction G4Qt::GetEvent." << G4endl;
+//   G4cout        << "G4Qt : Rien compris a cette fonction G4Qt::GetEvent." << G4endl;
 //  static XEvent  event;
 //  if(appContext==NULL) return NULL;
@@ -130,4 +132,5 @@
 //  QtAppNextEvent (appContext, &event);
 //  return         &event;
+  printf(" Si j'ai bien compris, cette fonction ne sert à rien");
 }
 /***************************************************************************/
