source: trunk/geant4/interfaces/basic/src/G4UIQt.cc @ 513

Last change on this file since 513 was 513, checked in by garnier, 17 years ago

r630@mac-90108: laurentgarnier | 2007-06-15 14:37:13 +0200
un peu de menage et tentative de passage d arguments dans l aide

  • Property svn:mime-type set to text/cpp
File size: 20.9 KB
Line 
1// TODO !
2
3//
4// ********************************************************************
5// * License and Disclaimer                                           *
6// *                                                                  *
7// * The  Geant4 software  is  copyright of the Copyright Holders  of *
8// * the Geant4 Collaboration.  It is provided  under  the terms  and *
9// * conditions of the Geant4 Software License,  included in the file *
10// * LICENSE and available at  http://cern.ch/geant4/license .  These *
11// * include a list of copyright holders.                             *
12// *                                                                  *
13// * Neither the authors of this software system, nor their employing *
14// * institutes,nor the agencies providing financial support for this *
15// * work  make  any representation or  warranty, express or implied, *
16// * regarding  this  software system or assume any liability for its *
17// * use.  Please see the license in the file  LICENSE  and URL above *
18// * for the full disclaimer and the limitation of liability.         *
19// *                                                                  *
20// * This  code  implementation is the result of  the  scientific and *
21// * technical work of the GEANT4 collaboration.                      *
22// * By using,  copying,  modifying or  distributing the software (or *
23// * any work based  on the software)  you  agree  to acknowledge its *
24// * use  in  resulting  scientific  publications,  and indicate your *
25// * acceptance of all terms of the Geant4 Software license.          *
26// ********************************************************************
27//
28//
29// $Id: G4UIQt.cc,v 1.14 2007/05/29 11:09:49 $
30// GEANT4 tag $Name: geant4-08-01 $
31//
32// L. Garnier
33
34//#define DEBUG
35
36#ifdef G4UI_BUILD_QT_SESSION
37
38#include "G4Types.hh"
39
40#include <string.h>
41
42#include "G4UIQt.hh"
43#include "G4UImanager.hh"
44#include "G4StateManager.hh"
45#include "G4UIcommandTree.hh"
46#include "G4UIcommandStatus.hh"
47
48#include "G4Qt.hh"
49
50#include <QtGui/qapplication.h>
51#include <QtGui/qwidget.h>
52#include <QtGui/qmenu.h>
53#include <QtGui/qmenubar.h>
54#include <QtGui/qboxlayout.h>
55#include <QtGui/qpushbutton.h>
56#include <QtGui/qlabel.h>
57#include <QtGui/qsplitter.h>
58#include <QtGui/qscrollbar.h>
59#include <QtGui/qdialog.h>
60
61#include <stdlib.h>
62
63// Pourquoi Static et non  variables de classe ?
64static G4bool exitSession = true;
65static G4bool exitPause = true;
66/***************************************************************************/
67/**
68 Build a Qt window with a menubar, output area and promt area
69      +-----------------------+
70      |exit menu|             |
71      |                       |
72      | +-------------------+ |
73      | |                   | |
74      | |  Output area      | |
75      | |                   | |
76      | +-------------------+ |
77      |     | clear |         |
78      | +-------------------+ |
79      | |  promt history    | |
80      | +-------------------+ |
81      | +-------------------+ |
82      | |> promt area       | |
83      | +-------------------+ |
84      +-----------------------+
85*/
86
87G4UIQt::G4UIQt (
88 int argc,
89 char** argv
90)
91  :fHelpDialog(NULL)
92
93/***************************************************************************/
94/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
95{
96  G4Qt* interactorManager = G4Qt::getInstance ();
97  G4UImanager* UI = G4UImanager::GetUIpointer();
98  if(UI!=NULL) UI->SetSession(this);
99
100  fMainWindow = new QMainWindow();
101  fMainWindow->setWindowTitle( "G4UI Session" );
102  fMainWindow->resize(800,600);
103  fMainWindow->move(QPoint(300,100));
104
105  QSplitter *splitter = new QSplitter(Qt::Vertical);
106  fTextArea = new QTextEdit();
107  QPushButton *clearButton = new QPushButton("clear");
108  connect(clearButton, SIGNAL(clicked()), SLOT(clearButtonCallback()));
109
110  fCommandHistoryArea = new QTextEdit();
111  fCommandLabel = new QLabel();
112
113  fCommandArea = new QLineEdit();
114  fCommandArea->activateWindow();
115  connect(fCommandArea, SIGNAL(returnPressed()), SLOT(commandEnteredCallback()));
116  fCommandArea->setFocusPolicy ( Qt::StrongFocus );
117  fCommandArea->setFocus(Qt::TabFocusReason);
118  fTextArea->setReadOnly(true);
119  fCommandHistoryArea->setReadOnly(true);
120
121 
122
123  // Set layouts
124  QVBoxLayout *layoutSplitter = new QVBoxLayout;
125
126  QWidget* topWidget = new QWidget();
127  QVBoxLayout *layoutTop = new QVBoxLayout;
128
129  QWidget* bottomWidget = new QWidget();
130  QVBoxLayout *layoutBottom = new QVBoxLayout;
131
132
133  layoutTop->addWidget(fTextArea);
134  layoutTop->addWidget(clearButton);
135  topWidget->setLayout(layoutTop);
136
137  layoutBottom->addWidget(fCommandHistoryArea);
138  layoutBottom->addWidget(fCommandLabel);
139  layoutBottom->addWidget(fCommandArea);
140  bottomWidget->setLayout(layoutBottom);
141
142
143  layoutSplitter->addWidget(topWidget);
144  layoutSplitter->addWidget(bottomWidget);
145  splitter->setLayout(layoutSplitter);
146
147  fMainWindow->setCentralWidget(splitter);
148
149  // Add a quit subMenu
150  QMenu *fileMenu = fMainWindow->menuBar()->addMenu("File");
151  fileMenu->addAction("Quitter", fMainWindow, SLOT(close()));
152
153  // Add a Help menu
154  QMenu *helpMenu = fMainWindow->menuBar()->addMenu("Help");
155  helpMenu->addAction("Show Help", this, SLOT(showHelp()));
156
157  // Set the splitter size. The fTextArea sould be 2/3 on the fMainWindow
158  QList<int> vals = splitter->sizes();
159  if(vals.size()==2) {
160    vals[0] = (splitter->orientation()==Qt::Vertical ? splitter->height() : splitter->width())*3/4;
161    vals[1] = (splitter->orientation()==Qt::Vertical ? splitter->height() : splitter->width())*1/4;
162    splitter->setSizes(vals);
163  }
164
165
166  if(UI!=NULL) UI->SetCoutDestination(this);  // TO KEEP
167}
168/***************************************************************************/
169G4UIQt::~G4UIQt(
170)
171/***************************************************************************/
172/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
173{
174  G4UImanager* UI = G4UImanager::GetUIpointer();  // TO KEEP
175  if(UI!=NULL) {  // TO KEEP
176    UI->SetSession(NULL);  // TO KEEP
177    UI->SetCoutDestination(NULL);  // TO KEEP
178  }
179
180 
181  if (fMainWindow!=NULL)
182    delete fMainWindow;
183}
184/***************************************************************************/
185/*
186    Start the Qt main loop
187 */
188G4UIsession* G4UIQt::SessionStart (
189)
190/***************************************************************************/
191/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
192{
193
194  G4Qt* interactorManager = G4Qt::getInstance ();
195  fMainWindow->show();
196  Prompt("session");
197  exitSession = false;
198
199
200  printf("disable secondary loop\n");
201  interactorManager->DisableSecondaryLoop (); // TO KEEP
202  ((QApplication*)interactorManager->GetMainInteractor())->exec();
203  // on ne passe pas le dessous ? FIXME ????
204  // je ne pense pas 13/06
205
206//   void* event; // TO KEEP
207//   while((event = interactorManager->GetEvent())!=NULL) {  // TO KEEP
208//     interactorManager->DispatchEvent(event); // TO KEEP
209//     if(exitSession==true) break; // TO KEEP
210//   } // TO KEEP
211
212  interactorManager->EnableSecondaryLoop ();
213  printf("enable secondary loop\n");
214  return this;
215}
216/***************************************************************************/
217
218/**
219  Display the prompt in the prompt area
220 */
221void G4UIQt::Prompt (
222 G4String aPrompt
223)
224/***************************************************************************/
225/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
226{
227  fCommandLabel->setText((char*)aPrompt.data());
228}
229/***************************************************************************/
230void G4UIQt::SessionTerminate (
231)
232/***************************************************************************/
233/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
234{
235  G4Qt* interactorManager = G4Qt::getInstance ();
236  fMainWindow->close();
237  ((QApplication*)interactorManager->GetMainInteractor())->exit();
238}
239/***************************************************************************/
240void G4UIQt::PauseSessionStart (
241 G4String a_state
242)
243/***************************************************************************/
244/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
245{
246  printf("G4UIQt::PauseSessionStart\n");
247  if(a_state=="G4_pause> ") {  // TO KEEP
248    SecondaryLoop ("Pause, type continue to exit this state"); // TO KEEP
249  } // TO KEEP
250
251  if(a_state=="EndOfEvent") { // TO KEEP
252    // Picking with feed back in event data Done here !!!
253    SecondaryLoop ("End of event, type continue to exit this state"); // TO KEEP
254  } // TO KEEP
255}
256/***************************************************************************/
257void G4UIQt::SecondaryLoop (
258 G4String a_prompt
259)
260/***************************************************************************/
261/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
262{
263  printf("G4UIQt::SecondaryLoop\n");
264  G4Qt* interactorManager = G4Qt::getInstance (); // TO KEEP ?
265  Prompt(a_prompt); // TO KEEP
266  exitPause = false; // TO KEEP
267  void* event; // TO KEEP
268  while((event = interactorManager->GetEvent())!=NULL) {  // TO KEEP
269    interactorManager->DispatchEvent(event); // TO KEEP
270    if(exitPause==true) break; // TO KEEP
271  } // TO KEEP
272  Prompt("session"); // TO KEEP
273}
274/***************************************************************************/
275/**
276  Receive a cout from Geant4. We have to display it in the cout zone
277 */
278G4int G4UIQt::ReceiveG4cout (
279 G4String a_string
280)
281/***************************************************************************/
282/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
283{
284  fTextArea->append(QString((char*)a_string.data()).trimmed());
285  fTextArea->verticalScrollBar()->setSliderPosition(fTextArea->verticalScrollBar()->maximum());
286  return 0;
287}
288/***************************************************************************/
289/**
290  Receive a cerr from Geant4. We have to display it in the cout zone
291 */
292G4int G4UIQt::ReceiveG4cerr (
293 G4String a_string
294)
295/***************************************************************************/
296/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
297{
298  QColor previousColor = fTextArea->textColor();
299  fTextArea->setTextColor(Qt::red);
300  fTextArea->append(QString((char*)a_string.data()).trimmed());
301  fTextArea->setTextColor(previousColor);
302  fTextArea->verticalScrollBar()->setSliderPosition(fTextArea->verticalScrollBar()->maximum());
303  return 0;
304}
305
306/***************************************************************************/
307void G4UIQt::AddMenu (
308 const char* a_name
309,const char* a_label
310)
311/***************************************************************************/
312/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
313{
314  printf("G4UIQt::AddMenu %s %s\n",a_name,a_label);
315
316  //  QMenu *fileMenu = fMainWindow->menuBar()->addMenu(a_label);
317  QMenu *fileMenu = new QMenu(a_label);
318  fMainWindow->menuBar()->insertMenu(fMainWindow->menuBar()->actions().last(),fileMenu);
319  AddInteractor (a_name,(G4Interactor)fileMenu);
320}
321/***************************************************************************/
322void G4UIQt::AddButton (
323 const char* a_menu
324,const char* a_label
325,const char* a_command
326)
327/***************************************************************************/
328/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
329{
330  if(a_menu==NULL) return; // TO KEEP
331  if(a_label==NULL) return; // TO KEEP
332  if(a_command==NULL) return; // TO KEEP
333  QMenu *parent = (QMenu*)GetInteractor(a_menu);
334  if(parent==NULL) return;
335 
336  signalMapper = new QSignalMapper(this);
337  QAction *action = parent->addAction(a_label, signalMapper, SLOT(map()));
338  signalMapper->setMapping(action, QString(a_command));
339  connect(signalMapper, SIGNAL(mapped(const QString &)),this, SLOT(buttonCallback(const QString&)));
340}
341
342
343/**
344  Callback call when "enter" clicked on the command zone.
345  Send the command to geant4
346 */
347void G4UIQt::buttonCallback (
348  const QString& a_command
349)
350/***************************************************************************/
351/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
352{
353  G4String ss = G4String(a_command.toStdString().c_str());
354  printf ("debug : execute:\n-%s- %d %d \n",ss.data(),exitSession,exitPause);
355  ApplyShellCommand(ss,exitSession,exitPause);
356  if(exitSession==true)
357    SessionTerminate();
358}
359
360/**
361  Callback call when "click on a menu entry.
362  Send the associated command to geant4
363 */
364void G4UIQt::commandEnteredCallback (
365)
366/***************************************************************************/
367/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
368{
369  printf ("debug : callback\n");
370  G4String command (fCommandArea->text().toStdString().c_str());
371  if (fCommandArea->text().toStdString().c_str() != "") {
372    fCommandHistoryArea->append(fCommandArea->text());
373
374    if (command(0,4) != "help") {
375      ApplyShellCommand (command,exitSession,exitPause);
376    } else {
377      printf ("terminal help\n");
378      TerminalHelp(command);
379    }
380    if(exitSession==true)
381      SessionTerminate();
382  }
383  fCommandArea->setText("");
384}
385
386
387/***************************************************************************/
388void G4UIQt::clearButtonCallback (
389)
390/***************************************************************************/
391/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
392{
393  fTextArea->clear();
394}
395
396
397/**
398  Open the help dialog in a separate window.
399  This will be display as a tree widget
400  Implementation of <b>void G4VBasicShell::TerminalHelp(G4String newCommand)</b>
401
402  @param newCommand : open the tree widget item on this command if is set
403 */
404void G4UIQt::TerminalHelp(G4String newCommand)
405{
406  if (fHelpDialog) {
407    fHelpDialog->show();
408    fHelpDialog->raise();
409    fHelpDialog->activateWindow();
410    return;
411  }
412  fHelpDialog = new QDialog;
413
414  QSplitter *splitter = new QSplitter(Qt::Horizontal);
415  fHelpArea = new QTextEdit();
416  QPushButton *exitButton = new QPushButton("Exit");
417  connect(exitButton, SIGNAL(clicked()), fHelpDialog,SLOT(close()));
418  fHelpArea->setReadOnly(true);
419
420  // the help tree
421  G4UImanager* UI = G4UImanager::GetUIpointer();
422  if(UI==NULL) return;
423  G4UIcommandTree * treeTop = UI->GetTree();
424
425  // Look for the choosen command "newCommand"
426  size_t i = newCommand.index(" ");
427  G4UIcommand* expandCommand = NULL;
428  if( i != std::string::npos )
429  {
430    G4String newValue = newCommand(i+1,newCommand.length()-(i+1));
431    newValue.strip(G4String::both);
432    G4String targetCom = ModifyToFullPathCommand( newValue );
433    expandCommand = treeTop->FindPath( targetCom );
434  }
435
436  // build widget
437  fHelpTreeWidget = new QTreeWidget();
438  fHelpTreeWidget->setColumnCount(2);
439  fHelpTreeWidget->setColumnHidden(1,true);
440  QStringList labels;
441  labels << QString("Summary") << QString("Description");
442  fHelpTreeWidget->setHeaderLabels(labels);
443
444  QList<QTreeWidgetItem *> items;
445  G4int treeSize = treeTop->GetTreeEntry();
446  QTreeWidgetItem * newItem;
447  for (int a=0;a<treeSize;a++) {
448    // Creating new item
449    QStringList stringList;
450    stringList << QString((char*)(treeTop->GetTree(a+1)->GetPathName()).data()).trimmed()  ;
451    stringList << QString((char*)(treeTop->GetTree(a+1)->GetTitle()).data()).trimmed()  ;
452
453    newItem = new QTreeWidgetItem(stringList);
454
455    // look for childs
456    CreateChildTree(newItem,treeTop->GetTree(a+1),expandCommand);
457    items.append(newItem);
458  }
459  fHelpTreeWidget->insertTopLevelItems(0, items);
460
461  //connecting callback
462  //  QSignalMapper signalMapper = new QSignalMapper(this);
463
464  connect(fHelpTreeWidget, SIGNAL(itemSelectionChanged ()),this, SLOT(helpTreeCallback())); 
465
466  // Set layouts
467  QHBoxLayout *splitterLayout = new QHBoxLayout;
468
469  QVBoxLayout *vLayout = new QVBoxLayout;
470
471  splitterLayout->addWidget(fHelpTreeWidget);
472  splitterLayout->addWidget(fHelpArea);
473  splitter->setLayout(splitterLayout);
474
475  vLayout->addWidget(splitter);
476  vLayout->addWidget(exitButton);
477  fHelpDialog->setLayout(vLayout);
478
479  fHelpDialog->resize(800,600);
480  fHelpDialog->move(QPoint(400,150));
481  fHelpDialog->show();
482  fHelpDialog->raise();
483  fHelpDialog->activateWindow();
484
485
486}
487void G4UIQt::CreateChildTree(QTreeWidgetItem *a_parent,G4UIcommandTree *a_commandTree,G4UIcommand* a_expandCommand) {
488
489  // Creating new item
490  QTreeWidgetItem * newItem;
491
492
493  // Get the Sub directories
494  for (int a=0;a<a_commandTree->GetTreeEntry();a++) {
495   
496    QStringList stringList;
497    stringList << QString((char*)(a_commandTree->GetTree(a+1)->GetPathName()).data()).trimmed()  ;
498    stringList << QString((char*)(a_commandTree->GetTree(a+1)->GetTitle()).data()).trimmed()  ;
499    newItem = new QTreeWidgetItem(stringList);
500
501    CreateChildTree(newItem,a_commandTree->GetTree(a+1),a_expandCommand);
502    a_parent->addChild(newItem);
503  }
504
505
506
507  // Get the Commands
508
509  for (int a=0;a<a_commandTree->GetCommandEntry();a++) {
510   
511    QStringList stringList;
512    stringList << QString((char*)(a_commandTree->GetCommand(a+1)->GetTitle()).data()).trimmed()  ;
513    stringList << QString((char*)(a_commandTree->GetCommand(a+1)->GetCommandPath()).data()).trimmed()  ;
514    newItem = new QTreeWidgetItem(stringList);
515     
516    a_parent->addChild(newItem);
517
518    // expand if possible
519    if (a_expandCommand) {
520      printf("compare : -%s- -%s- \n",((char*)(a_expandCommand->GetCommandPath()).data()),((char*)(a_commandTree->GetCommand(a+1)->GetCommandPath()).data()));
521      if (a_expandCommand->GetCommandPath() == a_commandTree->GetCommand(a+1)->GetCommandPath()) {
522        printf("mmmmmmmmmmmmmmmmmmm\n");
523        newItem->setExpanded(true);
524        fHelpArea->setText(GetCommandList(a_expandCommand));
525      } else {
526        newItem->setExpanded(false);
527      }
528    }
529  }
530}
531
532/**
533This callback is activated when user selected a item in the help tree
534 */
535void G4UIQt::helpTreeCallback (
536)
537/***************************************************************************/
538/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
539{
540  G4bool GetHelpChoice(G4int&);
541  QTreeWidgetItem* item =  NULL;
542  if (!fHelpTreeWidget)
543    return ;
544
545  if (!fHelpArea)
546    return;
547 
548  item = fHelpTreeWidget->selectedItems().first();
549  if (!item)
550    return;
551 
552  G4UImanager* UI = G4UImanager::GetUIpointer();
553  if(UI==NULL) return;
554  G4UIcommandTree * treeTop = UI->GetTree();
555  G4UIcommand* command = treeTop->FindPath(item->text (1).toStdString().c_str());
556  if (command) {
557    fHelpArea->setText(GetCommandList(command));
558  } else {
559    // this is not a command, this is a sub directory
560    // We display the Title
561    fHelpArea->setText(item->text (1).toStdString().c_str());
562  }
563}
564
565/**
566  This fonction return the command list parameters in a QString
567
568 */
569/***************************************************************************/
570QString G4UIQt::GetCommandList (
571  G4UIcommand *a_command
572)
573/***************************************************************************/
574/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
575{
576
577  QString txt;
578  G4String commandPath = a_command->GetCommandPath();
579  G4String rangeString = a_command->GetRange();
580
581  if((commandPath.length()-1)!='/')
582  {
583    txt += "Command " + QString((char*)(commandPath).data()) + "\n";
584  }
585  txt += "Guidance :\n";
586  G4int n_guidanceEntry = a_command->GetGuidanceEntries();
587
588  for( G4int i_thGuidance=0; i_thGuidance < n_guidanceEntry; i_thGuidance++ )
589    { txt += QString((char*)(a_command->GetGuidanceLine(i_thGuidance)).data()) + "\n"; }
590  if( ! rangeString.isNull() )
591    { txt += " Range of parameters : " + QString((char*)(rangeString).data()) + "\n"; }
592  G4int n_parameterEntry = a_command->GetParameterEntries();
593  if( n_parameterEntry > 0 )
594    {
595      G4UIparameter *param;
596
597      // Re-implementation of G4UIparameter.cc
598
599      for( G4int i_thParameter=0; i_thParameter<n_parameterEntry; i_thParameter++ )
600        { param = a_command->GetParameter(i_thParameter);
601          txt += "\nParameter : " + QString((char*)(param->GetParameterName()).data()) + "\n";
602          if( ! param->GetParameterGuidance().isNull() )
603            txt += QString((char*)(param->GetParameterGuidance()).data())+ "\n" ;
604          txt += " Parameter type  : " + QString(param->GetParameterType())+ "\n";
605          if(param->IsOmittable())
606            { txt += " Omittable       : True\n"; }
607          else
608            { txt += " Omittable       : False\n"; }
609          if( param->GetCurrentAsDefault() )
610            { txt += " Default value   : taken from the current value\n"; }
611          else if( ! param->GetDefaultValue().isNull() )
612            { txt += " Default value   : " + QString((char*)(param->GetDefaultValue()).data())+ "\n"; }
613          if( ! param->GetParameterRange().isNull() )
614            txt += " Parameter range : " + QString((char*)(param->GetParameterRange()).data())+ "\n";
615          if( ! param->GetParameterCandidates().isNull() )
616            txt += " Candidates      : " + QString((char*)(param->GetParameterCandidates()).data())+ "\n";
617        }
618    }
619  return txt;
620}
621
622/***************************************************************************/
623void G4UIQt::showHelp (
624)
625/***************************************************************************/
626/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
627{
628  TerminalHelp("");
629}
630
631#endif
Note: See TracBrowser for help on using the repository browser.