Geant4-11
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Types | Private Slots | Private Member Functions | Private Attributes
G4UIQt Class Reference

#include <G4UIQt.hh>

Inheritance diagram for G4UIQt:
G4VBasicShell G4VInteractiveSession G4UIsession G4coutDestination

Data Structures

struct  G4UIQtStyle
 

Public Types

using Transformer = std::function< G4bool(G4String &)>
 

Public Member Functions

void AddButton (const char *, const char *, const char *)
 
void AddCerrTransformer (const Transformer &t)
 
void AddCerrTransformer (Transformer &&t)
 
void AddCoutTransformer (const Transformer &t)
 
void AddCoutTransformer (Transformer &&t)
 
void AddIcon (const char *userLabel, const char *iconFile, const char *command, const char *file_name="")
 
void AddInteractor (G4String, G4Interactor)
 
void AddMenu (const char *, const char *)
 
bool AddTabWidget (QWidget *, QString)
 
bool AddViewerTab (QWidget *w, std::string title)
 
bool AddViewerTabFromFile (std::string fileName, std::string title)
 
void ClearMenu ()
 
void DefaultIcons (bool aVal)
 
 G4UIQt (int, char **)
 
QPixmap * getClearIcon ()
 
G4UIDockWidgetGetCoutDockWidget ()
 
QWidget * GetCoutWidget ()
 
QWidget * GetHelpWidget ()
 
QWidget * GetHistoryWidget ()
 
G4Interactor GetInteractor (G4String)
 
G4int GetLastReturnCode () const
 
QMainWindow * GetMainWindow ()
 
QWidget * GetPickInfosWidget ()
 
QWidget * GetSceneTreeWidget ()
 
QPixmap * getSearchIcon ()
 
QTabWidget * GetUITabWidget ()
 
G4UIDockWidgetGetUserInterfaceWidget ()
 
QWidget * GetViewerPropertiesWidget ()
 
QTabWidget * GetViewerTabWidget ()
 
bool IsIconMoveSelected ()
 
bool IsIconPickSelected ()
 
bool IsIconRotateSelected ()
 
bool IsIconZoomInSelected ()
 
bool IsIconZoomOutSelected ()
 
bool IsSplitterReleased ()
 
void NativeMenu (bool aVal)
 
void OutputStyle (const char *, const char *, const char *)
 
virtual void PauseSessionStart (const G4String &)
 
void Prompt (G4String)
 
virtual G4int ReceiveG4cerr (const G4String &)
 
G4int ReceiveG4cerr_ (const G4String &msg)
 
virtual G4int ReceiveG4cout (const G4String &)
 
G4int ReceiveG4cout_ (const G4String &msg)
 
virtual void ResetTransformers ()
 
G4UIsessionSessionStart ()
 
void SessionTerminate ()
 
void SetIconHLHSRSelected ()
 
void SetIconHLRSelected ()
 
void SetIconMoveSelected ()
 
void SetIconOrthoSelected ()
 
void SetIconPerspectiveSelected ()
 
void SetIconPickSelected ()
 
void SetIconRotateSelected ()
 
void SetIconSolidSelected ()
 
void SetIconWireframeSelected ()
 
void SetIconZoomInSelected ()
 
void SetIconZoomOutSelected ()
 
void SetStartPage (const std::string &)
 
 ~G4UIQt ()
 

Static Public Member Functions

static G4int InSession ()
 

Protected Member Functions

void ApplyShellCommand (const G4String &, G4bool &, G4bool &)
 
G4bool ChangeDirectory (const char *newDir)
 
void ChangeDirectoryCommand (const G4String &)
 
G4String Complete (const G4String &)
 
virtual void ExecuteCommand (const G4String &)
 
G4UIcommandFindCommand (const char *commandName) const
 
G4UIcommandTreeFindDirectory (const char *dirName) const
 
G4String FindMatchingPath (G4UIcommandTree *, const G4String &)
 
G4String GetCurrentWorkingDirectory () const
 
void ListDirectory (const G4String &) const
 
G4String ModifyToFullPathCommand (const char *aCommandLine) const
 
void ShowCurrent (const G4String &) const
 
void TerminalHelp (const G4String &)
 

Protected Attributes

G4int ifBatch = 0
 
G4int lastRC = 0
 
std::vector< TransformertransformersCerr
 
std::vector< TransformertransformersCout
 

Static Protected Attributes

static G4ICOMS_DLL G4int inSession = 0
 
static G4MTGLOB_DLL G4coutDestinationmasterG4coutDestination = nullptr
 

Private Types

typedef std::map< G4String, G4Interactor, std::less< G4String > > G4interactor_map
 

Private Slots

void ButtonCallback (const QString &)
 
void ChangeColorCallback (QWidget *)
 
void ChangeCursorAction (const QString &)
 
void ChangePerspectiveOrtho (const QString &)
 
void ChangeSurfaceStyle (const QString &)
 
void ClearButtonCallback ()
 
void CommandEditedCallback (const QString &text)
 
void CommandEnteredCallback ()
 
void CommandHistoryCallback ()
 
void CoutFilterCallback (const QString &)
 
void ExitSession ()
 
void HelpTreeClicCallback ()
 
void HelpTreeDoubleClicCallback ()
 
void LookForHelpStringCallback ()
 
void OpenIconCallback (const QString &)
 
void ResizeTabWidget (QResizeEvent *)
 
void SaveIconCallback (const QString &)
 
void SaveOutputCallback ()
 
void ShowHelpCallback ()
 
void TabCloseCallback (int)
 
void ThreadComboBoxCallback (int)
 
void ToolBoxActivated (int)
 
void UpdateTabWidget (int)
 
void ViewerPropertiesIconCallback (int)
 
void VisParameterCallback (QWidget *)
 

Private Member Functions

void ActivateCommand (G4String)
 
bool CheckG4EnvironmentVariable (char *txt, char *version)
 
bool CreateCommandWidget (G4UIcommand *command, QWidget *parent, bool isDialog)
 
QStandardItemModel * CreateCompleterModel (G4String aCmd)
 
G4UIDockWidgetCreateCoutTBWidget ()
 
void CreateEmptyPickInfosWidget ()
 
void CreateEmptyViewerPropertiesWidget ()
 
QWidget * CreateHelpTBWidget ()
 
void CreateHelpTree (QTreeWidgetItem *, G4UIcommandTree *)
 
void CreateHelpWidget ()
 
QWidget * CreateHistoryTBWidget ()
 
void CreateIcons ()
 
void CreatePickInfosDialog ()
 
QWidget * CreateSceneTreeWidget ()
 
G4UIDockWidgetCreateUITabWidget ()
 
void CreateViewerPropertiesDialog ()
 
void CreateViewerWidget ()
 
bool CreateVisCommandGroupAndToolBox (G4UIcommand *, QWidget *, int, bool isDialog)
 
QWidget * CreateVisParametersTBWidget ()
 
bool eventFilter (QObject *, QEvent *)
 
virtual void ExitHelp () const
 
void FillHelpTree ()
 
void FilterAllOutputTextArea ()
 
QString FilterOutput (const G4UIOutputString &, const QString &, const QString &)
 
QTreeWidgetItem * FindTreeItem (QTreeWidgetItem *, const QString &)
 
QString GetCommandList (const G4UIcommand *)
 
virtual G4bool GetHelpChoice (G4int &)
 
QString GetLongCommandPath (QTreeWidgetItem *)
 
QString GetShortCommandPath (QString)
 
G4String GetThreadPrefix ()
 
void InitHelpTreeAndVisParametersWidget ()
 
G4bool IsGUICommand (const G4UIcommand *)
 
QMap< int, QString > LookForHelpStringInChildTree (G4UIcommandTree *, const QString &)
 
G4String ModifyPath (const G4String &tempPath) const
 
void OpenHelpTreeOnCommand (const QString &)
 
void SecondaryLoop (G4String)
 
void SetDefaultIconsToolbar ()
 
void UpdateCommandCompleter ()
 
void updateHelpArea (const G4UIcommand *)
 

Private Attributes

G4String currentDirectory
 
QPixmap * fClearIcon
 
QLineEdit * fCommandArea
 
QPixmap * fCommandIcon
 
QLabel * fCommandLabel
 
QCompleter * fCompleter
 
G4UIDockWidgetfCoutDockWidget
 
QLineEdit * fCoutFilter
 
QTextEdit * fCoutTBTextArea
 
QString fCoutText
 
bool fDefaultIcons
 
std::string fDefaultViewerFirstPageHTMLText
 
QPixmap * fDirIcon
 
QPixmap * fExitIcon
 
std::vector< G4UIOutputStringfG4OutputString
 
QLineEdit * fHelpLine
 
QWidget * fHelpTBWidget
 
QTreeWidget * fHelpTreeWidget
 
QSplitter * fHelpVSplitter
 
QPixmap * fHiddenLineAndSurfaceRemovalIcon
 
QPixmap * fHiddenLineRemovalIcon
 
QListWidget * fHistoryTBTableList
 
QWidget * fHistoryTBWidget
 
QString fLastCompleteCommand
 
G4String fLastErrMessage
 
QString fLastOpenPath
 
QMainWindow * fMainWindow
 
QPixmap * fMoveIcon
 
bool fMoveSelected
 
QPixmap * fOpenIcon
 
QPixmap * fOrthoIcon
 
std::map< G4String, G4UIQtStylefOutputStyles
 
QTextEdit * fParameterHelpLabel
 
QTableWidget * fParameterHelpTable
 
QPixmap * fParamIcon
 
QPixmap * fPerspectiveIcon
 
QPixmap * fPickIcon
 
QDialog * fPickInfosDialog
 
QWidget * fPickInfosWidget
 
bool fPickSelected
 
QPixmap * fPickTargetIcon
 
QPixmap * fRotateIcon
 
bool fRotateSelected
 
QPixmap * fRunIcon
 
QPixmap * fSaveIcon
 
QWidget * fSceneTreeWidget
 
QPixmap * fSearchIcon
 
QPixmap * fSolidIcon
 
QTextBrowser * fStartPage
 
QString fStringSeparator
 
QToolButton * fSurfaceModePopupButton
 
QToolBar * fToolbarApp
 
QToolBar * fToolbarUser
 
G4UIDockWidgetfUIDockWidget
 
QTabWidget * fUITabWidget
 
QDialog * fViewerPropertiesDialog
 
QWidget * fViewerPropertiesWidget
 
G4QTabWidgetfViewerTabWidget
 
QToolButton * fViewModePopupButton
 
QPixmap * fWireframeIcon
 
QPixmap * fZoomInIcon
 
bool fZoomInSelected
 
QPixmap * fZoomOutIcon
 
bool fZoomOutSelected
 
G4interactor_map interactors
 
G4UImessengermessenger
 

Detailed Description

Definition at line 123 of file G4UIQt.hh.

Member Typedef Documentation

◆ G4interactor_map

typedef std::map<G4String,G4Interactor, std::less<G4String> > G4VInteractiveSession::G4interactor_map
privateinherited

Definition at line 63 of file G4VInteractiveSession.hh.

◆ Transformer

Definition at line 61 of file G4coutDestination.hh.

Constructor & Destructor Documentation

◆ G4UIQt()

G4UIQt::G4UIQt ( int  argc,
char **  argv 
)

Build a Qt window with a menubar, output area and promt area

   +-----------------------+
   |exit menu|             |
   |                       |
   | +-------------------+ |
   | |                   | |
   | |  Output area      | |
   | |                   | |
   | +-------------------+ |
   |      | clear |        |
   | +-------------------+ |
   | |  promt history    | |
   | +-------------------+ |
   | +-------------------+ |
   | |> promt area       | |
   | +-------------------+ |
   +-----------------------+

Definition at line 115 of file G4UIQt.cc.

119:fMainWindow(NULL)
120,fCommandLabel(NULL)
121,fCommandArea(NULL)
122,fCoutTBTextArea(NULL)
123,fUITabWidget(NULL)
124,fCoutFilter(NULL)
125,fCompleter(NULL)
126,fDefaultIcons(true)
128,fHelpTreeWidget(NULL)
129,fHelpTBWidget(NULL)
130,fHistoryTBWidget(NULL)
131,fCoutDockWidget(NULL)
132,fUIDockWidget(NULL)
133,fSceneTreeWidget(NULL)
135,fPickInfosWidget(NULL)
136,fHelpLine(NULL)
137,fViewerTabWidget(NULL)
138,fCoutText("Output")
139,fStartPage(NULL)
140,fHelpVSplitter(NULL)
143,fToolbarApp(NULL)
144,fToolbarUser(NULL)
145,fStringSeparator("__$$$@%%###__")
146,fLastOpenPath("")
147,fSearchIcon(NULL)
148,fClearIcon(NULL)
149,fSaveIcon(NULL)
150,fOpenIcon(NULL)
151,fMoveIcon(NULL)
152,fRotateIcon(NULL)
153,fPickIcon(NULL)
154,fZoomInIcon(NULL)
155,fZoomOutIcon(NULL)
156,fWireframeIcon(NULL)
157,fSolidIcon(NULL)
160,fPerspectiveIcon(NULL)
161,fOrthoIcon(NULL)
162,fCommandIcon(NULL)
163,fDirIcon(NULL)
164,fRunIcon(NULL)
165,fParamIcon(NULL)
166,fPickTargetIcon(NULL)
167#ifdef G4MULTITHREADED
168,fThreadsFilterComboBox(NULL)
169#endif
172,fPickInfosDialog(NULL)
174,fMoveSelected(false)
175,fRotateSelected(true)
176,fPickSelected(false)
177,fZoomInSelected(false)
178,fZoomOutSelected(false)
179{
180
181 G4Qt* interactorManager = G4Qt::getInstance (argc,argv,(char*)"Qt");
182 if (!(QApplication*)interactorManager->GetMainInteractor()) {
184 G4int verbose = UImanager->GetVerboseLevel();
185
186 if (verbose >= 2) {
187 G4cout << "G4UIQt : Unable to init Qt. Aborted" << G4endl;
188 }
189 }
190
192 if(UI!=NULL) UI->SetSession(this);
193 if(UI!=NULL) UI->SetG4UIWindow(this);
194
195 // Check if already define in external app QMainWindow
196 bool found = false;
197 Q_FOREACH (QWidget *widget, QApplication::allWidgets()) {
198 if ((found== false) && (widget->inherits("QMainWindow"))) {
199 found = true;
200 }
201 }
202
203 if (found) {
205 G4int verbose = UImanager->GetVerboseLevel();
206
207 if (verbose >= 2) {
208 G4cout << "G4UIQt : Found an external App with a QMainWindow already defined. Aborted" << G4endl;
209 }
210 return ;
211 }
212 CreateIcons();
213
214 // Set default output styles
215 for (const auto& destination: {"cout","cerr","warnings","errors"}) {
216 G4UIQtStyle defaultStyle;
217 defaultStyle.fixed = true;
218 defaultStyle.highlight = true;
219 fOutputStyles[destination] = defaultStyle;
220 }
221
222 fMainWindow = new QMainWindow();
223 fMainWindow->setAttribute(Qt::WA_DeleteOnClose);
224
225 fMainWindow->setCorner( Qt::TopLeftCorner, Qt::LeftDockWidgetArea );
226 fMainWindow->setCorner( Qt::TopRightCorner, Qt::RightDockWidgetArea );
227 fMainWindow->setCorner( Qt::BottomLeftCorner, Qt::LeftDockWidgetArea );
228 fMainWindow->setCorner( Qt::BottomRightCorner, Qt::RightDockWidgetArea );
229
231 fMainWindow->addDockWidget(Qt::LeftDockWidgetArea, CreateUITabWidget());
232 fMainWindow->addDockWidget(Qt::BottomDockWidgetArea, CreateCoutTBWidget());
233
234
235 // add defaults icons
237
238 if(UI!=NULL) UI->SetCoutDestination(this); // TO KEEP
239
240#ifdef G4MULTITHREADED
241 // explicitly request that cout/cerr messages from threads are ALSO propagated to the master.
243#endif
244
245 fMainWindow->setWindowTitle(QFileInfo( QCoreApplication::applicationFilePath() ).fileName());
246 fMainWindow->move(QPoint(50,50));
247
248 // force the size at be correct at the beggining
249 // because the widget is not realized yet, the size of the main window is not up to date. But
250 // we need it in order to add some viewer inside
251 fMainWindow->resize(fUIDockWidget->width()+fCoutDockWidget->width()+20,
252 fUIDockWidget->height()+fCoutDockWidget->height()+20);
253
254 // set last focus on command line
255 fCommandArea->setFocus(Qt::TabFocusReason);
256
257 // Allow QTextCursor to be called by another thread :
258 // http://qt-project.org/doc/qt-4.8/qmetatype.html#qRegisterMetaType
259 qRegisterMetaType<QTextCursor>("QTextCursor");
260
261 // add some tips
262 AddTabWidget(fStartPage,"Useful tips");
263
264 // Set not visible until session start
265 #if QT_VERSION < 0x040200
266 fMainWindow->hide();
267 #else
268 fMainWindow->setVisible(false);
269 #endif
270}
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
Definition: G4Qt.hh:49
static G4Qt * getInstance()
Definition: G4Qt.cc:51
QTextEdit * fParameterHelpLabel
Definition: G4UIQt.hh:344
QString fStringSeparator
Definition: G4UIQt.hh:349
G4QTabWidget * fViewerTabWidget
Definition: G4UIQt.hh:340
QPixmap * fPerspectiveIcon
Definition: G4UIQt.hh:368
QPixmap * fRotateIcon
Definition: G4UIQt.hh:360
void CreateViewerWidget()
Definition: G4UIQt.cc:1719
QLabel * fCommandLabel
Definition: G4UIQt.hh:321
QDialog * fViewerPropertiesDialog
Definition: G4UIQt.hh:382
G4UIDockWidget * CreateUITabWidget()
Definition: G4UIQt.cc:1678
QPixmap * fMoveIcon
Definition: G4UIQt.hh:359
QToolBar * fToolbarUser
Definition: G4UIQt.hh:348
QWidget * fViewerPropertiesWidget
Definition: G4UIQt.hh:337
QPixmap * fSearchIcon
Definition: G4UIQt.hh:355
QPixmap * fPickIcon
Definition: G4UIQt.hh:361
QPixmap * fSaveIcon
Definition: G4UIQt.hh:357
QPixmap * fClearIcon
Definition: G4UIQt.hh:356
QLineEdit * fCommandArea
Definition: G4UIQt.hh:322
bool fZoomOutSelected
Definition: G4UIQt.hh:389
std::string fDefaultViewerFirstPageHTMLText
Definition: G4UIQt.hh:380
QPixmap * fZoomInIcon
Definition: G4UIQt.hh:362
QPixmap * fSolidIcon
Definition: G4UIQt.hh:365
QString fCoutText
Definition: G4UIQt.hh:341
QPixmap * fCommandIcon
Definition: G4UIQt.hh:370
QWidget * fHistoryTBWidget
Definition: G4UIQt.hh:333
void SetDefaultIconsToolbar()
Definition: G4UIQt.cc:320
bool fDefaultIcons
Definition: G4UIQt.hh:328
QLineEdit * fHelpLine
Definition: G4UIQt.hh:339
QPixmap * fRunIcon
Definition: G4UIQt.hh:372
QPixmap * fHiddenLineAndSurfaceRemovalIcon
Definition: G4UIQt.hh:367
QTabWidget * fUITabWidget
Definition: G4UIQt.hh:324
bool fZoomInSelected
Definition: G4UIQt.hh:388
bool fMoveSelected
Definition: G4UIQt.hh:385
QDialog * fPickInfosDialog
Definition: G4UIQt.hh:383
QWidget * fPickInfosWidget
Definition: G4UIQt.hh:338
QTreeWidget * fHelpTreeWidget
Definition: G4UIQt.hh:331
QWidget * fSceneTreeWidget
Definition: G4UIQt.hh:336
std::map< G4String, G4UIQtStyle > fOutputStyles
Definition: G4UIQt.hh:393
QPixmap * fPickTargetIcon
Definition: G4UIQt.hh:374
QMainWindow * fMainWindow
Definition: G4UIQt.hh:320
QString fLastCompleteCommand
Definition: G4UIQt.hh:384
void CreateIcons()
Definition: G4UIQt.cc:367
QPixmap * fParamIcon
Definition: G4UIQt.hh:373
QCompleter * fCompleter
Definition: G4UIQt.hh:327
G4UIDockWidget * CreateCoutTBWidget()
Definition: G4UIQt.cc:1557
G4UIDockWidget * fCoutDockWidget
Definition: G4UIQt.hh:334
QSplitter * fHelpVSplitter
Definition: G4UIQt.hh:343
QTableWidget * fParameterHelpTable
Definition: G4UIQt.hh:345
QToolBar * fToolbarApp
Definition: G4UIQt.hh:347
QPixmap * fOrthoIcon
Definition: G4UIQt.hh:369
QPixmap * fHiddenLineRemovalIcon
Definition: G4UIQt.hh:366
QPixmap * fZoomOutIcon
Definition: G4UIQt.hh:363
QPixmap * fDirIcon
Definition: G4UIQt.hh:371
QPixmap * fOpenIcon
Definition: G4UIQt.hh:358
QTextEdit * fCoutTBTextArea
Definition: G4UIQt.hh:323
QPixmap * fWireframeIcon
Definition: G4UIQt.hh:364
QTextBrowser * fStartPage
Definition: G4UIQt.hh:342
bool AddTabWidget(QWidget *, QString)
Definition: G4UIQt.cc:1860
QString fLastOpenPath
Definition: G4UIQt.hh:351
QListWidget * fHistoryTBTableList
Definition: G4UIQt.hh:330
G4UIDockWidget * fUIDockWidget
Definition: G4UIQt.hh:335
QLineEdit * fCoutFilter
Definition: G4UIQt.hh:326
bool fRotateSelected
Definition: G4UIQt.hh:386
bool fPickSelected
Definition: G4UIQt.hh:387
QWidget * fHelpTBWidget
Definition: G4UIQt.hh:332
void SetCoutDestination(G4UIsession *const value)
Definition: G4UImanager.cc:727
G4int GetVerboseLevel() const
Definition: G4UImanager.hh:200
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77
void SetSession(G4UIsession *const value)
Definition: G4UImanager.hh:190
void SetG4UIWindow(G4UIsession *const value)
Definition: G4UImanager.hh:191
G4Interactor GetMainInteractor()
static G4MTGLOB_DLL G4coutDestination * masterG4coutDestination

References AddTabWidget(), CreateCoutTBWidget(), CreateIcons(), CreateUITabWidget(), CreateViewerWidget(), fCommandArea, fCoutDockWidget, G4UIQt::G4UIQtStyle::fixed, fMainWindow, fOutputStyles, fStartPage, fUIDockWidget, G4cout, G4endl, G4Qt::getInstance(), G4VInteractorManager::GetMainInteractor(), G4UImanager::GetUIpointer(), G4UImanager::GetVerboseLevel(), G4UIQt::G4UIQtStyle::highlight, G4coutDestination::masterG4coutDestination, G4UImanager::SetCoutDestination(), SetDefaultIconsToolbar(), G4UImanager::SetG4UIWindow(), and G4UImanager::SetSession().

◆ ~G4UIQt()

G4UIQt::~G4UIQt ( )

Definition at line 274 of file G4UIQt.cc.

276{
277 G4UImanager* UI = G4UImanager::GetUIpointer(); // TO KEEP
278 if(UI!=NULL) { // TO KEEP
279 UI->SetSession(NULL); // TO KEEP
280 UI->SetG4UIWindow(NULL);
281 UI->SetCoutDestination(0); // TO KEEP
282#ifdef G4MULTITHREADED
283 masterG4coutDestination = 0; // set to cout when UI is deleted
284#endif
285 }
286}

References G4UImanager::GetUIpointer(), G4coutDestination::masterG4coutDestination, G4UImanager::SetCoutDestination(), G4UImanager::SetG4UIWindow(), and G4UImanager::SetSession().

Member Function Documentation

◆ ActivateCommand()

void G4UIQt::ActivateCommand ( G4String  newCommand)
private

Definition at line 2700 of file G4UIQt.cc.

2703{
2704 if (!fHelpTreeWidget) {
2705 return;
2706 }
2707 // Look for the choosen command "newCommand"
2708 size_t i = newCommand.find(" ");
2709 G4String targetCom ="";
2710 if( i != std::string::npos )
2711 {
2712 G4String newValue = newCommand.substr(i+1,newCommand.length()-(i+1));
2713 G4StrUtil::strip(newValue);
2714 targetCom = ModifyToFullPathCommand( newValue );
2715 }
2716 if (targetCom != "") {
2717 OpenHelpTreeOnCommand(targetCom.data());
2718 }
2719
2720 fUITabWidget->setCurrentWidget(fHelpTBWidget);
2721}
void OpenHelpTreeOnCommand(const QString &)
Definition: G4UIQt.cc:4289
G4String ModifyToFullPathCommand(const char *aCommandLine) const
void strip(G4String &str, char c=' ')
Remove leading and trailing characters from string.

References fHelpTBWidget, fHelpTreeWidget, fUITabWidget, G4VBasicShell::ModifyToFullPathCommand(), OpenHelpTreeOnCommand(), and G4StrUtil::strip().

Referenced by CommandEnteredCallback().

◆ AddButton()

void G4UIQt::AddButton ( const char *  aMenu,
const char *  aLabel,
const char *  aCommand 
)
virtual

Add a new button to a menu

Parameters
aMenu: parent menu
aLabel: label to display
aCommand: command to execute as a callback

Reimplemented from G4VInteractiveSession.

Definition at line 2354 of file G4UIQt.cc.

2359{
2360 if(aMenu==NULL) return; // TO KEEP
2361 if(aLabel==NULL) return; // TO KEEP
2362 if(aCommand==NULL) return; // TO KEEP
2363
2364 QMenu *parentTmp = (QMenu*)GetInteractor(aMenu);
2365
2366 if(parentTmp==NULL) {
2368 G4int verbose = UImanager->GetVerboseLevel();
2369
2370 if (verbose >= 2) {
2371 G4cout << "Menu name " << aMenu<< " does not exist, please define it before using it."<< G4endl;
2372 }
2373 return;
2374 }
2375
2376 // Find the command in the command tree
2378 if(UI==NULL) return;
2379 G4UIcommandTree * treeTop = UI->GetTree();
2380
2381 G4String cmd = aCommand;
2382 G4int cmdEndPos = cmd.find_first_of(" \t");
2383 if(cmdEndPos!=G4int(std::string::npos)) {
2384 cmd.erase(cmdEndPos);
2385 }
2386
2387 if(treeTop->FindPath(cmd) == NULL) {
2388 if(cmd != "ls" &&
2389 cmd.substr(0,3) != "ls " &&
2390 cmd != "pwd" &&
2391 cmd != "cd" &&
2392 cmd.substr(0,3) != "cd " &&
2393 cmd != "help" &&
2394 cmd.substr(0,5) != "help " &&
2395 cmd[0] != '?' &&
2396 cmd != "hist" &&
2397 cmd != "history" &&
2398 cmd[0] != '!' &&
2399 cmd != "exit" &&
2400 cmd != "cont" &&
2401 cmd != "continue"){
2403 G4int verbose = UImanager->GetVerboseLevel();
2404
2405 if (verbose >= 2) {
2406 G4cout << "Warning: command '"<< cmd <<"' does not exist, please define it before using it."<< G4endl;
2407 }
2408 }
2409 }
2410
2411#if QT_VERSION < 0x050600
2412 QSignalMapper *signalMapper = new QSignalMapper(this);
2413 QAction *action = parentTmp->addAction(aLabel, signalMapper, SLOT(map()));
2414
2415 connect(signalMapper, SIGNAL(mapped(const QString &)),this, SLOT(ButtonCallback(const QString&)));
2416 signalMapper->setMapping(action, QString(aCommand));
2417#else
2418 QString cmd_tmp = QString(aCommand);
2419 parentTmp->addAction(aLabel, this, [this, cmd_tmp](){ this->ButtonCallback(cmd_tmp); });
2420#endif
2421}
void ButtonCallback(const QString &)
Definition: G4UIQt.cc:4046
G4UIcommand * FindPath(const char *commandPath) const
G4UIcommandTree * GetTree() const
Definition: G4UImanager.hh:186
G4Interactor GetInteractor(G4String)
def connect(endpoint="tcp://127.0.0.1:5555")
Definition: g4zmq.py:15

References geant4_check_module_cycles::action, ButtonCallback(), g4zmq::connect(), G4UIcommandTree::FindPath(), G4cout, G4endl, G4VInteractiveSession::GetInteractor(), G4UImanager::GetTree(), G4UImanager::GetUIpointer(), G4UImanager::GetVerboseLevel(), and anonymous_namespace{G4QuasiElRatios.cc}::map.

◆ AddCerrTransformer() [1/2]

void G4coutDestination::AddCerrTransformer ( const Transformer t)
inlineinherited

Definition at line 67 of file G4coutDestination.hh.

68 {
69 transformersCerr.push_back(t);
70 }
std::vector< Transformer > transformersCerr

References G4coutDestination::transformersCerr.

Referenced by G4MTcoutDestination::HandleFileCerr().

◆ AddCerrTransformer() [2/2]

void G4coutDestination::AddCerrTransformer ( Transformer &&  t)
inlineinherited

Definition at line 71 of file G4coutDestination.hh.

71{ transformersCerr.push_back(t); }

References G4coutDestination::transformersCerr.

◆ AddCoutTransformer() [1/2]

void G4coutDestination::AddCoutTransformer ( const Transformer t)
inlineinherited

◆ AddCoutTransformer() [2/2]

void G4coutDestination::AddCoutTransformer ( Transformer &&  t)
inlineinherited

Definition at line 66 of file G4coutDestination.hh.

66{ transformersCout.push_back(t); }

References G4coutDestination::transformersCout.

◆ AddIcon()

void G4UIQt::AddIcon ( const char *  aLabel,
const char *  aIconFile,
const char *  aCommand,
const char *  aFileName = "" 
)
virtual

special case for the "open" icon. It will open a file selector and map the return file to the given command.

Reimplemented from G4VInteractiveSession.

Definition at line 2429 of file G4UIQt.cc.

2429 {
2430 if(aLabel==NULL) return; // TO KEEP
2431 // special case, aCommand could be NULL if aIconFile is not user_icon
2432 if (aCommand==NULL) {
2433 if (std::string(aIconFile) == "user_icon") {
2434 return; // TO KEEP
2435 }
2436 }
2437 QPixmap* pix;
2438 bool userToolBar = false;
2439
2440 if (!fDefaultIcons) {
2441 userToolBar = true;
2442 }
2443 if (std::string(aIconFile) == "user_icon") {
2444 // try to open a file
2446 pix = new QPixmap(UImanager->FindMacroPath(aFileName).data());
2447 if (pix->isNull()) {
2448 G4int verbose = UImanager->GetVerboseLevel();
2449
2450 if (verbose >= 2) {
2451 G4cout << "Warning: file '"<< aFileName <<"' is incorrect or does not exist, this command will not be build"<< G4endl;
2452 }
2453 return;
2454 }
2455 } else if (std::string(aIconFile) == "open") {
2456 pix = fOpenIcon;
2457 } else if (std::string(aIconFile) == "save") {
2458 pix = fSaveIcon;
2459 } else if (std::string(aIconFile) == "move") {
2460 pix = fMoveIcon;
2461 } else if (std::string(aIconFile) == "rotate") {
2462 pix = fRotateIcon;
2463 } else if (std::string(aIconFile) == "pick") {
2464 pix = fPickIcon;
2465 } else if (std::string(aIconFile) == "zoom_in") {
2466 pix = fZoomInIcon;
2467 } else if (std::string(aIconFile) == "zoom_out") {
2468 pix = fZoomOutIcon;
2469 } else if (std::string(aIconFile) == "wireframe") {
2470 pix = fWireframeIcon;
2471 } else if (std::string(aIconFile) == "solid") {
2472 pix = fSolidIcon;
2473 } else if (std::string(aIconFile) == "hidden_line_removal") {
2475 } else if (std::string(aIconFile) == "hidden_line_and_surface_removal") {
2477 } else if (std::string(aIconFile) == "perspective") {
2478 pix = fPerspectiveIcon;
2479 } else if (std::string(aIconFile) == "ortho") {
2480 pix = fOrthoIcon;
2481 } else if (std::string(aIconFile) == "runBeamOn") {
2482 pix = fRunIcon;
2483 } else if (std::string(aIconFile) == "exit") {
2484 pix = fExitIcon;
2485 } else {
2487 G4int verbose = UImanager->GetVerboseLevel();
2488
2489 if (verbose >= 2) {
2490 G4cout << "Parameter"<< aIconFile <<" not defined"<< G4endl;
2491 }
2492 return;
2493 }
2494 QToolBar *currentToolbar = NULL;
2495 if (userToolBar) {
2496 if (fToolbarUser == NULL) {
2497 fToolbarUser = new QToolBar();
2498 fToolbarUser->setIconSize (QSize(20,20));
2499 fMainWindow->addToolBar(Qt::TopToolBarArea, fToolbarUser);
2500 }
2501 currentToolbar = fToolbarUser;
2502 } else {
2503 if (fToolbarApp == NULL) {
2504 fToolbarApp = new QToolBar();
2505 fToolbarApp->setIconSize (QSize(20,20));
2506 fMainWindow->addToolBar(Qt::TopToolBarArea, fToolbarApp);
2507 }
2508 currentToolbar = fToolbarApp;
2509 }
2510
2511 // Check if already present
2512
2513 QList<QAction*> list = currentToolbar->actions();
2514
2515 for (int i = 0; i < list.size(); ++i) {
2516 if (list.at(i)->text() == QString(aLabel)) {
2518 if(UI==NULL) return;
2519 G4int verbose = UI->GetVerboseLevel();
2520 if (verbose >= 2) {
2521 G4cout << "Warning: A toolBar icon \""<< aLabel<< "\" already exists with the same name!" << G4endl;
2522 }
2523 }
2524 }
2525
2526#if QT_VERSION < 0x050600
2527 QSignalMapper *signalMapper = new QSignalMapper(this);
2528 QAction *action = currentToolbar->addAction(QIcon(*pix),aLabel, signalMapper, SLOT(map()));
2529#endif
2530 // special cases :"open"
2531 if (std::string(aIconFile) == "open") {
2532 QString txt = aCommand + fStringSeparator + aLabel;
2533#if QT_VERSION < 0x050600
2534 connect(signalMapper, SIGNAL(mapped(const QString &)),this, SLOT(OpenIconCallback(const QString &)));
2535 signalMapper->setMapping(action, QString(txt));
2536#else
2537 currentToolbar->addAction(QIcon(*pix), aIconFile, this, [this, txt](){ this->OpenIconCallback(txt); });
2538#endif
2539
2540 // special cases :"save"
2541 } else if (std::string(aIconFile) == "save") {
2542 QString txt = aCommand + fStringSeparator + aLabel;
2543#if QT_VERSION < 0x050600
2544 connect(signalMapper, SIGNAL(mapped(const QString &)),this, SLOT(SaveIconCallback(const QString&)));
2545 signalMapper->setMapping(action, QString(txt));
2546#else
2547 currentToolbar->addAction(QIcon(*pix), aIconFile, this, [this, txt](){ this->SaveIconCallback(txt); });
2548#endif
2549
2550 // special cases : cursor style
2551 } else if ((std::string(aIconFile) == "move") ||
2552 (std::string(aIconFile) == "rotate") ||
2553 (std::string(aIconFile) == "pick") ||
2554 (std::string(aIconFile) == "zoom_out") ||
2555 (std::string(aIconFile) == "zoom_in")) {
2556#if QT_VERSION < 0x050600
2557 connect(signalMapper, SIGNAL(mapped(const QString &)),this, SLOT(ChangeCursorAction(const QString&)));
2558 signalMapper->setMapping(action, QString(aIconFile));
2559#else
2560 QString txt = QString(aIconFile);
2561 QAction* action = currentToolbar->addAction(QIcon(*pix), aIconFile, this, [this, txt](){ this->ChangeCursorAction(txt); });
2562#endif
2563 action->setCheckable(TRUE);
2564 action->setChecked(TRUE);
2565 action->setData(aIconFile);
2566
2567 if (std::string(aIconFile) == "move") {
2569 }
2570 if (std::string(aIconFile) == "rotate") {
2572 }
2573 if (std::string(aIconFile) == "pick") {
2575 }
2576 if (std::string(aIconFile) == "zoom_in") {
2578 }
2579 if (std::string(aIconFile) == "zoom_out") {
2581 }
2582
2583 // special case : surface style
2584 } else if ((std::string(aIconFile) == "hidden_line_removal") ||
2585 (std::string(aIconFile) == "hidden_line_and_surface_removal") ||
2586 (std::string(aIconFile) == "solid") ||
2587 (std::string(aIconFile) == "wireframe")) {
2588#if QT_VERSION < 0x050600
2589 connect(signalMapper, SIGNAL(mapped(const QString &)),this, SLOT(ChangeSurfaceStyle(const QString&)));
2590 signalMapper->setMapping(action, QString(aIconFile));
2591#else
2592 QString txt = QString(aIconFile);
2593 QAction* action = currentToolbar->addAction(QIcon(*pix), aIconFile, this, [this, txt](){ this->ChangeSurfaceStyle(txt); });
2594#endif
2595 action->setCheckable(TRUE);
2596 action->setChecked(TRUE);
2597 action->setData(aIconFile);
2598
2599 if (std::string(aIconFile) == "hidden_line_removal") {
2601 }
2602 if (std::string(aIconFile) == "hidden_line_and_surface_removal") {
2604 }
2605 if (std::string(aIconFile) == "solid") {
2607 }
2608 if (std::string(aIconFile) == "wireframe") {
2610 }
2611
2612 // special case : perspective/ortho
2613 } else if ((std::string(aIconFile) == "perspective") ||
2614 (std::string(aIconFile) == "ortho")) {
2615#if QT_VERSION < 0x050600
2616 connect(signalMapper, SIGNAL(mapped(const QString &)),this, SLOT(ChangePerspectiveOrtho(const QString&)));
2617 signalMapper->setMapping(action, QString(aIconFile));
2618#else
2619 QString txt = QString(aIconFile);
2620 QAction* action = currentToolbar->addAction(QIcon(*pix), aIconFile, this, [this, txt](){ this->ChangePerspectiveOrtho(txt); });
2621#endif
2622 action->setCheckable(TRUE);
2623 action->setChecked(TRUE);
2624 action->setData(aIconFile);
2625
2626 if (std::string(aIconFile) == "perspective") {
2628 }
2629 if (std::string(aIconFile) == "ortho") {
2631 }
2632
2633 } else {
2634
2635 // Find the command in the command tree
2637 if(UI==NULL) return;
2638 G4UIcommandTree * treeTop = UI->GetTree();
2639 if (aCommand != NULL) {
2640 std::string str = aCommand;
2641 std::string::size_type pos = str.find(" ");
2642 if (pos != std::string::npos)
2643 {
2644 str = str.substr(0,pos).c_str();
2645 }
2646 if(treeTop->FindPath(str.c_str()) == NULL) {
2648 G4int verbose = UImanager->GetVerboseLevel();
2649
2650 if (verbose >= 2) {
2651 G4cout << "Warning: command '"<< aCommand <<"' does not exist, please define it before using it."<< G4endl;
2652 }
2653 }
2654 }
2655
2656#if QT_VERSION < 0x050600
2657 connect(signalMapper, SIGNAL(mapped(const QString &)),this, SLOT(ButtonCallback(const QString&)));
2658 signalMapper->setMapping(action, QString(aCommand));
2659#else
2660 QString txt = QString(aCommand);
2661 currentToolbar->addAction(QIcon(*pix), aCommand, this, [this, txt](){ this->ButtonCallback(txt); });
2662#endif
2663 }
2664}
static const G4double pos
#define TRUE
Definition: Globals.hh:27
void SetIconPickSelected()
Definition: G4UIQt.cc:4868
void SetIconOrthoSelected()
Definition: G4UIQt.cc:5081
QPixmap * fExitIcon
Definition: G4UIQt.hh:375
void ChangePerspectiveOrtho(const QString &)
Definition: G4UIQt.cc:4789
void SetIconZoomInSelected()
Definition: G4UIQt.cc:4899
void ChangeCursorAction(const QString &)
Definition: G4UIQt.cc:4570
void OpenIconCallback(const QString &)
Definition: G4UIQt.cc:4664
void SetIconZoomOutSelected()
Definition: G4UIQt.cc:4930
void SetIconHLRSelected()
Definition: G4UIQt.cc:5009
void SetIconPerspectiveSelected()
Definition: G4UIQt.cc:5059
void ChangeSurfaceStyle(const QString &)
Definition: G4UIQt.cc:4624
void SetIconSolidSelected()
Definition: G4UIQt.cc:4961
void SaveIconCallback(const QString &)
Definition: G4UIQt.cc:4678
void SetIconRotateSelected()
Definition: G4UIQt.cc:4842
void SetIconWireframeSelected()
Definition: G4UIQt.cc:4985
void SetIconMoveSelected()
Definition: G4UIQt.cc:4816
void SetIconHLHSRSelected()
Definition: G4UIQt.cc:5034
G4String FindMacroPath(const G4String &fname) const
Definition: G4UImanager.cc:821

References geant4_check_module_cycles::action, ButtonCallback(), ChangeCursorAction(), ChangePerspectiveOrtho(), ChangeSurfaceStyle(), g4zmq::connect(), fDefaultIcons, fExitIcon, fHiddenLineAndSurfaceRemovalIcon, fHiddenLineRemovalIcon, G4UImanager::FindMacroPath(), G4UIcommandTree::FindPath(), fMainWindow, fMoveIcon, fOpenIcon, fOrthoIcon, fPerspectiveIcon, fPickIcon, fRotateIcon, fRunIcon, fSaveIcon, fSolidIcon, fStringSeparator, fToolbarApp, fToolbarUser, fWireframeIcon, fZoomInIcon, fZoomOutIcon, G4cout, G4endl, G4UImanager::GetTree(), G4UImanager::GetUIpointer(), G4UImanager::GetVerboseLevel(), anonymous_namespace{G4QuasiElRatios.cc}::map, OpenIconCallback(), pos, SaveIconCallback(), SetIconHLHSRSelected(), SetIconHLRSelected(), SetIconMoveSelected(), SetIconOrthoSelected(), SetIconPerspectiveSelected(), SetIconPickSelected(), SetIconRotateSelected(), SetIconSolidSelected(), SetIconWireframeSelected(), SetIconZoomInSelected(), SetIconZoomOutSelected(), and TRUE.

Referenced by SetDefaultIconsToolbar().

◆ AddInteractor()

void G4VInteractiveSession::AddInteractor ( G4String  a_name,
G4Interactor  a_interactor 
)
inherited

Definition at line 80 of file G4VInteractiveSession.cc.

82{
83 interactors[a_name] = a_interactor;
84}

References G4VInteractiveSession::interactors.

Referenced by AddMenu(), G4UIXm::AddMenu(), G4UIWin32::AddMenu(), and G4UIWin32::G4UIWin32().

◆ AddMenu()

void G4UIQt::AddMenu ( const char *  aName,
const char *  aLabel 
)
virtual

Add a new menu to the menu bar

Parameters
aNamename of menu
aLabellabel to display

Reimplemented from G4VInteractiveSession.

Definition at line 2333 of file G4UIQt.cc.

2337{
2338 if (aName == NULL) return;
2339 if (aLabel == NULL) return;
2340
2341 QMenu *fileMenu = new QMenu(aLabel);
2342 fMainWindow->menuBar()->addMenu(fileMenu);
2343
2344 AddInteractor (aName,(G4Interactor)fileMenu);
2345}
void * G4Interactor
void AddInteractor(G4String, G4Interactor)

References G4VInteractiveSession::AddInteractor(), and fMainWindow.

◆ AddTabWidget()

bool G4UIQt::AddTabWidget ( QWidget *  aWidget,
QString  name 
)

Add a new tab widget. Create the tab if it was not done

Definition at line 1860 of file G4UIQt.cc.

1864{
1865 // Special case for Qt version between 5.0 and 5.1 on Mac OSX
1866 // Due to a bug in this Qt version, we can't put a OpenGL Widget inside the QTabWidget.
1867 // A work around is to put it outside. Returning false will fore the wiewer to put the QGLWidget
1868 // inside a new QWindow.
1869
1870#ifdef Q_OS_MAC
1871 #if QT_VERSION < 0x050100
1872 #if QT_VERSION >= 0x050000
1873 QString message = QString(
1874 "This Qt version [")+qVersion ()+"] has some issues with the OpenGL viewer.\n"+
1875 "To prevent problems, you are not allowed to open a Stored nor Immediate viewer.\n" +
1876 "\n" +
1877 "Please upgrade to Qt version >= 5.1\n";
1878
1879 QMessageBox::warning(fMainWindow, tr("Warning"),
1880 tr(message.toStdString().c_str()),
1881 QMessageBox::Ok);
1882 return false;
1883 #endif
1884 #endif
1885#endif
1886
1887 if (fViewerTabWidget == NULL) {
1889 }
1890
1891 if (!aWidget) {
1892 return false;
1893 }
1894// Has to be added before we put it into the fViewerTabWidget widget
1895 aWidget->setParent(fViewerTabWidget); // Will create in some cases widget outside
1896 // of UI for a really short moment
1897
1898 fViewerTabWidget->addTab(aWidget,name);
1899
1900 fViewerTabWidget->setCurrentIndex(fViewerTabWidget->count()-1);
1901
1902 // Set visible
1903 #if QT_VERSION < 0x040200
1905 #else
1907 #endif
1908
1909 // Not the good solution, but ensure that the help tree is correctly build when launching a viewer
1910 // It should be done by a notification when adding a command, but that's nit done yet (Geant4.10.1)␓
1911 FillHelpTree();
1912
1913 return true;
1914}
void setLastTabCreated(int a)
Definition: G4UIQt.hh:91
void FillHelpTree()
Definition: G4UIQt.cc:2755
const char * name(G4int ptype)

References CreateViewerWidget(), FillHelpTree(), fMainWindow, fViewerTabWidget, G4InuclParticleNames::name(), and G4QTabWidget::setLastTabCreated().

Referenced by G4OpenInventorQtExaminerViewer::afterRealizeHook(), G4OpenGLQtViewer::CreateMainWindow(), G4VtkQtViewer::CreateMainWindow(), G4UIQt(), and G4ToolsSGQtViewer::Initialise().

◆ AddViewerTab()

bool G4UIQt::AddViewerTab ( QWidget *  aWidget,
std::string  title 
)

Add a new tab in the viewer

Definition at line 1811 of file G4UIQt.cc.

1815{
1816 if (fViewerTabWidget == NULL) {
1817 return false;
1818 }
1819 fViewerTabWidget->addTab(aWidget,title.c_str());
1820
1821 return true;
1822}

References fViewerTabWidget.

◆ AddViewerTabFromFile()

bool G4UIQt::AddViewerTabFromFile ( std::string  fileName,
std::string  title 
)

Add a new tab in the viewer

Definition at line 1827 of file G4UIQt.cc.

1831{
1832 if (fViewerTabWidget == NULL) {
1833 return false;
1834 }
1835
1837 if(UI==NULL) return 0;
1838 std::ifstream file(UI->FindMacroPath(fileName.c_str()).data());
1839 if (file) {
1840
1841 std::string content( (std::istreambuf_iterator<char>(file) ),
1842 (std::istreambuf_iterator<char>() ) );
1843
1844 QTextEdit* text = new QTextEdit();
1845 text->setAcceptRichText (true);
1846 text->setContentsMargins(5,5,5,5);
1847 text->setText(QString("<pre>")+content.c_str()+"</pre>");
1848 text->setReadOnly(true);
1849 fViewerTabWidget->addTab(text,title.c_str());
1850 } else {
1851 return false;
1852 }
1853 return true;
1854}

References geant4_check_module_cycles::file, G4UImanager::FindMacroPath(), fViewerTabWidget, and G4UImanager::GetUIpointer().

◆ ApplyShellCommand()

void G4VBasicShell::ApplyShellCommand ( const G4String a_string,
G4bool exitSession,
G4bool exitPause 
)
protectedinherited

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 232 of file G4VBasicShell.cc.

237{
239 if(UI==NULL) return;
240
241 G4String command = G4StrUtil::lstrip_copy(a_string);
242
243 if( command[0] == '#' ) {
244
245 G4cout << command << G4endl;
246
247 } else if( command == "ls" || command.substr(0,3) == "ls " ) {
248
249 ListDirectory( command );
250
251 } else if( command == "pwd" ) {
252
253 G4cout << "Current Working Directory : "
255
256 } else if( command == "cd" || command.substr(0,3) == "cd ") {
257
258 ChangeDirectoryCommand ( command );
259
260 } else if( command == "help" || command.substr(0,5) == "help ") {
261
262 TerminalHelp( command );
263
264 } else if( command[0] == '?' ) {
265
266 ShowCurrent( command );
267
268 } else if( command == "hist" || command == "history") {
269
270 G4int nh = UI->GetNumberOfHistory();
271 for(G4int i=0;i<nh;i++) {
272 G4cout << i << ": " << UI->GetPreviousCommand(i) << G4endl;
273 }
274
275 } else if( command[0] == '!' ) {
276
277 G4String ss = command.substr(1,command.length()-1);
278 G4int vl;
279 const char* tt = ss;
280 std::istringstream is(tt);
281 is >> vl;
282 G4int nh = UI->GetNumberOfHistory();
283 if(vl>=0 && vl<nh) {
284 G4String prev = UI->GetPreviousCommand(vl);
285 G4cout << prev << G4endl;
287 } else {
288 G4cerr << "history " << vl << " is not found." << G4endl;
289 }
290
291 } else if( command == "exit" ) {
292
293 if( exitPause == false) { //In a secondary loop.
294 G4cout << "You are now processing RUN." << G4endl;
295 G4cout << "Please abort it using \"/run/abort\" command first" << G4endl;
296 G4cout << " and use \"continue\" command until the application" << G4endl;
297 G4cout << " becomes to Idle." << G4endl;
298 } else {
299 exitSession = true;
300 }
301
302 } else if( command == "cont" || command == "continue"){
303
304 exitPause = true;
305
306 } else {
307
309
310 }
311}
static G4bool exitSession
Definition: G4UIQt.cc:92
static G4bool exitPause
Definition: G4UIQt.cc:93
G4GLOB_DLL std::ostream G4cerr
G4int GetNumberOfHistory() const
Definition: G4UImanager.hh:201
G4String GetPreviousCommand(G4int i) const
Definition: G4UImanager.hh:202
void ShowCurrent(const G4String &) const
void TerminalHelp(const G4String &)
virtual void ExecuteCommand(const G4String &)
void ListDirectory(const G4String &) const
G4String GetCurrentWorkingDirectory() const
void ChangeDirectoryCommand(const G4String &)
G4String lstrip_copy(G4String str, char c=' ')
Return copy of string with leading characters removed.

References G4VBasicShell::ChangeDirectoryCommand(), G4VBasicShell::ExecuteCommand(), exitPause, exitSession, G4cerr, G4cout, G4endl, G4VBasicShell::GetCurrentWorkingDirectory(), G4UImanager::GetNumberOfHistory(), G4UImanager::GetPreviousCommand(), G4UImanager::GetUIpointer(), G4VBasicShell::ListDirectory(), G4StrUtil::lstrip_copy(), G4VBasicShell::ModifyToFullPathCommand(), G4VBasicShell::ShowCurrent(), and G4VBasicShell::TerminalHelp().

Referenced by ButtonCallback(), G4UIXm::ButtonCallback(), CommandEnteredCallback(), G4UIXm::CommandEnteredCallback(), G4UIWin32::DoOpenMacro(), G4UIWin32::DoSaveViewer(), G4UIWin32::ProcessDefaultCommands(), and G4UIWin32::ProcessEnterKey().

◆ ButtonCallback

void G4UIQt::ButtonCallback ( const QString &  aCommand)
privateslot

Callback call when "enter" clicked on the command zone.
If command has no parameters :send the command to geant4 Else, open a dialog for parameters input

Parameters
aCommand

Definition at line 4046 of file G4UIQt.cc.

4049{
4050 G4String ss = G4StrUtil::lstrip_copy(G4String(aCommand.toStdString().c_str()));
4051
4053 if(UI==NULL) return;
4054 G4UIcommandTree * treeTop = UI->GetTree();
4055
4056 G4UIcommand* command = treeTop->FindPath(ss);
4057
4058 if (command) {
4059 // if is GUI, then open a dialog
4060 if (IsGUICommand(command)) {
4061 QDialog* menuParameterDialog = new QDialog();
4062
4063 if (CreateVisCommandGroupAndToolBox(command,menuParameterDialog,1,true)) {
4064 menuParameterDialog->setWindowTitle (aCommand);
4065 menuParameterDialog->setSizePolicy (QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum));
4066
4067 // exec this dialog, apply the command automaticaly, and return
4068 menuParameterDialog->exec();
4069 return;
4070 }
4071 delete menuParameterDialog;
4072 }
4073 }
4074
4076
4077 // Rebuild help tree
4078 FillHelpTree();
4079
4080 if(exitSession==true)
4082}
G4bool IsGUICommand(const G4UIcommand *)
Definition: G4UIQt.cc:3533
void SessionTerminate()
Definition: G4UIQt.cc:2032
bool CreateVisCommandGroupAndToolBox(G4UIcommand *, QWidget *, int, bool isDialog)
Definition: G4UIQt.cc:2880
void ApplyShellCommand(const G4String &, G4bool &, G4bool &)

References G4VBasicShell::ApplyShellCommand(), CreateVisCommandGroupAndToolBox(), exitPause, exitSession, FillHelpTree(), G4UIcommandTree::FindPath(), G4UImanager::GetTree(), G4UImanager::GetUIpointer(), IsGUICommand(), G4StrUtil::lstrip_copy(), and SessionTerminate().

Referenced by AddButton(), and AddIcon().

◆ ChangeColorCallback

void G4UIQt::ChangeColorCallback ( QWidget *  widget)
privateslot

Definition at line 4525 of file G4UIQt.cc.

4525 {
4526 if (widget == NULL) {
4527 return;
4528 }
4529
4530 QPushButton* button = dynamic_cast<QPushButton*>(widget);
4531 if (button == 0) {
4532 return;
4533 }
4534 QString value = button->accessibleName();
4535
4536 QColor old;
4537 old.setRgbF(value.section(" ",0,1).toDouble(),
4538 value.section(" ",1,2).toDouble(),
4539 value.section(" ",2,3).toDouble());
4540#if QT_VERSION < 0x040500
4541 bool a;
4542 QColor color = QColor(QColorDialog::getRgba (old.rgba(),&a,fUITabWidget));
4543#else
4544 QColor color = QColorDialog::getColor(old,
4546 "Change color",
4547 QColorDialog::ShowAlphaChannel);
4548#endif
4549
4550
4551 if (color.isValid()) {
4552 // rebuild the widget icon
4553 QPixmap pixmap = QPixmap(QSize(16, 16));
4554 pixmap.fill (color);
4555 QPainter painter(&pixmap);
4556 painter.setPen(Qt::black);
4557 painter.drawRect(0,0,15,15); // Draw contour
4558
4559 button->setAccessibleName(QString::number(color.redF())+" "+
4560 QString::number(color.greenF())+" "+
4561 QString::number(color.blueF())+" "
4562 );
4563 button->setIcon(pixmap);
4564
4565
4566 }
4567}

References fUITabWidget.

Referenced by CreateCommandWidget().

◆ ChangeCursorAction

void G4UIQt::ChangeCursorAction ( const QString &  action)
privateslot

Definition at line 4570 of file G4UIQt.cc.

4570 {
4571
4572 // Theses actions should be in the app toolbar
4573
4574 fMoveSelected = true;
4575 fPickSelected = true;
4576 fRotateSelected = true;
4577 fZoomInSelected = true;
4578 fZoomOutSelected = true;
4579
4580 if (fToolbarApp == NULL) return;
4581 QList<QAction *> list = fToolbarApp->actions ();
4582 for (int i = 0; i < list.size(); ++i) {
4583 if (list.at(i)->data().toString () == action) {
4584 list.at(i)->setChecked(TRUE);
4585 if (list.at(i)->data().toString () == "pick") {
4586 G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/picking true");
4588
4589 fPickInfosDialog->show();
4590 fPickInfosDialog->raise();
4591 fPickInfosDialog->activateWindow();
4592 }
4593 } else if (list.at(i)->data().toString () == "move") {
4594 fMoveSelected = false;
4595 list.at(i)->setChecked(FALSE);
4596 } else if (list.at(i)->data().toString () == "pick") {
4597 fPickSelected = false;
4598 list.at(i)->setChecked(FALSE);
4599 G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/picking false");
4600 if (fPickInfosDialog) {
4601 fPickInfosDialog->hide();
4602 }
4603 } else if (list.at(i)->data().toString () == "rotate") {
4604 fRotateSelected = false;
4605 list.at(i)->setChecked(FALSE);
4606 } else if (list.at(i)->data().toString () == "zoom_in") {
4607 fZoomInSelected = false;
4608 list.at(i)->setChecked(FALSE);
4609 } else if (list.at(i)->data().toString () == "zoom_out") {
4610 fZoomOutSelected = false;
4611 list.at(i)->setChecked(FALSE);
4612 }
4613 }
4614 // FIXME : Should connect this to Vis
4615}
#define FALSE
Definition: Globals.hh:23
void CreatePickInfosDialog()
Definition: G4UIQt.cc:4718
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:485

References geant4_check_module_cycles::action, G4UImanager::ApplyCommand(), CreatePickInfosDialog(), FALSE, fMoveSelected, fPickInfosDialog, fPickSelected, fRotateSelected, fToolbarApp, fZoomInSelected, fZoomOutSelected, G4UImanager::GetUIpointer(), and TRUE.

Referenced by AddIcon().

◆ ChangeDirectory()

G4bool G4VBasicShell::ChangeDirectory ( const char *  newDir)
protectedinherited

Definition at line 74 of file G4VBasicShell.cc.

75{
76 G4String newPrefix = G4StrUtil::strip_copy(newDir);
77
78 G4String newDirectory = ModifyPath( newPrefix );
79 if( newDirectory.back() != '/' )
80 { newDirectory += "/"; }
81 if( FindDirectory( newDirectory.c_str() ) == NULL )
82 { return false; }
83 currentDirectory = newDirectory;
84 return true;
85}
G4String ModifyPath(const G4String &tempPath) const
G4String currentDirectory
G4UIcommandTree * FindDirectory(const char *dirName) const
G4String strip_copy(G4String str, char c=' ')
Return copy of string with leading and trailing characters removed.

References G4VBasicShell::currentDirectory, G4VBasicShell::FindDirectory(), G4VBasicShell::ModifyPath(), and G4StrUtil::strip_copy().

Referenced by G4VBasicShell::ChangeDirectoryCommand().

◆ ChangeDirectoryCommand()

void G4VBasicShell::ChangeDirectoryCommand ( const G4String newCommand)
protectedinherited

Definition at line 325 of file G4VBasicShell.cc.

326{
328 if( newCommand.length() <= 3 ) {
329 prefix = "/";
330 } else {
331 G4String aNewPrefix = newCommand.substr(3, newCommand.length()-3);
332 prefix = G4StrUtil::strip_copy(aNewPrefix);
333 }
334 if(!ChangeDirectory(prefix)) {
335 G4cout << "directory <" << prefix << "> not found." << G4endl;
336 }
337}
G4bool ChangeDirectory(const char *newDir)

References G4VBasicShell::ChangeDirectory(), G4cout, G4endl, and G4StrUtil::strip_copy().

Referenced by G4VBasicShell::ApplyShellCommand(), G4UIterminal::GetCommand(), and G4ZMQServer::GetCommand().

◆ ChangePerspectiveOrtho

void G4UIQt::ChangePerspectiveOrtho ( const QString &  action)
privateslot

Definition at line 4789 of file G4UIQt.cc.

4789 {
4790
4791 // Theses actions should be in the app toolbar
4792
4793 if (fToolbarApp == NULL) return;
4794 QList<QAction *> list = fToolbarApp->actions ();
4795 QString checked = "";
4796 for (int i = 0; i < list.size(); ++i) {
4797 if (list.at(i)->data().toString () == action) {
4798 list.at(i)->setChecked(TRUE);
4799 checked = list.at(i)->data().toString ();
4800 } else if (list.at(i)->data().toString () == "perspective") {
4801 list.at(i)->setChecked(FALSE);
4802 } else if (list.at(i)->data().toString () == "ortho") {
4803 list.at(i)->setChecked(FALSE);
4804 }
4805 }
4806
4807 if ((action == "ortho") && (checked == "ortho")) {
4808 G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/projection o");
4809 } else if ((action == "perspective") && (checked == "perspective")) {
4810 G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/projection p");
4811 }
4812}

References geant4_check_module_cycles::action, G4UImanager::ApplyCommand(), FALSE, fToolbarApp, G4UImanager::GetUIpointer(), and TRUE.

Referenced by AddIcon().

◆ ChangeSurfaceStyle

void G4UIQt::ChangeSurfaceStyle ( const QString &  action)
privateslot

Definition at line 4624 of file G4UIQt.cc.

4624 {
4625
4626 // Theses actions should be in the app toolbar
4627
4628 if (fToolbarApp == NULL) return;
4629 QList<QAction *> list = fToolbarApp->actions ();
4630 for (int i = 0; i < list.size(); ++i) {
4631 if (list.at(i)->data().toString () == action) {
4632 list.at(i)->setChecked(TRUE);
4633 } else if (list.at(i)->data().toString () == "hidden_line_removal") {
4634 list.at(i)->setChecked(FALSE);
4635 } else if (list.at(i)->data().toString () == "hidden_line_and_surface_removal") {
4636 list.at(i)->setChecked(FALSE);
4637 } else if (list.at(i)->data().toString () == "solid") {
4638 list.at(i)->setChecked(FALSE);
4639 } else if (list.at(i)->data().toString () == "wireframe") {
4640 list.at(i)->setChecked(FALSE);
4641 }
4642 }
4643 // FIXME : Should connect this to Vis
4644
4645 if (action == "hidden_line_removal") {
4646 G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/style w");
4647 G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/hiddenEdge 1");
4648
4649 } else if (action == "hidden_line_and_surface_removal") {
4650 G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/style s");
4651 G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/hiddenEdge 1");
4652
4653 } else if (action == "solid") {
4654 G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/style s");
4655 G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/hiddenEdge 0");
4656
4657 } else if (action == "wireframe") {
4658 G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/style w");
4659 G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/hiddenEdge 0");
4660 }
4661}

References geant4_check_module_cycles::action, G4UImanager::ApplyCommand(), FALSE, fToolbarApp, G4UImanager::GetUIpointer(), and TRUE.

Referenced by AddIcon().

◆ CheckG4EnvironmentVariable()

bool G4UIQt::CheckG4EnvironmentVariable ( char *  txt,
char *  version 
)
private

◆ ClearButtonCallback

void G4UIQt::ClearButtonCallback ( )
privateslot

Called when user click on clear button. Clear the text Output area

Definition at line 3877 of file G4UIQt.cc.

3879{
3880 fCoutTBTextArea->clear();
3881 fG4OutputString.clear();
3882}
std::vector< G4UIOutputString > fG4OutputString
Definition: G4UIQt.hh:325

References fCoutTBTextArea, and fG4OutputString.

Referenced by CreateCoutTBWidget().

◆ ClearMenu()

void G4UIQt::ClearMenu ( )
virtual

Reimplemented from G4VInteractiveSession.

Definition at line 2695 of file G4UIQt.cc.

2696{
2697 fMainWindow->menuBar()->clear();
2698}

References fMainWindow.

◆ CommandEditedCallback

void G4UIQt::CommandEditedCallback ( const QString &  text)
privateslot

Callback when the text in the line edit is changed. When a newline is inserted, trigger the Activate Command on this text end set unchanged the end of the line after the newline.

Definition at line 3952 of file G4UIQt.cc.

3953{
3954#if QT_VERSION < 0x050F00
3955 // Before Qt5.15
3956 QStringList list = fCommandArea->text().split(QRegExp("[\r\n]"),QString::SkipEmptyParts);
3957#else
3958 // Qt5.15 and beyond
3959 QStringList list = fCommandArea->text().split(QRegExp("[\r\n]"),Qt::SkipEmptyParts);
3960#endif
3961
3962 if (list.size() > 1) { // trigger ActivateCommand
3963 for (int a=0; a<list.size()-1; a++) {
3964 // set only the first part
3965 fCommandArea->setText(list[a]);
3966 // trigger callback
3968 }
3969 // reset unfinished command
3970 fCommandArea->setText(list[list.size()-1]);
3971 }
3972}
void CommandEnteredCallback()
Definition: G4UIQt.cc:3900

References CommandEnteredCallback(), and fCommandArea.

Referenced by CreateCoutTBWidget().

◆ CommandEnteredCallback

void G4UIQt::CommandEnteredCallback ( )
privateslot

Callback call when "click on a menu entry.
Send the associated command to geant4

Definition at line 3900 of file G4UIQt.cc.

3902{
3903 // split by any new line character
3904 fCommandArea->setText(fCommandArea->text().trimmed());
3905#if QT_VERSION < 0x050F00
3906 // Before Qt5.15
3907 QStringList list = fCommandArea->text().split(QRegExp("[\r\n]"),QString::SkipEmptyParts);
3908#else
3909 // Qt5.15 and beyond
3910 QStringList list = fCommandArea->text().split(QRegExp("[\r\n]"),Qt::SkipEmptyParts);
3911#endif
3912
3913 // Apply for all commands
3914 for (int a=0; a< list.size(); a++) {
3915 QString txt (list[a].trimmed());
3916 if (txt != "") {
3917 fHistoryTBTableList->addItem(txt);
3918 fHistoryTBTableList->clearSelection();
3919 fHistoryTBTableList->setCurrentItem(NULL);
3920 fCommandArea->setText("");
3921 G4Qt* interactorManager = G4Qt::getInstance ();
3922 if (interactorManager) {
3923 interactorManager->FlushAndWaitExecution();
3924 }
3925
3926 G4String command = txt.toStdString().c_str();
3927 if (command.substr(0,4) != "help") {
3929 } else {
3930 ActivateCommand(command);
3931 }
3932 }
3933 }
3934 // set the focus to the command line
3935 fCommandArea->setFocus();
3936
3937 // Rebuild help tree
3938 FillHelpTree();
3939
3940 // Rebuild command completion
3942
3943 if(exitSession==true)
3945}
void FlushAndWaitExecution()
Definition: G4Qt.cc:186
void UpdateCommandCompleter()
Definition: G4UIQt.cc:3685
void ActivateCommand(G4String)
Definition: G4UIQt.cc:2700

References ActivateCommand(), G4VBasicShell::ApplyShellCommand(), exitPause, exitSession, fCommandArea, fHistoryTBTableList, FillHelpTree(), G4Qt::FlushAndWaitExecution(), G4Qt::getInstance(), SessionTerminate(), and UpdateCommandCompleter().

Referenced by CommandEditedCallback(), and CreateCoutTBWidget().

◆ CommandHistoryCallback

void G4UIQt::CommandHistoryCallback ( )
privateslot

Callback called when user select an old command in the command history
Give it to the command area.

Definition at line 4154 of file G4UIQt.cc.

4156{
4157 QListWidgetItem* item = NULL;
4159 return ;
4160
4161
4162 QList<QListWidgetItem *> list =fHistoryTBTableList->selectedItems();
4163 if (list.isEmpty())
4164 return;
4165 item = list.first();
4166 if (!item)
4167 return;
4168 fCommandArea->setText(item->text());
4169}

References fCommandArea, and fHistoryTBTableList.

Referenced by CreateHistoryTBWidget().

◆ Complete()

G4String G4VBasicShell::Complete ( const G4String commandName)
protectedinherited

Definition at line 180 of file G4VBasicShell.cc.

181{
182 G4String rawCommandLine = commandName;
183 G4String commandLine = G4StrUtil::strip_copy(rawCommandLine);
184
185 size_t i = commandLine.find(" ");
186 if( i != std::string::npos ) return rawCommandLine; // Already entering parameters,
187 // assume command path is correct.
188 G4String commandString = commandLine;
189 G4String targetCom = ModifyPath(commandString);
191 G4String value = FindMatchingPath(tree,targetCom);
192 if(value=="") return rawCommandLine;
193 return value;
194}
G4String FindMatchingPath(G4UIcommandTree *, const G4String &)

References G4VBasicShell::FindMatchingPath(), G4UImanager::GetTree(), G4UImanager::GetUIpointer(), G4VBasicShell::ModifyPath(), and G4StrUtil::strip_copy().

Referenced by eventFilter(), G4UIXm::keyHandler(), and G4UIWin32::ProcessTabKey().

◆ CoutFilterCallback

void G4UIQt::CoutFilterCallback ( const QString &  )
privateslot

Definition at line 4177 of file G4UIQt.cc.

4178 {
4179
4181
4182 fCoutTBTextArea->repaint();
4183 fCoutTBTextArea->verticalScrollBar()->setSliderPosition(fCoutTBTextArea->verticalScrollBar()->maximum());
4184
4185 }
void FilterAllOutputTextArea()
Definition: G4UIQt.cc:4223

References fCoutTBTextArea, and FilterAllOutputTextArea().

Referenced by CreateCoutTBWidget(), and ThreadComboBoxCallback().

◆ CreateCommandWidget()

bool G4UIQt::CreateCommandWidget ( G4UIcommand aCommand,
QWidget *  aParent,
bool  isDialog 
)
private

Create a widget with the command parameters inside

Parameters
commandcommand line @parent : parent widget @isDialog : true if we want apply/cancel button and close at end, false if we want only apply

Definition at line 3005 of file G4UIQt.cc.

3005 {
3006
3007 if (aCommand == NULL) {
3008 return false;
3009 }
3010
3011
3012 // parameters
3013 G4int n_parameterEntry = aCommand->GetParameterEntries();
3014 if( n_parameterEntry > 0 ) {
3015 G4UIparameter *param;
3016
3017 // Re-implementation of G4UIparameter.cc
3018 QWidget* paramWidget = new QWidget();
3019 QGridLayout* gridLayout = new QGridLayout();
3020 paramWidget->setLayout(gridLayout);
3021
3022 // Special case for colour, try to display a color chooser if we found red/green/blue parameter
3023 unsigned int nbColorParameter = 0;
3024 bool isStillColorParameter = false;
3025 bool isColorDialogAdded = false;
3026 QLabel* redLabel = NULL;
3027 QLabel* greenLabel = NULL;
3028 QString redDefaultStr = "";
3029 QString greenDefaultStr = "";
3030 QString blueDefaultStr = "";
3031 QWidget* redInput = NULL;
3032 QWidget* greenInput = NULL;
3033
3034 for( G4int i_thParameter=0; i_thParameter<n_parameterEntry; i_thParameter++ ) {
3035 QString txt;
3036 param = aCommand->GetParameter(i_thParameter);
3037 QLabel* label = new QLabel(QString((char*)(param->GetParameterName()).data()));
3038
3039 if ((label->text() == "red") || (label->text() == "red_or_string")){
3040 nbColorParameter ++;
3041 isStillColorParameter = true;
3042 } else if ((label->text() == "green") && isStillColorParameter) {
3043 nbColorParameter ++;
3044 } else if ((label->text() == "blue") && isStillColorParameter) {
3045 nbColorParameter ++;
3046 } else if (!isColorDialogAdded) {
3047
3048 // not following red/green/blue parameters ?
3049 if (nbColorParameter == 1) {
3050 gridLayout->addWidget(redLabel,i_thParameter-1,0);
3051 gridLayout->addWidget(redInput,i_thParameter-1,1);
3052 } else if (nbColorParameter == 2) {
3053 gridLayout->addWidget(redLabel,i_thParameter-2,0);
3054 gridLayout->addWidget(redInput,i_thParameter-2,1);
3055 gridLayout->addWidget(greenLabel,i_thParameter-1,0);
3056 gridLayout->addWidget(greenInput,i_thParameter-1,1);
3057 }
3058 nbColorParameter = 0;
3059 }
3060 // Check parameter type, could be NULL if not found
3061 QWidget* input = NULL;
3062 if ((QString(QChar(param->GetParameterType())) == "d") || (QString(QChar(param->GetParameterType())) == "i")) {
3063 input = new QLineEdit();
3064 // set default value
3065 dynamic_cast<QLineEdit*>(input)->setText(QString((char*)(param->GetDefaultValue()).data()));
3066
3067 if (((label->text() == "red") || (label->text() == "red_or_string")) && isStillColorParameter) {
3068 redDefaultStr = QString((char*)(param->GetDefaultValue()).data());
3069 } else if ((label->text() == "green") && isStillColorParameter) {
3070 greenDefaultStr = QString((char*)(param->GetDefaultValue()).data());
3071 } else if ((label->text() == "green") && isStillColorParameter) {
3072 blueDefaultStr = QString((char*)(param->GetDefaultValue()).data());
3073 }
3074
3075 } else if (QString(QChar(param->GetParameterType())) == "b") {
3076 input = new QWidget();
3077 QHBoxLayout* layout = new QHBoxLayout();
3078 input->setLayout(layout);
3079
3080 QButtonGroup* buttons = new QButtonGroup();
3081 QRadioButton* radioOff = new QRadioButton("0");
3082 QRadioButton* radioOn = new QRadioButton("1");
3083 buttons->addButton(radioOn);
3084 buttons->addButton(radioOff);
3085 layout->addWidget(radioOn);
3086 layout->addWidget(radioOff);
3087
3088 // set default value
3089 QString defaultValue = QString((char*)(param->GetDefaultValue()).data());
3090 if (defaultValue == "0") {
3091 radioOff->setChecked(true);
3092 } else if (defaultValue == "1") {
3093 radioOn->setChecked(true);
3094 }
3095 } else if ((QString(QChar(param->GetParameterType())) == "s") && (!param->GetParameterCandidates().empty())) {
3096 input = new QComboBox();
3097 QString candidates = QString((char*)(param->GetParameterCandidates()).data());
3098 QStringList list = candidates.split (" ");
3099
3100 // add all candidates to widget
3101 QString defaultValue = QString((char*)(param->GetDefaultValue()).data());
3102 for (int a=0; a<list.size(); a++) {
3103 dynamic_cast<QComboBox*>(input)->addItem(list.at(a));
3104 if (list.at(a) == defaultValue) {
3105 dynamic_cast<QComboBox*>(input)->setCurrentIndex(a);
3106 }
3107 }
3108
3109 } else if ((QString(QChar(param->GetParameterType())) == "s")) { // string
3110 input = new QLineEdit();
3111 // set default value
3112 dynamic_cast<QLineEdit*>(input)->setText(QString((char*)(param->GetDefaultValue()).data()));
3113
3114 } else if ((QString(QChar(param->GetParameterType())) == "c")) { // on/off
3115 input = new QWidget();
3116 QHBoxLayout* layout = new QHBoxLayout();
3117 input->setLayout(layout);
3118
3119 QButtonGroup* buttons = new QButtonGroup();
3120 QRadioButton* radioOff = new QRadioButton("off");
3121 QRadioButton* radioOn = new QRadioButton("on");
3122 buttons->addButton(radioOn);
3123 buttons->addButton(radioOff);
3124 layout->addWidget(radioOn);
3125 layout->addWidget(radioOff);
3126
3127 // set default value
3128 QString defaultValue = QString((char*)(param->GetDefaultValue()).data());
3129 if (defaultValue == "off") {
3130 radioOff->setChecked(true);
3131 } else if (defaultValue == "on") {
3132 radioOn->setChecked(true);
3133 }
3134
3135 } else {
3136 input = new QLineEdit();
3137 dynamic_cast<QLineEdit*>(input)->setText(QString((char*)(param->GetDefaultValue()).data()));
3138 }
3139
3140 txt += "\nParameter : " + QString((char*)(param->GetParameterName()).data()) + "\n";
3141 if( ! param->GetParameterGuidance().empty() )
3142 txt += QString((char*)(param->GetParameterGuidance()).data())+ "\n" ;
3143
3144 txt += " Parameter type : " + QString(QChar(param->GetParameterType())) + "\n";
3145 if(param->IsOmittable()){
3146 txt += " Omittable : True\n";
3147 } else {
3148 txt += " Omittable : False\n";
3149 }
3150 if( param->GetCurrentAsDefault() ) {
3151 txt += " Default value : taken from the current value\n";
3152 } else if( ! param->GetDefaultValue().empty() ) {
3153 txt += " Default value : " + QString((char*)(param->GetDefaultValue()).data())+ "\n";
3154 }
3155 if( ! param->GetParameterRange().empty() ) {
3156 txt += " Parameter range : " + QString((char*)(param->GetParameterRange()).data())+ "\n";
3157 }
3158 if( ! param->GetParameterCandidates().empty() ) {
3159 txt += " Candidates : " + QString((char*)(param->GetParameterCandidates()).data())+ "\n";
3160 }
3161
3162 if (isStillColorParameter && (nbColorParameter != 0)) {
3163 if ((label->text() == "red") || (label->text() == "red_or_string")) {
3164 redLabel = label;
3165 redInput = input;
3166 } else if (label->text() == "green") {
3167 greenLabel = label;
3168 greenInput = input;
3169 } else if (label->text() == "blue") {
3170
3171 // we have all, then add a color chooser
3172
3173 // Create a pixmap with the default color
3174 QColor qc;
3175 if ((redDefaultStr != "") && (redDefaultStr != "") && (redDefaultStr != "")) {
3176 qc.setRgbF(redDefaultStr.toDouble(),
3177 greenDefaultStr.toDouble(),
3178 blueDefaultStr.toDouble());
3179 }
3180 QPixmap pixmap = QPixmap(QSize(16, 16));
3181 pixmap.fill (qc);
3182 QPainter painter(&pixmap);
3183 painter.setPen(Qt::black);
3184 painter.drawRect(0,0,15,15); // Draw contour
3185
3186 input = new QPushButton("Change color");
3187 dynamic_cast<QPushButton*>(input)->setIcon(pixmap);
3188 dynamic_cast<QPushButton*>(input)->setAccessibleName(redDefaultStr+" "+greenDefaultStr+" "+blueDefaultStr);
3189 label = new QLabel("Choose color");
3190
3191 // less 1 because we have to add one to the row number
3192 nbColorParameter--;
3193 gridLayout->addWidget(label,i_thParameter-nbColorParameter,0);
3194 input->setToolTip("Select the current color");
3195 gridLayout->addWidget(input,i_thParameter-nbColorParameter,1);
3196
3197 // Connect pushButton to ColorDialog in callback
3198#if QT_VERSION < 0x050600
3199 QSignalMapper* signalMapper = new QSignalMapper(this);
3200 signalMapper->setMapping(input,input);
3201 connect(input, SIGNAL(clicked()), signalMapper, SLOT(map()));
3202 connect(signalMapper, SIGNAL(mapped(QWidget*)),this, SLOT(ChangeColorCallback(QWidget*)));
3203#else
3204 connect(dynamic_cast<QPushButton*>(input), &QPushButton::clicked , [this, input](){ this->ChangeColorCallback(input);});
3205#endif
3206 isColorDialogAdded = true;
3207 isStillColorParameter = false;
3208 }
3209 } else {
3210 gridLayout->addWidget(label,i_thParameter-nbColorParameter,0);
3211 input->setToolTip(txt);
3212 gridLayout->addWidget(input,i_thParameter-nbColorParameter,1);
3213 }
3214 }
3215 // add command name in hidden value at last line position 0
3216 QLabel* name = new QLabel(QString((char*)(aCommand->GetCommandPath().data())));
3217 name->hide();
3218 gridLayout->addWidget(name,n_parameterEntry-nbColorParameter,0);
3219
3220 QPushButton* applyButton = new QPushButton("Apply");
3221 if (!isDialog) {
3222
3223 gridLayout->addWidget(applyButton,n_parameterEntry-nbColorParameter,1);
3224
3225#if QT_VERSION < 0x050600
3226 QSignalMapper* signalMapper = new QSignalMapper(this);
3227 signalMapper->setMapping(applyButton, paramWidget);
3228 connect(applyButton, SIGNAL(clicked()), signalMapper, SLOT(map()));
3229 connect(signalMapper, SIGNAL(mapped(QWidget*)),this, SLOT(VisParameterCallback(QWidget*)));
3230#else
3231 connect(applyButton, &QPushButton::clicked , [this, paramWidget](){ this->VisParameterCallback(paramWidget);});
3232#endif
3233 } else {
3234 // Apply/Cancel buttons
3235
3236 applyButton->setAutoDefault( TRUE );
3237 applyButton->setDefault( TRUE );
3238
3239 QPushButton* cancelButton = new QPushButton( tr( "&Cancel" ));
3240 cancelButton->setAutoDefault( TRUE );
3241 gridLayout->addWidget(cancelButton,n_parameterEntry-nbColorParameter,1);
3242 gridLayout->addWidget(applyButton,n_parameterEntry-nbColorParameter,0);
3243
3244#if QT_VERSION < 0x050600
3245 QSignalMapper* signalMapper = new QSignalMapper(this);
3246 signalMapper->setMapping(applyButton, paramWidget);
3247 connect(applyButton, SIGNAL(clicked()), signalMapper, SLOT(map()));
3248 connect(signalMapper, SIGNAL(mapped(QWidget*)),this, SLOT(VisParameterCallback(QWidget*)));
3249#else
3250 connect(applyButton, &QPushButton::clicked , [this, paramWidget](){ this->VisParameterCallback(paramWidget);});
3251#endif
3252
3253 QWidget * parentCheck = aParent;
3254 QDialog* parentDialog = NULL;
3255 bool found = false;
3256 while ((parentCheck->parentWidget()) != NULL) {
3257 parentCheck = parentCheck->parentWidget();
3258 parentDialog = dynamic_cast<QDialog*>(parentCheck);
3259 if (parentDialog) {
3260 connect( applyButton, SIGNAL( clicked() ), parentDialog, SLOT( accept() ) );
3261 connect( cancelButton, SIGNAL( clicked() ), parentDialog, SLOT( reject() ) );
3262 found = true;
3263 }
3264 }
3265 if (!found) {
3266 return false;
3267 }
3268 }
3269
3270 if (!aParent->layout()) {
3271 aParent->setLayout(new QVBoxLayout());
3272 }
3273 aParent->layout()->addWidget(paramWidget);
3274 }
3275
3276 return true;
3277}
void ChangeColorCallback(QWidget *)
Definition: G4UIQt.cc:4525
void VisParameterCallback(QWidget *)
Definition: G4UIQt.cc:3977
std::size_t GetParameterEntries() const
Definition: G4UIcommand.hh:138
G4UIparameter * GetParameter(G4int i) const
Definition: G4UIcommand.hh:139
const G4String & GetCommandPath() const
Definition: G4UIcommand.hh:136
const G4String & GetParameterCandidates() const
const G4String & GetParameterGuidance() const
G4bool IsOmittable() const
const G4String & GetParameterRange() const
G4bool GetCurrentAsDefault() const
char GetParameterType() const
const G4String & GetParameterName() const
const G4String & GetDefaultValue() const

References ChangeColorCallback(), g4zmq::connect(), G4UIcommand::GetCommandPath(), G4UIparameter::GetCurrentAsDefault(), G4UIparameter::GetDefaultValue(), G4UIcommand::GetParameter(), G4UIparameter::GetParameterCandidates(), G4UIcommand::GetParameterEntries(), G4UIparameter::GetParameterGuidance(), G4UIparameter::GetParameterName(), G4UIparameter::GetParameterRange(), G4UIparameter::GetParameterType(), G4UIparameter::IsOmittable(), anonymous_namespace{G4QuasiElRatios.cc}::map, G4InuclParticleNames::name(), TRUE, and VisParameterCallback().

Referenced by CreateVisCommandGroupAndToolBox().

◆ CreateCompleterModel()

QStandardItemModel * G4UIQt::CreateCompleterModel ( G4String  aCmd)
private

Definition at line 3712 of file G4UIQt.cc.

3712 {
3713
3714 QList< QStandardItem*> dirModelList;
3715 QList< QStandardItem*> commandModelList;
3716 QList< QStandardItem*> subDirModelList;
3717 QList< QStandardItem*> subCommandModelList;
3718
3719 G4String strtmp;
3720 G4int nMatch= 0;
3721
3722 G4String pName = aCmd;
3723 G4String remainingPath = aCmd;
3724 G4String empty = "";
3725 G4String matchingPath = empty;
3726
3727 // find the tree
3728 auto jpre= pName.rfind('/');
3729 if(jpre != G4String::npos) pName.erase(jpre+1);
3731 G4UIcommandTree * commandTreeTop = UI->GetTree();
3732 G4UIcommandTree* aTree = commandTreeTop->FindCommandTree(pName);
3733 if (aTree) {
3734 int Ndir= aTree-> GetTreeEntry();
3735 int Ncmd= aTree-> GetCommandEntry();
3736
3737 // directory ...
3738 for(G4int idir=1; idir<=Ndir; idir++) {
3739 G4String fpdir= aTree-> GetTree(idir)-> GetPathName();
3740 // matching test
3741 if( fpdir.find(remainingPath, 0) == 0) {
3742 if(nMatch==0) {
3743 matchingPath = fpdir;
3744 } else {
3745 matchingPath = aTree->GetFirstMatchedString(fpdir,matchingPath);
3746 }
3747 nMatch++;
3748
3749 // append to dir model list
3750 QStandardItem* item1 = new QStandardItem(fpdir.data());
3751 QIcon i = QIcon(*fDirIcon);
3752 item1->setData(1); // dir
3753 item1->setIcon(QIcon(*fDirIcon));
3754 dirModelList.append(item1);
3755
3756 // Go recursively
3757 QStandardItemModel* subModel = CreateCompleterModel(fpdir.data());
3758 for (int a=0; a< subModel->rowCount(); a++) {
3759
3760 // copy item (an item could only be part of one model
3761 QStandardItem* tempItem = new QStandardItem(subModel->item(a)->text());
3762 tempItem->setIcon(subModel->item(a)->icon());
3763 tempItem->setToolTip(subModel->item(a)->toolTip());
3764 tempItem->setData(subModel->item(a)->data());
3765
3766 // dir
3767 if (tempItem->data() == 1) {
3768 subModel->item(a);
3769 subDirModelList.append(tempItem);
3770 }
3771 // command
3772 else if (tempItem->data() == 0) {
3773 subCommandModelList.append(tempItem);
3774 }
3775 }
3776 }
3777 }
3778
3779 // command ...
3780 G4int n_parameterEntry;
3781 G4String rangeString;
3782 G4int n_guidanceEntry;
3783 G4UIcommand * command;
3784 G4UIparameter *param;
3785 std::string tooltip;
3786 G4String params;
3787
3788 for(G4int icmd=1; icmd<=Ncmd; icmd++){
3789 tooltip = "";
3790 params = " ";
3791 command = aTree-> GetCommand(icmd);
3792 G4String longCommandName= aTree-> GetPathName() +
3793 command -> GetCommandName();
3794 rangeString = command->GetRange();
3795 n_guidanceEntry = command->GetGuidanceEntries();
3796 n_parameterEntry = command->GetParameterEntries();
3797
3798
3799 // matching test
3800 if( longCommandName.find(remainingPath, 0) ==0) {
3801 if(nMatch==0) {
3802 matchingPath= longCommandName + " ";
3803 } else {
3804 strtmp= longCommandName + " ";
3805 matchingPath= aTree->GetFirstMatchedString(matchingPath, strtmp);
3806 }
3807
3808 // guidance
3809 for( G4int i_thGuidance=0; i_thGuidance < n_guidanceEntry; i_thGuidance++ ) {
3810 tooltip += std::string((command->GetGuidanceLine(i_thGuidance)).data());
3811 if (i_thGuidance < n_guidanceEntry-1 ) {
3812 tooltip += "\n";
3813 }
3814 }
3815
3816 // parameters
3817 for( G4int a=0; a<n_parameterEntry; a++ ) {
3818 param = command->GetParameter(a);
3819 if (param->IsOmittable()) {
3820 params += "[<" + param->GetParameterName()+">] ";
3821 } else {
3822 params += "<" + param->GetParameterName()+"> ";
3823 }
3824 }
3825 nMatch++;
3826
3827 // Append to command model list
3828 QStandardItem* item = new QStandardItem(G4String(longCommandName + params).data());
3829 item->setData(0); // command
3830 item->setIcon(QIcon(*fCommandIcon));
3831 item->setToolTip(tooltip.c_str());
3832
3833 commandModelList.append(item);
3834 }
3835 }
3836 }
3837
3838 QStandardItemModel* model = new QStandardItemModel();
3839 // initialize the model
3840 model->setColumnCount(1);
3841
3842 // concat models
3843 for (int a= 0; a< dirModelList.size(); a++) {
3844 model->appendRow(dirModelList.at(a));
3845 }
3846 for (int a= 0; a< subDirModelList.size(); a++) {
3847 model->appendRow(subDirModelList.at(a));
3848 }
3849 for (int a= 0; a< commandModelList.size(); a++) {
3850 model->appendRow(commandModelList.at(a));
3851 }
3852 for (int a= 0; a< subCommandModelList.size(); a++) {
3853 model->appendRow(subCommandModelList.at(a));
3854 }
3855
3856 return model;
3857}
QStandardItemModel * CreateCompleterModel(G4String aCmd)
Definition: G4UIQt.cc:3712
G4UIcommandTree * FindCommandTree(const char *commandPath)
G4String GetFirstMatchedString(const G4String &, const G4String &) const
const G4String & GetGuidanceLine(G4int i) const
Definition: G4UIcommand.hh:132
std::size_t GetGuidanceEntries() const
Definition: G4UIcommand.hh:128
const G4String & GetRange() const
Definition: G4UIcommand.hh:127

References CreateCompleterModel(), anonymous_namespace{G4MTcoutDestination.cc}::empty, fCommandIcon, fDirIcon, G4UIcommandTree::FindCommandTree(), G4UIcommandTree::GetFirstMatchedString(), G4UIcommand::GetGuidanceEntries(), G4UIcommand::GetGuidanceLine(), G4UIcommand::GetParameter(), G4UIcommand::GetParameterEntries(), G4UIparameter::GetParameterName(), G4UIcommand::GetRange(), G4UImanager::GetTree(), G4UImanager::GetUIpointer(), and G4UIparameter::IsOmittable().

Referenced by CreateCompleterModel(), and UpdateCommandCompleter().

◆ CreateCoutTBWidget()

G4UIDockWidget * G4UIQt::CreateCoutTBWidget ( )
private

Create the Cout ToolBox Widget

Definition at line 1557 of file G4UIQt.cc.

1559{
1560 QWidget* coutTBWidget = new QWidget();
1561
1562 QVBoxLayout *layoutCoutTB = new QVBoxLayout();
1563
1564 fCoutTBTextArea = new QTextEdit();
1565
1566 fCoutFilter = new QLineEdit();
1567 fCoutFilter->setToolTip("Filter output by...");
1568
1569#if QT_VERSION > 0x050100
1570 fCoutFilter->addAction(*fSearchIcon,QLineEdit::TrailingPosition);
1571 fCoutFilter->setStyleSheet ("border-radius:7px;");
1572#else
1573 QPushButton *coutTBFilterButton = new QPushButton();
1574 coutTBFilterButton->setIcon(QIcon(*fSearchIcon));
1575 coutTBFilterButton->setStyleSheet ("padding-left: 0px; border:0px;");
1576 fCoutFilter->setStyleSheet ("padding-right: 0px;");
1577#endif
1578
1579 QPushButton *coutTBClearButton = new QPushButton();
1580 coutTBClearButton->setIcon(*fClearIcon);
1581 coutTBClearButton->setToolTip("Clear console output");
1582 coutTBClearButton->setStyleSheet ("border-radius:7px;");
1583 connect(coutTBClearButton, SIGNAL(clicked()), SLOT(ClearButtonCallback()));
1584 connect(fCoutFilter, SIGNAL(textEdited ( const QString &)), SLOT(CoutFilterCallback( const QString &)));
1585
1586 QPushButton *coutTBSaveOutputButton = new QPushButton();
1587 coutTBSaveOutputButton->setIcon(*fSaveIcon);
1588 coutTBSaveOutputButton->setToolTip("Save console output");
1589 coutTBSaveOutputButton->setStyleSheet ("border-radius:7px;");
1590 connect(coutTBSaveOutputButton, SIGNAL(clicked()), SLOT(SaveOutputCallback()));
1591
1592 fCoutTBTextArea->setReadOnly(true);
1593
1594 QWidget* coutButtonWidget = new QWidget();
1595 QHBoxLayout* layoutCoutTBButtons = new QHBoxLayout();
1596
1597#ifdef G4MULTITHREADED
1598 // add all candidates to widget
1599 fThreadsFilterComboBox = new QComboBox();
1600 fThreadsFilterComboBox->setInsertPolicy(QComboBox::InsertAlphabetically);
1601 connect(fThreadsFilterComboBox, SIGNAL(activated(int)), this, SLOT(ThreadComboBoxCallback(int)));
1602
1603 UpdateCoutThreadFilter();
1604
1605 fThreadsFilterComboBox->setToolTip("Thread selection in output");
1606 layoutCoutTBButtons->addWidget(new QLabel(" Threads:"));
1607 layoutCoutTBButtons->addWidget(fThreadsFilterComboBox);
1608#endif
1609
1610 layoutCoutTBButtons->addWidget(fCoutFilter);
1611#if QT_VERSION <= 0x050100
1612 layoutCoutTBButtons->addWidget(coutTBFilterButton);
1613#endif
1614 layoutCoutTBButtons->addWidget(coutTBClearButton);
1615 layoutCoutTBButtons->addWidget(coutTBSaveOutputButton);
1616 coutButtonWidget->setLayout(layoutCoutTBButtons);
1617
1618 // reduce margins
1619 layoutCoutTBButtons->setContentsMargins(3,3,3,0);
1620
1621 layoutCoutTB->addWidget(coutButtonWidget);
1622 layoutCoutTB->addWidget(fCoutTBTextArea);
1623
1624 coutTBWidget->setLayout(layoutCoutTB);
1625
1626 fCoutTBTextArea->setMinimumSize(100,100);
1627
1628 // Command line :
1629 QWidget* commandLineWidget = new QWidget();
1630 QHBoxLayout *layoutCommandLine = new QHBoxLayout();
1631
1632 // fill them
1633
1634 fCommandLabel = new QLabel("");
1635 fCommandArea = new QLineEdit();
1636
1637 // The QCompleter will be append at SessionStart()
1638
1639 fCommandArea->activateWindow();
1640
1641 fCommandArea->setFocusPolicy ( Qt::StrongFocus );
1642 fCommandArea->setFocus(Qt::TabFocusReason);
1643 fCommandArea->setToolTip("Apply command");
1644
1645
1646 layoutCommandLine->addWidget(fCommandLabel);
1647 layoutCommandLine->addWidget(fCommandArea);
1648
1649 // Connect signal
1650 connect(fCommandArea, SIGNAL(returnPressed()), SLOT(CommandEnteredCallback()));
1651 connect(fCommandArea, SIGNAL(textEdited(const QString &)), SLOT(CommandEditedCallback(const QString &)));
1652
1653
1654 commandLineWidget->setLayout(layoutCommandLine);
1655 commandLineWidget->setMinimumSize(50,50);
1656
1657 layoutCoutTB->addWidget(commandLineWidget);
1658
1659 fCoutDockWidget = new G4UIDockWidget ("Output");
1660 fCoutDockWidget->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea);
1661
1662 fCoutDockWidget->setWidget(coutTBWidget);
1663 return fCoutDockWidget;
1664}
void ClearButtonCallback()
Definition: G4UIQt.cc:3877
void CoutFilterCallback(const QString &)
Definition: G4UIQt.cc:4177
void CommandEditedCallback(const QString &text)
Definition: G4UIQt.cc:3952
void SaveOutputCallback()
Definition: G4UIQt.cc:4188
void ThreadComboBoxCallback(int)
Definition: G4UIQt.cc:4172

References ClearButtonCallback(), CommandEditedCallback(), CommandEnteredCallback(), g4zmq::connect(), CoutFilterCallback(), fClearIcon, fCommandArea, fCommandLabel, fCoutDockWidget, fCoutFilter, fCoutTBTextArea, fSaveIcon, fSearchIcon, SaveOutputCallback(), and ThreadComboBoxCallback().

Referenced by G4UIQt().

◆ CreateEmptyPickInfosWidget()

void G4UIQt::CreateEmptyPickInfosWidget ( )
private

Definition at line 4764 of file G4UIQt.cc.

4764 {
4765 QLayoutItem * wItem;
4766 if (fPickInfosWidget->layout()->count()) {
4767 while ((wItem = fPickInfosWidget->layout()->takeAt(0)) != 0) {
4768 delete wItem->widget();
4769 delete wItem;
4770 }
4771 }
4772 // Add empty one
4773 QLabel* label = new QLabel("Click on the object you want to pick");
4774 fPickInfosWidget->layout()->addWidget(label);
4775 fPickInfosDialog->setWindowTitle("Nothing to pick");
4776}

References fPickInfosDialog, and fPickInfosWidget.

Referenced by CreatePickInfosDialog().

◆ CreateEmptyViewerPropertiesWidget()

void G4UIQt::CreateEmptyViewerPropertiesWidget ( )
private

Definition at line 4746 of file G4UIQt.cc.

4746 {
4747 if(!fViewerPropertiesWidget) return;
4748 if(!fViewerPropertiesWidget->layout()) return;
4749 QLayoutItem * wItem;
4750 if (fViewerPropertiesWidget->layout()->count()) {
4751 while ((wItem = fViewerPropertiesWidget->layout()->takeAt(0)) != 0) {
4752 delete wItem->widget();
4753 delete wItem;
4754 }
4755 }
4756 // Add empty one
4757 QLabel* label = new QLabel("No viewer - Please open a viewer first");
4758 fViewerPropertiesWidget->layout()->addWidget(label);
4759 fViewerPropertiesDialog->setWindowTitle("No viewer");
4760 fViewerPropertiesDialog->setVisible(false);
4761}

References fViewerPropertiesDialog, and fViewerPropertiesWidget.

Referenced by CreateViewerPropertiesDialog(), and TabCloseCallback().

◆ CreateHelpTBWidget()

QWidget * G4UIQt::CreateHelpTBWidget ( )
private

Create the Help ToolBox Widget

Definition at line 1503 of file G4UIQt.cc.

1505{
1506 fHelpTBWidget = new QWidget();
1507
1508 QWidget *helpWidget = new QWidget();
1509 QHBoxLayout *helpLayout = new QHBoxLayout();
1510 QVBoxLayout *vLayout = new QVBoxLayout();
1511 fHelpVSplitter = new QSplitter(Qt::Vertical);
1512 fHelpLine = new QLineEdit();
1513 helpLayout->addWidget(new QLabel("Search :"));
1514 helpLayout->addWidget(fHelpLine);
1515 connect( fHelpLine, SIGNAL( editingFinished () ), this, SLOT( LookForHelpStringCallback() ) );
1516
1517 // Create Help tree
1518 FillHelpTree();
1519
1520 fParameterHelpLabel = new QTextEdit();
1521 fParameterHelpLabel->setReadOnly(true);
1522 fParameterHelpTable = new QTableWidget();
1523
1524 // Set layouts
1525
1526 if (fHelpTreeWidget) {
1527 fHelpVSplitter->addWidget(fHelpTreeWidget);
1528 }
1531
1532 fParameterHelpLabel->setVisible(false);
1533 fParameterHelpTable->setVisible(false);
1534 QSizePolicy policy = QSizePolicy(QSizePolicy::Maximum,QSizePolicy::Maximum);
1535 policy.setVerticalStretch(4);
1536 if (fHelpTreeWidget) {
1537 fHelpTreeWidget->setSizePolicy(policy);
1538 }
1539 policy = QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Preferred);
1540 policy.setVerticalStretch(1);
1541 fParameterHelpLabel->setSizePolicy(policy);
1542 fParameterHelpTable->setSizePolicy(policy);
1543
1544 vLayout->addWidget(helpWidget);
1545 vLayout->addWidget(fHelpVSplitter,1);
1546 vLayout->setContentsMargins(5,5,5,5);
1547
1548 helpWidget->setLayout(helpLayout);
1549 fHelpTBWidget->setLayout(vLayout);
1550
1551 return fHelpTBWidget;
1552}
void LookForHelpStringCallback()
Definition: G4UIQt.cc:4268

References g4zmq::connect(), fHelpLine, fHelpTBWidget, fHelpTreeWidget, fHelpVSplitter, FillHelpTree(), fParameterHelpLabel, fParameterHelpTable, and LookForHelpStringCallback().

Referenced by CreateUITabWidget().

◆ CreateHelpTree()

void G4UIQt::CreateHelpTree ( QTreeWidgetItem *  aParent,
G4UIcommandTree aCommandTree 
)
private

Fill the Help Tree Widget

Parameters
aParent: parent item to fill
aCommandTree: commandTree node associate with this part of the Tree

Definition at line 2821 of file G4UIQt.cc.

2825{
2826 if (aParent == NULL) return;
2827 if (aCommandTree == NULL) return;
2828
2829
2830 // Creating new item
2831 QTreeWidgetItem * newItem;
2832
2833 QString commandText = "";
2834 // Get the Sub directories
2835 for (int a=0;a<aCommandTree->GetTreeEntry();a++) {
2836
2837 commandText = QString((char*)(aCommandTree->GetTree(a+1)->GetPathName()).data()).trimmed();
2838
2839 // if already exist, don't create it !
2840 newItem = FindTreeItem(aParent,commandText);
2841 if (newItem == NULL) {
2842 newItem = new QTreeWidgetItem();
2843 newItem->setText(0,GetShortCommandPath(commandText));
2844 aParent->addChild(newItem);
2845 }
2846 CreateHelpTree(newItem,aCommandTree->GetTree(a+1));
2847 }
2848
2849 // Get the Commands
2850
2851 for (int a=0;a<aCommandTree->GetCommandEntry();a++) {
2852
2853 QStringList stringList;
2854 commandText = QString((char*)(aCommandTree->GetCommand(a+1)->GetCommandPath()).data()).trimmed();
2855
2856 // if already exist, don't create it !
2857 newItem = FindTreeItem(aParent,commandText);
2858 if (newItem == NULL) {
2859 newItem = new QTreeWidgetItem();
2860 newItem->setText(0,GetShortCommandPath(commandText));
2861 aParent->addChild(newItem);
2862
2863#if QT_VERSION < 0x040202
2864 fHelpTreeWidget->setItemExpanded(newItem,false);
2865#else
2866 newItem->setExpanded(false);
2867#endif
2868 }
2869 }
2870}
void CreateHelpTree(QTreeWidgetItem *, G4UIcommandTree *)
Definition: G4UIQt.cc:2821
QTreeWidgetItem * FindTreeItem(QTreeWidgetItem *, const QString &)
Definition: G4UIQt.cc:3284
QString GetShortCommandPath(QString)
Definition: G4UIQt.cc:4487
G4int GetCommandEntry() const
G4UIcommand * GetCommand(G4int i)
const G4String & GetPathName() const
G4int GetTreeEntry() const
G4UIcommandTree * GetTree(G4int i)

References CreateHelpTree(), fHelpTreeWidget, FindTreeItem(), G4UIcommandTree::GetCommand(), G4UIcommandTree::GetCommandEntry(), G4UIcommand::GetCommandPath(), G4UIcommandTree::GetPathName(), GetShortCommandPath(), G4UIcommandTree::GetTree(), and G4UIcommandTree::GetTreeEntry().

Referenced by CreateHelpTree(), and FillHelpTree().

◆ CreateHelpWidget()

void G4UIQt::CreateHelpWidget ( )
private

◆ CreateHistoryTBWidget()

QWidget * G4UIQt::CreateHistoryTBWidget ( )
private

Create the History ToolBox Widget

Definition at line 1484 of file G4UIQt.cc.

1486{
1487 fHistoryTBWidget = new QWidget();
1488
1489 QVBoxLayout *layoutHistoryTB = new QVBoxLayout();
1490 fHistoryTBTableList = new QListWidget();
1491 fHistoryTBTableList->setSelectionMode(QAbstractItemView::SingleSelection);
1492 connect(fHistoryTBTableList, SIGNAL(itemSelectionChanged()), SLOT(CommandHistoryCallback()));
1493
1494 layoutHistoryTB->addWidget(fHistoryTBTableList);
1495
1496 fHistoryTBWidget->setLayout(layoutHistoryTB);
1497 return fHistoryTBWidget;
1498}
void CommandHistoryCallback()
Definition: G4UIQt.cc:4154

References CommandHistoryCallback(), g4zmq::connect(), fHistoryTBTableList, and fHistoryTBWidget.

Referenced by CreateUITabWidget().

◆ CreateIcons()

void G4UIQt::CreateIcons ( )
private

Definition at line 367 of file G4UIQt.cc.

369{
370 const char * const save[]={
371 "32 32 24 1",
372 " c None",
373 "+ c #000200",
374 "@ c #141E43",
375 "# c #000C56",
376 "$ c #494A47",
377 "% c #636662",
378 "& c #312F2A",
379 "* c #191B19",
380 "= c #002992",
381 "- c #003DFF",
382 "; c #041DA5",
383 "> c #A8A9A3",
384 ", c #FDFFFC",
385 "' c #DDE0DD",
386 ") c #818783",
387 "! c #C9CBC8",
388 "~ c #0116C3",
389 "{ c #C5C8FA",
390 "] c #6596FC",
391 "^ c #A0B4F9",
392 "/ c #0B2AFD",
393 "( c #799BE3",
394 "_ c #5F4826",
395 ": c #D5D8D5",
396 " ",
397 " ",
398 " +++++++++++++++++++++++++ ",
399 " +@##+$%%%%%%%%%%%%%%%&*$%&+ ",
400 " +=-;@>,,''',,,,,,,',,)&!,)+ ",
401 " +;-~@>,,,,,,,,,,,,,,,>$!,)+ ",
402 " +=-~@>,,,,,{]]]]]^,,,>*&$&+ ",
403 " +=-~@>,,,,,'{^{^^{,,,>*#=#+ ",
404 " +=-~@>,,,,,,,,,,,,,,,>@~/=+ ",
405 " +=-~@>,,,{{{''''{',,,>@~-=+ ",
406 " +=-~@>,,'^]]]]]]({,,,>@~-=+ ",
407 " +=-~@>,,,{{{{{{{{{,,,>@~-=+ ",
408 " +=-~@>,,,,,'{^{{^{,,,>@~-=+ ",
409 " +=-~@>,,,,,]]]]]]],,,>@~-=+ ",
410 " +=-~*>,,,,,,,,,,,,,,,>@~-=+ ",
411 " +=-~@>,,,,,,,,,,,,,,,>@~-=+ ",
412 " +=-/=$%%%%%%%%%%%%%%%$=/-=+ ",
413 " +=---;###############;---=+ ",
414 " +=---////////////////----=+ ",
415 " +=----------------///----=+ ",
416 " +=---=@##############@#--=+ ",
417 " +=---@+++++++++++*%))_+~-=+ ",
418 " +=---#+++++++++++&:,,>@~-=+ ",
419 " +=---#+++++++++++$',,>@~-=+ ",
420 " +=---#+++++++++++&!,,>@~-=+ ",
421 " +=/--#+++++++++++&',,>@~-=+ ",
422 " @;--#+++++++++++$',,>@~-=+ ",
423 " @;;@+++++++++++*)!>%@=;#+ ",
424 " @++++++++++++++*&**++@++ ",
425 " ",
426 " ",
427 " "}
428 ;
429 fSaveIcon = new QPixmap(save);
430
431 const char * const search[] = {
432 /* columns rows colors chars-per-pixel */
433 "19 19 8 1",
434 " c #5C5C5C",
435 ". c #7D7D7D",
436 "X c #9B9B9B",
437 "o c #C3C3C3",
438 "O c None",
439 "+ c #000000",
440 "@ c #000000",
441 "# c None",
442 /* pixels */
443 "OOOOOOOOOOOOOOOOOOO",
444 "OOOOOOOOOOOOOOOOOOO",
445 "OOOOOOOo. .oOOOOOO",
446 "OOOOOOX XOOOOO",
447 "OOOOOo XOOX oOOOO",
448 "OOOOO. XOOOOX .OOOO",
449 "OOOOO OOOOOO OOOO",
450 "OOOOO OOOOOO OOOO",
451 "OOOOO. XOOOOo .OOOO",
452 "OOOOOo oOOo oOOOO",
453 "OOOOOOX XOOOO",
454 "OOOOOOOo. . XOOO",
455 "OOOOOOOOOOOOO. XOO",
456 "OOOOOOOOOOOOOO. XOO",
457 "OOOOOOOOOOOOOOOoOOO",
458 "OOOOOOOOOOOOOOOOOOO",
459 "OOOOOOOOOOOOOOOOOOO",
460 "OOOOOOOOOOOOOOOOOOO",
461 "OOOOOOOOOOOOOOOOOOO"
462 };
463 fSearchIcon = new QPixmap(search);
464
465 const char * const clear[] = {
466 /* columns rows colors chars-per-pixel */
467 "20 20 8 1",
468 " c #020202",
469 ". c #202020",
470 "X c #2C2C2C",
471 "o c #797979",
472 "O c None",
473 "+ c #797979",
474 "@ c #797979",
475 "# c #797979",
476 /* pixels */
477 "OOOOOOOOOOOOOOOOOOOO",
478 "OOOOOOOo oOOOOOOO",
479 "OOOOOXX XXOOOOO",
480 "OOOOOOOOOOOOOOOOOOOO",
481 "OOOOOOOOOOOOOOOOOOOO",
482 "OOOO XXXXXXXXXX OOOO",
483 "OOO XOOOOOOOOOO OOO",
484 "OOOOXOooOooOooO OOOO",
485 "OOOOXOooOooOooO OOOO",
486 "OOOOXOooOooOooO OOOO",
487 "OOOOXOooOooOooO OOOO",
488 "OOOOXOooOooOooO OOOO",
489 "OOOOXOooOooOooO OOOO",
490 "OOOOXOooOooOooO OOOO",
491 "OOOOXOooOooOooO OOOO",
492 "OOOOXOooOooOooO OOOO",
493 "OOOOXOooOooOooO OOOO",
494 "OOOOXOOOOOOOOOO OOOO",
495 "OOOOOooooooooooOOOOO",
496 "OOOOOO........OOOOOO"
497 };
498
499 fClearIcon = new QPixmap(clear);
500
501
502 const char * const open[]={
503 "32 32 33 1",
504 " c None",
505 "+ c #09091E",
506 "@ c #191B18",
507 "# c #5F615F",
508 "$ c #777977",
509 "% c #AEB1AF",
510 "& c #929491",
511 "* c #515250",
512 "= c #858784",
513 "- c #333533",
514 "; c #000100",
515 "> c #272926",
516 ", c #424341",
517 "' c #696C6A",
518 ") c #5F4927",
519 "! c #583D18",
520 "~ c #6E6A5B",
521 "{ c #47351D",
522 "] c #E0A554",
523 "^ c #FFD67B",
524 "/ c #EFB465",
525 "( c #FDBF6C",
526 "_ c #FFCD76",
527 ": c #806238",
528 "< c #362611",
529 "[ c #0B0D0A",
530 "} c #68471B",
531 "| c #523E22",
532 "1 c #B78A51",
533 "2 c #A17B44",
534 "3 c #D6A45E",
535 "4 c #C29354",
536 "5 c #A1A3A0",
537 " ",
538 " ",
539 " +@@@# ",
540 " $% +& * ",
541 " #= $ -; ",
542 " %>;+ ",
543 " ,;;+ ",
544 " &#$''#' >;;;+ ",
545 " =)!)!!!!~ *#$'' ",
546 " {]^/((_({- %%%%%%%%%%% ",
547 " {(^_^^^^:<{{{{{{{{{{{{{[& ",
548 " {/_/(((((/]]]]]]]]]]]/]!# ",
549 " {/^(((((_^^^^^^^^^^^^^^:# ",
550 " {/^(((_^^____________^^}$ ",
551 " {/^(((((/////////////((!# ",
552 " {/^/^_:<|||||||||||||||@@****1 ",
553 " {/^/^(<[)||||||||||||||))!!}<; ",
554 " {/^_(:|234444444444444444432)1 ",
555 " {/_^/<)34444444444444444443}, ",
556 " {/^(2{:41111111111111111142|5 ",
557 " {3^3<:31111111111111111143}- ",
558 " {/^2<:31111111111111111441|' ",
559 " {_/<:41111111111111111143}, ",
560 " {(4<:31111111111111111144!# ",
561 " )4))44111111111111111144}, ",
562 " )2<:31111111111111111144{# ",
563 " @|:14444444444444444444}* ",
564 " ;@434444444444444444434<# ",
565 " ;[))))))))))))))))))))!~ ",
566 " ++++++++++++++++++++++;% ",
567 " ",
568 " "}
569 ;
570 fOpenIcon = new QPixmap(open);
571
572
573 const char * const move[]={
574 "32 32 16 1",
575 " c None",
576 ". c #F1F1F1",
577 "+ c #939393",
578 "@ c #282828",
579 "# c #787878",
580 "$ c #000000",
581 "% c #CCCCCC",
582 "& c #1A1A1A",
583 "* c #0D0D0D",
584 "= c #5D5D5D",
585 "- c #AEAEAE",
586 "; c #BBBBBB",
587 "> c #C9C9C9",
588 ", c #D6D6D6",
589 "' c #FFFFFF",
590 ") c #999999",
591 " ",
592 " ",
593 " ",
594 " ",
595 " .. ",
596 " ++ ",
597 " .@@. ",
598 " #$$# ",
599 " %&$$*% ",
600 " =$$$$= ",
601 " -**$$**- ",
602 " %;%&*>;% ",
603 " -% @& %- ",
604 " ,=*; @& ;*=, ",
605 " .#*$$> >$$*#. ",
606 " ')&$$$$*@@ @@*$$$$&)' ",
607 " ')&$$$$*@@ @@*$$$$&+' ",
608 " .#*$$> >$$*#. ",
609 " ,=*; @& ;*=, ",
610 " -% @& %- ",
611 " %;%&*>>% ",
612 " -**$$**- ",
613 " =$$$$= ",
614 " %&$$*% ",
615 " #$$# ",
616 " .@@. ",
617 " ++ ",
618 " .. ",
619 " ",
620 " ",
621 " ",
622 " "}
623 ;
624 fMoveIcon = new QPixmap(move);
625
626 const char * const rotate[]={
627 "32 32 27 1",
628 " c None",
629 ". c #003333",
630 "+ c #000066",
631 "@ c #1A1A1A",
632 "# c #003399",
633 "$ c #3333CC",
634 "% c #000033",
635 "& c #353535",
636 "* c #434343",
637 "= c #336699",
638 "- c #3399FF",
639 "; c #003366",
640 "> c #5D5D5D",
641 ", c #282828",
642 "' c #3399CC",
643 ") c #333333",
644 "! c #3366CC",
645 "~ c #333399",
646 "{ c #505050",
647 "] c #666666",
648 "^ c #333366",
649 "/ c #0033CC",
650 "( c #3366FF",
651 "_ c #336666",
652 ": c #787878",
653 "< c #868686",
654 "[ c #6B6B6B",
655 " .++@ ",
656 " #$$%&* ",
657 " =--; *>, ",
658 " '-= )>& ",
659 " !-', ,>* ",
660 " !!=--= >* ",
661 " =------!!~@&)@ ",
662 " --------!*{{{*&, ",
663 " -------=){*{{{>>{) ",
664 " ,!-----= ){& ,&{{@",
665 " ,*>!----= &>& )@",
666 " ){>)~---= *]) @",
667 " @*>, --! ,&@ ",
668 " @{* '! ,-!=~^,@ ",
669 " @& == {/(----!^ ",
670 " _ ]:;(----' ",
671 " ==_ >{+(----~ ",
672 " !-!!======!!(((---! ",
673 " ='--------------! ",
674 " =!!!!'!!=; !-! ",
675 " &<* !~ ",
676 " @. *[* ; ",
677 " ;+)>* ",
678 " @@ ",
679 " ",
680 " ",
681 " ",
682 " ",
683 " ",
684 " ",
685 " ",
686 " "}
687 ;
688 fRotateIcon = new QPixmap(rotate);
689
690 const char * const pick[]={
691 /* columns rows colors chars-per-pixel */
692 "20 20 12 1 ",
693 " c #050804",
694 ". c #222321",
695 "X c #3B3C3A",
696 "o c #4C4E4B",
697 "O c #616360",
698 "+ c #747673",
699 "@ c #8A8C89",
700 "# c #9FA19E",
701 "$ c #BABCB9",
702 "% c #CED0CD",
703 "& c #E4E6E3",
704 "* c None",
705 /* pixels */
706 "*********oo*********",
707 "*********oo*********",
708 "******$O. .O%******",
709 "****&o .O..O O*****",
710 "***&X @**oo**@ X****",
711 "***o $***oo***$ O***",
712 "**% @**********@ %**",
713 "**O.***********& +**",
714 "**.O*****@@*****o.**",
715 "oo .oo**@ #*&XX. oo",
716 "oo .oo**@ #*&oo. oO",
717 "**.O*****##*****oX**",
718 "**O ***********& +**",
719 "**% @****&&****+ &**",
720 "***O $***Xo***# +***",
721 "****X @&*Xo*&+ o****",
722 "*****O o..o +*****",
723 "******%+. X+&******",
724 "*********oo*********",
725 "*********oO*********"
726 };
727 fPickIcon = new QPixmap(pick);
728
729 const char * const zoom_in[]={
730 "32 32 11 1",
731 " c None",
732 ". c #C9CBC8",
733 "+ c #A8A9A3",
734 "@ c #818783",
735 "# c #D5D8D5",
736 "$ c #9BCCCC",
737 "% c #5FC7F4",
738 "& c #FDFFFC",
739 "* c #636662",
740 "= c #9599CE",
741 "- c #DDE0DD",
742 " ",
743 " ",
744 " ",
745 " ",
746 " ",
747 " .++@@++. ",
748 " +++..#.+++ ",
749 " .@+...++++#+@. ",
750 " @$.%%+&&&@%..@ ",
751 " ++.%%%+&&&*%%.++ ",
752 " .+#%%%%+&&&*%%.#+ ",
753 " ++..%%%+&&&*%%%.++ ",
754 " +#.+++++&&&*++++.+ ",
755 " @.+&&&&&&&&&&&&&+@ ",
756 " @#+&&&&&&&&&&&&&+@ ",
757 " @.+&&&&&&&&&&&&&+. ",
758 " +++@***+&&&****@+. ",
759 " ....++++&&&*++++.. ",
760 " ++.===+&&&*%=.++ ",
761 " @..==+&&&*=..@#& ",
762 " .@+#.+&&&@-+@@*@ ",
763 " +++.++++++ *+@* ",
764 " .+@@@++. @**+* ",
765 " .*@*+* ",
766 " .*@*+* ",
767 " +*@@* ",
768 " .**+ ",
769 " ",
770 " ",
771 " ",
772 " ",
773 " "}
774 ;
775 fZoomInIcon = new QPixmap(zoom_in);
776
777 const char * const zoom_out[]={
778 "32 32 11 1",
779 " c None",
780 ". c #C9CBC8",
781 "+ c #A8A9A3",
782 "@ c #818783",
783 "# c #D5D8D5",
784 "$ c #5FC7F4",
785 "% c #9BCCCC",
786 "& c #FDFFFC",
787 "* c #636662",
788 "= c #9599CE",
789 "- c #DDE0DD",
790 " ",
791 " ",
792 " ",
793 " ",
794 " ",
795 " .++@@++. ",
796 " +++..#.+++ ",
797 " .@+..$$$$.#+@. ",
798 " @%.$$$$$$$$..@ ",
799 " ++.$$$$$$$$$$.++ ",
800 " .+#$$$$$$$$$$$.#+ ",
801 " ++..$$$$$$$$$$$.++ ",
802 " +#.+++++++++++++.+ ",
803 " @.+&&&&&&&&&&&&&+@ ",
804 " @#+&&&&&&&&&&&&&+@ ",
805 " @.+&&&&&&&&&&&&&+. ",
806 " +++@***********@+. ",
807 " ....++++++++++++.. ",
808 " ++.===$$$$$$=.++ ",
809 " @..===$$$$=..@#& ",
810 " .@+#.$$$..-+@@*@ ",
811 " +++#--.+++ *+@* ",
812 " .+@@@++. @**+* ",
813 " .*@*+* ",
814 " .*@*+* ",
815 " +*@@* ",
816 " .**+ ",
817 " ",
818 " ",
819 " ",
820 " ",
821 " "}
822 ;
823 fZoomOutIcon = new QPixmap(zoom_out);
824
825 const char * const wireframe[]={
826 "32 32 24 1",
827 " c None",
828 "+ c #E4E4E4",
829 "@ c #D5D5D5",
830 "# c #E1E1E1",
831 "$ c #E7E7E7",
832 "% c #D8D8D8",
833 "& c #A7A7A7",
834 "* c #000000",
835 "= c #989898",
836 "- c #8A8A8A",
837 "; c #B5B5B5",
838 "> c #1B1B1B",
839 ", c #676767",
840 "' c #959595",
841 ") c #4A4A4A",
842 "! c #878787",
843 "~ c #D3D3D3",
844 "{ c #C4C4C4",
845 "] c #A4A4A4",
846 "^ c #5B5B5B",
847 "/ c #B3B3B3",
848 "( c #787878",
849 "_ c #C7C7C7",
850 ": c #585858",
851 " ",
852 " +@@# ",
853 " $%@@@@@&****=+ ",
854 " +&********&@-***; ",
855 " +@@@&**&@@@@@@$ @*-&>&+ ",
856 " +*****&+ %*@ ,**'# ",
857 " @***)!~ @*{&*****+ ",
858 " @*!]***&+ +-*^**'~!*@ ",
859 " @*~ +@&**&@@@@@@&****&+ ~*@ ",
860 " @*@ +&********&-*= @*@ ",
861 " @*@ $%@-*-@$ @*@ @*@ ",
862 " @*@ @*@ %*% @*@ ",
863 " @*@ %*% %*% @*@ ",
864 " @*@ %*% %*% @*@ ",
865 " @*@ %*% %*% @*@ ",
866 " @*@ %*% %*% @*@ ",
867 " @*@ %*% %*% @*@ ",
868 " @*@ @*@ %*% @*@ ",
869 " @*@ =*-+ @*@ @*@ ",
870 " @*@ $%@@&****&@-*-+ @*@ ",
871 " @*@ $@&*****&@@&******&~~!*@ ",
872 " @*{/***&@@%$ $@-*-&*****+ ",
873 " @*)*)(-~ @*@ ~)**] ",
874 " +*******&@@@@+ %*_+]**] ",
875 " +@@@@@&******&@%+_*^**]# ",
876 " $%@@@&****:**&+ ",
877 " +%@&**& ",
878 " ++ ",
879 " ",
880 " ",
881 " ",
882 " "}
883 ;
884 fWireframeIcon = new QPixmap(wireframe);
885
886 const char * const solid[]={
887 "32 32 33 1",
888 " c None",
889 "+ c #C2DEDE",
890 "@ c #B5D7DF",
891 "# c #ACD6E6",
892 "$ c #60C0EC",
893 "% c #4EB7EE",
894 "& c #53B9ED",
895 "* c #82CEEA",
896 "= c #CFDDDA",
897 "- c #94C9E8",
898 "; c #0960FF",
899 "> c #0943FF",
900 ", c #0949FF",
901 "' c #3CB3F0",
902 ") c #71C7EB",
903 "! c #73CBE5",
904 "~ c #D3DDDB",
905 "{ c #C4DDDE",
906 "] c #B7D5DF",
907 "^ c #2DACF5",
908 "/ c #59C1ED",
909 "( c #5FC0ED",
910 "_ c #85CEE9",
911 ": c #096BFF",
912 "< c #2AACF6",
913 "[ c #5CBEEC",
914 "} c #7ACAE4",
915 "| c #73CAEB",
916 "1 c #71C8E5",
917 "2 c #D1DDDA",
918 "3 c #CBDDD9",
919 "4 c #67C1EB",
920 "5 c #80CDEA",
921 " ",
922 " ",
923 " +@@@@@@#$%&*= ",
924 " +-;>>>>>>>>>,')!~ ",
925 " {]@@-;>>>>>>>>>>>>^/(_= ",
926 " {:>>>>>>>>>>>>>>>>><//[)!= ",
927 " ]>>>>>>>>>>>>>>>>>><////[)} ",
928 " @>>>>>>>>>>>>>>>>>><//////| ",
929 " @>>>>>>>>>>>>>>>>>><//////| ",
930 " @>>>>>>>>>>>>>>>>>><//////| ",
931 " @>>>>>>>>>>>>>>>>>><//////| ",
932 " @>>>>>>>>>>>>>>>>>><//////| ",
933 " @>>>>>>>>>>>>>>>>>><//////| ",
934 " @>>>>>>>>>>>>>>>>>><//////| ",
935 " @>>>>>>>>>>>>>>>>>><//////| ",
936 " @>>>>>>>>>>>>>>>>>><//////| ",
937 " @>>>>>>>>>>>>>>>>>><//////| ",
938 " @>>>>>>>>>>>>>>>>>><//////| ",
939 " @>>>>>>>>>>>>>>>>>><//////| ",
940 " @>>>>>>>>>>>>>>>>>><//////| ",
941 " @>>>>>>>>>>>>>>>>>><//////| ",
942 " @>>>>>>>>>>>>>>>>>></////[1 ",
943 " @>>>>>>>>>>>>>>>>>><////[*2 ",
944 " {:>>>>>>>>>>>>>>>>><//[)12 ",
945 " +@@@@@-;>>>>>>>>>><[)13 ",
946 " {]@@@-;>>>,'*3 ",
947 " +@@#452 ",
948 " ",
949 " ",
950 " ",
951 " ",
952 " "}
953 ;
954 fSolidIcon = new QPixmap(solid);
955
956 const char * const hidden_line_removal[]={
957 "32 32 15 1",
958 " c None",
959 "+ c #D5D5D5",
960 "@ c #C7C7C7",
961 "# c #9C9C9C",
962 "$ c #000000",
963 "% c #8E8E8E",
964 "& c #808080",
965 "* c #A9A9A9",
966 "= c #D8D8D8",
967 "- c #CACACA",
968 "; c #181818",
969 "> c #9F9F9F",
970 ", c #ACACAC",
971 "' c #B9B9B9",
972 ") c #555555",
973 " ",
974 " +@@+ ",
975 " +@@@@@@#$$$$%+ ",
976 " +#$$$$$$$$#@&$$$* ",
977 " =-@@#$$#@@@@@-= @$&#;>= ",
978 " =$$$$$#+ -$@ *$$%+ ",
979 " -$&@-= -$- #$$$= ",
980 " -$@ -$- +&$- ",
981 " @$@ @$@ @$@ ",
982 " @$@ @$@ @$@ ",
983 " @$@ @$@ @$@ ",
984 " @$@ @$@ @$@ ",
985 " @$@ @$@ @$@ ",
986 " @$@ @$@ @$@ ",
987 " @$@ @$@ @$@ ",
988 " @$@ @$@ @$@ ",
989 " @$@ @$@ @$@ ",
990 " @$@ @$@ @$@ ",
991 " @$@ @$@ @$@ ",
992 " @$@ @$@ @$@ ",
993 " @$@ @$@ @$@ ",
994 " @$@ @$@ #$= ",
995 " -$&@@@-= -$- =>;, ",
996 " =$$$$$$$#@@@-= -$'+#$$, ",
997 " =-@@@@#$$$$$$#@-+'$)$$#+ ",
998 " =-@@@#$$$$)$$#+ ",
999 " +@@#$$# ",
1000 " ++ ",
1001 " ",
1002 " ",
1003 " ",
1004 " "}
1005 ;
1006 fHiddenLineRemovalIcon = new QPixmap(hidden_line_removal);
1007
1008 const char * const hidden_line_and_surface_removal[]={
1009 "32 32 40 1",
1010 " c None",
1011 "+ c #FFFFFF",
1012 "@ c #89A2E9",
1013 "# c #5378E3",
1014 "$ c #A2B5ED",
1015 "% c #5379E3",
1016 "& c #5076E3",
1017 "* c #3E69E4",
1018 "= c #0C43F8",
1019 "- c #043FFE",
1020 "; c #CDD9ED",
1021 "> c #BDCDE9",
1022 ", c #FBFCFC",
1023 "' c #406AE4",
1024 ") c #0439FE",
1025 "! c #0137FF",
1026 "~ c #4F75E3",
1027 "{ c #9EB5E3",
1028 "] c #829FE0",
1029 "^ c #B6C6E7",
1030 "/ c #9DB4E3",
1031 "( c #7E9CE0",
1032 "_ c #B2C3E9",
1033 ": c #7E9AE0",
1034 "< c #86A2E1",
1035 "[ c #CAD6ED",
1036 "} c #5177E3",
1037 "| c #829CE0",
1038 "1 c #BCCCE9",
1039 "2 c #3A67E6",
1040 "3 c #0A43FA",
1041 "4 c #95ACE1",
1042 "5 c #BBCBE9",
1043 "6 c #A9BBE5",
1044 "7 c #96AFE1",
1045 "8 c #BDCBE9",
1046 "9 c #4067E4",
1047 "0 c #6485E5",
1048 "a c #E3EAF3",
1049 "b c #CAD6F3",
1050 " ",
1051 " ",
1052 " ++++ ",
1053 " ++++++++@#$+++ ",
1054 " ++@%####&*=-#+;>, ",
1055 " +++++@'=)))))))!)~+{]^++ ",
1056 " +$%&*=)!!!!!!!!!)~+/(]_+++ ",
1057 " +#-))!!!!!!!!!!!)~+/(::<[+ ",
1058 " +#)!!!!!!!!!!!!!!}+/::::{+ ",
1059 " +#)!!!!!!!!!!!!!!}+/::::{+ ",
1060 " +#)!!!!!!!!!!!!!!}+/::::{+ ",
1061 " +#)!!!!!!!!!!!!!!}+/::::{+ ",
1062 " +#)!!!!!!!!!!!!!!}+/::::{+ ",
1063 " +#)!!!!!!!!!!!!!!}+/::::{+ ",
1064 " +#)!!!!!!!!!!!!!!}+/::::{+ ",
1065 " +#)!!!!!!!!!!!!!!}+/::::{+ ",
1066 " +#)!!!!!!!!!!!!!!}+/::::{+ ",
1067 " +#)!!!!!!!!!!!!!!}+/::::{+ ",
1068 " +#)!!!!!!!!!!!!!!}+/::::{+ ",
1069 " +#)!!!!!!!!!!!!!!}+/::::{+ ",
1070 " +#)!!!!!!!!!!!!!!}+/::::{+ ",
1071 " +#)!!!!!!!!!!!!!!}+/:::|1+ ",
1072 " +$#}}~23!!!!!!!!)~+/(]45, ",
1073 " +++++++@#}}~23!!)~+678++ ",
1074 " ++++++@#~90+a++ ",
1075 " ++++b++ ",
1076 " ++ ",
1077 " ",
1078 " ",
1079 " ",
1080 " ",
1081 " "}
1082 ;
1083 fHiddenLineAndSurfaceRemovalIcon = new QPixmap(hidden_line_and_surface_removal);
1084
1085 const char * const perspective[]={
1086 "32 32 3 1",
1087 " c None",
1088 ". c #D5D8D5",
1089 "+ c #000000",
1090 " ",
1091 " ",
1092 " ",
1093 " ",
1094 " ",
1095 " ................ ",
1096 " ....+++++++++++++++. ",
1097 " ...++++..+.........+++. ",
1098 " ..++..............++..+. ",
1099 " .+++++++++++++++++.. .+. ",
1100 " .+...............+. .+. ",
1101 " .+. .+. .+. .+. ",
1102 " .+. .+. .+. .+. ",
1103 " .+. .+. .+. .+. ",
1104 " .+. .+. .+. .+. ",
1105 " .+. .+. .+. .+. ",
1106 " .+. .+. .+. .+. ",
1107 " .+. .+. .+. .+. ",
1108 " .+. .+. .+. .+. ",
1109 " .+. .+......+....+. ",
1110 " .+. ..++++++.+.++++. ",
1111 " .+. .++.......+...+.. ",
1112 " .+. .++. .+..++. ",
1113 " .+. ..+.. .+..+. ",
1114 " .+..++. .+.+. ",
1115 " .+.++. .+++. ",
1116 " .+++.............++. ",
1117 " .+++++++++++++++++. ",
1118 " ................... ",
1119 " ",
1120 " ",
1121 " "}
1122 ;
1123 fPerspectiveIcon = new QPixmap(perspective);
1124
1125 const char * const ortho[]={
1126 "32 32 3 1",
1127 " c None",
1128 ". c #D5D8D5",
1129 "@ c #000000",
1130 " ",
1131 " ",
1132 " ",
1133 " ................... ",
1134 " ..@@@@@@@@@@@@@@@@@. ",
1135 " ..@@@.............@@@. ",
1136 " ..@@.@. ..@..@. ",
1137 " ..@@ ..@. .@@...@. ",
1138 " ..@@..............@@.. .@. ",
1139 " .@@@@@@@@@@@@@@@@@.. .@. ",
1140 " .@...............@. .@. ",
1141 " .@. .@. .@. .@. ",
1142 " .@. .@. .@. .@. ",
1143 " .@. .@. .@. .@. ",
1144 " .@. .@. .@. .@. ",
1145 " .@. .@. .@. .@. ",
1146 " .@. .@. .@. .@. ",
1147 " .@. .@. .@. .@. ",
1148 " .@. .@. .@. .@. ",
1149 " .@. .@. .@. .@. ",
1150 " .@. .@. .@. .@. ",
1151 " .@. .@........@......@. ",
1152 " .@. .@@@@@@@@@.@.@@@@@@. ",
1153 " .@. .@@+........@....@@.. ",
1154 " .@...@. .@...@... ",
1155 " .@.@@. .@.@@ . ",
1156 " .@@@.............@@@.. ",
1157 " .@@@@@@@@@@@@@@@@@... ",
1158 " ................... ",
1159 " ",
1160 " ",
1161 " "}
1162 ;
1163 fOrthoIcon = new QPixmap(ortho);
1164
1165 const char * const commandIcon[]={
1166 "20 20 25 1 ",
1167 " c #4ED17F",
1168 ". c #4FD280",
1169 "X c #50D381",
1170 "o c #5BD181",
1171 "O c #5DD382",
1172 "+ c #59D48A",
1173 "@ c #66D68C",
1174 "# c #6FD895",
1175 "$ c #85DEA4",
1176 "% c #8CE0AC",
1177 "& c #96E4B8",
1178 "* c #9EE3B8",
1179 "= c #A8E5BB",
1180 "- c #A7E8C4",
1181 "; c #B2EAC8",
1182 ": c #B9ECD1",
1183 "> c #C2EDD3",
1184 ", c #CBF1DF",
1185 "< c #D4F3E3",
1186 "1 c #DDF4E5",
1187 "2 c #DBF5EC",
1188 "3 c #E5F7F0",
1189 "4 c #EDFAFB",
1190 "5 c #F6FBFE",
1191 "6 c #FEFFFC",
1192 /* pixels */
1193 "66666666666666666666",
1194 "66%++++++++++++++&56",
1195 "6$ o..o......o..o *6",
1196 "6+o...o*<441;@.o..+6",
1197 "6+..o@1553<354$..o+6",
1198 "6+..o<5<@ .*54#o.+6",
1199 "6+o.*52X :5-..@6",
1200 "6+..15% o$+o.+6",
1201 "6+.+55@ .o.+6",
1202 "6O.#54 .X.+6",
1203 "6O #54 .X.+6",
1204 "6O.+55@ .o.+6",
1205 "6+..25% @,*o.@6",
1206 "6+o.*52X :5>.o+6",
1207 "6+..O25<@ X=54#o.+6",
1208 "6+.o.@1553<354$...@6",
1209 "6+o..oo*<44<;@o..o+6",
1210 "6$ .o..o.....o..o *6",
1211 "66%+++++OOOO+++++*66",
1212 "66666666666666666666"
1213 };
1214 fCommandIcon = new QPixmap(commandIcon);
1215
1216 const char * const dirIcon[]={
1217 "20 20 25 1 ",
1218 " c #DF5959",
1219 ". c #DD5F5F",
1220 "X c #DE7370",
1221 "o c #E06360",
1222 "O c #E06467",
1223 "+ c #E06C6C",
1224 "@ c #E57979",
1225 "# c #E08886",
1226 "$ c #E18D91",
1227 "% c #E19D9B",
1228 "& c #E99B9D",
1229 "* c #E8A2A2",
1230 "= c #EEB2B0",
1231 "- c #EDBBBC",
1232 "; c #EDCBC7",
1233 ": c #E9CDD1",
1234 "> c #F1D5D6",
1235 ", c #F9DFE2",
1236 "< c #EFE8E7",
1237 "1 c #F3E3E4",
1238 "2 c #F8EEEC",
1239 "3 c #FCF6F4",
1240 "4 c #F6F3F9",
1241 "5 c #F2F8FC",
1242 "6 c #FEFFFD",
1243 /* pixels */
1244 "66666666666666666666",
1245 "66$oOOOOOOOOOOOOo%66",
1246 "6# %6",
1247 "6o +,666663:+ o6",
1248 "6o =635533666$ o6",
1249 "6o -65:+ +165X o6",
1250 "6o >6<. 36; O6",
1251 "6o 26- &6>. o6",
1252 "6. o56* @63. o6",
1253 "6. X56& o66. o6",
1254 "6. X56& +63. o6",
1255 "6. o56* @62. o6",
1256 "6o 26- =61 O6",
1257 "6o >6<. o36: o6",
1258 "6o -65:+ @265X o6",
1259 "6o =635543665# O6",
1260 "6o +1666662;+ o6",
1261 "6# %6",
1262 "66$OOOoo....OOOOo%66",
1263 "66666666666666666666"}
1264 ;
1265 fDirIcon = new QPixmap(dirIcon);
1266
1267
1268 const char * const runIcon[]={
1269 /* columns rows colors chars-per-pixel */
1270 "20 20 33 1 ",
1271 " c #5CA323",
1272 ". c #5EA03F",
1273 "X c #6DB620",
1274 "o c #66AD3F",
1275 "O c #70B73C",
1276 "+ c #7CC13F",
1277 "@ c #569B41",
1278 "# c #61A14E",
1279 "$ c #70A95D",
1280 "% c #7EB55C",
1281 "& c #85B94E",
1282 "* c #90BE49",
1283 "= c #81B669",
1284 "- c #81B370",
1285 "; c #95CA46",
1286 ": c #A1CD40",
1287 "> c #AED045",
1288 ", c #B3D558",
1289 "< c #9BC87E",
1290 "1 c #AED668",
1291 "2 c #A2D075",
1292 "3 c #C2DC73",
1293 "4 c #A5C98F",
1294 "5 c #C1DC9F",
1295 "6 c #CAE18E",
1296 "7 c #CCE39A",
1297 "8 c #C4DCB6",
1298 "9 c #E3ECBA",
1299 "0 c #EEF3D3",
1300 "q c #F0F7DE",
1301 "w c #F8FAE9",
1302 "e c #FCFFFB",
1303 "r c None",
1304 /* pixels */
1305 "rrrrrrrr%<<2rrrrrrrr",
1306 "rrrrr5=$$$$===rrrrrr",
1307 "rrrr<##$$$$$---&rrrr",
1308 "rrr=###$$$$-----%rrr",
1309 "rr=####$$$$------&rr",
1310 "r2@####7##$-------rr",
1311 "r.@####048$-------Or",
1312 "r.@####q4ee=----$@.r",
1313 " .@@###w4eee5%$#@@@X",
1314 " .@@@..w4eeeeqo..@@X",
1315 " .@..ooe<eeee7Oooo@X",
1316 " ..oooOe2eee6OOOooo ",
1317 "rOooOO+e2ew2+++++O+r",
1318 "r:oO+++e30,;;;;;++Or",
1319 "r :++;:9,>,,>>:;;1rr",
1320 "rr*1;:>,333333,>32rr",
1321 "rrr66,1367777637<rrr",
1322 "rrrr509799999905rrrr",
1323 "rrrrr=8wqwwww8-rrrrr",
1324 "rrrrrrrr4444rrrrrrrr"
1325 };
1326 fRunIcon = new QPixmap(runIcon);
1327
1328 const char * const paramIcon[]={
1329 /* columns rows colors chars-per-pixel */
1330 "20 20 35 1 ",
1331 " c #2E2525",
1332 ". c #403737",
1333 "X c #423A3A",
1334 "o c #443C3C",
1335 "O c #473F3F",
1336 "+ c #4C4444",
1337 "@ c #4F4848",
1338 "# c #514949",
1339 "$ c #544D4D",
1340 "% c #595252",
1341 "& c #625B5B",
1342 "* c #696262",
1343 "= c #6D6666",
1344 "- c #716B6B",
1345 "; c #726C6C",
1346 ": c #767171",
1347 "> c #7E7878",
1348 ", c #8B8787",
1349 "< c #8C8787",
1350 "1 c #8D8888",
1351 "2 c #918D8D",
1352 "3 c #928E8E",
1353 "4 c #948F8F",
1354 "5 c #9C9898",
1355 "6 c #9D9999",
1356 "7 c #D5D4D4",
1357 "8 c #D8D6D6",
1358 "9 c #DDDBDB",
1359 "0 c #EFEFEF",
1360 "q c #F6F6F6",
1361 "w c None",
1362 "e c None",
1363 "r c None",
1364 "t c gray99",
1365 "y c None",
1366 /* pixels */
1367 "wwwwwwww5 5wwwwwwww",
1368 "wwwwwwww, ,wwwwwwww",
1369 "www&;ww7+ +9ww=-www",
1370 "ww& O# OX *ww",
1371 "ww; >ww",
1372 "wwwO .%%X +www",
1373 "www# 3wwww3 Owww",
1374 "ww7 3wwwwww3 7ww",
1375 "5<+ .wwwwwww0. +<5",
1376 " %wwwwwwww$ ",
1377 " %wwwwwwww$ ",
1378 "5<+ .wwwwwww0X +<5",
1379 "ww9 4wwwwww1 9ww",
1380 "wwwO 30ww03 Owww",
1381 "wwwX X#$X @www",
1382 "ww= =ww",
1383 "ww- +O ++ :ww",
1384 "www*>ww7+ +7ww=:www",
1385 "wwwwwwww1 1wwwwwwww",
1386 "wwwwwwww5 5wwwwwwww"
1387 };
1388 fParamIcon = new QPixmap(paramIcon);
1389
1390 const char * const exitIcon[]={
1391 /* columns rows colors chars-per-pixel */
1392 "23 28 55 1 ",
1393 " c None",
1394 ". c #350505",
1395 "X c #3A0505",
1396 "o c #3C0605",
1397 "O c #3D0605",
1398 "+ c #430606",
1399 "@ c #440606",
1400 "# c #470706",
1401 "$ c #500707",
1402 "% c #510807",
1403 "& c #520807",
1404 "* c #530807",
1405 "= c #550808",
1406 "- c #570808",
1407 "; c #5C0908",
1408 ": c #5D0908",
1409 "> c #5F0908",
1410 ", c #630A08",
1411 "< c #640A09",
1412 "1 c #6B0A09",
1413 "2 c #6C0A09",
1414 "3 c #720B0A",
1415 "4 c #760B0A",
1416 "5 c #770B0A",
1417 "6 c #7A0B0B",
1418 "7 c #7D0C0B",
1419 "8 c #7F0C0B",
1420 "9 c #840D0B",
1421 "0 c #850D0C",
1422 "q c #880D0C",
1423 "w c #8D0E0C",
1424 "e c #900E0C",
1425 "r c #940E0D",
1426 "t c #950E0D",
1427 "y c #9C0F0E",
1428 "u c #9E100E",
1429 "i c #AA100E",
1430 "p c #AC100F",
1431 "a c #AD100F",
1432 "s c #AE110F",
1433 "d c #B31110",
1434 "f c #B51210",
1435 "g c #B61210",
1436 "h c #B71210",
1437 "j c #B91210",
1438 "k c #C01311",
1439 "l c #C21311",
1440 "z c #C81311",
1441 "x c #C91312",
1442 "c c #CC1412",
1443 "v c #CE1412",
1444 "b c #D01412",
1445 "n c #D11412",
1446 "m c #D31412",
1447 "M c #D51513",
1448 /* pixels */
1449 " ",
1450 " O= ",
1451 " :MMh ",
1452 " hMMM ",
1453 " jMMM ",
1454 " <x1 jMMM %xw ",
1455 " rMMM jMMM MMMk ",
1456 " rMMMM# jMMM MMMMx ",
1457 " OMMMMk jMMM 8MMMM9 ",
1458 " xMMMM jMMM pMMMM ",
1459 " MMMM jMMM xMMM8 ",
1460 "rMMM3 jMMM MMMM ",
1461 "MMMM hMMM MMMM ",
1462 "MMMM :MMh hMMM ",
1463 "MMMM O% 8MMM ",
1464 "MMMM pMMM ",
1465 "MMMM MMMM ",
1466 "wMMM3 MMMM ",
1467 ".MMMM xMMM9 ",
1468 " hMMMk wMMMM ",
1469 " MMMMMO hMMMM= ",
1470 " <MMMMMp: $rMMMMMp ",
1471 " yMMMMMMMMMMMMMMk ",
1472 " #MMMMMMMMMMMM3 ",
1473 " uMMMMMMMMk ",
1474 " #1wr3% ",
1475 " ",
1476 " "
1477 };
1478 fExitIcon= new QPixmap(exitIcon);
1479}

