MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / openFileDialog

Function openFileDialog

source/MRViewer/MRFileDialog.cpp:475–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

473{
474
475std::filesystem::path openFileDialog( const FileParameters& params )
476{
477 FileDialog::Parameters parameters{ params };
478 parameters.folderDialog = false;
479 parameters.multiselect = false;
480 parameters.saveDialog = false;
481 if ( parameters.filters.empty() )
482 parameters.filters = { { "All files", "*.*" } };
483
484 const auto results = runDialog( parameters );
485 if ( results.size() == 1 )
486 {
487 if ( !results[0].empty() )
488 FileDialogSignals::instance().onOpenFile( results[0] );
489 return results[0];
490 }
491 return {};
492}
493
494void openFileDialogAsync( std::function<void( const std::filesystem::path& )> callback, const FileParameters& params /*= {} */ )
495{

Callers 3

addNewToolFromFile_Method · 0.85
openFileDialogAsyncFunction · 0.85

Calls 4

runDialogFunction · 0.85
instanceFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected