MCPcopy Create free account
hub / github.com/Geant4/geant4 / OpenIconCallback

Method OpenIconCallback

source/interfaces/implementation/src/G4UIQt.cc:5836–5849  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5834}
5835
5836void G4UIQt::OpenIconCallback(const QString& aParam)
5837{
5838 QString aCommand = aParam.left(aParam.indexOf(fStringSeparator));
5839 QString aLabel = aParam.mid(aParam.indexOf(fStringSeparator) + fStringSeparator.length());
5840
5841 QString nomFich = QFileDialog::getOpenFileName(fMainWindow, aLabel, fLastOpenPath,
5842 "Macro files (*.mac);;Geant4 files( *.mac *.g4* *.in);;All (*.*)");
5843 if (nomFich != "") {
5844 G4UImanager::GetUIpointer()->ApplyCommand(
5845 (QString(aCommand) + QString(" ") + nomFich).toStdString().c_str());
5846 QDir dir;
5847 fLastOpenPath = dir.absoluteFilePath(nomFich);
5848 }
5849}
5850
5851void G4UIQt::SaveIconCallback(const QString& aParam)
5852{

Callers 1

AddIconMethod · 0.95

Calls 4

c_strMethod · 0.80
QStringClass · 0.50
lengthMethod · 0.45
ApplyCommandMethod · 0.45

Tested by

no test coverage detected