References fClearIcon, fCommandIcon, fDirIcon, fExitIcon, fHiddenLineAndSurfaceRemovalIcon, fHiddenLineRemovalIcon, fMoveIcon, fOpenIcon, fOrthoIcon, fParamIcon, fPerspectiveIcon, fPickIcon, fRotateIcon, fRunIcon, fSaveIcon, fSearchIcon, fSolidIcon, fWireframeIcon, fZoomInIcon, and fZoomOutIcon.

Referenced by G4UIQt().

◆ CreatePickInfosDialog()

void G4UIQt::CreatePickInfosDialog ( )
private

Definition at line 4718 of file G4UIQt.cc.

4718 {
4719
4720 if (fPickInfosDialog != NULL) {
4721 return;
4722 }
4723 fPickInfosDialog = new QDialog();
4724
4725 fPickInfosDialog->setWindowTitle("Pick infos");
4726 fPickInfosDialog->setSizePolicy (QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding));
4727
4728 if (!fPickInfosWidget) {
4729 fPickInfosWidget = new QWidget();
4730 QVBoxLayout* layoutPickInfos = new QVBoxLayout();
4731 fPickInfosWidget->setLayout(layoutPickInfos);
4732
4734 }
4735
4736 QVBoxLayout* layoutDialog = new QVBoxLayout();
4737
4738 layoutDialog->addWidget(fPickInfosWidget);
4739 layoutDialog->setContentsMargins(0,0,0,0);
4740 fPickInfosDialog->setLayout(layoutDialog);
4741 fPickInfosDialog->setWindowFlags(Qt::WindowStaysOnTopHint);
4742
4743}
void CreateEmptyPickInfosWidget()
Definition: G4UIQt.cc:4764

References CreateEmptyPickInfosWidget(), fPickInfosDialog, and fPickInfosWidget.

Referenced by ChangeCursorAction(), and GetPickInfosWidget().

◆ CreateSceneTreeWidget()

QWidget * G4UIQt::CreateSceneTreeWidget ( )
private

Definition at line 1703 of file G4UIQt.cc.

1703 {
1704
1705 fSceneTreeWidget = new QWidget();
1706 QVBoxLayout* layout = new QVBoxLayout();
1707 fSceneTreeWidget->setLayout(layout);
1708
1709#if QT_VERSION < 0x040200
1710 fSceneTreeWidget->hide();
1711#else
1712 fSceneTreeWidget->setVisible(false);
1713#endif
1714
1715 return fSceneTreeWidget;
1716}

References fSceneTreeWidget.

Referenced by CreateUITabWidget().

◆ CreateUITabWidget()

G4UIDockWidget * G4UIQt::CreateUITabWidget ( )
private

Create the VisParameters ToolBox Widget

Definition at line 1678 of file G4UIQt.cc.

1680{
1681 fUITabWidget = new QTabWidget();
1682
1683 // the left dock
1684 fUITabWidget->addTab(CreateSceneTreeWidget(),"Scene tree");
1685 fUITabWidget->addTab(CreateHelpTBWidget(),"Help");
1686 fUITabWidget->addTab(CreateHistoryTBWidget(),"History");
1687 fUITabWidget->setCurrentWidget(fHelpTBWidget);
1688
1689 fUITabWidget->setTabToolTip (0,"Scene component tree. Only available in Stored mode");
1690 fUITabWidget->setTabToolTip (1,"Help widget");
1691 fUITabWidget->setTabToolTip (2,"All commands history");
1692 connect(fUITabWidget, SIGNAL(currentChanged(int)), SLOT(ToolBoxActivated(int)));
1693
1694 fUIDockWidget = new G4UIDockWidget ("Scene tree, Help, History");
1695 fUIDockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
1696
1697 fUIDockWidget->setWidget(fUITabWidget);
1698
1699 return fUIDockWidget;
1700}
QWidget * CreateSceneTreeWidget()
Definition: G4UIQt.cc:1703
QWidget * CreateHistoryTBWidget()
Definition: G4UIQt.cc:1484
void ToolBoxActivated(int)
Definition: G4UIQt.cc:5175
QWidget * CreateHelpTBWidget()
Definition: G4UIQt.cc:1503

References g4zmq::connect(), CreateHelpTBWidget(), CreateHistoryTBWidget(), CreateSceneTreeWidget(), fHelpTBWidget, fUIDockWidget, fUITabWidget, and ToolBoxActivated().

Referenced by G4UIQt().

◆ CreateViewerPropertiesDialog()

void G4UIQt::CreateViewerPropertiesDialog ( )
private

Definition at line 4692 of file G4UIQt.cc.

4692 {
4693
4694 if (fViewerPropertiesDialog != NULL) {
4695 return;
4696 }
4697 fViewerPropertiesDialog = new QDialog();
4698
4699 fViewerPropertiesDialog->setWindowTitle("Viewer properties");
4700 fViewerPropertiesDialog->setSizePolicy (QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding));
4701
4703 fViewerPropertiesWidget = new QWidget();
4704 QVBoxLayout* layoutPropertiesWidget = new QVBoxLayout();
4705 fViewerPropertiesWidget->setLayout(layoutPropertiesWidget);
4706
4708 }
4709
4710 QVBoxLayout* layoutDialog = new QVBoxLayout();
4711
4712 layoutDialog->addWidget(fViewerPropertiesWidget);
4713 layoutDialog->setContentsMargins(0,0,0,0);
4714 fViewerPropertiesDialog->setLayout(layoutDialog);
4715}
void CreateEmptyViewerPropertiesWidget()
Definition: G4UIQt.cc:4746

References CreateEmptyViewerPropertiesWidget(), fViewerPropertiesDialog, and fViewerPropertiesWidget.

Referenced by GetViewerPropertiesWidget(), and ViewerPropertiesIconCallback().

◆ CreateViewerWidget()

void G4UIQt::CreateViewerWidget ( )
private

Definition at line 1719 of file G4UIQt.cc.

1719 {
1720
1721 // Set layouts
1722
1723 SetStartPage(std::string("<table width='100%'><tr><td width='30%'></td><td><div ")+
1724 "style='color: rgb(140, 31, 31); font-size: xx-large; font-family: Garamond, serif; padding-bottom: 0px; font-weight: normal'>Geant4: "+
1725 QApplication::applicationName ().toStdString()+
1726 "</div></td><td width='40%'>&nbsp;<br/><i>http://cern.ch/geant4/</i></td></tr></table>"+
1727 "<p>&nbsp;</p>"+
1728 "<div style='background:#EEEEEE;'><b>Tooltips :</b><ul>"+
1729 "<li><b>Start a new viewer :</b><br />"+
1730 "<i>'/vis/open/...'<br />"+
1731 "For example '/vis/open OGL'</i></li>"+
1732 "<li><b>Execute a macro file :</b><br />"+
1733 "<i>'/control/execute my_macro_file'</i></li>"+
1734 "</ul></div>"+
1735
1736 "<div style='background:#EEEEEE;'><b>Documentation :</b><ul>"+
1737 "<li><b>Visualisation publication :</b><br />"+
1738 "<i><a href='http://www.worldscientific.com/doi/abs/10.1142/S1793962313400011'>The Geant4 Visualization System - A Multi-Driver Graphics System</b><br />, Allison, J. et al., International Journal of Modeling, Simulation, and Scientific Computing, Vol. 4, Suppl. 1 (2013) 1340001</a>:<br/> http://www.worldscientific.com/doi/abs/10.1142/S1793962313400011</i></li>"+
1739 "</ul></div>"+
1740
1741 "<div style='background:#EEEEEE;'><b>Getting Help :</b><ul>"+
1742 "<li><b>If problems arise, try <a href='https://cern.ch/geant4-forum'>browsing the user forum</a> to see whether or not your problem has already been encountered.<br /> If it hasn't, you can post it and Geant4 developers will do their best to find a solution. This is also a good place to<br /> discuss Geant4 topics in general.</b> https://cern.ch/geant4-forum"+
1743 "<li><b>Get a look at <a href='http://cern.ch/geant4/support'>Geant4 User support pages</a>: <i>http://cern.ch/geant4/support</i></b></li>"+
1744 "</ul></div>"
1745 );
1746
1747
1748 // fill right splitter
1749 if (fViewerTabWidget == NULL) {
1751 fMainWindow->setCentralWidget(fViewerTabWidget);
1752#if QT_VERSION < 0x040500
1753#else
1754 fViewerTabWidget->setTabsClosable (true);
1755#endif
1756
1757#if QT_VERSION < 0x040200
1758#else
1759 fViewerTabWidget->setUsesScrollButtons (true);
1760#endif
1761
1762#if QT_VERSION < 0x040500
1763#else
1764 connect(fViewerTabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(TabCloseCallback(int)));
1765#endif
1766 connect(fViewerTabWidget, SIGNAL(currentChanged ( int ) ), SLOT(UpdateTabWidget(int)));
1767 }
1768
1769// set the QGLWidget size policy
1770 QSizePolicy policy = QSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
1771 policy.setVerticalStretch(4);
1772 fViewerTabWidget->setSizePolicy(policy);
1773
1774 fViewerTabWidget->setMinimumSize(40,40);
1775}
void TabCloseCallback(int)
Definition: G4UIQt.cc:5145
void SetStartPage(const std::string &)
Definition: G4UIQt.cc:1917
void UpdateTabWidget(int)
Definition: G4UIQt.cc:1933

References g4zmq::connect(), fMainWindow, fViewerTabWidget, SetStartPage(), TabCloseCallback(), and UpdateTabWidget().

Referenced by AddTabWidget(), and G4UIQt().

◆ CreateVisCommandGroupAndToolBox()

bool G4UIQt::CreateVisCommandGroupAndToolBox ( G4UIcommand aCommand,
QWidget *  aParent,
int  aDepthLevel,
bool  isDialog 
)
private

Add the following command to the corresponding groupbox If depthLevel is 1 : create ToolBox If depthLevel is 2 or more : create GroupBox

Definition at line 2880 of file G4UIQt.cc.

2886{
2887 QString commandText = QString((char*)(aCommand->GetCommandPath().data())).section("/",-aDepthLevel);
2888
2889 if (commandText == NULL) {
2890 return false;
2891 }
2892
2893 // Look if groupBox is create
2894 // QGroupBox* gBoxCommandWidget;
2895 QWidget* newParentWidget = NULL;
2896 bool found = false;
2897 QString commandSection = commandText.left(commandText.indexOf("/"));
2898
2899 if (aDepthLevel == 1) {
2900 QToolBox* currentParent = dynamic_cast<QToolBox*>(aParent);
2901 if (currentParent != 0){
2902
2903 // already exists ?
2904 for (int a=0; a<currentParent->count(); a++) {
2905 if (currentParent->itemText(a) == commandSection) {
2906 found = true;
2907 newParentWidget = currentParent->widget(a);
2908 }
2909 }
2910 }
2911 // Not found ? create it
2912 if (!found) {
2913 newParentWidget = new QGroupBox();
2914 newParentWidget->setLayout(new QVBoxLayout());
2915 if (currentParent != 0){
2916 currentParent->addItem(newParentWidget,commandSection);
2917 } else {
2918 if (!aParent->layout()) {
2919 aParent->setLayout(new QVBoxLayout());
2920 }
2921 aParent->layout()->addWidget(newParentWidget);
2922 }
2923
2924 if (commandText.indexOf("/") == -1) {
2925
2926 // Guidance
2927 QString guidance;
2928 G4int n_guidanceEntry = aCommand->GetGuidanceEntries();
2929 for( G4int i_thGuidance=0; i_thGuidance < n_guidanceEntry; i_thGuidance++ ) {
2930 guidance += QString((char*)(aCommand->GetGuidanceLine(i_thGuidance)).data()) + "\n";
2931 }
2932 newParentWidget->setToolTip(guidance);
2933 }
2934
2935 QScrollArea* sc = dynamic_cast<QScrollArea*>(newParentWidget->parent()->parent());
2936 if (sc != 0) {
2937 sc->ensureWidgetVisible(newParentWidget);
2938
2939 }
2940 }
2941 } else {
2942
2943 // try to know if this level is already there
2944 QGroupBox* currentParent = dynamic_cast<QGroupBox*>(aParent);
2945 if (currentParent != 0){
2946
2947 // if depth==2, then we add a [more parameters inside] to the toolBoxItem parent
2948 // QGroupBox > QWidget > QScrollArea > QToolBox
2949 if (aDepthLevel == 2){
2950 QToolBox* parentToolBox = dynamic_cast<QToolBox*>(currentParent->parent()->parent()->parent());
2951 if (parentToolBox != 0) {
2952 // parentToolBox->setItemText(parentToolBox->indexOf(currentParent),"[more parameters inside]");
2953 }
2954 }
2955 for (int a=0; a<aParent->layout()->count(); a++) {
2956 QGroupBox* gb = dynamic_cast<QGroupBox*>(aParent->layout()->itemAt(a)->widget());
2957 if (gb != 0) {
2958 if (gb->title() == commandSection) {
2959 found = true;
2960 newParentWidget = gb;
2961 }
2962 }
2963 }
2964 }
2965
2966 // Not found ? create it
2967 if (!found) {
2968 newParentWidget = new QGroupBox();
2969 newParentWidget->setLayout(new QVBoxLayout());
2970 if (!aParent->layout()) {
2971 aParent->setLayout(new QVBoxLayout());
2972 }
2973 aParent->layout()->addWidget(newParentWidget);
2974
2975 // set toolTip
2976 // Guidance
2977 QString guidance;
2978 G4int n_guidanceEntry = aCommand->GetGuidanceEntries();
2979 for( G4int i_thGuidance=0; i_thGuidance < n_guidanceEntry; i_thGuidance++ ) {
2980 guidance += QString((char*)(aCommand->GetGuidanceLine(i_thGuidance)).data()) + "\n";
2981 }
2982 newParentWidget->setToolTip(guidance);
2983 }
2984 }
2985
2986 // fill command groupbox
2987 if (commandText.indexOf("/") == -1) {
2988 if (CreateCommandWidget(aCommand, newParentWidget,isDialog)) {
2989 return true;
2990 }
2991 } else {
2992 CreateVisCommandGroupAndToolBox(aCommand,newParentWidget, aDepthLevel-1,isDialog);
2993 }
2994
2995 return true;
2996}
bool CreateCommandWidget(G4UIcommand *command, QWidget *parent, bool isDialog)
Definition: G4UIQt.cc:3005

References CreateCommandWidget(), CreateVisCommandGroupAndToolBox(), G4UIcommand::GetCommandPath(), G4UIcommand::GetGuidanceEntries(), and G4UIcommand::GetGuidanceLine().

Referenced by ButtonCallback(), and CreateVisCommandGroupAndToolBox().

◆ CreateVisParametersTBWidget()

QWidget * G4UIQt::CreateVisParametersTBWidget ( )
private

Create the VisParameters ToolBox Widget

Definition at line 1669 of file G4UIQt.cc.

1671{
1672 return NULL;
1673}

◆ DefaultIcons()

void G4UIQt::DefaultIcons ( bool  aVal)
virtual

Reimplemented from G4VInteractiveSession.

Definition at line 289 of file G4UIQt.cc.

