source: trunk/geant4/interfaces/html/G4UIQt_8cc-source.html @ 571

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

r581@mac-90108: laurentgarnier | 2007-08-17 17:30:26 +0200
deplacement de frame

  • Property svn:mime-type set to text/html
File size: 45.9 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3<title>G4UIQt.cc Source File</title>
4<link href="doxygen.css" rel="stylesheet" type="text/css">
5</head><body>
6<!-- Generated by Doxygen 1.3.4 -->
7<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
8<h1>G4UIQt.cc</h1><a href="G4UIQt_8cc.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">//</span>
900002 <span class="comment">// ********************************************************************</span>
1000003 <span class="comment">// * License and Disclaimer                                           *</span>
1100004 <span class="comment">// *                                                                  *</span>
1200005 <span class="comment">// * The  Geant4 software  is  copyright of the Copyright Holders  of *</span>
1300006 <span class="comment">// * the Geant4 Collaboration.  It is provided  under  the terms  and *</span>
1400007 <span class="comment">// * conditions of the Geant4 Software License,  included in the file *</span>
1500008 <span class="comment">// * LICENSE and available at  http://cern.ch/geant4/license .  These *</span>
1600009 <span class="comment">// * include a list of copyright holders.                             *</span>
1700010 <span class="comment">// *                                                                  *</span>
1800011 <span class="comment">// * Neither the authors of this software system, nor their employing *</span>
1900012 <span class="comment">// * institutes,nor the agencies providing financial support for this *</span>
2000013 <span class="comment">// * work  make  any representation or  warranty, express or implied, *</span>
2100014 <span class="comment">// * regarding  this  software system or assume any liability for its *</span>
2200015 <span class="comment">// * use.  Please see the license in the file  LICENSE  and URL above *</span>
2300016 <span class="comment">// * for the full disclaimer and the limitation of liability.         *</span>
2400017 <span class="comment">// *                                                                  *</span>
2500018 <span class="comment">// * This  code  implementation is the result of  the  scientific and *</span>
2600019 <span class="comment">// * technical work of the GEANT4 collaboration.                      *</span>
2700020 <span class="comment">// * By using,  copying,  modifying or  distributing the software (or *</span>
2800021 <span class="comment">// * any work based  on the software)  you  agree  to acknowledge its *</span>
2900022 <span class="comment">// * use  in  resulting  scientific  publications,  and indicate your *</span>
3000023 <span class="comment">// * acceptance of all terms of the Geant4 Software license.          *</span>
3100024 <span class="comment">// ********************************************************************</span>
3200025 <span class="comment">//</span>
3300026 <span class="comment">//</span>
3400027 <span class="comment">// $Id: G4UIQt.cc,v 1.14 2007/05/29 11:09:49 $</span>
3500028 <span class="comment">// GEANT4 tag $Name: geant4-08-01 $</span>
3600029 <span class="comment">//</span>
3700030 <span class="comment">// L. Garnier</span>
3800031
3900032 <span class="comment">//#define DEBUG</span>
4000033
4100034 <span class="preprocessor">#ifdef G4UI_BUILD_QT_SESSION</span>
4200035 <span class="preprocessor"></span>
4300036 <span class="preprocessor">#include "G4Types.hh"</span>
4400037
4500038 <span class="preprocessor">#include &lt;string.h&gt;</span>
4600039
4700040 <span class="preprocessor">#include "<a class="code" href="G4UIQt_8hh.html">G4UIQt.hh</a>"</span>
4800041 <span class="preprocessor">#include "G4UImanager.hh"</span>
4900042 <span class="preprocessor">#include "G4StateManager.hh"</span>
5000043 <span class="preprocessor">#include "G4UIcommandTree.hh"</span>
5100044 <span class="preprocessor">#include "G4UIcommandStatus.hh"</span>
5200045
5300046 <span class="preprocessor">#include "<a class="code" href="G4Qt_8hh.html">G4Qt.hh</a>"</span>
5400047
5500048 <span class="preprocessor">#include &lt;QtGui/qapplication.h&gt;</span>
5600049 <span class="preprocessor">#include &lt;QtGui/qwidget.h&gt;</span>
5700050 <span class="preprocessor">#include &lt;QtGui/qmenu.h&gt;</span>
5800051 <span class="preprocessor">#include &lt;QtGui/qmenubar.h&gt;</span>
5900052 <span class="preprocessor">#include &lt;QtGui/qboxlayout.h&gt;</span>
6000053 <span class="preprocessor">#include &lt;QtGui/qpushbutton.h&gt;</span>
6100054 <span class="preprocessor">#include &lt;QtGui/qlabel.h&gt;</span>
6200055 <span class="preprocessor">#include &lt;QtGui/qsplitter.h&gt;</span>
6300056 <span class="preprocessor">#include &lt;QtGui/qscrollbar.h&gt;</span>
6400057 <span class="preprocessor">#include &lt;QtGui/qdialog.h&gt;</span>
6500058 <span class="preprocessor">#include &lt;QtGui/qevent.h&gt;</span>
6600059
6700060 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
6800061
6900062 <span class="comment">// Pourquoi Static et non  variables de classe ?</span>
70<a name="l00063"></a><a class="code" href="G4UIQt_8cc.html#a0">00063</a> <span class="keyword">static</span> G4bool <a class="code" href="G4UIQt_8cc.html#a0">exitSession</a> = <span class="keyword">true</span>;
71<a name="l00064"></a><a class="code" href="G4UIQt_8cc.html#a1">00064</a> <span class="keyword">static</span> G4bool <a class="code" href="G4UIQt_8cc.html#a1">exitPause</a> = <span class="keyword">true</span>;
7200065
73<a name="l00087"></a><a class="code" href="classG4UIQt.html#a0">00087</a> <a class="code" href="classG4UIQt.html#a0">G4UIQt::G4UIQt</a> (
7400088                 <span class="keywordtype">int</span> argc,
7500089                 <span class="keywordtype">char</span>** argv
7600090                 )
7700091   :fHelpDialog(NULL)
7800092 {
7900093   <a class="code" href="classG4Qt.html">G4Qt</a>* interactorManager = <a class="code" href="classG4Qt.html#e0">G4Qt::getInstance</a> ();
8000094   G4UImanager* UI = G4UImanager::GetUIpointer();
8100095   <span class="keywordflow">if</span>(UI!=NULL) UI-&gt;SetSession(<span class="keyword">this</span>);
8200096
8300097   <a class="code" href="classG4UIQt.html#r0">fMainWindow</a> = <span class="keyword">new</span> QMainWindow();
8400098   <a class="code" href="classG4UIQt.html#r0">fMainWindow</a>-&gt;setWindowTitle( <span class="stringliteral">"G4UI Session"</span> );
8500099   <a class="code" href="classG4UIQt.html#r0">fMainWindow</a>-&gt;resize(800,600);
8600100   <a class="code" href="classG4UIQt.html#r0">fMainWindow</a>-&gt;move(QPoint(200,100));
8700101
8800102   QSplitter *splitter = <span class="keyword">new</span> QSplitter(Qt::Vertical);
8900103   <a class="code" href="classG4UIQt.html#r3">fTextArea</a> = <span class="keyword">new</span> QTextEdit();
9000104   QPushButton *clearButton = <span class="keyword">new</span> QPushButton(<span class="stringliteral">"clear"</span>);
9100105   connect(clearButton, SIGNAL(clicked()), SLOT(<a class="code" href="classG4UIQt.html#k0">clearButtonCallback</a>()));
9200106
9300107   <a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a> = <span class="keyword">new</span> QListWidget();
9400108   <a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;setSelectionMode(QAbstractItemView::SingleSelection);
9500109   connect(<a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>, SIGNAL(itemSelectionChanged()), SLOT(<a class="code" href="classG4UIQt.html#k5">commandHistoryCallback</a>()));
9600110   <a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;installEventFilter(<span class="keyword">this</span>);
9700111   <a class="code" href="classG4UIQt.html#r1">fCommandLabel</a> = <span class="keyword">new</span> QLabel();
9800112
9900113   <a class="code" href="classG4UIQt.html#r2">fCommandArea</a> = <span class="keyword">new</span> QLineEdit();
10000114   <a class="code" href="classG4UIQt.html#r2">fCommandArea</a>-&gt;installEventFilter(<span class="keyword">this</span>);
10100115   <a class="code" href="classG4UIQt.html#r2">fCommandArea</a>-&gt;activateWindow();
10200116   connect(<a class="code" href="classG4UIQt.html#r2">fCommandArea</a>, SIGNAL(returnPressed()), SLOT(<a class="code" href="classG4UIQt.html#k1">commandEnteredCallback</a>()));
10300117   <span class="comment">//  fCommandArea-&gt;setFocusPolicy ( Qt::StrongFocus );</span>
10400118   <span class="comment">//  fCommandArea-&gt;setFocus(Qt::TabFocusReason);</span>
10500119   <a class="code" href="classG4UIQt.html#r3">fTextArea</a>-&gt;setReadOnly(<span class="keyword">true</span>);
10600120
10700121
10800122   <span class="comment">// Set layouts</span>
10900123
11000124   QWidget* topWidget = <span class="keyword">new</span> QWidget();
11100125   QVBoxLayout *layoutTop = <span class="keyword">new</span> QVBoxLayout;
11200126
11300127   QWidget* bottomWidget = <span class="keyword">new</span> QWidget();
11400128   QVBoxLayout *layoutBottom = <span class="keyword">new</span> QVBoxLayout;
11500129
11600130
11700131   layoutTop-&gt;addWidget(<a class="code" href="classG4UIQt.html#r3">fTextArea</a>);
11800132   layoutTop-&gt;addWidget(clearButton);
11900133   topWidget-&gt;setLayout(layoutTop);
12000134
12100135   layoutBottom-&gt;addWidget(<a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>);
12200136   layoutBottom-&gt;addWidget(<a class="code" href="classG4UIQt.html#r1">fCommandLabel</a>);
12300137   layoutBottom-&gt;addWidget(<a class="code" href="classG4UIQt.html#r2">fCommandArea</a>);
12400138   bottomWidget-&gt;setLayout(layoutBottom);
12500139
12600140
12700141   splitter-&gt;addWidget(topWidget);
12800142   splitter-&gt;addWidget(bottomWidget);
12900143   <a class="code" href="classG4UIQt.html#r0">fMainWindow</a>-&gt;setCentralWidget(splitter);
13000144
13100145   <span class="comment">// Add a quit subMenu</span>
13200146   QMenu *fileMenu = <a class="code" href="classG4UIQt.html#r0">fMainWindow</a>-&gt;menuBar()-&gt;addMenu(<span class="stringliteral">"File"</span>);
13300147   fileMenu-&gt;addAction(<span class="stringliteral">"Quitter"</span>, <a class="code" href="classG4UIQt.html#r0">fMainWindow</a>, SLOT(close()));
13400148
13500149   <span class="comment">// Add a Help menu</span>
13600150   QMenu *helpMenu = <a class="code" href="classG4UIQt.html#r0">fMainWindow</a>-&gt;menuBar()-&gt;addMenu(<span class="stringliteral">"Help"</span>);
13700151   helpMenu-&gt;addAction(<span class="stringliteral">"Show Help"</span>, <span class="keyword">this</span>, SLOT(<a class="code" href="classG4UIQt.html#k4">showHelpCallback</a>()));
13800152
13900153   <span class="comment">// Set the splitter size. The fTextArea sould be 2/3 on the fMainWindow</span>
14000154   QList&lt;int&gt; vals = splitter-&gt;sizes();
14100155   <span class="keywordflow">if</span>(vals.size()==2) {
14200156     vals[0] = (splitter-&gt;orientation()==Qt::Vertical ? splitter-&gt;height() : splitter-&gt;width())*3/4;
14300157     vals[1] = (splitter-&gt;orientation()==Qt::Vertical ? splitter-&gt;height() : splitter-&gt;width())*1/4;
14400158     splitter-&gt;setSizes(vals);
14500159   }
14600160
14700161
14800162   <span class="keywordflow">if</span>(UI!=NULL) UI-&gt;SetCoutDestination(<span class="keyword">this</span>);  <span class="comment">// TO KEEP</span>
14900163 }
15000164
15100165
15200166
153<a name="l00167"></a><a class="code" href="classG4UIQt.html#a4">00167</a> <a class="code" href="classG4UIQt.html#a4">G4UIQt::~G4UIQt</a>(
15400168 )
15500169 {
15600170   G4UImanager* UI = G4UImanager::GetUIpointer();  <span class="comment">// TO KEEP</span>
15700171   <span class="keywordflow">if</span>(UI!=NULL) {  <span class="comment">// TO KEEP</span>
15800172     UI-&gt;SetSession(NULL);  <span class="comment">// TO KEEP</span>
15900173     UI-&gt;SetCoutDestination(NULL);  <span class="comment">// TO KEEP</span>
16000174   }
16100175
16200176   
16300177   <span class="keywordflow">if</span> (<a class="code" href="classG4UIQt.html#r0">fMainWindow</a>!=NULL)
16400178     <span class="keyword">delete</span> <a class="code" href="classG4UIQt.html#r0">fMainWindow</a>;
16500179 }
16600180
16700181
16800182
16900183
170<a name="l00187"></a><a class="code" href="classG4UIQt.html#a1">00187</a> G4UIsession* <a class="code" href="classG4UIQt.html#a1">G4UIQt::SessionStart</a> (
17100188 )
17200189 {
17300190
17400191   <a class="code" href="classG4Qt.html">G4Qt</a>* interactorManager = <a class="code" href="classG4Qt.html#e0">G4Qt::getInstance</a> ();
17500192   <a class="code" href="classG4UIQt.html#r0">fMainWindow</a>-&gt;show();
17600193   <a class="code" href="classG4UIQt.html#a5">Prompt</a>(<span class="stringliteral">"session"</span>);
17700194   <a class="code" href="G4UIQt_8cc.html#a0">exitSession</a> = <span class="keyword">false</span>;
17800195
17900196
18000197   printf(<span class="stringliteral">"disable secondary loop\n"</span>);
18100198   interactorManager-&gt;<a class="code" href="classG4VInteractorManager.html#a13">DisableSecondaryLoop</a> (); <span class="comment">// TO KEEP</span>
18200199   ((QApplication*)interactorManager-&gt;<a class="code" href="classG4VInteractorManager.html#a5">GetMainInteractor</a>())-&gt;exec();
18300200   <span class="comment">// on ne passe pas le dessous ? FIXME ????</span>
18400201   <span class="comment">// je ne pense pas 13/06</span>
18500202
18600203   <span class="comment">//   void* event; // TO KEEP</span>
18700204   <span class="comment">//   while((event = interactorManager-&gt;GetEvent())!=NULL) {  // TO KEEP</span>
18800205   <span class="comment">//     interactorManager-&gt;DispatchEvent(event); // TO KEEP</span>
18900206   <span class="comment">//     if(exitSession==true) break; // TO KEEP</span>
19000207   <span class="comment">//   } // TO KEEP</span>
19100208
19200209   interactorManager-&gt;<a class="code" href="classG4VInteractorManager.html#a12">EnableSecondaryLoop</a> ();
19300210   printf(<span class="stringliteral">"enable secondary loop\n"</span>);
19400211   <span class="keywordflow">return</span> <span class="keyword">this</span>;
19500212 }
19600213
19700214
198<a name="l00221"></a><a class="code" href="classG4UIQt.html#a5">00221</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#a5">G4UIQt::Prompt</a> (
19900222  G4String aPrompt
20000223 )
20100224 {
20200225   <a class="code" href="classG4UIQt.html#r1">fCommandLabel</a>-&gt;setText((<span class="keywordtype">char</span>*)aPrompt.data());
20300226 }
20400227
20500228
206<a name="l00229"></a><a class="code" href="classG4UIQt.html#a6">00229</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#a6">G4UIQt::SessionTerminate</a> (
20700230 )
20800231 {
20900232   <a class="code" href="classG4Qt.html">G4Qt</a>* interactorManager = <a class="code" href="classG4Qt.html#e0">G4Qt::getInstance</a> ();
21000233   <a class="code" href="classG4UIQt.html#r0">fMainWindow</a>-&gt;close();
21100234   ((QApplication*)interactorManager-&gt;<a class="code" href="classG4VInteractorManager.html#a5">GetMainInteractor</a>())-&gt;exit();
21200235 }
21300236
21400237
21500238
216<a name="l00247"></a><a class="code" href="classG4UIQt.html#a7">00247</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#a7">G4UIQt::PauseSessionStart</a> (
21700248  G4String aState
21800249 )
21900250 {
22000251   printf(<span class="stringliteral">"G4UIQt::PauseSessionStart\n"</span>);
22100252   <span class="keywordflow">if</span>(aState==<span class="stringliteral">"G4_pause&gt; "</span>) {  <span class="comment">// TO KEEP</span>
22200253     <a class="code" href="classG4UIQt.html#d0">SecondaryLoop</a> (<span class="stringliteral">"Pause, type continue to exit this state"</span>); <span class="comment">// TO KEEP</span>
22300254   } <span class="comment">// TO KEEP</span>
22400255
22500256   <span class="keywordflow">if</span>(aState==<span class="stringliteral">"EndOfEvent"</span>) { <span class="comment">// TO KEEP</span>
22600257     <span class="comment">// Picking with feed back in event data Done here !!!</span>
22700258     <a class="code" href="classG4UIQt.html#d0">SecondaryLoop</a> (<span class="stringliteral">"End of event, type continue to exit this state"</span>); <span class="comment">// TO KEEP</span>
22800259   } <span class="comment">// TO KEEP</span>
22900260 }
23000261
23100262
23200263
233<a name="l00268"></a><a class="code" href="classG4UIQt.html#d0">00268</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#d0">G4UIQt::SecondaryLoop</a> (
23400269  G4String aPrompt
23500270 )
23600271 {
23700272   printf(<span class="stringliteral">"G4UIQt::SecondaryLoop\n"</span>);
23800273   <a class="code" href="classG4Qt.html">G4Qt</a>* interactorManager = <a class="code" href="classG4Qt.html#e0">G4Qt::getInstance</a> (); <span class="comment">// TO KEEP ?</span>
23900274   <a class="code" href="classG4UIQt.html#a5">Prompt</a>(aPrompt); <span class="comment">// TO KEEP</span>
24000275   <a class="code" href="G4UIQt_8cc.html#a1">exitPause</a> = <span class="keyword">false</span>; <span class="comment">// TO KEEP</span>
24100276   <span class="keywordtype">void</span>* event; <span class="comment">// TO KEEP</span>
24200277   <span class="keywordflow">while</span>((event = interactorManager-&gt;<a class="code" href="classG4Qt.html#a1">GetEvent</a>())!=NULL) {  <span class="comment">// TO KEEP</span>
24300278     interactorManager-&gt;<a class="code" href="classG4VInteractorManager.html#a17">DispatchEvent</a>(event); <span class="comment">// TO KEEP</span>
24400279     <span class="keywordflow">if</span>(<a class="code" href="G4UIQt_8cc.html#a1">exitPause</a>==<span class="keyword">true</span>) <span class="keywordflow">break</span>; <span class="comment">// TO KEEP</span>
24500280   } <span class="comment">// TO KEEP</span>
24600281   <a class="code" href="classG4UIQt.html#a5">Prompt</a>(<span class="stringliteral">"session"</span>); <span class="comment">// TO KEEP</span>
24700282 }
24800283
24900284
25000285
251<a name="l00290"></a><a class="code" href="classG4UIQt.html#a8">00290</a> G4int <a class="code" href="classG4UIQt.html#a8">G4UIQt::ReceiveG4cout</a> (
25200291  G4String aString
25300292 )
25400293 {
25500294   <a class="code" href="classG4UIQt.html#r3">fTextArea</a>-&gt;append(QString((<span class="keywordtype">char</span>*)aString.data()).trimmed());
25600295   <a class="code" href="classG4UIQt.html#r3">fTextArea</a>-&gt;verticalScrollBar()-&gt;setSliderPosition(<a class="code" href="classG4UIQt.html#r3">fTextArea</a>-&gt;verticalScrollBar()-&gt;maximum());
25700296   <span class="keywordflow">return</span> 0;
25800297 }
25900298
26000299
261<a name="l00304"></a><a class="code" href="classG4UIQt.html#a9">00304</a> G4int <a class="code" href="classG4UIQt.html#a9">G4UIQt::ReceiveG4cerr</a> (
26200305  G4String aString
26300306 )
26400307 {
26500308   QColor previousColor = <a class="code" href="classG4UIQt.html#r3">fTextArea</a>-&gt;textColor();
26600309   <a class="code" href="classG4UIQt.html#r3">fTextArea</a>-&gt;setTextColor(Qt::red);
26700310   <a class="code" href="classG4UIQt.html#r3">fTextArea</a>-&gt;append(QString((<span class="keywordtype">char</span>*)aString.data()).trimmed());
26800311   <a class="code" href="classG4UIQt.html#r3">fTextArea</a>-&gt;setTextColor(previousColor);
26900312   <a class="code" href="classG4UIQt.html#r3">fTextArea</a>-&gt;verticalScrollBar()-&gt;setSliderPosition(<a class="code" href="classG4UIQt.html#r3">fTextArea</a>-&gt;verticalScrollBar()-&gt;maximum());
27000313   <span class="keywordflow">return</span> 0;
27100314 }
27200315
27300316
27400317
275<a name="l00323"></a><a class="code" href="classG4UIQt.html#a2">00323</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#a2">G4UIQt::AddMenu</a> (
27600324  <span class="keyword">const</span> <span class="keywordtype">char</span>* aName
27700325 ,<span class="keyword">const</span> <span class="keywordtype">char</span>* aLabel
27800326 )
27900327 {
28000328   QMenu *fileMenu = <span class="keyword">new</span> QMenu(aLabel);
28100329   <a class="code" href="classG4UIQt.html#r0">fMainWindow</a>-&gt;menuBar()-&gt;insertMenu(<a class="code" href="classG4UIQt.html#r0">fMainWindow</a>-&gt;menuBar()-&gt;actions().last(),fileMenu);
28200330   <a class="code" href="classG4VInteractiveSession.html#a4">AddInteractor</a> (aName,(<a class="code" href="G4VInteractorManager_8hh.html#a0">G4Interactor</a>)fileMenu);
28300331 }
28400332
28500333
286<a name="l00340"></a><a class="code" href="classG4UIQt.html#a3">00340</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#a3">G4UIQt::AddButton</a> (
28700341  <span class="keyword">const</span> <span class="keywordtype">char</span>* aMenu
28800342 ,<span class="keyword">const</span> <span class="keywordtype">char</span>* aLabel
28900343 ,<span class="keyword">const</span> <span class="keywordtype">char</span>* aCommand
29000344 )
29100345 {
29200346   <span class="keywordflow">if</span>(aMenu==NULL) <span class="keywordflow">return</span>; <span class="comment">// TO KEEP</span>
29300347   <span class="keywordflow">if</span>(aLabel==NULL) <span class="keywordflow">return</span>; <span class="comment">// TO KEEP</span>
29400348   <span class="keywordflow">if</span>(aCommand==NULL) <span class="keywordflow">return</span>; <span class="comment">// TO KEEP</span>
29500349   QMenu *parent = (QMenu*)<a class="code" href="classG4VInteractiveSession.html#a5">GetInteractor</a>(aMenu);
29600350   <span class="keywordflow">if</span>(parent==NULL) <span class="keywordflow">return</span>;
29700351   
29800352   <a class="code" href="classG4UIQt.html#r6">signalMapper</a> = <span class="keyword">new</span> QSignalMapper(<span class="keyword">this</span>);
29900353   QAction *action = parent-&gt;addAction(aLabel, <a class="code" href="classG4UIQt.html#r6">signalMapper</a>, SLOT(map()));
30000354   <a class="code" href="classG4UIQt.html#r6">signalMapper</a>-&gt;setMapping(action, QString(aCommand));
30100355   connect(<a class="code" href="classG4UIQt.html#r6">signalMapper</a>, SIGNAL(mapped(<span class="keyword">const</span> QString &amp;)),<span class="keyword">this</span>, SLOT(<a class="code" href="classG4UIQt.html#k2">buttonCallback</a>(<span class="keyword">const</span> QString&amp;)));
30200356 }
30300357
30400358
30500359
30600360
307<a name="l00368"></a><a class="code" href="classG4UIQt.html#d1">00368</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#d1">G4UIQt::TerminalHelp</a>(
30800369  G4String newCommand
30900370 )
31000371 {
31100372   <span class="keywordflow">if</span> (!<a class="code" href="classG4UIQt.html#r8">fHelpDialog</a>) {
31200373     <a class="code" href="classG4UIQt.html#r8">fHelpDialog</a> = <span class="keyword">new</span> QDialog;
31300374
31400375     QSplitter *splitter = <span class="keyword">new</span> QSplitter(Qt::Horizontal);
31500376     <a class="code" href="classG4UIQt.html#r4">fHelpArea</a> = <span class="keyword">new</span> QTextEdit();
31600377     QPushButton *exitButton = <span class="keyword">new</span> QPushButton(<span class="stringliteral">"Exit"</span>);
31700378     connect(exitButton, SIGNAL(clicked()), <a class="code" href="classG4UIQt.html#r8">fHelpDialog</a>,SLOT(close()));
31800379     <a class="code" href="classG4UIQt.html#r4">fHelpArea</a>-&gt;setReadOnly(<span class="keyword">true</span>);
31900380
32000381     <span class="comment">// the help tree</span>
32100382     G4UImanager* UI = G4UImanager::GetUIpointer();
32200383     <span class="keywordflow">if</span>(UI==NULL) <span class="keywordflow">return</span>;
32300384     G4UIcommandTree * treeTop = UI-&gt;GetTree();
32400385
32500386     <span class="comment">// build widget</span>
32600387     <a class="code" href="classG4UIQt.html#r7">fHelpTreeWidget</a> = <span class="keyword">new</span> QTreeWidget();
32700388     <a class="code" href="classG4UIQt.html#r7">fHelpTreeWidget</a>-&gt;setSelectionMode(QAbstractItemView::SingleSelection);
32800389     <a class="code" href="classG4UIQt.html#r7">fHelpTreeWidget</a>-&gt;setColumnCount(2);
32900390     <a class="code" href="classG4UIQt.html#r7">fHelpTreeWidget</a>-&gt;setColumnHidden(1,<span class="keyword">true</span>);
33000391     QStringList labels;
33100392     labels &lt;&lt; QString(<span class="stringliteral">"Command"</span>) &lt;&lt; QString(<span class="stringliteral">"Description"</span>);
33200393     <a class="code" href="classG4UIQt.html#r7">fHelpTreeWidget</a>-&gt;setHeaderLabels(labels);
33300394
33400395     QList&lt;QTreeWidgetItem *&gt; items;
33500396     G4int treeSize = treeTop-&gt;GetTreeEntry();
33600397     QTreeWidgetItem * newItem;
33700398     <span class="keywordflow">for</span> (<span class="keywordtype">int</span> a=0;a&lt;treeSize;a++) {
33800399       <span class="comment">// Creating new item</span>
33900400       QStringList stringList;
34000401       stringList &lt;&lt; QString((<span class="keywordtype">char</span>*)(treeTop-&gt;GetTree(a+1)-&gt;GetPathName()).data()).trimmed()  ;
34100402       stringList &lt;&lt; QString((<span class="keywordtype">char</span>*)(treeTop-&gt;GetTree(a+1)-&gt;GetTitle()).data()).trimmed()  ;
34200403
34300404       newItem = <span class="keyword">new</span> QTreeWidgetItem(stringList);
34400405
34500406       <span class="comment">// look for childs</span>
34600407       <a class="code" href="classG4UIQt.html#d2">CreateChildTree</a>(newItem,treeTop-&gt;GetTree(a+1));
34700408       items.append(newItem);
34800409     }
34900410     <a class="code" href="classG4UIQt.html#r7">fHelpTreeWidget</a>-&gt;insertTopLevelItems(0, items);
35000411
35100412     <span class="comment">//connecting callback</span>
35200413     <span class="comment">//  QSignalMapper signalMapper = new QSignalMapper(this);</span>
35300414
35400415     connect(<a class="code" href="classG4UIQt.html#r7">fHelpTreeWidget</a>, SIGNAL(itemSelectionChanged ()),<span class="keyword">this</span>, SLOT(<a class="code" href="classG4UIQt.html#k3">helpTreeCallback</a>())); 
35500416
35600417     <span class="comment">// Set layouts</span>
35700418
35800419     QVBoxLayout *vLayout = <span class="keyword">new</span> QVBoxLayout;
35900420
36000421     splitter-&gt;addWidget(<a class="code" href="classG4UIQt.html#r7">fHelpTreeWidget</a>);
36100422     splitter-&gt;addWidget(<a class="code" href="classG4UIQt.html#r4">fHelpArea</a>);
36200423
36300424     vLayout-&gt;addWidget(splitter);
36400425     vLayout-&gt;addWidget(exitButton);
36500426     <a class="code" href="classG4UIQt.html#r8">fHelpDialog</a>-&gt;setLayout(vLayout);
36600427
36700428   }
36800429
36900430   <span class="comment">// Look for the choosen command "newCommand"</span>
37000431   size_t i = newCommand.index(<span class="stringliteral">" "</span>);
37100432   G4String targetCom=<span class="stringliteral">""</span>;
37200433   <span class="keywordflow">if</span>( i != std::string::npos )
37300434     {
37400435       G4String newValue = newCommand(i+1,newCommand.length()-(i+1));
37500436       newValue.strip(G4String::both);
37600437       targetCom = <a class="code" href="classG4VBasicShell.html#b0">ModifyToFullPathCommand</a>( newValue );
37700438       printf(<span class="stringliteral">"test : av:%s-- ap:%s--\n"</span>,((<span class="keywordtype">char</span>*)newValue.data()),((<span class="keywordtype">char</span>*)targetCom.data()));
37800439     }
37900440   <span class="keywordflow">if</span> (targetCom != <span class="stringliteral">""</span>) {
38000441     QList&lt;QTreeWidgetItem *&gt; list = <a class="code" href="classG4UIQt.html#r7">fHelpTreeWidget</a>-&gt;findItems(QString(((<span class="keywordtype">char</span>*)targetCom.data())),Qt::MatchFixedString,0);
38100442     <span class="keywordflow">for</span> (<span class="keywordtype">int</span> a=0;a&lt;13;a++) {
38200443       printf(<span class="stringliteral">"verif.... =%s= +%s+\n"</span>,<a class="code" href="classG4UIQt.html#r7">fHelpTreeWidget</a>-&gt;topLevelItem(a)-&gt;text(0).toStdString().c_str(),((<span class="keywordtype">char</span>*)targetCom.data()));
38300444     }
38400445
38500446     <span class="keywordflow">if</span> (!list.isEmpty()) {
38600447       <span class="keywordflow">if</span> (list.first()-&gt;childCount() &gt;0) 
38700448         list.first()-&gt;setExpanded(<span class="keyword">true</span>);
38800449       
38900450       <span class="comment">//collapsed open item</span>
39000451       QList&lt;QTreeWidgetItem *&gt; selected;
39100452       selected = <a class="code" href="classG4UIQt.html#r7">fHelpTreeWidget</a>-&gt;selectedItems();
39200453       <span class="keywordflow">if</span> ( selected.count() != 0 ) {
39300454         <a class="code" href="classG4UIQt.html#r7">fHelpTreeWidget</a>-&gt;collapseItem (selected.at( 0 ) );
39400455       }
39500456       
39600457       <span class="comment">// clear old selection</span>
39700458       <a class="code" href="classG4UIQt.html#r7">fHelpTreeWidget</a>-&gt;clearSelection();
39800459       list.first()-&gt;setSelected(<span class="keyword">true</span>);
39900460       
40000461       <span class="comment">// Call the update of the right textArea</span>
40100462       <a class="code" href="classG4UIQt.html#k3">helpTreeCallback</a>();
40200463     }
40300464   }
40400465   <a class="code" href="classG4UIQt.html#r8">fHelpDialog</a>-&gt;setWindowTitle(<span class="stringliteral">"Help on commands"</span>);
40500466   <a class="code" href="classG4UIQt.html#r8">fHelpDialog</a>-&gt;resize(800,600);
40600467   <a class="code" href="classG4UIQt.html#r8">fHelpDialog</a>-&gt;move(QPoint(400,150));
40700468   <a class="code" href="classG4UIQt.html#r8">fHelpDialog</a>-&gt;show();
40800469   <a class="code" href="classG4UIQt.html#r8">fHelpDialog</a>-&gt;raise();
40900470   <a class="code" href="classG4UIQt.html#r8">fHelpDialog</a>-&gt;activateWindow();
41000471 }
41100472
41200473
41300474
414<a name="l00480"></a><a class="code" href="classG4UIQt.html#d2">00480</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#d2">G4UIQt::CreateChildTree</a>(
41500481  QTreeWidgetItem *aParent
41600482 ,G4UIcommandTree *aCommandTree
41700483 )
41800484 {
41900485
42000486   <span class="comment">// Creating new item</span>
42100487   QTreeWidgetItem * newItem;
42200488
42300489
42400490   <span class="comment">// Get the Sub directories</span>
42500491   <span class="keywordflow">for</span> (<span class="keywordtype">int</span> a=0;a&lt;aCommandTree-&gt;GetTreeEntry();a++) {
42600492     
42700493     QStringList stringList;
42800494     stringList &lt;&lt; QString((<span class="keywordtype">char</span>*)(aCommandTree-&gt;GetTree(a+1)-&gt;GetPathName()).data()).trimmed()  ;
42900495     stringList &lt;&lt; QString((<span class="keywordtype">char</span>*)(aCommandTree-&gt;GetTree(a+1)-&gt;GetTitle()).data()).trimmed()  ;
43000496     newItem = <span class="keyword">new</span> QTreeWidgetItem(stringList);
43100497
43200498     <a class="code" href="classG4UIQt.html#d2">CreateChildTree</a>(newItem,aCommandTree-&gt;GetTree(a+1));
43300499     aParent-&gt;addChild(newItem);
43400500   }
43500501
43600502
43700503
43800504   <span class="comment">// Get the Commands</span>
43900505
44000506   <span class="keywordflow">for</span> (<span class="keywordtype">int</span> a=0;a&lt;aCommandTree-&gt;GetCommandEntry();a++) {
44100507     
44200508     QStringList stringList;
44300509     stringList &lt;&lt; QString((<span class="keywordtype">char</span>*)(aCommandTree-&gt;GetCommand(a+1)-&gt;GetCommandPath()).data()).trimmed()  ;
44400510     stringList &lt;&lt; QString((<span class="keywordtype">char</span>*)(aCommandTree-&gt;GetCommand(a+1)-&gt;GetCommandPath()).data()).trimmed()  ;
44500511     newItem = <span class="keyword">new</span> QTreeWidgetItem(stringList);
44600512       
44700513     aParent-&gt;addChild(newItem);
44800514     newItem-&gt;setExpanded(<span class="keyword">false</span>);
44900515   }
45000516 }
45100517
45200518
453<a name="l00526"></a><a class="code" href="classG4UIQt.html#d3">00526</a> QString <a class="code" href="classG4UIQt.html#d3">G4UIQt::GetCommandList</a> (
45400527  G4UIcommand *aCommand
45500528 )
45600529 {
45700530
45800531   QString txt;
45900532   G4String commandPath = aCommand-&gt;GetCommandPath();
46000533   G4String rangeString = aCommand-&gt;GetRange();
46100534
46200535   <span class="keywordflow">if</span>((commandPath.length()-1)!=<span class="charliteral">'/'</span>)
46300536     {
46400537       txt += <span class="stringliteral">"Command "</span> + QString((<span class="keywordtype">char</span>*)(commandPath).data()) + <span class="stringliteral">"\n"</span>;
46500538     }
46600539   txt += <span class="stringliteral">"Guidance :\n"</span>;
46700540   G4int n_guidanceEntry = aCommand-&gt;GetGuidanceEntries();
46800541
46900542   <span class="keywordflow">for</span>( G4int i_thGuidance=0; i_thGuidance &lt; n_guidanceEntry; i_thGuidance++ )
47000543     { txt += QString((<span class="keywordtype">char</span>*)(aCommand-&gt;GetGuidanceLine(i_thGuidance)).data()) + <span class="stringliteral">"\n"</span>; }
47100544   <span class="keywordflow">if</span>( ! rangeString.isNull() )
47200545     { txt += <span class="stringliteral">" Range of parameters : "</span> + QString((<span class="keywordtype">char</span>*)(rangeString).data()) + <span class="stringliteral">"\n"</span>; }
47300546   G4int n_parameterEntry = aCommand-&gt;GetParameterEntries();
47400547   <span class="keywordflow">if</span>( n_parameterEntry &gt; 0 )
47500548     {
47600549       G4UIparameter *param;
47700550
47800551       <span class="comment">// Re-implementation of G4UIparameter.cc</span>
47900552
48000553       <span class="keywordflow">for</span>( G4int i_thParameter=0; i_thParameter&lt;n_parameterEntry; i_thParameter++ )
48100554         { param = aCommand-&gt;GetParameter(i_thParameter);
48200555           txt += <span class="stringliteral">"\nParameter : "</span> + QString((<span class="keywordtype">char</span>*)(param-&gt;GetParameterName()).data()) + <span class="stringliteral">"\n"</span>;
48300556           <span class="keywordflow">if</span>( ! param-&gt;GetParameterGuidance().isNull() )
48400557             txt += QString((<span class="keywordtype">char</span>*)(param-&gt;GetParameterGuidance()).data())+ <span class="stringliteral">"\n"</span> ;
48500558           txt += <span class="stringliteral">" Parameter type  : "</span> + QString(param-&gt;GetParameterType())+ <span class="stringliteral">"\n"</span>;
48600559           <span class="keywordflow">if</span>(param-&gt;IsOmittable())
48700560             { txt += <span class="stringliteral">" Omittable       : True\n"</span>; }
48800561           <span class="keywordflow">else</span>
48900562             { txt += <span class="stringliteral">" Omittable       : False\n"</span>; }
49000563           <span class="keywordflow">if</span>( param-&gt;GetCurrentAsDefault() )
49100564             { txt += <span class="stringliteral">" Default value   : taken from the current value\n"</span>; }
49200565           <span class="keywordflow">else</span> <span class="keywordflow">if</span>( ! param-&gt;GetDefaultValue().isNull() )
49300566             { txt += <span class="stringliteral">" Default value   : "</span> + QString((<span class="keywordtype">char</span>*)(param-&gt;GetDefaultValue()).data())+ <span class="stringliteral">"\n"</span>; }
49400567           <span class="keywordflow">if</span>( ! param-&gt;GetParameterRange().isNull() )
49500568             txt += <span class="stringliteral">" Parameter range : "</span> + QString((<span class="keywordtype">char</span>*)(param-&gt;GetParameterRange()).data())+ <span class="stringliteral">"\n"</span>;
49600569           <span class="keywordflow">if</span>( ! param-&gt;GetParameterCandidates().isNull() )
49700570             txt += <span class="stringliteral">" Candidates      : "</span> + QString((<span class="keywordtype">char</span>*)(param-&gt;GetParameterCandidates()).data())+ <span class="stringliteral">"\n"</span>;
49800571         }
49900572     }
50000573   <span class="keywordflow">return</span> txt;
50100574 }
50200575
50300576
50400577
505<a name="l00581"></a><a class="code" href="classG4UIQt.html#d4">00581</a> G4bool <a class="code" href="classG4UIQt.html#d4">G4UIQt::GetHelpChoice</a>(
50600582  G4int&amp; aInt
50700583 )
50800584 {
50900585   printf(<span class="stringliteral">"G4UIQt::GetHelpChoice SHOULD NEVER GO HERE"</span>);
51000586   <span class="keywordflow">return</span> <span class="keyword">true</span>;
51100587 }
51200588
51300589
514<a name="l00593"></a><a class="code" href="classG4UIQt.html#d5">00593</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#d5">G4UIQt::ExitHelp</a>(
51500594 )
51600595 {
51700596   printf(<span class="stringliteral">"G4UIQt::ExitHelp SHOULD NEVER GO HERE"</span>);
51800597 }
51900598
52000599
521<a name="l00608"></a><a class="code" href="classG4UIQt.html#d6">00608</a> <span class="keywordtype">bool</span> <a class="code" href="classG4UIQt.html#d6">G4UIQt::eventFilter</a>(
52200609                          QObject *obj
52300610                          ,QEvent *event
52400611                          )
52500612 {
52600613   <span class="keywordflow">if</span> (obj == <a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>) {
52700614     <span class="keywordflow">if</span> (event-&gt;type() == QEvent::KeyPress) {
52800615       <a class="code" href="classG4UIQt.html#r2">fCommandArea</a>-&gt;setFocus();
52900616     }
53000617   }
53100618   <span class="keywordflow">if</span> (obj == <a class="code" href="classG4UIQt.html#r2">fCommandArea</a>) {
53200619     <span class="keywordflow">if</span> (event-&gt;type() == QEvent::KeyPress) {
53300620       QKeyEvent *e = static_cast&lt;QKeyEvent*&gt;(event);
53400621       <span class="keywordflow">if</span> ((e-&gt;key() == (Qt::Key_Down)) ||
53500622           (e-&gt;key() == (Qt::Key_PageDown)) ||
53600623           (e-&gt;key() == (Qt::Key_Up)) ||
53700624           (e-&gt;key() == (Qt::Key_PageUp))) {
53800625         <span class="keywordtype">int</span> selection = <a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;currentRow();
53900626         <span class="keywordflow">for</span> (<span class="keywordtype">int</span> a=0;a&lt;<a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;count();a++) {
54000627           
54100628         }
54200629         <span class="keywordflow">if</span> (<a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;count()) {
54300630           <span class="keywordflow">if</span> (selection == -1) {
54400631             selection = <a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;count()-1;
54500632           }
54600633           <span class="keywordflow">if</span> (e-&gt;key() == (Qt::Key_Down)) {
54700634             <span class="keywordflow">if</span> (selection &lt;(<a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;count()-1))
54800635               selection++;
54900636           } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (e-&gt;key() == (Qt::Key_PageDown)) {
55000637             selection = <a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;count()-1;
55100638           } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (e-&gt;key() == (Qt::Key_Up)) {
55200639             <span class="keywordflow">if</span> (selection &gt;0)
55300640               selection --;
55400641           } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (e-&gt;key() == (Qt::Key_PageUp)) {
55500642             selection = 0;
55600643           }
55700644           <a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;clearSelection();
55800645           <a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;item(selection)-&gt;setSelected(<span class="keyword">true</span>);
55900646           <a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;setCurrentItem(<a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;item(selection));
56000647         }
56100648       }
56200649     }
56300650   }
56400651   <span class="comment">// pass the event on to the parent class</span>
56500652   <span class="keywordflow">return</span> QObject::eventFilter(obj, event);
56600653 }
56700654
56800655
56900656
57000657
57100658 <span class="comment">/***************************************************************************/</span>
57200659 <span class="comment">//</span>
57300660 <span class="comment">//             SLOTS DEFINITIONS</span>
57400661 <span class="comment">//</span>
57500662 <span class="comment">/***************************************************************************/</span>
57600663
577<a name="l00667"></a><a class="code" href="classG4UIQt.html#k4">00667</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#k4">G4UIQt::showHelpCallback</a> (
57800668 )
57900669 {
58000670   <a class="code" href="classG4UIQt.html#d1">TerminalHelp</a>(<span class="stringliteral">""</span>);
58100671 }
58200672
58300673
584<a name="l00677"></a><a class="code" href="classG4UIQt.html#k0">00677</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#k0">G4UIQt::clearButtonCallback</a> (
58500678 )
58600679 {
58700680   <a class="code" href="classG4UIQt.html#r3">fTextArea</a>-&gt;clear();
58800681 }
58900682
59000683
591<a name="l00688"></a><a class="code" href="classG4UIQt.html#k1">00688</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#k1">G4UIQt::commandEnteredCallback</a> (
59200689 )
59300690 {
59400691   G4String command (<a class="code" href="classG4UIQt.html#r2">fCommandArea</a>-&gt;text().toStdString().c_str());
59500692   <span class="keywordflow">if</span> (<a class="code" href="classG4UIQt.html#r2">fCommandArea</a>-&gt;text().trimmed() != <span class="stringliteral">""</span>) {
59600693     <a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;addItem(<a class="code" href="classG4UIQt.html#r2">fCommandArea</a>-&gt;text());
59700694     <a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;clearSelection();
59800695     <a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;item(<a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;count()-1)-&gt;setSelected(<span class="keyword">true</span>);
59900696     <a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;setCurrentItem(<a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;item(<a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;count()-1));
60000697
60100698     <span class="keywordflow">if</span> (command(0,4) != <span class="stringliteral">"help"</span>) {
60200699       <a class="code" href="classG4VBasicShell.html#b10">ApplyShellCommand</a> (command,<a class="code" href="G4UIQt_8cc.html#a0">exitSession</a>,<a class="code" href="G4UIQt_8cc.html#a1">exitPause</a>);
60300700     } <span class="keywordflow">else</span> {
60400701       <a class="code" href="classG4UIQt.html#d1">TerminalHelp</a>(command);
60500702     }
60600703     <span class="keywordflow">if</span>(<a class="code" href="G4UIQt_8cc.html#a0">exitSession</a>==<span class="keyword">true</span>)
60700704       <a class="code" href="classG4UIQt.html#a6">SessionTerminate</a>();
60800705   }
60900706   <a class="code" href="classG4UIQt.html#r2">fCommandArea</a>-&gt;setText(<span class="stringliteral">""</span>);
61000707 }
61100708
61200709
613<a name="l00715"></a><a class="code" href="classG4UIQt.html#k2">00715</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#k2">G4UIQt::buttonCallback</a> (
61400716  <span class="keyword">const</span> QString&amp; aCommand
61500717 )
61600718 {
61700719   G4String ss = G4String(aCommand.toStdString().c_str());
61800720   printf (<span class="stringliteral">"debug : execute:\n-%s- %d %d \n"</span>,ss.data(),<a class="code" href="G4UIQt_8cc.html#a0">exitSession</a>,<a class="code" href="G4UIQt_8cc.html#a1">exitPause</a>);
61900721   <a class="code" href="classG4VBasicShell.html#b10">ApplyShellCommand</a>(ss,<a class="code" href="G4UIQt_8cc.html#a0">exitSession</a>,<a class="code" href="G4UIQt_8cc.html#a1">exitPause</a>);
62000722   <span class="keywordflow">if</span>(<a class="code" href="G4UIQt_8cc.html#a0">exitSession</a>==<span class="keyword">true</span>)
62100723     <a class="code" href="classG4UIQt.html#a6">SessionTerminate</a>();
62200724 }
62300725
62400726
62500727
626<a name="l00731"></a><a class="code" href="classG4UIQt.html#k3">00731</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#k3">G4UIQt::helpTreeCallback</a> (
62700732 )
62800733 {
62900734   <span class="comment">//  G4bool GetHelpChoice(G4int&amp;);</span>
63000735   QTreeWidgetItem* item =  NULL;
63100736   <span class="keywordflow">if</span> (!<a class="code" href="classG4UIQt.html#r7">fHelpTreeWidget</a>)
63200737     <span class="keywordflow">return</span> ;
63300738
63400739   <span class="keywordflow">if</span> (!<a class="code" href="classG4UIQt.html#r4">fHelpArea</a>)
63500740     <span class="keywordflow">return</span>;
63600741   
63700742   QList&lt;QTreeWidgetItem *&gt; list =<a class="code" href="classG4UIQt.html#r7">fHelpTreeWidget</a>-&gt;selectedItems();
63800743   <span class="keywordflow">if</span> (list.isEmpty())
63900744     <span class="keywordflow">return</span>;
64000745   item = list.first();
64100746   <span class="keywordflow">if</span> (!item)
64200747     <span class="keywordflow">return</span>;
64300748   
64400749   G4UImanager* UI = G4UImanager::GetUIpointer();
64500750   <span class="keywordflow">if</span>(UI==NULL) <span class="keywordflow">return</span>;
64600751   G4UIcommandTree * treeTop = UI-&gt;GetTree();
64700752   G4UIcommand* command = treeTop-&gt;FindPath(item-&gt;text (1).toStdString().c_str());
64800753   <span class="keywordflow">if</span> (command) {
64900754     <a class="code" href="classG4UIQt.html#r4">fHelpArea</a>-&gt;setText(<a class="code" href="classG4UIQt.html#d3">GetCommandList</a>(command));
65000755   } <span class="keywordflow">else</span> {
65100756     <span class="comment">// this is not a command, this is a sub directory</span>
65200757     <span class="comment">// We display the Title</span>
65300758     <a class="code" href="classG4UIQt.html#r4">fHelpArea</a>-&gt;setText(item-&gt;text (1).toStdString().c_str());
65400759   }
65500760 }
65600761
65700762
658<a name="l00767"></a><a class="code" href="classG4UIQt.html#k5">00767</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#k5">G4UIQt::commandHistoryCallback</a>(
65900768 )
66000769 {
66100770   QListWidgetItem* item =  NULL;
66200771   <span class="keywordflow">if</span> (!<a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>)
66300772     <span class="keywordflow">return</span> ;
66400773
66500774   
66600775   QList&lt;QListWidgetItem *&gt; list =<a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>-&gt;selectedItems();
66700776   <span class="keywordflow">if</span> (list.isEmpty())
66800777     <span class="keywordflow">return</span>;
66900778   item = list.first();
67000779   <span class="keywordflow">if</span> (!item)
67100780     <span class="keywordflow">return</span>;
67200781   <a class="code" href="classG4UIQt.html#r2">fCommandArea</a>-&gt;setText(item-&gt;text());
67300782
67400783 }
67500784
67600785 <span class="preprocessor">#endif</span>
677</pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri Jun 22 11:07:02 2007 by
678<a href="http://www.doxygen.org/index.html">
679<img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
680</a>1.3.4 </small></address>
681</body>
682</html>
Note: See TracBrowser for help on using the repository browser.