Index: trunk/geant4/interfaces/basic/include/G4UIQt.hh
===================================================================
--- trunk/geant4/interfaces/basic/include/G4UIQt.hh	(revision 694)
+++ trunk/geant4/interfaces/basic/include/G4UIQt.hh	(revision 695)
@@ -39,4 +39,5 @@
 
 #include <qobject.h>
+#include <qhash.h>
 
 class QMainWindow;
@@ -74,4 +75,5 @@
 //
 // Class description - end :
+
 
 class G4UIQt : public QObject, public G4VBasicShell, public G4VInteractiveSession {
@@ -119,4 +121,7 @@
   void ExitHelp();// have to be implemeted because we heritate from G4VBasicShell
   bool eventFilter(QObject*,QEvent*);
+  void ActivateCommand(G4String);
+  QHash<QString, int> LookForHelpStringInChildTree(G4UIcommandTree *,const QString&);
+
 
 private:
@@ -139,5 +144,6 @@
 #endif
   QDialog *fHelpDialog;
-
+  QLineEdit *helpLine;
+ 
 signals : 
   void myClicked(const QString &text);
@@ -152,4 +158,5 @@
   void ShowHelpCallback();
   void CommandHistoryCallback();
+  void lookForHelpStringCallback();
 };
 
Index: trunk/geant4/interfaces/basic/src/G4UIQt.cc
===================================================================
--- trunk/geant4/interfaces/basic/src/G4UIQt.cc	(revision 694)
+++ trunk/geant4/interfaces/basic/src/G4UIQt.cc	(revision 695)
@@ -30,5 +30,5 @@
 // L. Garnier
 
-//#define GEANT4_QT_DEBUG
+#define GEANT4_QT_DEBUG
 
 #ifdef G4UI_BUILD_QT_SESSION
@@ -541,7 +541,10 @@
 #endif
     QVBoxLayout *vLayout = new QVBoxLayout(fHelpDialog);
+    helpLine = new QLineEdit("Look for...",fHelpDialog);
     QSplitter *splitter = new QSplitter(Qt::Horizontal,fHelpDialog);
     QPushButton *exitButton = new QPushButton("Exit",fHelpDialog);
     connect(exitButton, SIGNAL(clicked()), fHelpDialog,SLOT(close()));
+    connect( helpLine, SIGNAL( editingFinished () ), this, SLOT( lookForHelpStringCallback() ) );
+
 
     // the help tree
@@ -646,4 +649,26 @@
   }
 
+  ActivateCommand(newCommand);
+
+#if QT_VERSION < 0x040000
+  fHelpDialog->setCaption( tr( "Help on commands" ));
+#else
+  fHelpDialog->setWindowTitle(tr("Help on commands")); 
+#endif
+  fHelpDialog->resize(800,600); 
+  fHelpDialog->move(QPoint(400,150));
+  fHelpDialog->show();
+  fHelpDialog->raise();
+#if QT_VERSION < 0x040000
+  fHelpDialog->setActiveWindow();
+#else
+  fHelpDialog->activateWindow();
+#endif
+}
+
+void G4UIQt::ActivateCommand(
+ G4String newCommand
+)
+{
   // Look for the choosen command "newCommand"
   size_t i = newCommand.index(" ");
@@ -743,21 +768,5 @@
     }
   }
-#if QT_VERSION < 0x040000
-  fHelpDialog->setCaption( tr( "Help on commands" ));
-#else
-  fHelpDialog->setWindowTitle(tr("Help on commands")); 
-#endif
-  fHelpDialog->resize(800,600); 
-  fHelpDialog->move(QPoint(400,150));
-  fHelpDialog->show();
-  fHelpDialog->raise();
-#if QT_VERSION < 0x040000
-  fHelpDialog->setActiveWindow();
-#else
-  fHelpDialog->activateWindow();
-#endif
-}
-
-
+}
 
 /**   Fill the Help Tree Widget
@@ -1301,3 +1310,83 @@
 }
 
-#endif
+/**   Callback called when user give a new string to look for<br>
+   Display a list of matching commands descriptions.
+*/
+void G4UIQt::lookForHelpStringCallback(
+)
+{
+  QString found = "";
+  // the help tree
+  G4UImanager* UI = G4UImanager::GetUIpointer();
+  if(UI==NULL) return;
+  G4UIcommandTree * treeTop = UI->GetTree();
+#ifdef GEANT4_QT_DEBUG
+  printf("1111 %s\n",helpLine->text().toStdString().c_str());
+#endif
+  
+  G4int treeSize = treeTop->GetTreeEntry();
+  int tmp = 0;
+  for (int a=0;a<treeSize;a++) {
+#ifdef GEANT4_QT_DEBUG
+    printf("Command %s\n",(char*)(treeTop->GetTree(a+1)->GetPathName()).data());
+#endif
+    G4UIcommand* command = treeTop->FindPath(treeTop->GetTree(a+1)->GetPathName().data());
+    tmp = GetCommandList (command).count(helpLine->text(),Qt::CaseInsensitive);
+    if (tmp >0) {
+#ifdef GEANT4_QT_DEBUG
+      printf("Command %s match %d times \n",(char*)(treeTop->GetTree(a+1)->GetPathName()).data(),tmp);
+#endif
+    }
+    // look for childs
+    LookForHelpStringInChildTree(treeTop->GetTree(a+1),helpLine->text());
+    tmp = 0;
+  }
+}
+
+QHash<QString, int> G4UIQt::LookForHelpStringInChildTree(
+ G4UIcommandTree *aCommandTree
+ ,const QString & text
+)
+{
+  QHash<QString, int> found;
+  if (aCommandTree == NULL) return found;
+
+  // Get the Sub directories
+  int tmp = 0;
+  for (int a=0;a<aCommandTree->GetTreeEntry();a++) {
+    const G4UIcommand* command = aCommandTree->GetGuidance();
+#ifdef GEANT4_QT_DEBUG
+    //    printf("Command %s\n",(char*)(aCommandTree->GetTree(a+1)->GetPathName()).data());
+    //    printf("%s \n",GetCommandList (command).toStdString().c_str());
+#endif
+    tmp = GetCommandList (command).count(text,Qt::CaseInsensitive);
+    if (tmp >0) {
+      found.insert(QString((char*)(aCommandTree->GetTree(a+1)->GetPathName()).data()),tmp);
+#ifdef GEANT4_QT_DEBUG
+      printf("---Command %s match %d times \n",(char*)(aCommandTree->GetTree(a+1)->GetPathName()).data(),tmp);
+#endif
+    }
+    // look for childs
+    LookForHelpStringInChildTree(aCommandTree->GetTree(a+1),text);
+  }
+
+  // Get the Commands
+
+  for (int a=0;a<aCommandTree->GetCommandEntry();a++) {
+    const G4UIcommand* command = aCommandTree->GetCommand(a+1);
+#ifdef GEANT4_QT_DEBUG
+    //    printf("Command Finale %s\n");
+    //    printf("%s \n",GetCommandList (command).toStdString().c_str());
+#endif
+    tmp = GetCommandList (command).count(text,Qt::CaseInsensitive);
+    if (tmp >0) {
+      found.insert(QString((char*)(aCommandTree->GetCommand(a+1)->GetCommandPath()).data()),tmp);
+#ifdef GEANT4_QT_DEBUG
+      printf("---Command Finale %s match %d times \n",(char*)(aCommandTree->GetCommand(a+1)->GetCommandPath()).data(),tmp);
+#endif
+    }
+    
+  }
+  return found;
+}
+#endif