290{
291 fDefaultIcons = aVal;
292
293#if QT_VERSION < 0x040200
294 if (!fMainWindow->isHidden()) {
295#else
296 if (!fMainWindow->isVisible()) {
297#endif
298 return;
299 }
300
301 if (fToolbarApp) {
302 if (aVal) {
303#if QT_VERSION < 0x040200
304 fToolbarApp->show();
305#else
306 fToolbarApp->setVisible(true);
307#endif
308 } else {
309 // Set not visible until session start
310#if QT_VERSION < 0x040200
311 fToolbarApp->hide();
312#else
313 fToolbarApp->setVisible(false);
314#endif
315 }
316 }
317}

References fDefaultIcons, fMainWindow, and fToolbarApp.

◆ eventFilter()

bool G4UIQt::eventFilter ( QObject *  aObj,
QEvent *  aEvent 
)
private

Event filter method. Every event from QtApplication goes here.
We apply a filter only for the Up and Down Arrow press when the QLineEdit
is active. If this filter match, Up arrow we give the previous command
and Down arrow will give the next if exist.

Parameters
objEmitter of the event
eventKind of event

Definition at line 3584 of file G4UIQt.cc.

3588{
3589 bool tabKeyPress = false;
3590 bool moveCommandCursor = false;
3591 if (aObj == NULL) return false;
3592 if (aEvent == NULL) return false;
3593
3594 if (aObj == fHistoryTBTableList) {
3595 if (aEvent->type() == QEvent::KeyPress) {
3596 fCommandArea->setFocus();
3597 }
3598 }
3599
3600 if (aObj == fCompleter->popup()) {
3601 if (aEvent->type() == QEvent::KeyPress) {
3602 QKeyEvent *e = static_cast<QKeyEvent*>(aEvent);
3603 if (e->key() == (Qt::Key_Tab)) {
3604 tabKeyPress = true;
3605 }
3606 } else if ( aEvent->type() == QEvent::Hide ) {
3607 // Store this value
3608 QString c = fCommandArea->text();
3609 fLastCompleteCommand = c.left(c.indexOf("<"));
3610 }
3611 }
3612
3613 if (aObj == fCommandArea) {
3614 if (aEvent->type() == QEvent::KeyPress) {
3615 QKeyEvent *e = static_cast<QKeyEvent*>(aEvent);
3616 if ((e->key() == (Qt::Key_Down)) ||
3617 (e->key() == (Qt::Key_PageDown)) ||
3618 (e->key() == (Qt::Key_Up)) ||
3619 (e->key() == (Qt::Key_PageUp))) {
3620 int selection = fHistoryTBTableList->currentRow();
3621 if (fHistoryTBTableList->count()) {
3622 if (selection == -1) {
3623 selection = fHistoryTBTableList->count()-1;
3624 } else {
3625 if (e->key() == (Qt::Key_Down)) {
3626 if (selection <(fHistoryTBTableList->count()-1))
3627 selection++;
3628 } else if (e->key() == (Qt::Key_PageDown)) {
3629 selection = fHistoryTBTableList->count()-1;
3630 } else if (e->key() == (Qt::Key_Up)) {
3631 if (selection >0)
3632 selection --;
3633 } else if (e->key() == (Qt::Key_PageUp)) {
3634 selection = 0;
3635 }
3636 }
3637 fHistoryTBTableList->clearSelection();
3638#if QT_VERSION < 0x040202
3639 fHistoryTBTableList->setItemSelected(fHistoryTBTableList->item(selection),true);
3640#else
3641 fHistoryTBTableList->item(selection)->setSelected(true);
3642#endif
3643 fHistoryTBTableList->setCurrentItem(fHistoryTBTableList->item(selection));
3644 }
3645 moveCommandCursor = true;
3646 } else if (e->key() == (Qt::Key_Tab)) {
3647 tabKeyPress = true;
3648 } else if (((e->modifiers () == Qt::ControlModifier) || (e->modifiers () == Qt::MetaModifier)) && (e->key() == Qt::Key_A)) {
3649 fCommandArea->home(false);
3650 return true;
3651 } else if (((e->modifiers () == Qt::ControlModifier) || (e->modifiers () == Qt::MetaModifier)) && (e->key() == Qt::Key_E)) {
3652 fCommandArea->end(false);
3653 return true;
3654 }
3655 } else if (aEvent->type() == QEvent::Paint) {
3656 if (fLastCompleteCommand != "") {
3659 }
3660 }
3661 }
3662 if (tabKeyPress == true) {
3663 G4String ss = Complete(fCommandArea->text().toStdString().c_str());
3664 fCommandArea->setText((char*)(ss.data()));
3665 fCommandArea->setFocus();
3666 // do not pass by parent, it will disable widget tab focus !
3667 return true;
3668 // L.Garnier : MetaModifier is CTRL for MAC, but I don't want to put a MAC
3669 // specific #ifdef
3670 }
3671
3672 bool res= false;
3673 // change cursor position if needed
3674 if (moveCommandCursor == true) {
3675 fCommandArea->setCursorPosition ( fCommandArea->text().length() );
3676 fCommandArea->setCursorPosition (4);
3677 } else {
3678 // pass the event on to the parent class
3679 res = QObject::eventFilter(aObj, aEvent);
3680 }
3681 return res;
3682}
G4String Complete(const G4String &)

References G4VBasicShell::Complete(), fCommandArea, fCompleter, fHistoryTBTableList, and fLastCompleteCommand.

◆ ExecuteCommand()

void G4VBasicShell::ExecuteCommand ( const G4String aCommand)
protectedvirtualinherited

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Reimplemented in G4UIterminal, and G4ZMQServer.

Definition at line 206 of file G4VBasicShell.cc.

210{
211 if(aCommand.length()<2) return;
213 if(UI==NULL) return;
214 G4int commandStatus = UI->ApplyCommand(aCommand);
215 switch(commandStatus) {
217 break;
218 case fCommandNotFound:
219 G4cerr << "command not found: " << "\"" << aCommand << "\"" << G4endl;
220 break;
222 G4cerr << "illegal application state -- command refused:" << "\"" << aCommand << "\"" << G4endl;
223 break;
227 default:
228 G4cerr << "command refused (" << commandStatus << "):" << "\"" << aCommand << "\"" << G4endl;
229 }
230}
@ fParameterOutOfCandidates
@ fCommandNotFound
@ fIllegalApplicationState
@ fParameterUnreadable
@ fCommandSucceeded
@ fParameterOutOfRange

References G4UImanager::ApplyCommand(), fCommandNotFound, fCommandSucceeded, fIllegalApplicationState, fParameterOutOfCandidates, fParameterOutOfRange, fParameterUnreadable, G4cerr, G4endl, and G4UImanager::GetUIpointer().

Referenced by G4VBasicShell::ApplyShellCommand().

◆ ExitHelp()

void G4UIQt::ExitHelp ( ) const
privatevirtual

Implements G4VBasicShell.

Definition at line 3892 of file G4UIQt.cc.

3894{
3895}

◆ ExitSession

void G4UIQt::ExitSession ( )
privateslot

Called when user exit session

Definition at line 3886 of file G4UIQt.cc.

3888{
3890}

References SessionTerminate().

◆ FillHelpTree()

void G4UIQt::FillHelpTree ( )
private

Create the help tree widget

Parameters
parent: parent of tree widget
Returns
the widget containing the tree or NULL if it could not have beeen created

Definition at line 2755 of file G4UIQt.cc.

2756{
2757 if (! fHelpTreeWidget ) {
2759 }
2760
2761 QString searchText = fHelpLine->text();
2762
2763 if (searchText =="") {
2764 // clear old help tree
2765 // fHelpTreeWidget->clear();
2766 } else {
2767 return;
2768 }
2769
2770 if (fParameterHelpLabel) {
2771 fParameterHelpLabel->setText("Choose a command in the command tree");
2772 fParameterHelpTable->setVisible(false);
2773 }
2774
2775 if (fHelpLine) {
2776#if QT_VERSION < 0x040200
2777 fHelpLine->clear();
2778#else
2779 fHelpLine->setText("");
2780#endif
2781 }
2782
2784 if(UI==NULL) return;
2785 G4UIcommandTree * treeTop = UI->GetTree();
2786
2787 G4int treeSize = treeTop->GetTreeEntry();
2788 QTreeWidgetItem * newItem = NULL;
2789 QString commandText = "";
2790 for (int a=0;a<treeSize;a++) {
2791 // Creating new item
2792 newItem = NULL;
2793
2794 commandText = QString((char*)(treeTop->GetTree(a+1)->GetPathName()).data()).trimmed();
2795
2796 // if already exist, don't create it !
2797 for (int b=0;b<fHelpTreeWidget->topLevelItemCount();b++) {
2798 if (!newItem)
2799 newItem = FindTreeItem(fHelpTreeWidget->topLevelItem(b),commandText);
2800 }
2801
2802 if (newItem == NULL) {
2803
2804 newItem = new QTreeWidgetItem();
2805 newItem->setText(0,GetShortCommandPath(commandText));
2806 fHelpTreeWidget->addTopLevelItem(newItem);
2807 }
2808
2809 // look for childs
2810 CreateHelpTree(newItem,treeTop->GetTree(a+1));
2811 }
2812
2813}
void InitHelpTreeAndVisParametersWidget()
Definition: G4UIQt.cc:2731

References CreateHelpTree(), fHelpLine, fHelpTreeWidget, FindTreeItem(), fParameterHelpLabel, fParameterHelpTable, G4UIcommandTree::GetPathName(), GetShortCommandPath(), G4UImanager::GetTree(), G4UIcommandTree::GetTree(), G4UIcommandTree::GetTreeEntry(), G4UImanager::GetUIpointer(), and InitHelpTreeAndVisParametersWidget().

Referenced by AddTabWidget(), ButtonCallback(), CommandEnteredCallback(), CreateHelpTBWidget(), LookForHelpStringCallback(), SessionStart(), and ToolBoxActivated().

◆ FilterAllOutputTextArea()

void G4UIQt::FilterAllOutputTextArea ( )
private

Definition at line 4223 of file G4UIQt.cc.

4223 {
4224
4225 QString currentThread = "";
4226#ifdef G4MULTITHREADED
4227 currentThread = fThreadsFilterComboBox->currentText();
4228 if (currentThread == "Master") {
4229 currentThread = "";
4230 }
4231#endif
4232 QString filter = fCoutFilter->text();
4233 G4String previousOutputStream = "";
4234
4235 QString pref = "";
4236 QString post = "";
4237
4238 fCoutTBTextArea->clear();
4239
4240 for (unsigned int a=0; a<fG4OutputString.size(); a++) {
4242 if (FilterOutput(out,currentThread,filter) != "") {
4243
4244 // changing color ?
4245 if (out.fOutputStream != previousOutputStream) {
4246 previousOutputStream = out.fOutputStream;
4247 if (out.fOutputStream == "info") {
4248 pref = "";
4249 post = "";
4250 } else if (out.fOutputStream == "warning") {
4251 pref = "<font color=\"DarkYellow\">";
4252 post = "</font>";
4253 } else {
4254 pref = "<font color=\"Red\">";
4255 post = "</font>";
4256 }
4257 }
4258 fCoutTBTextArea->append(pref + out.fText + post);
4259 }
4260 }
4261}
G4String fOutputStream
Definition: G4UIQt.hh:112
QString fText
Definition: G4UIQt.hh:109
QString FilterOutput(const G4UIOutputString &, const QString &, const QString &)
Definition: G4UIQt.cc:4203

References fCoutFilter, fCoutTBTextArea, fG4OutputString, FilterOutput(), G4UIOutputString::fOutputStream, and G4UIOutputString::fText.

Referenced by CoutFilterCallback().

◆ FilterOutput()

QString G4UIQt::FilterOutput ( const G4UIOutputString output,
const QString &  currentThread,
const QString &  filter 
)
private

Definition at line 4203 of file G4UIQt.cc.

4207 {
4208
4209#ifdef G4MULTITHREADED
4210 if ((currentThread == "All") ||
4211 (currentThread == output.fThread)) {
4212#else
4213 if (currentThread == "") {
4214#endif
4215 if (output.fText.contains(QRegExp(filter))) {
4216 return output.fText;
4217 }
4218 }
4219 return "";
4220}
G4String fThread
Definition: G4UIQt.hh:111

References G4UIOutputString::fText, and G4UIOutputString::fThread.

Referenced by FilterAllOutputTextArea(), ReceiveG4cerr(), and ReceiveG4cout().

◆ FindCommand()

G4UIcommand * G4VBasicShell::FindCommand ( const char *  commandName) const
protectedinherited

Definition at line 109 of file G4VBasicShell.cc.

110{
111 G4String commandLine = G4StrUtil::strip_copy(commandName);
112
113 G4String commandString;
114 size_t i = commandLine.find(" ");
115 if( i != std::string::npos )
116 { commandString = commandLine.substr(0,i); }
117 else
118 { commandString = commandLine; }
119
120 G4String targetCom = ModifyPath(commandString);
121 return G4UImanager::GetUIpointer()->GetTree()->FindPath(targetCom);
122}

References G4UIcommandTree::FindPath(), G4UImanager::GetTree(), G4UImanager::GetUIpointer(), G4VBasicShell::ModifyPath(), and G4StrUtil::strip_copy().

Referenced by G4UIterminal::ExecuteCommand(), and G4ZMQServer::ExecuteCommand().

◆ FindDirectory()

G4UIcommandTree * G4VBasicShell::FindDirectory ( const char *  dirName) const
protectedinherited

Definition at line 87 of file G4VBasicShell.cc.

88{
89 G4String theDir = G4StrUtil::strip_copy(dirName);
90
91 G4String targetDir = ModifyPath( theDir );
92 if( targetDir.back() != '/' )
93 { targetDir += "/"; }
95 if( targetDir == "/" )
96 { return comTree; }
97 size_t idx = 1;
98 while( idx < targetDir.length()-1 )
99 {
100 size_t i = targetDir.find("/",idx);
101 comTree = comTree->GetTree(targetDir.substr(0,i+1).c_str());
102 if( comTree == NULL )
103 { return NULL; }
104 idx = i+1;
105 }
106 return comTree;
107}

References G4UImanager::GetTree(), G4UIcommandTree::GetTree(), G4UImanager::GetUIpointer(), G4VBasicShell::ModifyPath(), and G4StrUtil::strip_copy().

Referenced by G4VBasicShell::ChangeDirectory(), G4VBasicShell::ListDirectory(), and G4ZMQServer::SessionStart().

◆ FindMatchingPath()

G4String G4VBasicShell::FindMatchingPath ( G4UIcommandTree aTree,
const G4String aCommandPath 
)
protectedinherited

Definition at line 196 of file G4VBasicShell.cc.

198{
199 return aTree-> CompleteCommandPath(aCommandPath);
200}

Referenced by G4VBasicShell::Complete().

◆ FindTreeItem()

QTreeWidgetItem * G4UIQt::FindTreeItem ( QTreeWidgetItem *  aParent,
const QString &  aCommand 
)
private

Find a treeItemWidget in the help tree

Parameters
aCommanditem's String to look for
Returns
item if found, NULL if not

Definition at line 3284 of file G4UIQt.cc.

3288{
3289 if (aParent == NULL) return NULL;
3290
3291 // Suppress last "/"
3292 QString myCommand = aCommand;
3293
3294 if (myCommand.lastIndexOf("/") == (myCommand.size()-1)) {
3295 myCommand = myCommand.left(myCommand.size()-1);
3296 }
3297
3298 if (GetLongCommandPath(aParent) == myCommand)
3299 return aParent;
3300
3301 QTreeWidgetItem * tmp = NULL;
3302 for (int a=0;a<aParent->childCount();a++) {
3303 if (!tmp)
3304 tmp = FindTreeItem(aParent->child(a),myCommand);
3305 }
3306 return tmp;
3307}
QString GetLongCommandPath(QTreeWidgetItem *)
Definition: G4UIQt.cc:4505

References FindTreeItem(), and GetLongCommandPath().

Referenced by CreateHelpTree(), FillHelpTree(), and FindTreeItem().

◆ getClearIcon()

QPixmap * G4UIQt::getClearIcon ( )
inline

Definition at line 217 of file G4UIQt.hh.

217{ return fClearIcon;};

References fClearIcon.

◆ GetCommandList()

QString G4UIQt::GetCommandList ( const G4UIcommand aCommand)
private

Build the command list parameters in a QString
Reimplement partialy the G4UIparameter.cc

Parameters
aCommand: command to list parameters
See also
G4UIparameter::List()
G4UIcommand::List()
Returns
the command list parameters, or "" if nothing

Definition at line 3318 of file G4UIQt.cc.

3321{
3322
3323 QString txt ="";
3324 if (aCommand == NULL)
3325 return txt;
3326
3327 G4String commandPath = aCommand->GetCommandPath();
3328 G4String rangeString = aCommand->GetRange();
3329 G4int n_guidanceEntry = aCommand->GetGuidanceEntries();
3330 G4int n_parameterEntry = aCommand->GetParameterEntries();
3331
3332 if ((commandPath == "") &&
3333 (rangeString == "") &&
3334 (n_guidanceEntry == 0) &&
3335 (n_parameterEntry == 0)) {
3336 return txt;
3337 }
3338
3339 if((commandPath.length()-1)!='/') {
3340 txt += "Command " + QString((char*)(commandPath).data()) + "\n";
3341 }
3342 txt += "Guidance :\n";
3343
3344 for( G4int i_thGuidance=0; i_thGuidance < n_guidanceEntry; i_thGuidance++ ) {
3345 txt += QString((char*)(aCommand->GetGuidanceLine(i_thGuidance)).data()) + "\n";
3346 }
3347 if( ! rangeString.empty() ) {
3348 txt += " Range of parameters : " + QString((char*)(rangeString).data()) + "\n";
3349 }
3350 if( n_parameterEntry > 0 ) {
3351 G4UIparameter *param;
3352
3353 // Re-implementation of G4UIparameter.cc
3354
3355 for( G4int i_thParameter=0; i_thParameter<n_parameterEntry; i_thParameter++ ) {
3356 param = aCommand->GetParameter(i_thParameter);
3357 txt += "\nParameter : " + QString((char*)(param->GetParameterName()).data()) + "\n";
3358 if( ! param->GetParameterGuidance().empty() )
3359 txt += QString((char*)(param->GetParameterGuidance()).data())+ "\n" ;
3360 txt += " Parameter type : " + QString(QChar(param->GetParameterType())) + "\n";
3361 if(param->IsOmittable()){
3362 txt += " Omittable : True\n";
3363 } else {
3364 txt += " Omittable : False\n";
3365 }
3366 if( param->GetCurrentAsDefault() ) {
3367 txt += " Default value : taken from the current value\n";
3368 } else if( ! param->GetDefaultValue().empty() ) {
3369 txt += " Default value : " + QString((char*)(param->GetDefaultValue()).data())+ "\n";
3370 }
3371 if( ! param->GetParameterRange().empty() ) {
3372 txt += " Parameter range : " + QString((char*)(param->GetParameterRange()).data())+ "\n";
3373 }
3374 if( ! param->GetParameterCandidates().empty() ) {
3375 txt += " Candidates : " + QString((char*)(param->GetParameterCandidates()).data())+ "\n";
3376 }
3377 }
3378 }
3379 return txt;
3380}

References G4UIcommand::GetCommandPath(), G4UIparameter::GetCurrentAsDefault(), G4UIparameter::GetDefaultValue(), G4UIcommand::GetGuidanceEntries(), G4UIcommand::GetGuidanceLine(), G4UIcommand::GetParameter(), G4UIparameter::GetParameterCandidates(), G4UIcommand::GetParameterEntries(), G4UIparameter::GetParameterGuidance(), G4UIparameter::GetParameterName(), G4UIparameter::GetParameterRange(), G4UIparameter::GetParameterType(), G4UIcommand::GetRange(), and G4UIparameter::IsOmittable().

Referenced by LookForHelpStringInChildTree(), and OpenHelpTreeOnCommand().

◆ GetCoutDockWidget()

G4UIDockWidget * G4UIQt::GetCoutDockWidget ( )
inline

Definition at line 230 of file G4UIQt.hh.

230 {
231 return fCoutDockWidget;
232 };

References fCoutDockWidget.

◆ GetCoutWidget()

QWidget * G4UIQt::GetCoutWidget ( )
inline

Definition at line 225 of file G4UIQt.hh.

225 {
226 return fCoutDockWidget->widget();
227 };

References fCoutDockWidget.

◆ GetCurrentWorkingDirectory()

G4String G4VBasicShell::GetCurrentWorkingDirectory ( ) const
protectedinherited

◆ GetHelpChoice()

G4bool G4UIQt::GetHelpChoice ( G4int )
privatevirtual

Implement G4VBasicShell vurtual function

Implements G4VBasicShell.

Definition at line 3569 of file G4UIQt.cc.

3572{
3573 return true;
3574}

◆ GetHelpWidget()

QWidget * G4UIQt::GetHelpWidget ( )
inline

Definition at line 250 of file G4UIQt.hh.

250 {
251 return fHelpTBWidget;
252 }

References fHelpTBWidget.

◆ GetHistoryWidget()

QWidget * G4UIQt::GetHistoryWidget ( )
inline

Definition at line 245 of file G4UIQt.hh.

245 {
246 return fHistoryTBWidget;
247 }

References fHistoryTBWidget.

◆ GetInteractor()

G4Interactor G4VInteractiveSession::GetInteractor ( G4String  a_name)
inherited

Definition at line 87 of file G4VInteractiveSession.cc.

88{
89 G4interactor_map::iterator it;
90 if((it=interactors.find(a_name))==interactors.end()) return NULL;
91 return (*it).second;
92}

References G4VInteractiveSession::interactors.

Referenced by AddButton(), G4UIXm::AddButton(), and G4UIWin32::AddButton().

◆ GetLastReturnCode()

G4int G4UIsession::GetLastReturnCode ( ) const
inlineinherited

Definition at line 63 of file G4UIsession.hh.

63{ return lastRC; }
G4int lastRC
Definition: G4UIsession.hh:69

References G4UIsession::lastRC.

◆ GetLongCommandPath()

QString G4UIQt::GetLongCommandPath ( QTreeWidgetItem *  item)
private

Definition at line 4505 of file G4UIQt.cc.

4508{
4509 if (item == NULL) return "";
4510
4511 // rebuild path:
4512 QString itemText = "";
4513 itemText = item->text(0);
4514
4515 while (item->parent() != NULL) {
4516 itemText = item->parent()->text(0)+"/"+itemText;
4517 item = item->parent();
4518 }
4519 itemText = "/"+itemText;
4520
4521 return itemText;
4522}

Referenced by FindTreeItem(), HelpTreeClicCallback(), and HelpTreeDoubleClicCallback().

◆ GetMainWindow()

QMainWindow * G4UIQt::GetMainWindow ( )
inline

Definition at line 210 of file G4UIQt.hh.

210 {
211 return fMainWindow;
212 };

References fMainWindow.

Referenced by G4ToolsSGQtViewer::Initialise().

◆ GetPickInfosWidget()

QWidget * G4UIQt::GetPickInfosWidget ( )

Get the Pick Widget

Definition at line 1799 of file G4UIQt.cc.

1801{
1802 if (!fPickInfosDialog) {
1804 }
1805 return fPickInfosWidget;
1806}

References CreatePickInfosDialog(), fPickInfosDialog, and fPickInfosWidget.

Referenced by G4OpenGLQtViewer::createPickInfosWidget().

◆ GetSceneTreeWidget()

QWidget * G4UIQt::GetSceneTreeWidget ( )

Get the ViewerComponents ToolBox Widget

Definition at line 1780 of file G4UIQt.cc.

1782{
1783 return fSceneTreeWidget;
1784}

References fSceneTreeWidget.

Referenced by G4OpenGLQtViewer::createSceneTreeWidget().

◆ getSearchIcon()

QPixmap * G4UIQt::getSearchIcon ( )
inline

Definition at line 215 of file G4UIQt.hh.

215{ return fSearchIcon;};

References fSearchIcon.

Referenced by G4OpenGLQtViewer::createSceneTreeComponent().

◆ GetShortCommandPath()

QString G4UIQt::GetShortCommandPath ( QString  commandPath)
private

Definition at line 4487 of file G4UIQt.cc.

4490{
4491 if (commandPath.indexOf("/") == 0) {
4492 commandPath = commandPath.right(commandPath.size()-1);
4493 }
4494
4495 commandPath = commandPath.right(commandPath.size()-commandPath.lastIndexOf("/",-2)-1);
4496
4497 if (commandPath.lastIndexOf("/") == (commandPath.size()-1)) {
4498 commandPath = commandPath.left(commandPath.size()-1);
4499 }
4500
4501 return commandPath;
4502}

Referenced by CreateHelpTree(), and FillHelpTree().

◆ GetThreadPrefix()

G4String G4UIQt::GetThreadPrefix ( )
private

Definition at line 2285 of file G4UIQt.cc.

2285 {
2286 G4String threadPrefix = "";
2287#ifdef G4MULTITHREADED
2289 if(UI==NULL) return "";
2290 if (UI->GetThreadCout() != NULL) {
2291 threadPrefix = UI->GetThreadCout()->GetFullPrefixString().data();
2292 if (UI->GetThreadCout()->GetPrefixString() == G4String("G4VIS")) {
2293 return "G4VIS";
2294 }
2295 }
2296#endif
2297 return threadPrefix;
2298}
G4String GetFullPrefixString() const
G4String GetPrefixString() const
G4MTcoutDestination * GetThreadCout()
Definition: G4UImanager.hh:249

References G4MTcoutDestination::GetFullPrefixString(), G4MTcoutDestination::GetPrefixString(), G4UImanager::GetThreadCout(), and G4UImanager::GetUIpointer().

Referenced by ReceiveG4cerr(), and ReceiveG4cout().

◆ GetUITabWidget()

QTabWidget * G4UIQt::GetUITabWidget ( )
inline

Definition at line 240 of file G4UIQt.hh.

240 {
241 return fUITabWidget;
242 }

References fUITabWidget.

◆ GetUserInterfaceWidget()

G4UIDockWidget * G4UIQt::GetUserInterfaceWidget ( )
inline

Definition at line 235 of file G4UIQt.hh.

235 {
236 return fUIDockWidget;
237 };

References fUIDockWidget.

◆ GetViewerPropertiesWidget()

QWidget * G4UIQt::GetViewerPropertiesWidget ( )

Get the Viewer properties Widget

Definition at line 1788 of file G4UIQt.cc.

1790{
1793 }
1795}
void CreateViewerPropertiesDialog()
Definition: G4UIQt.cc:4692

References CreateViewerPropertiesDialog(), fViewerPropertiesDialog, and fViewerPropertiesWidget.

Referenced by G4OpenGLQtViewer::createViewerPropertiesWidget().

◆ GetViewerTabWidget()

QTabWidget * G4UIQt::GetViewerTabWidget ( )
inline

◆ HelpTreeClicCallback

void G4UIQt::HelpTreeClicCallback ( )
privateslot

This callback is activated when user selected a item in the help tree

Definition at line 4088 of file G4UIQt.cc.

4090{
4091 QTreeWidgetItem* item = NULL;
4092 if (!fHelpTreeWidget)
4093 return ;
4094
4095 QList<QTreeWidgetItem *> list =fHelpTreeWidget->selectedItems();
4096 if (list.isEmpty())
4097 return;
4098 item = list.first();
4099 if (!item)
4100 return;
4101
4103 if(UI==NULL) return;
4104 G4UIcommandTree * treeTop = UI->GetTree();
4105
4106 std::string itemText = GetLongCommandPath(item).toStdString();
4107
4108 // check if it is a command path
4109 if (item->childCount() > 0) {
4110 itemText +="/";
4111 }
4112 G4UIcommand* command = treeTop->FindPath(itemText.c_str());
4113
4114 if (command) {
4115 updateHelpArea(command);
4116 } else { // this is a command
4117 G4UIcommandTree* path = treeTop->FindCommandTree(itemText.c_str());
4118 if ( path) {
4119 // this is not a command, this is a sub directory
4120 // We display the Title
4121 fParameterHelpLabel->setVisible(true);
4122 fParameterHelpLabel->setText(path->GetTitle().data());
4123 fParameterHelpTable->setVisible(false);
4124 }
4125 }
4126}
void updateHelpArea(const G4UIcommand *)
Definition: G4UIQt.cc:3390
const G4String GetTitle() const

References fHelpTreeWidget, G4UIcommandTree::FindCommandTree(), G4UIcommandTree::FindPath(), fParameterHelpLabel, fParameterHelpTable, GetLongCommandPath(), G4UIcommandTree::GetTitle(), G4UImanager::GetTree(), G4UImanager::GetUIpointer(), and updateHelpArea().

Referenced by HelpTreeDoubleClicCallback(), and InitHelpTreeAndVisParametersWidget().

◆ HelpTreeDoubleClicCallback

void G4UIQt::HelpTreeDoubleClicCallback ( )
privateslot

This callback is activated when user double clic on a item in the help tree

Definition at line 4130 of file G4UIQt.cc.

4132{
4134
4135 QTreeWidgetItem* item = NULL;
4136 if (!fHelpTreeWidget)
4137 return ;
4138
4139 QList<QTreeWidgetItem *> list =fHelpTreeWidget->selectedItems();
4140 if (list.isEmpty())
4141 return;
4142 item = list.first();
4143 if (!item)
4144 return;
4145
4146 fCommandArea->clear();
4147 fCommandArea->setText(GetLongCommandPath(item));
4148}
void HelpTreeClicCallback()
Definition: G4UIQt.cc:4088

References fCommandArea, fHelpTreeWidget, GetLongCommandPath(), and HelpTreeClicCallback().

Referenced by InitHelpTreeAndVisParametersWidget().

◆ InitHelpTreeAndVisParametersWidget()

void G4UIQt::InitHelpTreeAndVisParametersWidget ( )
private

Create the help tree widget

Parameters
parent: parent of tree widget
Returns
the widget containing the tree or NULL if it could not have beeen created

Definition at line 2731 of file G4UIQt.cc.

2732{
2733
2734 if (! fHelpTreeWidget ) {
2735 fHelpTreeWidget = new QTreeWidget();
2736 }
2737
2738 // build widget
2739 fHelpTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection);
2740 QStringList labels;
2741 labels << QString("Command");
2742 fHelpTreeWidget->setHeaderLabels(labels);
2743
2744
2745 connect(fHelpTreeWidget, SIGNAL(itemSelectionChanged ()),this, SLOT(HelpTreeClicCallback()));
2746 connect(fHelpTreeWidget, SIGNAL(itemDoubleClicked (QTreeWidgetItem*,int)),this, SLOT(HelpTreeDoubleClicCallback()));
2747
2748}
void HelpTreeDoubleClicCallback()
Definition: G4UIQt.cc:4130

References g4zmq::connect(), fHelpTreeWidget, HelpTreeClicCallback(), and HelpTreeDoubleClicCallback().

Referenced by FillHelpTree().

◆ InSession()

G4int G4UIsession::InSession ( )
staticinherited

Definition at line 68 of file G4UIsession.cc.

69{
70 return inSession;
71}
static G4ICOMS_DLL G4int inSession
Definition: G4UIsession.hh:67

References G4UIsession::inSession.

Referenced by G4UIcontrolMessenger::SetNewValue().

◆ IsGUICommand()

G4bool G4UIQt::IsGUICommand ( const G4UIcommand aCommand)
private

Return true if this command takes almost a number (int, double, bool, string) as an input or a string with a candidate list

Definition at line 3533 of file G4UIQt.cc.

3536{
3537 if (aCommand == NULL)
3538 return false;
3539
3540 G4int n_parameterEntry = aCommand->GetParameterEntries();
3541
3542 if( n_parameterEntry > 0 ) {
3543 G4UIparameter *param;
3544
3545 // Re-implementation of G4UIparameter.cc
3546
3547 for( G4int i_thParameter=0; i_thParameter<n_parameterEntry; i_thParameter++ ) {
3548 param = aCommand->GetParameter(i_thParameter);
3549 if (QString(QChar(param->GetParameterType())) == "d") {
3550 return true;
3551 }
3552 if (QString(QChar(param->GetParameterType())) == "b") {
3553 return true;
3554 }
3555 if (QString(QChar(param->GetParameterType())) == "i") {
3556 return true;
3557 }
3558 if (QString(QChar(param->GetParameterType())) == "s") {
3559 return true;
3560 }
3561 }
3562 }
3563 return false;
3564}

References G4UIcommand::GetParameter(), G4UIcommand::GetParameterEntries(), and G4UIparameter::GetParameterType().

Referenced by ButtonCallback().

◆ IsIconMoveSelected()

bool G4UIQt::IsIconMoveSelected ( )
inline

◆ IsIconPickSelected()

bool G4UIQt::IsIconPickSelected ( )
inline

◆ IsIconRotateSelected()

bool G4UIQt::IsIconRotateSelected ( )
inline

◆ IsIconZoomInSelected()

bool G4UIQt::IsIconZoomInSelected ( )
inline

Definition at line 191 of file G4UIQt.hh.

191 {
192 return fZoomInSelected;
193 };

References fZoomInSelected.

Referenced by G4OpenGLQtViewer::G4MousePressEvent(), and G4OpenGLQtViewer::updateToolbarAndMouseContextMenu().

◆ IsIconZoomOutSelected()

bool G4UIQt::IsIconZoomOutSelected ( )
inline

Definition at line 194 of file G4UIQt.hh.

194 {
195 return fZoomOutSelected;
196 };

References fZoomOutSelected.

Referenced by G4OpenGLQtViewer::G4MousePressEvent(), and G4OpenGLQtViewer::updateToolbarAndMouseContextMenu().

◆ IsSplitterReleased()

bool G4UIQt::IsSplitterReleased ( )

◆ ListDirectory()

void G4VBasicShell::ListDirectory ( const G4String newCommand) const
protectedinherited

Definition at line 339 of file G4VBasicShell.cc.

340{
341 G4String targetDir;
342 if( newCommand.length() <= 3 ) {
343 targetDir = GetCurrentWorkingDirectory();
344 } else {
345 G4String newPrefix = newCommand.substr(3, newCommand.length()-3);
346 targetDir = G4StrUtil::strip_copy(newPrefix);
347 }
348 G4UIcommandTree* commandTree = FindDirectory( targetDir );
349 if( commandTree == NULL ) {
350 G4cout << "Directory <" << targetDir << "> is not found." << G4endl;
351 } else {
352 commandTree->ListCurrent();
353 }
354}
void ListCurrent() const

References G4VBasicShell::FindDirectory(), G4cout, G4endl, G4VBasicShell::GetCurrentWorkingDirectory(), G4UIcommandTree::ListCurrent(), and G4StrUtil::strip_copy().

Referenced by G4VBasicShell::ApplyShellCommand(), G4UIterminal::GetCommand(), and G4ZMQServer::GetCommand().

◆ LookForHelpStringCallback

void G4UIQt::LookForHelpStringCallback ( )
privateslot

Callback called when user give a new string to look for
Display a list of matching commands descriptions. If no string is set, will display the complete help tree

Definition at line 4268 of file G4UIQt.cc.

4270{
4271 fHelpLine->setText(fHelpLine->text().trimmed());
4272 QString searchText = fHelpLine->text();
4273
4274 fParameterHelpLabel->setText("");
4275 fParameterHelpTable->setVisible(false);
4276 if (searchText =="") {
4277 // clear old help tree
4278 fHelpTreeWidget->clear();
4279
4280 FillHelpTree();
4281
4282 return;
4283 } else {
4284 OpenHelpTreeOnCommand(searchText);
4285 }
4286}

References fHelpLine, fHelpTreeWidget, FillHelpTree(), fParameterHelpLabel, fParameterHelpTable, and OpenHelpTreeOnCommand().

Referenced by CreateHelpTBWidget().

◆ LookForHelpStringInChildTree()

QMap< int, QString > G4UIQt::LookForHelpStringInChildTree ( G4UIcommandTree aCommandTree,
const QString &  text 
)
private

Definition at line 4406 of file G4UIQt.cc.

4410{
4411 QMap<int,QString> commandResultMap;
4412 if (aCommandTree == NULL) return commandResultMap;
4413 // Get the Sub directories
4414 int tmp = 0;
4415 QMap<int,QString> commandChildResultMap;
4416 for (int a=0;a<aCommandTree->GetTreeEntry();a++) {
4417 const G4UIcommand* command = aCommandTree->GetGuidance();
4418 tmp = GetCommandList (command).count(text,Qt::CaseInsensitive);
4419 if (tmp >0) {
4420 commandResultMap.insertMulti(tmp,QString((char*)(aCommandTree->GetTree(a+1)->GetPathName()).data()));
4421 }
4422 // look for childs
4423 commandChildResultMap = LookForHelpStringInChildTree(aCommandTree->GetTree(a+1),text);
4424 if (!commandChildResultMap.empty()) {
4425 // insert new childs
4426 QMap<int,QString>::const_iterator i = commandChildResultMap.constBegin();
4427 while (i != commandChildResultMap.constEnd()) {
4428 commandResultMap.insertMulti(i.key(),i.value());
4429 i++;
4430 }
4431 commandChildResultMap.clear();
4432 }
4433 }
4434 // Get the Commands
4435 for (int a=0;a<aCommandTree->GetCommandEntry();a++) {
4436 const G4UIcommand* command = aCommandTree->GetCommand(a+1);
4437 tmp = GetCommandList (command).count(text,Qt::CaseInsensitive);
4438 if (tmp >0) {
4439 commandResultMap.insertMulti(tmp,QString((char*)(aCommandTree->GetCommand(a+1)->GetCommandPath()).data()));
4440 }
4441 }
4442 return commandResultMap;
4443}
QString GetCommandList(const G4UIcommand *)
Definition: G4UIQt.cc:3318
QMap< int, QString > LookForHelpStringInChildTree(G4UIcommandTree *, const QString &)
Definition: G4UIQt.cc:4406
const G4UIcommand * GetGuidance() const

References G4UIcommandTree::GetCommand(), G4UIcommandTree::GetCommandEntry(), GetCommandList(), G4UIcommand::GetCommandPath(), G4UIcommandTree::GetGuidance(), G4UIcommandTree::GetPathName(), G4UIcommandTree::GetTree(), G4UIcommandTree::GetTreeEntry(), and LookForHelpStringInChildTree().

Referenced by LookForHelpStringInChildTree(), and OpenHelpTreeOnCommand().

◆ ModifyPath()

G4String G4VBasicShell::ModifyPath ( const G4String tempPath) const
privateinherited

Definition at line 124 of file G4VBasicShell.cc.

125{
126 if( tempPath.length() == 0 ) return tempPath;
127
128 G4String newPath = "";
129
130 // temporal full path
131 if( tempPath[0] == '/') newPath = tempPath;
132 else newPath = currentDirectory + tempPath;
133
134 // body of path...
135 while(1){
136 size_t idx = newPath.find("/./");
137 if( idx == G4String::npos) break;
138 newPath.erase(idx,2);
139 }
140
141 while(1) {
142 size_t idx = newPath.find("/../");
143 if( idx == G4String::npos) break;
144 if( idx == 0) {
145 newPath.erase(1,3);
146 continue;
147 }
148 size_t idx2 = newPath.find_last_of('/', idx-1);
149 if(idx2 != G4String::npos) newPath.erase(idx2, idx-idx2+3);
150 }
151
152 // end of path...
153 if ( newPath.size() >= 3 ) {
154 if(newPath.substr(newPath.size()-3,3) == "/..") {
155 if( newPath.size() == 3) {
156 newPath = "/";
157 } else {
158 size_t idx = newPath.find_last_of('/', newPath.size()-4);
159 if(idx != G4String::npos) newPath.erase(idx+1);
160 }
161 }
162 }
163
164 if ( newPath.size() >= 2 ) {
165 if(newPath.substr(newPath.size()-2,2) == "/.") newPath.erase(newPath.size()-1,1);
166 }
167
168 // truncate "/////" to "/"
169 while(1) {
170 size_t idx = newPath.find("//");
171 if( idx == G4String::npos) break;
172 newPath.erase(idx,1);
173 }
174
175 return newPath;
176}

References G4VBasicShell::currentDirectory.

Referenced by G4VBasicShell::ChangeDirectory(), G4VBasicShell::Complete(), G4VBasicShell::FindCommand(), G4VBasicShell::FindDirectory(), and G4VBasicShell::ModifyToFullPathCommand().

◆ ModifyToFullPathCommand()

G4String G4VBasicShell::ModifyToFullPathCommand ( const char *  aCommandLine) const
protectedinherited

Definition at line 47 of file G4VBasicShell.cc.

48{
49 G4String rawCommandLine = aCommandLine;
50 if(rawCommandLine.empty()||rawCommandLine[0]=='\0') return rawCommandLine;
51 G4String commandLine = G4StrUtil::strip_copy(rawCommandLine);
52 G4String commandString;
53 G4String parameterString;
54 size_t i = commandLine.find(" ");
55 if( i != std::string::npos )
56 {
57 commandString = commandLine.substr(0,i);
58 parameterString = " ";
59 parameterString += commandLine.substr(i+1,commandLine.length()-(i+1));
60 }
61 else
62 { commandString = commandLine; }
63
64 G4String fullPathCommandLine
65 = ModifyPath( commandString )+parameterString;
66 return fullPathCommandLine;
67}

References G4VBasicShell::ModifyPath(), and G4StrUtil::strip_copy().

Referenced by ActivateCommand(), G4VBasicShell::ApplyShellCommand(), G4UIterminal::GetCommand(), G4ZMQServer::GetCommand(), G4VBasicShell::ShowCurrent(), and G4VBasicShell::TerminalHelp().

◆ NativeMenu()

void G4UIQt::NativeMenu ( bool  aVal)
virtual

Reimplemented from G4VInteractiveSession.

Definition at line 2686 of file G4UIQt.cc.

2687{
2688 if ( fMainWindow->menuBar()->isNativeMenuBar() == aVal )
2689 return; // already in this state
2690
2691 // Menu become empty when goin from Qt to Native Bar
2692 fMainWindow->menuBar()->setNativeMenuBar(aVal);
2693}

References fMainWindow.

◆ OpenHelpTreeOnCommand()

void G4UIQt::OpenHelpTreeOnCommand ( const QString &  searchText)
private

Definition at line 4289 of file G4UIQt.cc.

4292{
4293 // the help tree
4295 if(UI==NULL) return;
4296 G4UIcommandTree * treeTop = UI->GetTree();
4297
4298 G4int treeSize = treeTop->GetTreeEntry();
4299
4300 // clear old help tree
4301 fHelpTreeWidget->clear();
4302
4303 // look for new items
4304
4305 int tmp = 0;
4306
4307#if QT_VERSION < 0x050F00
4308 // Before Qt5.15
4309 QMap<int,QString> commandResultMap;
4310 QMap<int,QString> commandChildResultMap;
4311 for (int a=0;a<treeSize;a++) {
4312 G4UIcommand* command = treeTop->FindPath(treeTop->GetTree(a+1)->GetPathName().data());
4313 tmp = GetCommandList (command).count(searchText,Qt::CaseInsensitive);
4314 if (tmp >0) {
4315 commandResultMap.insertMulti(tmp,QString((char*)(treeTop->GetTree(a+1)->GetPathName()).data()));
4316 }
4317 // look for childs
4318 commandChildResultMap = LookForHelpStringInChildTree(treeTop->GetTree(a+1),searchText);
4319 // insert new childs
4320 if (!commandChildResultMap.empty()) {
4321 QMap<int,QString>::const_iterator i = commandChildResultMap.constBegin();
4322 while (i != commandChildResultMap.constEnd()) {
4323 commandResultMap.insertMulti(i.key(),i.value());
4324 i++;
4325 }
4326 commandChildResultMap.clear();
4327 }
4328 }
4329#else
4330 // Qt5.15 and beyond
4331 QMultiMap<int,QString> commandResultMap;
4332 QMultiMap<int,QString> commandChildResultMap;
4333 for (int a=0;a<treeSize;a++) {
4334 G4UIcommand* command = treeTop->FindPath(treeTop->GetTree(a+1)->GetPathName().data());
4335 tmp = GetCommandList (command).count(searchText,Qt::CaseInsensitive);
4336 if (tmp >0) {
4337 commandResultMap.insert(tmp,QString((char*)(treeTop->GetTree(a+1)->GetPathName()).data()));
4338 }
4339 // look for childs
4340 commandChildResultMap = LookForHelpStringInChildTree(treeTop->GetTree(a+1),searchText);
4341 // insert new childs
4342 if (!commandChildResultMap.empty()) {
4343 QMap<int,QString>::const_iterator i = commandChildResultMap.constBegin();
4344 while (i != commandChildResultMap.constEnd()) {
4345 commandResultMap.insert(i.key(),i.value());
4346 i++;
4347 }
4348 commandChildResultMap.clear();
4349 }
4350 }
4351#endif
4352
4353 // build new help tree
4354 fHelpTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection);
4355 fHelpTreeWidget->setColumnCount(2);
4356 QStringList labels;
4357 labels << QString("Command") << QString("Match");
4358 fHelpTreeWidget->setHeaderLabels(labels);
4359
4360 if (commandResultMap.empty()) {
4361 fParameterHelpLabel->setText("No match found");
4362 fParameterHelpTable->setVisible(false);
4363 return;
4364 }
4365
4366 QMap<int,QString>::const_iterator i = commandResultMap.constEnd();
4367 i--;
4368 // 10 maximum progress values
4369 float multValue = 10.0/(float)(i.key());
4370 QString progressChar = "|";
4371 QString progressStr = "|";
4372
4373 QTreeWidgetItem * newItem;
4374 bool end = false;
4375 while (!end) {
4376 if (i == commandResultMap.constBegin()) {
4377 end = true;
4378 }
4379 for(int a=0;a<int(i.key()*multValue);a++) {
4380 progressStr += progressChar;
4381 }
4382 newItem = new QTreeWidgetItem();
4383 QString commandStr = i.value().trimmed();
4384
4385 if (commandStr.indexOf("/") == 0) {
4386 commandStr = commandStr.right(commandStr.size()-1);
4387 }
4388
4389 newItem->setText(0,commandStr);
4390 newItem->setText(1,progressStr);
4391 fHelpTreeWidget->addTopLevelItem(newItem);
4392#if QT_VERSION < 0x040200
4393#else
4394 newItem->setForeground ( 1, QBrush(Qt::blue) );
4395#endif
4396 progressStr = "|";
4397 i--;
4398 }
4399 fHelpTreeWidget->resizeColumnToContents (0);
4400 fHelpTreeWidget->sortItems(1,Qt::DescendingOrder);
4401 // fHelpTreeWidget->setColumnWidth(1,10);//resizeColumnToContents (1);
4402}

References fHelpTreeWidget, G4UIcommandTree::FindPath(), fParameterHelpLabel, fParameterHelpTable, GetCommandList(), G4UIcommandTree::GetPathName(), G4UImanager::GetTree(), G4UIcommandTree::GetTree(), G4UIcommandTree::GetTreeEntry(), G4UImanager::GetUIpointer(), and LookForHelpStringInChildTree().

Referenced by ActivateCommand(), and LookForHelpStringCallback().

◆ OpenIconCallback

void G4UIQt::OpenIconCallback ( const QString &  aParam)
privateslot

Definition at line 4664 of file G4UIQt.cc.

4664 {
4665
4666 QString aCommand = aParam.left(aParam.indexOf(fStringSeparator));
4667 QString aLabel = aParam.mid(aParam.indexOf(fStringSeparator)+fStringSeparator.length());
4668
4669 QString nomFich = QFileDialog::getOpenFileName(fMainWindow, aLabel, fLastOpenPath, "Macro files (*.mac);;Geant4 files( *.mac *.g4* *.in);;All (*.*)");
4670 if (nomFich != "") {
4671 G4UImanager::GetUIpointer()->ApplyCommand((QString(aCommand)+ QString(" ")+ nomFich).toStdString().c_str());
4672 QDir dir;
4673 fLastOpenPath = dir.absoluteFilePath(nomFich);
4674 }
4675}

References G4UImanager::ApplyCommand(), fLastOpenPath, fMainWindow, fStringSeparator, and G4UImanager::GetUIpointer().

Referenced by AddIcon().

◆ OutputStyle()

void G4UIQt::OutputStyle ( const char *  destination,
const char *  style,
const char *  highlight 
)
virtual

Reimplemented from G4VInteractiveSession.

Definition at line 2667 of file G4UIQt.cc.

2668{
2669 // Specify an output style
2670 // First argument destination (cout cerr warnings errors all)
2671 // Second argument is the style (fixed proportional)
2672 // Third argument highlights commands if "highlight" (and if /control/verbose > 0)
2673 G4String uiQtDestination(destination);
2674 G4UIQtStyle uiQtStyle;
2675 if (G4String(style) == "fixed") uiQtStyle.fixed = true; else uiQtStyle.fixed = false;
2676 if (G4String(highlight) == "highlight") uiQtStyle.highlight = true; else uiQtStyle.highlight = false;
2677 if (uiQtDestination == "all") {
2678 for (auto& i: fOutputStyles) {
2679 i.second = uiQtStyle;
2680 }
2681 } else {
2682 fOutputStyles[uiQtDestination] = uiQtStyle;
2683 }
2684}

References G4UIQt::G4UIQtStyle::fixed, fOutputStyles, and G4UIQt::G4UIQtStyle::highlight.

◆ PauseSessionStart()

void G4UIQt::PauseSessionStart ( const G4String aState)
virtual

Called by intercoms/src/G4UImanager.cc
Called by visualization/management/src/G4VisCommands.cc with "EndOfEvent" argument
It have to pause the session command terminal.
Call SecondaryLoop to wait for exit event

Parameters
aState
See also
: G4VisCommandReviewKeptEvents::SetNewValue

Implements G4VBasicShell.

Definition at line 2050 of file G4UIQt.cc.

2053{
2054 if (!aState) return;
2055
2056 if(aState=="G4_pause> ") { // TO KEEP
2057 SecondaryLoop ("Pause, type continue to exit this state"); // TO KEEP
2058 } // TO KEEP
2059
2060 if(aState=="EndOfEvent") { // TO KEEP
2061 // Picking with feed back in event data Done here !!!
2062 SecondaryLoop ("End of event, type continue to exit this state"); // TO KEEP
2063 } // TO KEEP
2064}
void SecondaryLoop(G4String)
Definition: G4UIQt.cc:2072

References SecondaryLoop().

◆ Prompt()

void G4UIQt::Prompt ( G4String  aPrompt)

Display the prompt in the prompt area

Parameters
aPrompt: string to display as the promt label

Definition at line 2021 of file G4UIQt.cc.

2024{
2025 if (!aPrompt) return;
2026
2027 fCommandLabel->setText((char*)aPrompt.data());
2028}

References fCommandLabel.

Referenced by SecondaryLoop(), and SessionStart().

◆ ReceiveG4cerr()

G4int G4UIQt::ReceiveG4cerr ( const G4String aString)
virtual

Receive a cerr from Geant4. We have to display it in the cout zone

Parameters
aString: label to add in the display area
Returns
0

Reimplemented from G4UIsession.

Definition at line 2195 of file G4UIQt.cc.

2198{
2199 if (aString.empty()) return 0;
2200
2201#ifdef G4MULTITHREADED
2202 G4AutoLock al(&ReceiveG4cerrMutex);
2203#endif
2204
2205 // Workaround so that output is not lost after crash or G4Exception
2206 // It seems workers write to std::cerr anyway, so limit this to the master
2207#ifdef G4MULTITHREADED
2209#endif
2210 std::cerr << aString;
2211
2212 G4String aStringWithStyle;
2213 // aString has a \n on the end (maybe it comes from G4endl or from the
2214 // Enter key on the command line) - ignore it. That’s why
2215 // i < aString.length() - 1
2216 // But other \n need to be translated to an HTML newline.
2217 // Similarly, spaces need to be translated to an HTML "non-breaking space".
2218 // Tabs (\t) are more tricky since the number of equivalent spaces depends
2219 // on how many characters precede it. Probably needs an HTML table. For now
2220 // we replace \t with four spaces.
2221 for (size_t i = 0; i < aString.length() - 1; ++i) {
2222 if (aString[i] == '\n') {
2223 aStringWithStyle += "<br>";
2224 } else if (aString[i] == ' ') {
2225 aStringWithStyle += "&nbsp;";
2226 } else if (aString[i] == '\t') {
2227 aStringWithStyle += "&nbsp;&nbsp;&nbsp;&nbsp;";
2228 } else if (aString[i] == '<') {
2229 aStringWithStyle += "&lt;";
2230 } else {
2231 aStringWithStyle += aString[i];
2232 }
2233 }
2234 if (fOutputStyles["cerr"].fixed) {
2235 aStringWithStyle = "<span style='font-family:courier;'>" + aStringWithStyle + "</span>";
2236 } else {
2237 aStringWithStyle = "<span>" + aStringWithStyle + "</span>";
2238 }
2239
2240 // Add to string
2241
2242 G4UIOutputString txt = G4UIOutputString(QString((char*)aStringWithStyle.data()).trimmed(),
2244 "error");
2245 fG4OutputString.push_back(txt);
2246
2247#ifdef G4MULTITHREADED
2248 QString result = FilterOutput(txt,fThreadsFilterComboBox->currentText(),fCoutFilter->text());
2249#else
2250 QString result = FilterOutput(txt,"",fCoutFilter->text());
2251#endif
2252 if (result.isEmpty()) {
2253 return 0;
2254 }
2255
2256 // Suppress space, \n,\t,\r...
2257 if (QString(aString.data()).trimmed() != "") {
2258 if ((G4StateManager::GetStateManager()->GetCurrentState() == G4State_Abort) ||
2259 (G4StateManager::GetStateManager()->GetCurrentState() == G4State_Quit )) {
2260 // In case of Abort or Quit, the useful error message should be in the last error message !
2261 fLastErrMessage += "\n"+aString;
2262 QString criticalMessage = fLastErrMessage.data();
2263#if QT_VERSION < 0x050000
2264 criticalMessage = Qt::escape(criticalMessage);
2265#else
2266 criticalMessage = criticalMessage.toHtmlEscaped();
2267#endif
2268 QMessageBox::critical(fMainWindow, "Error",QString(fLastErrMessage));
2269 }
2270 }
2271 fCoutTBTextArea->append(QString("<font color=\"Red\">") +
2272 result + QString("</font>"));
2273 fCoutTBTextArea->ensureCursorVisible ();
2274
2275 if (QString(aString.data()).trimmed() != "") {
2276 fLastErrMessage += aString;
2277 }
2278#ifdef G4MULTITHREADED
2279 UpdateCoutThreadFilter();
2280#endif
2281 return 0;
2282}
@ G4State_Quit
@ G4State_Abort
static G4StateManager * GetStateManager()
G4String GetThreadPrefix()
Definition: G4UIQt.cc:2285
G4String fLastErrMessage
Definition: G4UIQt.hh:350
const G4double al
Mysterious coefficient that appears in the wavefunctions.
G4bool IsMasterThread()
Definition: G4Threading.cc:124

References G4INCL::DeuteronDensity::anonymous_namespace{G4INCLDeuteronDensity.cc}::al, fCoutFilter, fCoutTBTextArea, fG4OutputString, FilterOutput(), fLastErrMessage, fMainWindow, fOutputStyles, G4State_Abort, G4State_Quit, G4StateManager::GetStateManager(), GetThreadPrefix(), and G4Threading::IsMasterThread().

Referenced by ReceiveG4cout().

◆ ReceiveG4cerr_()

G4int G4coutDestination::ReceiveG4cerr_ ( const G4String msg)
inherited

Definition at line 84 of file G4coutDestination.cc.

85{
86 if(transformersCout.size() > 0)
87 {
88 G4String m = msg;
89 std::for_each(transformersCerr.begin(), transformersCerr.end(),
90 [&m](const Transformer& t) { t(m); }
91 // Call transforming function on message
92 );
93 return ReceiveG4cerr(m);
94 }
95 else
96 {
97 return ReceiveG4cerr(msg);
98 }
99}
static constexpr double m
Definition: G4SIunits.hh:109
virtual G4int ReceiveG4cerr(const G4String &msg)
std::function< G4bool(G4String &)> Transformer

References m, G4coutDestination::ReceiveG4cerr(), G4coutDestination::transformersCerr, and G4coutDestination::transformersCout.

Referenced by G4MasterForwardcoutDestination::ReceiveG4cerr().

◆ ReceiveG4cout()

G4int G4UIQt::ReceiveG4cout ( const G4String aString)
virtual

Receive a cout from Geant4. We have to display it in the cout zone

Parameters
aString: label to add in the display area
Returns
0

Reimplemented from G4UIsession.

Definition at line 2102 of file G4UIQt.cc.

2105{
2106 if(aString.empty()) return 0;
2107
2108#ifdef G4MULTITHREADED
2109 G4AutoLock al(&ReceiveG4coutMutex);
2110#endif
2111
2112 // Try to be smart :
2113 // "*** This is just a warning message. ***"
2114 if (G4StrUtil::contains(aString, "*** This is just a warning message. ***")) {
2115 return ReceiveG4cerr(aString);
2116 }
2117
2118 // Workaround so that output is not lost after crash or G4Exception
2119 // It seems workers write to std::cout anyway, so limit this to the master
2120#ifdef G4MULTITHREADED
2122#endif
2123 std::cout << aString;
2124
2125 G4String aStringWithStyle;
2126 // aString has a \n on the end (maybe it comes from G4endl or from the
2127 // Enter key on the command line) - ignore it. That’s why
2128 // i < aString.length() - 1
2129 // But other \n need to be translated to an HTML newline.
2130 // Similarly, spaces need to be translated to an HTML "non-breaking space".
2131 // Tabs (\t) are more tricky since the number of equivalent spaces depends
2132 // on how many characters precede it. Probably needs an HTML table. For now
2133 // we replace \t with four spaces.
2134 for (size_t i = 0; i < aString.length() - 1; ++i) {
2135 if (aString[i] == '\n') {
2136 aStringWithStyle += "<br>";
2137 } else if (aString[i] == ' ') {
2138 aStringWithStyle += "&nbsp;";
2139 } else if (aString[i] == '\t') {
2140 aStringWithStyle += "&nbsp;&nbsp;&nbsp;&nbsp;";
2141 } else if (aString[i] == '<') {
2142 aStringWithStyle += "&lt;";
2143 } else {
2144 aStringWithStyle += aString[i];
2145 }
2146 }
2147 if (fOutputStyles["cout"].fixed) {
2148 aStringWithStyle = "<span style='font-family:courier;'>" + aStringWithStyle + "</span>";
2149 } else {
2150 aStringWithStyle = "<span>" + aStringWithStyle + "</span>";
2151 }
2152
2153 // Add to string
2154 G4UIOutputString txt = G4UIOutputString(QString((char*)aStringWithStyle.data()),GetThreadPrefix());
2155 fG4OutputString.push_back(txt);
2156
2157#ifdef G4MULTITHREADED
2158 QString result = FilterOutput(txt,fThreadsFilterComboBox->currentText(),fCoutFilter->text());
2159#else
2160 QString result = FilterOutput(txt,"",fCoutFilter->text());
2161#endif
2162
2163 if (result.isEmpty()) {
2164 return 0;
2165 }
2166
2168 if (fOutputStyles["cout"].highlight) {
2169 if (!UI->IsLastCommandOutputTreated() ) {
2170 QPalette pal;
2171 result = QString("<span style='background:") + pal.link().color().name() + ";'>&nbsp;</span>"
2172 + "<span style='background:" + pal.highlight().color().name() +";'> " + result + "</span>";
2173 }
2174 }
2176
2177 fCoutTBTextArea->append(result);
2178 fCoutTBTextArea->ensureCursorVisible ();
2179
2180#ifdef G4MULTITHREADED
2181 UpdateCoutThreadFilter();
2182#endif
2183
2184 // reset error stack
2185 fLastErrMessage = aString;
2186 return 0;
2187}
virtual G4int ReceiveG4cerr(const G4String &)
Definition: G4UIQt.cc:2195
bool IsLastCommandOutputTreated()
Definition: G4UImanager.hh:256
void SetLastCommandOutputTreated()
Definition: G4UImanager.hh:257
G4bool contains(const G4String &str, std::string_view ss)
Check if a string contains a given substring.

References G4INCL::DeuteronDensity::anonymous_namespace{G4INCLDeuteronDensity.cc}::al, G4StrUtil::contains(), fCoutFilter, fCoutTBTextArea, fG4OutputString, FilterOutput(), fLastErrMessage, fOutputStyles, GetThreadPrefix(), G4UImanager::GetUIpointer(), G4UImanager::IsLastCommandOutputTreated(), G4Threading::IsMasterThread(), ReceiveG4cerr(), and G4UImanager::SetLastCommandOutputTreated().

◆ ReceiveG4cout_()

G4int G4coutDestination::ReceiveG4cout_ ( const G4String msg)
inherited

Definition at line 62 of file G4coutDestination.cc.

63{
64 // Avoid copy of string if not necessary
65 if(transformersCout.size() > 0)
66 {
67 G4String m = msg;
68 G4bool result = true;
69 for(const auto& el : transformersCout)
70 {
71 result &= el(m);
72 if(!result)
73 break;
74 }
75 return (result ? ReceiveG4cout(m) : 0);
76 }
77 else
78 {
79 return ReceiveG4cout(msg);
80 }
81}
bool G4bool
Definition: G4Types.hh:86
virtual G4int ReceiveG4cout(const G4String &msg)

References m, G4coutDestination::ReceiveG4cout(), and G4coutDestination::transformersCout.

Referenced by G4MasterForwardcoutDestination::ReceiveG4cout().

◆ ResetTransformers()

void G4coutDestination::ResetTransformers ( )
virtualinherited

Definition at line 41 of file G4coutDestination.cc.

42{
43 transformersCout.clear();
44 transformersCerr.clear();
45}

References G4coutDestination::transformersCerr, and G4coutDestination::transformersCout.

◆ ResizeTabWidget

void G4UIQt::ResizeTabWidget ( QResizeEvent *  e)
privateslot

Send resize event to all tabs

Definition at line 1956 of file G4UIQt.cc.

1956 {
1957 if ( fViewerTabWidget) {
1958 for (G4int a=0;a<fViewerTabWidget->count() ;a++) {
1959 fViewerTabWidget->widget(a)->resize(e->size());
1960 }
1961 }
1962}

References fViewerTabWidget.

◆ SaveIconCallback

void G4UIQt::SaveIconCallback ( const QString &  aParam)
privateslot

Definition at line 4678 of file G4UIQt.cc.

4678 {
4679
4680 QString aCommand = aParam.left(aParam.indexOf(fStringSeparator));
4681 QString aLabel = aParam.mid(aParam.indexOf(fStringSeparator)+fStringSeparator.length());
4682
4683 QString nomFich = QFileDialog::getSaveFileName(fMainWindow, aLabel, fLastOpenPath, "Macro files (*.mac)");
4684 if (nomFich != "") {
4685 G4UImanager::GetUIpointer()->ApplyCommand((QString(aCommand)+ QString(" ")+nomFich).toStdString().c_str());
4686 QDir dir;
4687 fLastOpenPath = dir.absoluteFilePath(nomFich);
4688 }
4689}

References G4UImanager::ApplyCommand(), fLastOpenPath, fMainWindow, fStringSeparator, and G4UImanager::GetUIpointer().

Referenced by AddIcon().

◆ SaveOutputCallback

void G4UIQt::SaveOutputCallback ( )
privateslot

Definition at line 4188 of file G4UIQt.cc.

4188 {
4189 QString fileName = QFileDialog::getSaveFileName(fMainWindow, "Save console output as...", fLastOpenPath, "Save output as...");
4190 if (fileName != "") {
4191
4192 QFile data(fileName);
4193 if (data.open(QFile::WriteOnly | QFile::Truncate)) {
4194 QTextStream out(&data);
4195 out << fCoutTBTextArea->toPlainText();
4196 out.flush();
4197 }
4198 data.close();
4199 }
4200}

References fCoutTBTextArea, fLastOpenPath, and fMainWindow.

Referenced by CreateCoutTBWidget().

◆ SecondaryLoop()

void G4UIQt::SecondaryLoop ( G4String  aPrompt)
private

Begin the secondary loop

Parameters
a_prompt: label to display as the prompt label

Definition at line 2072 of file G4UIQt.cc.

2075{
2076 if (!aPrompt) return;
2077
2078 G4Qt* interactorManager = G4Qt::getInstance (); // TO KEEP ?
2079 Prompt(aPrompt); // TO KEEP
2080 exitPause = false; // TO KEEP
2081 while(1) {
2082 ((QApplication*)interactorManager)->processEvents(QEventLoop::WaitForMoreEvents);
2083 if(exitPause==true) break; // TO KEEP
2084 } // TO KEEP
2085 Prompt("Session :"); // TO KEEP
2086}
void Prompt(G4String)
Definition: G4UIQt.cc:2021

References exitPause, G4Qt::getInstance(), and Prompt().

Referenced by PauseSessionStart().

◆ SessionStart()

G4UIsession * G4UIQt::SessionStart ( )
virtual

Start the Qt main loop

Implements G4VBasicShell.

Definition at line 1967 of file G4UIQt.cc.

1969{
1970 G4Qt* interactorManager = G4Qt::getInstance ();
1971 Prompt("Session :");
1972 exitSession = false;
1973
1974 QCoreApplication::sendPostedEvents () ;
1975
1976 #if QT_VERSION < 0x040200
1977 fMainWindow->show();
1978 #else
1979 fMainWindow->setVisible(true);
1980 #endif
1981
1982 if (fDefaultIcons) {
1983#if QT_VERSION < 0x040200
1984 fToolbarApp->show();
1985#else
1986 fToolbarApp->setVisible(true);
1987#endif
1988 } else {
1989 // Set not visible until session start
1990#if QT_VERSION < 0x040200
1991 fToolbarApp->hide();
1992#else
1993 fToolbarApp->setVisible(false);
1994#endif
1995 }
1996 // Rebuild help tree (new command could be registered)
1997 FillHelpTree();
1998
1999 // Rebuild command completion (new command could be registered)
2001
2002 // Set event filters
2003 fHistoryTBTableList->installEventFilter(this);
2004 fCommandArea->installEventFilter(this);
2005
2006 // Focus on command line
2007 fCommandArea->setFocus();
2008
2009 interactorManager->DisableSecondaryLoop (); // TO KEEP
2010 if ((QApplication*)interactorManager->GetMainInteractor())
2011 ((QApplication*)interactorManager->GetMainInteractor())->exec();
2012
2013 interactorManager->EnableSecondaryLoop ();
2014 return this;
2015}

References G4VInteractorManager::DisableSecondaryLoop(), G4VInteractorManager::EnableSecondaryLoop(), exitSession, fCommandArea, fDefaultIcons, fHistoryTBTableList, FillHelpTree(), fMainWindow, fToolbarApp, G4Qt::getInstance(), G4VInteractorManager::GetMainInteractor(), Prompt(), and UpdateCommandCompleter().

◆ SessionTerminate()

void G4UIQt::SessionTerminate ( )

Definition at line 2032 of file G4UIQt.cc.

2034{
2035 G4Qt* interactorManager = G4Qt::getInstance ();
2036 fMainWindow->close();
2037 ((QApplication*)interactorManager->GetMainInteractor())->exit();
2038}
def exit()
Definition: g4zmq.py:99

References g4zmq::exit(), fMainWindow, G4Qt::getInstance(), and G4VInteractorManager::GetMainInteractor().

Referenced by ButtonCallback(), CommandEnteredCallback(), and ExitSession().

◆ SetDefaultIconsToolbar()

void G4UIQt::SetDefaultIconsToolbar ( )
private

Definition at line 320 of file G4UIQt.cc.

321 {
322
323 if (fDefaultIcons) {
324 if (fToolbarApp == NULL) {
325 fToolbarApp = new QToolBar();
326 fToolbarApp->setIconSize (QSize(20,20));
327 fMainWindow->addToolBar(Qt::TopToolBarArea, fToolbarApp);
328 }
329
330 // Open/Save Icons
331 AddIcon("Open macro file","open", "/control/execute");
332 AddIcon("Save viewer state", "save", "/vis/viewer/save");
333
334 // View parameters
335#if QT_VERSION < 0x050600
336 QSignalMapper *signalMapperViewerProperties = new QSignalMapper(this);
337 QAction *actionViewerProperties = fToolbarApp->addAction(QIcon(*fParamIcon),"Viewer properties", signalMapperViewerProperties, SLOT(map()));
338 connect(signalMapperViewerProperties, SIGNAL(mapped(int)),this, SLOT(ViewerPropertiesIconCallback(int)));
339 int intVP = 0;
340 signalMapperViewerProperties->setMapping(actionViewerProperties, intVP);
341#else
342 fToolbarApp->addAction(QIcon(*fParamIcon),"Viewer properties", this, [this](){ this->ViewerPropertiesIconCallback(0); });
343#endif
344
345 // Cursors style icons
346 AddIcon("Move", "move", "");
347 AddIcon("Pick", "pick", "");
348 AddIcon("Zoom out", "zoom_out", "");
349 AddIcon("Zoom in", "zoom_in", "");
350 AddIcon("Rotate", "rotate", "");
351
352 // Surface Style icons
353 AddIcon("Hidden line removal", "hidden_line_removal", "");
354 AddIcon("Hidden line and hidden surface removal", "hidden_line_and_surface_removal", "");
355 AddIcon("Surfaces", "solid", "");
356 AddIcon("Wireframe", "wireframe", "");
357
358 // Perspective/Ortho icons
359 AddIcon("Perspective", "perspective","");
360 AddIcon("Orthographic", "ortho","");
361 AddIcon("Run beam on", "runBeamOn","/run/beamOn 1");
362 AddIcon("Exit Application", "exit","exit");
363 }
364}
void ViewerPropertiesIconCallback(int)
Definition: G4UIQt.cc:4779
void AddIcon(const char *userLabel, const char *iconFile, const char *command, const char *file_name="")
Definition: G4UIQt.cc:2429

References AddIcon(), g4zmq::connect(), fDefaultIcons, fMainWindow, fParamIcon, fToolbarApp, anonymous_namespace{G4QuasiElRatios.cc}::map, and ViewerPropertiesIconCallback().

Referenced by G4UIQt().

◆ SetIconHLHSRSelected()

void G4UIQt::SetIconHLHSRSelected ( )

Definition at line 5034 of file G4UIQt.cc.

5034 {
5035 // Theses actions should be in the app toolbar
5036
5037 QToolBar* bar = fToolbarApp;
5038 if (!fDefaultIcons) {
5039 bar = fToolbarUser;
5040 }
5041
5042 if (!bar) return;
5043
5044 QList<QAction *> list = bar->actions ();
5045 for (int i = 0; i < list.size(); ++i) {
5046 if (list.at(i)->data().toString () == "hidden_line_and_surface_removal") {
5047 list.at(i)->setChecked(TRUE);
5048 } else if (list.at(i)->data().toString () == "solid") {
5049 list.at(i)->setChecked(FALSE);
5050 } else if (list.at(i)->data().toString () == "hidden_line_removal") {
5051 list.at(i)->setChecked(FALSE);
5052 } else if (list.at(i)->data().toString () == "wireframe") {
5053 list.at(i)->setChecked(FALSE);
5054 }
5055 }
5056}
static constexpr double bar
Definition: G4SIunits.hh:224

References bar, FALSE, fDefaultIcons, fToolbarApp, fToolbarUser, and TRUE.

Referenced by AddIcon(), and G4OpenGLQtViewer::updateToolbarAndMouseContextMenu().

◆ SetIconHLRSelected()

void G4UIQt::SetIconHLRSelected ( )

Definition at line 5009 of file G4UIQt.cc.

5009 {
5010 // Theses actions should be in the app toolbar
5011
5012 QToolBar* bar = fToolbarApp;
5013 if (!fDefaultIcons) {
5014 bar = fToolbarUser;
5015 }
5016 if (!bar) return;
5017
5018
5019 QList<QAction *> list = bar->actions ();
5020 for (int i = 0; i < list.size(); ++i) {
5021 if (list.at(i)->data().toString () == "hidden_line_removal") {
5022 list.at(i)->setChecked(TRUE);
5023 } else if (list.at(i)->data().toString () == "solid") {
5024 list.at(i)->setChecked(FALSE);
5025 } else if (list.at(i)->data().toString () == "hidden_line_and_surface_removal") {
5026 list.at(i)->setChecked(FALSE);
5027 } else if (list.at(i)->data().toString () == "wireframe") {
5028 list.at(i)->setChecked(FALSE);
5029 }
5030 }
5031}

References bar, FALSE, fDefaultIcons, fToolbarApp, fToolbarUser, and TRUE.

Referenced by AddIcon(), and G4OpenGLQtViewer::updateToolbarAndMouseContextMenu().

◆ SetIconMoveSelected()

void G4UIQt::SetIconMoveSelected ( )

Definition at line 4816 of file G4UIQt.cc.

4816 {
4817 // Theses actions should be in the app toolbar
4818 fMoveSelected = true;
4819 fRotateSelected = false;
4820 fPickSelected = false;
4821 fZoomInSelected = false;
4822 fZoomOutSelected = false;
4823
4824 if (fToolbarApp == NULL) return;
4825 QList<QAction *> list = fToolbarApp->actions ();
4826 for (int i = 0; i < list.size(); ++i) {
4827 if (list.at(i)->data().toString () == "move") {
4828 list.at(i)->setChecked(TRUE);
4829 } else if (list.at(i)->data().toString () == "rotate") {
4830 list.at(i)->setChecked(FALSE);
4831 } else if (list.at(i)->data().toString () == "pick") {
4832 list.at(i)->setChecked(FALSE);
4833 } else if (list.at(i)->data().toString () == "zoom_in") {
4834 list.at(i)->setChecked(FALSE);
4835 } else if (list.at(i)->data().toString () == "zoom_out") {
4836 list.at(i)->setChecked(FALSE);
4837 }
4838 }
4839}

References FALSE, fMoveSelected, fPickSelected, fRotateSelected, fToolbarApp, fZoomInSelected, fZoomOutSelected, and TRUE.

Referenced by AddIcon(), and G4OpenGLQtViewer::toggleMouseAction().

◆ SetIconOrthoSelected()

void G4UIQt::SetIconOrthoSelected ( )

Definition at line 5081 of file G4UIQt.cc.

5081 {
5082 // Theses actions should be in the app toolbar
5083
5084 QToolBar* bar = fToolbarApp;
5085 if (!fDefaultIcons) {
5086 bar = fToolbarUser;
5087 }
5088
5089 if (!bar) return;
5090
5091 QList<QAction *> list = bar->actions ();
5092 for (int i = 0; i < list.size(); ++i) {
5093 if (list.at(i)->data().toString () == "ortho") {
5094 list.at(i)->setChecked(TRUE);
5095 } else if (list.at(i)->data().toString () == "perspective") {
5096 list.at(i)->setChecked(FALSE);
5097 }
5098 }
5099}

References bar, FALSE, fDefaultIcons, fToolbarApp, fToolbarUser, and TRUE.

Referenced by AddIcon(), and G4OpenGLQtViewer::updateToolbarAndMouseContextMenu().

◆ SetIconPerspectiveSelected()

void G4UIQt::SetIconPerspectiveSelected ( )

Definition at line 5059 of file G4UIQt.cc.

5059 {
5060 // Theses actions should be in the app toolbar
5061
5062 QToolBar* bar = fToolbarApp;
5063 if (!fDefaultIcons) {
5064 bar = fToolbarUser;
5065 }
5066 if (!bar) return;
5067
5068
5069 QList<QAction *> list = bar->actions ();
5070 for (int i = 0; i < list.size(); ++i) {
5071 if (list.at(i)->data().toString () == "perspective") {
5072 list.at(i)->setChecked(TRUE);
5073 } else if (list.at(i)->data().toString () == "ortho") {
5074 list.at(i)->setChecked(FALSE);
5075 }
5076 }
5077}

References bar, FALSE, fDefaultIcons, fToolbarApp, fToolbarUser, and TRUE.

Referenced by AddIcon(), and G4OpenGLQtViewer::updateToolbarAndMouseContextMenu().

◆ SetIconPickSelected()

void G4UIQt::SetIconPickSelected ( )

Definition at line 4868 of file G4UIQt.cc.

4868 {
4869 // Theses actions should be in the app toolbar
4870 fPickSelected = true;
4871 fMoveSelected = false;
4872 fRotateSelected = false;
4873 fZoomInSelected = false;
4874 fZoomOutSelected = false;
4875
4876 QToolBar* bar = fToolbarApp;
4877 if (!fDefaultIcons) {
4878 bar = fToolbarUser;
4879 }
4880 if (!bar) return;
4881
4882 QList<QAction *> list = bar->actions ();
4883 for (int i = 0; i < list.size(); ++i) {
4884 if (list.at(i)->data().toString () == "pick") {
4885 list.at(i)->setChecked(TRUE);
4886 } else if (list.at(i)->data().toString () == "move") {
4887 list.at(i)->setChecked(FALSE);
4888 } else if (list.at(i)->data().toString () == "rotate") {
4889 list.at(i)->setChecked(FALSE);
4890 } else if (list.at(i)->data().toString () == "zoom_in") {
4891 list.at(i)->setChecked(FALSE);
4892 } else if (list.at(i)->data().toString () == "zoom_out") {
4893 list.at(i)->setChecked(FALSE);
4894 }
4895 }
4896}

References bar, FALSE, fDefaultIcons, fMoveSelected, fPickSelected, fRotateSelected, fToolbarApp, fToolbarUser, fZoomInSelected, fZoomOutSelected, and TRUE.

Referenced by AddIcon(), and G4OpenGLQtViewer::togglePicking().

◆ SetIconRotateSelected()

void G4UIQt::SetIconRotateSelected ( )

Definition at line 4842 of file G4UIQt.cc.

4842 {
4843 // Theses actions should be in the app toolbar
4844 fRotateSelected = true;
4845 fMoveSelected = false;
4846 fPickSelected = false;
4847 fZoomInSelected = false;
4848 fZoomOutSelected = false;
4849
4850 if (fToolbarApp == NULL) return;
4851 QList<QAction *> list = fToolbarApp->actions ();
4852 for (int i = 0; i < list.size(); ++i) {
4853 if (list.at(i)->data().toString () == "rotate") {
4854 list.at(i)->setChecked(TRUE);
4855 } else if (list.at(i)->data().toString () == "move") {
4856 list.at(i)->setChecked(FALSE);
4857 } else if (list.at(i)->data().toString () == "pick") {
4858 list.at(i)->setChecked(FALSE);
4859 } else if (list.at(i)->data().toString () == "zoom_in") {
4860 list.at(i)->setChecked(FALSE);
4861 } else if (list.at(i)->data().toString () == "zoom_out") {
4862 list.at(i)->setChecked(FALSE);
4863 }
4864 }
4865}

References FALSE, fMoveSelected, fPickSelected, fRotateSelected, fToolbarApp, fZoomInSelected, fZoomOutSelected, and TRUE.

Referenced by AddIcon(), G4OpenGLQtViewer::toggleMouseAction(), and G4OpenGLQtViewer::togglePicking().

◆ SetIconSolidSelected()

void G4UIQt::SetIconSolidSelected ( )

Definition at line 4961 of file G4UIQt.cc.

4961 {
4962 // Theses actions should be in the app toolbar
4963
4964 QToolBar* bar = fToolbarApp;
4965 if (!fDefaultIcons) {
4966 bar = fToolbarUser;
4967 }
4968 if (!bar) return;
4969
4970 QList<QAction *> list = bar->actions ();
4971 for (int i = 0; i < list.size(); ++i) {
4972 if (list.at(i)->data().toString () == "solid") {
4973 list.at(i)->setChecked(TRUE);
4974 } else if (list.at(i)->data().toString () == "hidden_line_removal") {
4975 list.at(i)->setChecked(FALSE);
4976 } else if (list.at(i)->data().toString () == "hidden_line_and_surface_removal") {
4977 list.at(i)->setChecked(FALSE);
4978 } else if (list.at(i)->data().toString () == "wireframe") {
4979 list.at(i)->setChecked(FALSE);
4980 }
4981 }
4982}

References bar, FALSE, fDefaultIcons, fToolbarApp, fToolbarUser, and TRUE.

Referenced by AddIcon(), and G4OpenGLQtViewer::updateToolbarAndMouseContextMenu().

◆ SetIconWireframeSelected()

void G4UIQt::SetIconWireframeSelected ( )

Definition at line 4985 of file G4UIQt.cc.

4985 {
4986 // Theses actions should be in the app toolbar
4987
4988 QToolBar* bar = fToolbarApp;
4989 if (!fDefaultIcons) {
4990 bar = fToolbarUser;
4991 }
4992 if (!bar) return;
4993
4994 QList<QAction *> list = bar->actions ();
4995 for (int i = 0; i < list.size(); ++i) {
4996 if (list.at(i)->data().toString () == "wireframe") {
4997 list.at(i)->setChecked(TRUE);
4998 } else if (list.at(i)->data().toString () == "hidden_line_removal") {
4999 list.at(i)->setChecked(FALSE);
5000 } else if (list.at(i)->data().toString () == "hidden_line_and_surface_removal") {
5001 list.at(i)->setChecked(FALSE);
5002 } else if (list.at(i)->data().toString () == "solid") {
5003 list.at(i)->setChecked(FALSE);
5004 }
5005 }
5006}

References bar, FALSE, fDefaultIcons, fToolbarApp, fToolbarUser, and TRUE.

Referenced by AddIcon(), and G4OpenGLQtViewer::updateToolbarAndMouseContextMenu().

◆ SetIconZoomInSelected()

void G4UIQt::SetIconZoomInSelected ( )

Definition at line 4899 of file G4UIQt.cc.

4899 {
4900 // Theses actions should be in the app toolbar
4901 fZoomInSelected = true;
4902 fMoveSelected = false;
4903 fRotateSelected = false;
4904 fPickSelected = false;
4905 fZoomOutSelected = false;
4906
4907 QToolBar* bar = fToolbarApp;
4908 if (!fDefaultIcons) {
4909 bar = fToolbarUser;
4910 }
4911 if (!bar) return;
4912
4913 QList<QAction *> list = bar->actions ();
4914 for (int i = 0; i < list.size(); ++i) {
4915 if (list.at(i)->data().toString () == "zoom_in") {
4916 list.at(i)->setChecked(TRUE);
4917 } else if (list.at(i)->data().toString () == "move") {
4918 list.at(i)->setChecked(FALSE);
4919 } else if (list.at(i)->data().toString () == "rotate") {
4920 list.at(i)->setChecked(FALSE);
4921 } else if (list.at(i)->data().toString () == "pick") {
4922 list.at(i)->setChecked(FALSE);
4923 } else if (list.at(i)->data().toString () == "zoom_out") {
4924 list.at(i)->setChecked(FALSE);
4925 }
4926 }
4927}

References bar, FALSE, fDefaultIcons, fMoveSelected, fPickSelected, fRotateSelected, fToolbarApp, fToolbarUser, fZoomInSelected, fZoomOutSelected, and TRUE.

Referenced by AddIcon(), and G4OpenGLQtViewer::toggleMouseAction().

◆ SetIconZoomOutSelected()

void G4UIQt::SetIconZoomOutSelected ( )

Definition at line 4930 of file G4UIQt.cc.

4930 {
4931 // Theses actions should be in the app toolbar
4932 fZoomOutSelected = true;
4933 fMoveSelected = false;
4934 fRotateSelected = false;
4935 fPickSelected = false;
4936 fZoomInSelected = false;
4937
4938 QToolBar* bar = fToolbarApp;
4939 if (!fDefaultIcons) {
4940 bar = fToolbarUser;
4941 }
4942 if (!bar) return;
4943
4944 QList<QAction *> list = bar->actions ();
4945 for (int i = 0; i < list.size(); ++i) {
4946 if (list.at(i)->data().toString () == "zoom_out") {
4947 list.at(i)->setChecked(TRUE);
4948 } else if (list.at(i)->data().toString () == "move") {
4949 list.at(i)->setChecked(FALSE);
4950 } else if (list.at(i)->data().toString () == "rotate") {
4951 list.at(i)->setChecked(FALSE);
4952 } else if (list.at(i)->data().toString () == "pick") {
4953 list.at(i)->setChecked(FALSE);
4954 } else if (list.at(i)->data().toString () == "zoom_in") {
4955 list.at(i)->setChecked(FALSE);
4956 }
4957 }
4958}

References bar, FALSE, fDefaultIcons, fMoveSelected, fPickSelected, fRotateSelected, fToolbarApp, fToolbarUser, fZoomInSelected, fZoomOutSelected, and TRUE.

Referenced by AddIcon(), and G4OpenGLQtViewer::toggleMouseAction().

◆ SetStartPage()

void G4UIQt::SetStartPage ( const std::string &  text)

Definition at line 1917 of file G4UIQt.cc.

1919{
1920 if (text != "") {
1922 }
1923 if (!fStartPage) {
1924 fStartPage = new QTextBrowser();
1925 fStartPage->setContentsMargins(5,5,5,5);
1926 fStartPage->setReadOnly(true);
1927 }
1928 fStartPage->setOpenExternalLinks(true);
1930}

References fDefaultViewerFirstPageHTMLText, and fStartPage.

Referenced by CreateViewerWidget().

◆ ShowCurrent()

void G4VBasicShell::ShowCurrent ( const G4String newCommand) const
protectedinherited

Definition at line 313 of file G4VBasicShell.cc.

314{
316 if(UI==NULL) return;
317 G4String comString = newCommand.substr(1,newCommand.length()-1);
318 G4String theCommand = ModifyToFullPathCommand(comString);
319 G4String curV = UI->GetCurrentValues(theCommand);
320 if( ! curV.empty() ) {
321 G4cout << "Current value(s) of the parameter(s) : " << curV << G4endl;
322 }
323}
G4String GetCurrentValues(const char *aCommand)
Definition: G4UImanager.cc:164

References G4cout, G4endl, G4UImanager::GetCurrentValues(), G4UImanager::GetUIpointer(), and G4VBasicShell::ModifyToFullPathCommand().

Referenced by G4VBasicShell::ApplyShellCommand(), G4UIterminal::GetCommand(), and G4ZMQServer::GetCommand().

◆ ShowHelpCallback

void G4UIQt::ShowHelpCallback ( )
privateslot

Called when user give "help" command.

Definition at line 3868 of file G4UIQt.cc.

3870{
3871 TerminalHelp("");
3872}

References G4VBasicShell::TerminalHelp().

◆ TabCloseCallback

void G4UIQt::TabCloseCallback ( int  )
privateslot

Definition at line 5145 of file G4UIQt.cc.

5145 {
5146#else
5147void G4UIQt::TabCloseCallback(int a){
5148#endif
5149#if QT_VERSION < 0x040500
5150#else
5151 if (fViewerTabWidget == NULL) return;
5152
5153 // get the address of the widget
5154 QWidget* temp = fViewerTabWidget->widget(a);
5155 // remove the tab
5156 fViewerTabWidget->removeTab (a);
5157
5158 // if last QWidget : Add empty string
5159 bool lastTab = true;
5160 for (int c=0; c<fViewerTabWidget->count(); c++) {
5161 if (fViewerTabWidget->tabText(c).contains("viewer")) {
5162 lastTab = false;
5163 }
5164 }
5165
5166 if (lastTab) {
5168 }
5169 // delete the widget
5170 delete temp;
5171#endif
5172}

References CreateEmptyViewerPropertiesWidget(), fViewerTabWidget, and TabCloseCallback().

Referenced by CreateViewerWidget(), and TabCloseCallback().

◆ TerminalHelp()

void G4VBasicShell::TerminalHelp ( const G4String newCommand)
protectedinherited

Definition at line 355 of file G4VBasicShell.cc.

356{
358 if(UI==NULL) return;
359 G4UIcommandTree * treeTop = UI->GetTree();
360 size_t i = newCommand.find(" ");
361 if( i != std::string::npos )
362 {
363 G4String newValue = newCommand.substr(i+1, newCommand.length()-(i+1));
364 G4StrUtil::strip(newValue);
365 G4String targetCom = ModifyToFullPathCommand(newValue);
366 G4UIcommand* theCommand = treeTop->FindPath(targetCom);
367 if( theCommand != NULL )
368 {
369 theCommand->List();
370 return;
371 }
372 else
373 {
374 G4cout << "Command <" << newValue << " is not found." << G4endl;
375 return;
376 }
377 }
378
379 G4UIcommandTree * floor[10];
380 floor[0] = treeTop;
381 size_t iFloor = 0;
382 size_t prefixIndex = 1;
384 while( prefixIndex < prefix.length()-1 )
385 {
386 size_t ii = prefix.find("/",prefixIndex);
387 floor[iFloor+1] =
388 floor[iFloor]->GetTree(G4String(prefix.substr(0,ii+1)));
389 prefixIndex = ii+1;
390 iFloor++;
391 }
392 floor[iFloor]->ListCurrentWithNum();
393 // 1998 Oct 2 non-number input
394 while(1){
395 //G4cout << G4endl << "Type the number ( 0:end, -n:n level back ) : "<<std::flush;
396 G4cout << G4endl << "Type the number ( 0:end, -n:n level back ) : "<<G4endl;
397 G4int j;
398 if(!GetHelpChoice(j)){
399 G4cout << G4endl << "Not a number, once more" << G4endl;
400 continue;
401 } else if( j < 0 ){
402 if( iFloor < (size_t)-j ) iFloor = 0;
403 else iFloor += j;
404 //iFloor += j;
405 //if( iFloor < 0 ) iFloor = 0;
406 floor[iFloor]->ListCurrentWithNum();
407 continue;
408 } else if(j == 0) {
409 break;
410 } else if( j > 0 ) {
411 G4int n_tree = floor[iFloor]->GetTreeEntry();
412 if( j > n_tree )
413 {
414 if( j <= n_tree + floor[iFloor]->GetCommandEntry() )
415 {
416 floor[iFloor]->GetCommand(j-n_tree)->List();
417 }
418 }
419 else
420 {
421 floor[iFloor+1] = floor[iFloor]->GetTree(j);
422 iFloor++;
423 floor[iFloor]->ListCurrentWithNum();
424 }
425 }
426 }
427 G4cout << "Exit from HELP." << G4endl << G4endl;
428 //G4cout << G4endl;
429 ExitHelp();
430}
void ListCurrentWithNum() const
virtual void List()
Definition: G4UIcommand.cc:410
virtual void ExitHelp() const =0
virtual G4bool GetHelpChoice(G4int &)=0

References G4VBasicShell::ExitHelp(), G4UIcommandTree::FindPath(), G4cout, G4endl, G4UIcommandTree::GetCommand(), G4VBasicShell::GetCurrentWorkingDirectory(), G4VBasicShell::GetHelpChoice(), G4UImanager::GetTree(), G4UIcommandTree::GetTree(), G4UIcommandTree::GetTreeEntry(), G4UImanager::GetUIpointer(), G4UIcommand::List(), G4UIcommandTree::ListCurrentWithNum(), G4VBasicShell::ModifyToFullPathCommand(), and G4StrUtil::strip().

Referenced by G4VBasicShell::ApplyShellCommand(), G4UIterminal::GetCommand(), G4ZMQServer::GetCommand(), and ShowHelpCallback().

◆ ThreadComboBoxCallback

void G4UIQt::ThreadComboBoxCallback ( int  )
privateslot

Definition at line 4172 of file G4UIQt.cc.

4172 {
4174}

References CoutFilterCallback().

Referenced by CreateCoutTBWidget().

◆ ToolBoxActivated

void G4UIQt::ToolBoxActivated ( int  a)
privateslot

Definition at line 5175 of file G4UIQt.cc.

5175 {
5176
5177 if (fUITabWidget->widget(a) == fHelpTBWidget) {
5178 // Rebuild the help tree
5179 FillHelpTree();
5180 } else if (fUITabWidget->widget(a) == fSceneTreeWidget) {
5181#if QT_VERSION < 0x040200
5182 fSceneTreeWidget->show();
5183#else
5184 fSceneTreeWidget->setVisible(true);
5185#endif
5186 }
5187}

References fHelpTBWidget, FillHelpTree(), fSceneTreeWidget, and fUITabWidget.

Referenced by CreateUITabWidget().

◆ UpdateCommandCompleter()

void G4UIQt::UpdateCommandCompleter ( )
private

Definition at line 3685 of file G4UIQt.cc.

3685 {
3686 if (!fCommandArea) return;
3687
3688 // remove previous one
3689 fCommandArea->setCompleter(NULL);
3690 if (fCompleter) {
3691 if (fCompleter->popup()) {
3692 fCompleter->popup()->removeEventFilter(this);
3693 }
3694 }
3695
3696 QStandardItemModel* model = CreateCompleterModel("/");
3697 fCompleter = new QCompleter(model);
3698
3699 // set all dir visibles in completion
3701 G4UIcommandTree * commandTreeTop = UI->GetTree();
3702 G4UIcommandTree* aTree = commandTreeTop->FindCommandTree("/");
3703 if (aTree) {
3704 int Ndir= aTree-> GetTreeEntry();
3705 fCompleter->setMaxVisibleItems(Ndir);
3706 }
3707 fCommandArea->setCompleter(fCompleter);
3708 fCompleter->popup()->installEventFilter(this);
3709}

References CreateCompleterModel(), fCommandArea, fCompleter, G4UIcommandTree::FindCommandTree(), G4UImanager::GetTree(), and G4UImanager::GetUIpointer().

Referenced by CommandEnteredCallback(), and SessionStart().

◆ updateHelpArea()

void G4UIQt::updateHelpArea ( const G4UIcommand aCommand)
private

Build the command list parameters in a QString with HTML
Reimplement partialy the G4UIparameter.cc

Parameters
aCommand: command to list parameters
See also
G4UIparameter::List()
G4UIcommand::List()
Returns
the command list parameters, or "" if nothing

Definition at line 3390 of file G4UIQt.cc.

3393{
3395 return;
3397 return;
3398
3399 fParameterHelpLabel->setTextInteractionFlags(Qt::NoTextInteraction);
3400 QString txt;
3401 if (aCommand == NULL)
3402 return;
3403
3404 G4String commandPath = aCommand->GetCommandPath();
3405 G4String rangeString = aCommand->GetRange();
3406 G4int n_guidanceEntry = aCommand->GetGuidanceEntries();
3407 G4int n_parameterEntry = aCommand->GetParameterEntries();
3408
3409 if ((commandPath == "") &&
3410 (rangeString == "") &&
3411 (n_guidanceEntry == 0) &&
3412 (n_parameterEntry == 0)) {
3413 return;
3414 }
3415
3416 if((commandPath.length()-1)!='/') {
3417 txt += "<b>Command </b> " + QString((char*)(commandPath).data()) + "<br />";
3418 }
3419 txt += "<b>Guidance :</b> ";
3420 QString tmpGuidance = "";
3421 for( G4int i_thGuidance=0; i_thGuidance < n_guidanceEntry; i_thGuidance++ ) {
3422 tmpGuidance = QString((char*)(aCommand->GetGuidanceLine(i_thGuidance)).data());
3423#if QT_VERSION < 0x050000
3424 tmpGuidance = Qt::escape(tmpGuidance);
3425#else
3426 tmpGuidance = tmpGuidance.toHtmlEscaped();
3427#endif
3428 tmpGuidance.replace("\n","<br />");
3429 txt += tmpGuidance + "<br />";
3430 }
3431 if( ! rangeString.empty() ) {
3432 QString range = QString((char*)(rangeString).data());
3433#if QT_VERSION < 0x050000
3434 range = Qt::escape(range);
3435#else
3436 range = range.toHtmlEscaped();
3437#endif
3438
3439 txt += "<b>Range of parameters : </b> " + range + "<br />";
3440 } else {
3441 txt += "<br />";
3442 }
3443 fParameterHelpLabel->setHtml(txt);
3444
3445 if( n_parameterEntry > 0 ) {
3446 G4UIparameter *param;
3447
3448 // Re-implementation of G4UIparameter.cc
3449
3450 fParameterHelpTable->clear();
3451 fParameterHelpTable->setRowCount(n_parameterEntry);
3452 fParameterHelpTable->setColumnCount(8);
3453 fParameterHelpTable->setHorizontalHeaderLabels(QStringList() <<
3454 tr("") <<
3455 tr("Parameter") <<
3456 tr("Guidance") <<
3457 tr("Type") <<
3458 tr("Ommitable") <<
3459 tr("Default") <<
3460 tr("Range") <<
3461 tr("Candidate"));
3462 fParameterHelpTable->setColumnWidth(2,60);
3463
3464 fParameterHelpTable->verticalHeader()->setVisible(false);
3465 fParameterHelpTable->setAlternatingRowColors (true);
3466#if QT_VERSION < 0x050000
3467 fParameterHelpTable->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
3468 fParameterHelpTable->horizontalHeader()->setResizeMode(2, QHeaderView::Stretch);
3469#else
3470 fParameterHelpTable->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
3471 fParameterHelpTable->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch);
3472#endif
3473 fParameterHelpTable->setWordWrap(true);
3474
3475 QTableWidgetItem* t = fParameterHelpTable->horizontalHeaderItem(1);
3476 QFont fnt = t->font();
3477 int size = fnt.pointSize();
3478 fnt.setPointSize(size-2);
3479
3480 for( G4int a=0; a<n_parameterEntry; a++ ) {
3481 param = aCommand->GetParameter(a);
3482 fParameterHelpTable->setItem(a, 0, new QTableWidgetItem(QString::number(a+1)));
3483
3484 fParameterHelpTable->setItem(a, 1, new QTableWidgetItem(QString((char*)(param->GetParameterName()).data())));
3485 if( ! param->GetParameterGuidance().empty() ) {
3486 fParameterHelpTable->setItem(a, 2, new QTableWidgetItem(QString((char*)(param->GetParameterGuidance()).data())));
3487 }
3488 fParameterHelpTable->setItem(a, 3, new QTableWidgetItem(QString(QChar(param->GetParameterType()))));
3489
3490 if(param->IsOmittable()){
3491 fParameterHelpTable->setItem(a, 4, new QTableWidgetItem(QString("True")));
3492 } else {
3493 fParameterHelpTable->setItem(a, 4, new QTableWidgetItem(QString("False")));
3494 }
3495 if( param->GetCurrentAsDefault() ) {
3496 fParameterHelpTable->setItem(a, 5, new QTableWidgetItem(QString("taken from the current value")));
3497 } else if( ! param->GetDefaultValue().empty() ) {
3498 fParameterHelpTable->setItem(a, 5, new QTableWidgetItem(QString((char*)(param->GetDefaultValue()).data())));
3499 }
3500 if( ! param->GetParameterRange().empty() ) {
3501 fParameterHelpTable->setItem(a, 6, new QTableWidgetItem(QString((char*)(param->GetParameterRange()).data())));
3502 }
3503 if( ! param->GetParameterCandidates().empty() ) {
3504 fParameterHelpTable->setItem(a, 7, new QTableWidgetItem(QString((char*)(param->GetParameterCandidates()).data())));
3505 }
3506 // tooltips
3507 for (int b=0; b<8; b++) {
3508 QTableWidgetItem* tmp = fParameterHelpTable->item(a,b);
3509 if (tmp) {
3510 tmp->setToolTip(tmp->text());
3511 tmp->setFlags(Qt::NoItemFlags);
3512 }
3513 }
3514 fParameterHelpTable->resizeRowToContents(a);
3515 }
3516 for (int c=0; c<8; c++) {
3517 if (c !=2) {
3518 fParameterHelpTable->resizeColumnToContents(c);
3519 }
3520 }
3521 fParameterHelpLabel->setVisible(true);
3522 fParameterHelpTable->setVisible(true);
3523
3524 }
3525}

References fParameterHelpLabel, fParameterHelpTable, G4UIcommand::GetCommandPath(), G4UIparameter::GetCurrentAsDefault(), G4UIparameter::GetDefaultValue(), G4UIcommand::GetGuidanceEntries(), G4UIcommand::GetGuidanceLine(), G4UIcommand::GetParameter(), G4UIparameter::GetParameterCandidates(), G4UIcommand::GetParameterEntries(), G4UIparameter::GetParameterGuidance(), G4UIparameter::GetParameterName(), G4UIparameter::GetParameterRange(), G4UIparameter::GetParameterType(), G4UIcommand::GetRange(), and G4UIparameter::IsOmittable().

Referenced by HelpTreeClicCallback().

◆ UpdateTabWidget

void G4UIQt::UpdateTabWidget ( int  tabNumber)
privateslot

Definition at line 1933 of file G4UIQt.cc.

1933 {
1934 if ( fViewerTabWidget == NULL) {
1936 }
1937
1938 fViewerTabWidget->setCurrentIndex(tabNumber);
1939
1940 // Send this signal to unblock graphic updates !
1942
1943 #if QT_VERSION < 0x040200
1944 fViewerTabWidget->show();
1945 #else
1946 fViewerTabWidget->setVisible(true);
1947 #endif
1948
1949 // This will send a paintEvent to OGL Viewers
1951}
void setTabSelected(bool a)
Definition: G4UIQt.hh:90

References fViewerTabWidget, and G4QTabWidget::setTabSelected().

Referenced by CreateViewerWidget().

◆ ViewerPropertiesIconCallback

void G4UIQt::ViewerPropertiesIconCallback ( int  )
privateslot

Definition at line 4779 of file G4UIQt.cc.

4779 {
4780
4782
4784 fViewerPropertiesDialog->raise();
4785 fViewerPropertiesDialog->activateWindow();
4786}

References CreateViewerPropertiesDialog(), and fViewerPropertiesDialog.

Referenced by SetDefaultIconsToolbar().

◆ VisParameterCallback

void G4UIQt::VisParameterCallback ( QWidget *  widget)
privateslot

Callback when one of the scene/vis parameters has changed

Definition at line 3977 of file G4UIQt.cc.

3977 {
3978 if (widget == NULL) {
3979 return;
3980 }
3981
3982 // Look in all the Grid layout, but only column 1 (0 is the parameter name)
3983 QGridLayout* grid = dynamic_cast<QGridLayout*>(widget->layout());
3984 if (grid == 0) {
3985 return;
3986 }
3987 QString command;
3988#if QT_VERSION < 0x040400
3989 QWidget* name = grid->itemAt(grid->columnCount()*(grid->rowCount()-2))->widget();
3990#else
3991 QWidget* name = grid->itemAtPosition(grid->rowCount()-1,0)->widget();
3992#endif
3993 if (dynamic_cast<QLabel*>(name) == 0) {
3994 return;
3995 }
3996 command += (dynamic_cast<QLabel*>(name))->text()+" ";
3997
3998 for (int a=0;a<grid->rowCount()-1; a++) {
3999#if QT_VERSION < 0x040400
4000 QWidget* widgetTmp = grid->itemAt(a*grid->columnCount()+1)->widget();
4001#else
4002 QWidget* widgetTmp = grid->itemAtPosition(a,1)->widget();
4003#endif
4004
4005 // 4 kind of widgets : QLineEdit / QComboBox / radioButtonsGroup / QPushButton (color chooser)
4006 if (widgetTmp != NULL) {
4007
4008 if (dynamic_cast<QLineEdit*>(widgetTmp) != 0) {
4009 command += (dynamic_cast<QLineEdit*>(widgetTmp))->text()+" ";
4010
4011 } else if (dynamic_cast<QComboBox*>(widgetTmp) != 0){
4012 command += (dynamic_cast<QComboBox*>(widgetTmp))->itemText((dynamic_cast<QComboBox*>(widgetTmp))->currentIndex())+" ";
4013
4014 // Color chooser
4015 } else if (dynamic_cast<QPushButton*>(widgetTmp) != 0){
4016 command += widgetTmp->accessibleName()+" ";
4017
4018 // Check for Button group
4019 } else if (dynamic_cast<QWidget*>(widgetTmp) != 0){
4020 if (widgetTmp->layout()->count() > 0){
4021 if (dynamic_cast<QRadioButton*>(widgetTmp->layout()->itemAt(0)->widget()) != 0) {
4022 QAbstractButton * checked = (dynamic_cast<QRadioButton*>(widgetTmp->layout()->itemAt(0)->widget()))->group()->checkedButton();
4023 if (checked != 0) {
4024 command += (dynamic_cast<QRadioButton*>(widgetTmp->layout()->itemAt(0)->widget()))->group()->checkedButton()->text()+" ";
4025 }
4026 }
4027 }
4028
4029 }
4030 }
4031 }
4032 if (command != "") {
4034 if(UI != NULL) {
4035 UI->ApplyCommand(command.toStdString().c_str());
4036 }
4037 }
4038}

References G4UImanager::ApplyCommand(), G4UImanager::GetUIpointer(), and G4InuclParticleNames::name().

Referenced by CreateCommandWidget().

Field Documentation

◆ currentDirectory

G4String G4VBasicShell::currentDirectory
privateinherited

◆ fClearIcon

QPixmap* G4UIQt::fClearIcon
private

Definition at line 356 of file G4UIQt.hh.

Referenced by CreateCoutTBWidget(), CreateIcons(), and getClearIcon().

◆ fCommandArea

QLineEdit* G4UIQt::fCommandArea
private

◆ fCommandIcon

QPixmap* G4UIQt::fCommandIcon
private

Definition at line 370 of file G4UIQt.hh.

Referenced by CreateCompleterModel(), and CreateIcons().

◆ fCommandLabel

QLabel* G4UIQt::fCommandLabel
private

Definition at line 321 of file G4UIQt.hh.

Referenced by CreateCoutTBWidget(), and Prompt().

◆ fCompleter

QCompleter* G4UIQt::fCompleter
private

Definition at line 327 of file G4UIQt.hh.

Referenced by eventFilter(), and UpdateCommandCompleter().

◆ fCoutDockWidget

G4UIDockWidget* G4UIQt::fCoutDockWidget
private

Definition at line 334 of file G4UIQt.hh.

Referenced by CreateCoutTBWidget(), G4UIQt(), GetCoutDockWidget(), and GetCoutWidget().

◆ fCoutFilter

QLineEdit* G4UIQt::fCoutFilter
private

◆ fCoutTBTextArea

QTextEdit* G4UIQt::fCoutTBTextArea
private

◆ fCoutText

QString G4UIQt::fCoutText
private

Definition at line 341 of file G4UIQt.hh.

◆ fDefaultIcons

bool G4UIQt::fDefaultIcons
private

◆ fDefaultViewerFirstPageHTMLText

std::string G4UIQt::fDefaultViewerFirstPageHTMLText
private

Definition at line 380 of file G4UIQt.hh.

Referenced by SetStartPage().

◆ fDirIcon

QPixmap* G4UIQt::fDirIcon
private

Definition at line 371 of file G4UIQt.hh.

Referenced by CreateCompleterModel(), and CreateIcons().

◆ fExitIcon

QPixmap* G4UIQt::fExitIcon
private

Definition at line 375 of file G4UIQt.hh.

Referenced by AddIcon(), and CreateIcons().

◆ fG4OutputString

std::vector<G4UIOutputString> G4UIQt::fG4OutputString
private

◆ fHelpLine

QLineEdit* G4UIQt::fHelpLine
private

Definition at line 339 of file G4UIQt.hh.

Referenced by CreateHelpTBWidget(), FillHelpTree(), and LookForHelpStringCallback().

◆ fHelpTBWidget

QWidget* G4UIQt::fHelpTBWidget
private

◆ fHelpTreeWidget

QTreeWidget* G4UIQt::fHelpTreeWidget
private

◆ fHelpVSplitter

QSplitter* G4UIQt::fHelpVSplitter
private

Definition at line 343 of file G4UIQt.hh.

Referenced by CreateHelpTBWidget().

◆ fHiddenLineAndSurfaceRemovalIcon

QPixmap* G4UIQt::fHiddenLineAndSurfaceRemovalIcon
private

Definition at line 367 of file G4UIQt.hh.

Referenced by AddIcon(), and CreateIcons().

◆ fHiddenLineRemovalIcon

QPixmap* G4UIQt::fHiddenLineRemovalIcon
private

Definition at line 366 of file G4UIQt.hh.

Referenced by AddIcon(), and CreateIcons().

◆ fHistoryTBTableList

QListWidget* G4UIQt::fHistoryTBTableList
private

◆ fHistoryTBWidget

QWidget* G4UIQt::fHistoryTBWidget
private

Definition at line 333 of file G4UIQt.hh.

Referenced by CreateHistoryTBWidget(), and GetHistoryWidget().

◆ fLastCompleteCommand

QString G4UIQt::fLastCompleteCommand
private

Definition at line 384 of file G4UIQt.hh.

Referenced by eventFilter().

◆ fLastErrMessage

G4String G4UIQt::fLastErrMessage
private

Definition at line 350 of file G4UIQt.hh.

Referenced by ReceiveG4cerr(), and ReceiveG4cout().

◆ fLastOpenPath

QString G4UIQt::fLastOpenPath
private

Definition at line 351 of file G4UIQt.hh.

Referenced by OpenIconCallback(), SaveIconCallback(), and SaveOutputCallback().

◆ fMainWindow

QMainWindow* G4UIQt::fMainWindow
private

◆ fMoveIcon

QPixmap* G4UIQt::fMoveIcon
private

Definition at line 359 of file G4UIQt.hh.

Referenced by AddIcon(), and CreateIcons().

◆ fMoveSelected

bool G4UIQt::fMoveSelected
private

◆ fOpenIcon

QPixmap* G4UIQt::fOpenIcon
private

Definition at line 358 of file G4UIQt.hh.

Referenced by AddIcon(), and CreateIcons().

◆ fOrthoIcon

QPixmap* G4UIQt::fOrthoIcon
private

Definition at line 369 of file G4UIQt.hh.

Referenced by AddIcon(), and CreateIcons().

◆ fOutputStyles

std::map<G4String,G4UIQtStyle> G4UIQt::fOutputStyles
private

Definition at line 393 of file G4UIQt.hh.

Referenced by G4UIQt(), OutputStyle(), ReceiveG4cerr(), and ReceiveG4cout().

◆ fParameterHelpLabel

QTextEdit* G4UIQt::fParameterHelpLabel
private

◆ fParameterHelpTable

QTableWidget* G4UIQt::fParameterHelpTable
private

◆ fParamIcon

QPixmap* G4UIQt::fParamIcon
private

Definition at line 373 of file G4UIQt.hh.

Referenced by CreateIcons(), and SetDefaultIconsToolbar().

◆ fPerspectiveIcon

QPixmap* G4UIQt::fPerspectiveIcon
private

Definition at line 368 of file G4UIQt.hh.

Referenced by AddIcon(), and CreateIcons().

◆ fPickIcon

QPixmap* G4UIQt::fPickIcon
private

Definition at line 361 of file G4UIQt.hh.

Referenced by AddIcon(), and CreateIcons().

◆ fPickInfosDialog

QDialog* G4UIQt::fPickInfosDialog
private

◆ fPickInfosWidget

QWidget* G4UIQt::fPickInfosWidget
private

◆ fPickSelected

bool G4UIQt::fPickSelected
private

◆ fPickTargetIcon

QPixmap* G4UIQt::fPickTargetIcon
private

Definition at line 374 of file G4UIQt.hh.

◆ fRotateIcon

QPixmap* G4UIQt::fRotateIcon
private

Definition at line 360 of file G4UIQt.hh.

Referenced by AddIcon(), and CreateIcons().

◆ fRotateSelected

bool G4UIQt::fRotateSelected
private

◆ fRunIcon

QPixmap* G4UIQt::fRunIcon
private

Definition at line 372 of file G4UIQt.hh.

Referenced by AddIcon(), and CreateIcons().

◆ fSaveIcon

QPixmap* G4UIQt::fSaveIcon
private

Definition at line 357 of file G4UIQt.hh.

Referenced by AddIcon(), CreateCoutTBWidget(), and CreateIcons().

◆ fSceneTreeWidget

QWidget* G4UIQt::fSceneTreeWidget
private

Definition at line 336 of file G4UIQt.hh.

Referenced by CreateSceneTreeWidget(), GetSceneTreeWidget(), and ToolBoxActivated().

◆ fSearchIcon

QPixmap* G4UIQt::fSearchIcon
private

Definition at line 355 of file G4UIQt.hh.

Referenced by CreateCoutTBWidget(), CreateIcons(), and getSearchIcon().

◆ fSolidIcon

QPixmap* G4UIQt::fSolidIcon
private

Definition at line 365 of file G4UIQt.hh.

Referenced by AddIcon(), and CreateIcons().

◆ fStartPage

QTextBrowser* G4UIQt::fStartPage
private

Definition at line 342 of file G4UIQt.hh.

Referenced by G4UIQt(), and SetStartPage().

◆ fStringSeparator

QString G4UIQt::fStringSeparator
private

Definition at line 349 of file G4UIQt.hh.

Referenced by AddIcon(), OpenIconCallback(), and SaveIconCallback().

◆ fSurfaceModePopupButton

QToolButton* G4UIQt::fSurfaceModePopupButton
private

Definition at line 353 of file G4UIQt.hh.

◆ fToolbarApp

QToolBar* G4UIQt::fToolbarApp
private

◆ fToolbarUser

QToolBar* G4UIQt::fToolbarUser
private

◆ fUIDockWidget

G4UIDockWidget* G4UIQt::fUIDockWidget
private

Definition at line 335 of file G4UIQt.hh.

Referenced by CreateUITabWidget(), G4UIQt(), and GetUserInterfaceWidget().

◆ fUITabWidget

QTabWidget* G4UIQt::fUITabWidget
private

◆ fViewerPropertiesDialog

QDialog* G4UIQt::fViewerPropertiesDialog
private

◆ fViewerPropertiesWidget

QWidget* G4UIQt::fViewerPropertiesWidget
private

◆ fViewerTabWidget

G4QTabWidget* G4UIQt::fViewerTabWidget
private

◆ fViewModePopupButton

QToolButton* G4UIQt::fViewModePopupButton
private

Definition at line 352 of file G4UIQt.hh.

◆ fWireframeIcon

QPixmap* G4UIQt::fWireframeIcon
private

Definition at line 364 of file G4UIQt.hh.

Referenced by AddIcon(), and CreateIcons().

◆ fZoomInIcon

QPixmap* G4UIQt::fZoomInIcon
private

Definition at line 362 of file G4UIQt.hh.

Referenced by AddIcon(), and CreateIcons().

◆ fZoomInSelected

bool G4UIQt::fZoomInSelected
private

◆ fZoomOutIcon

QPixmap* G4UIQt::fZoomOutIcon
private

Definition at line 363 of file G4UIQt.hh.

Referenced by AddIcon(), and CreateIcons().

◆ fZoomOutSelected

bool G4UIQt::fZoomOutSelected
private

◆ ifBatch

G4int G4UIsession::ifBatch = 0
protectedinherited

Definition at line 68 of file G4UIsession.hh.

Referenced by G4UIsession::~G4UIsession().

◆ inSession

G4int G4UIsession::inSession = 0
staticprotectedinherited

◆ interactors

G4interactor_map G4VInteractiveSession::interactors
privateinherited

◆ lastRC

G4int G4UIsession::lastRC = 0
protectedinherited

◆ masterG4coutDestination

G4coutDestination * G4coutDestination::masterG4coutDestination = nullptr
staticprotectedinherited

◆ messenger

G4UImessenger* G4VInteractiveSession::messenger
privateinherited

◆ transformersCerr

std::vector<Transformer> G4coutDestination::transformersCerr
protectedinherited

◆ transformersCout

std::vector<Transformer> G4coutDestination::transformersCout
protectedinherited

The documentation for this class was generated from the following files: