SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmmvis::ui::FileOpenDialog Class Reference

#include <fileopendialog.h>

Collaboration diagram for openswmmvis::ui::FileOpenDialog:

Static Public Member Functions

static QString startDirectory (const QString &type, const QString &fallback={})
 Choose the most applicable existing directory for an open/import category.
 
static void rememberSelection (const QString &type, const QStringList &paths)
 Persist the parent of the last nonempty selected regular file.
 
static QString getOpenFileName (const QString &type, QWidget *parent=nullptr, const QString &caption={}, const QString &directory={}, const QString &filter={}, QString *selectedFilter=nullptr, QFileDialog::Options options={})
 Open the standard modal file picker with per-category folder memory.
 
static QStringList getOpenFileNames (const QString &type, QWidget *parent=nullptr, const QString &caption={}, const QString &directory={}, const QString &filter={}, QString *selectedFilter=nullptr, QFileDialog::Options options={})
 Open the standard modal file picker with per-category folder memory.
 
static QString typeForFilter (const QString &filter)
 Map a filename filter to a shared category or deterministic extension-set key.
 

Member Function Documentation

◆ getOpenFileName()

static QString openswmmvis::ui::FileOpenDialog::getOpenFileName ( const QString &  type,
QWidget *  parent = nullptr,
const QString &  caption = {},
const QString &  directory = {},
const QString &  filter = {},
QString *  selectedFilter = nullptr,
QFileDialog::Options  options = {} 
)
inlinestatic

Open the standard modal file picker with per-category folder memory.

Parameters
[in]typeStable untranslated history category.
[in]parentOptional owner for the dialog; call on the GUI thread.
[in]captionDialog title.
[in]directoryFallback initial directory/filename after preferred/remembered locations.
[in]filterQt filename filters, optionally empty.
[in,out]selectedFilterOptional initial/returned active filter string.
[in]optionsQFileDialog options forwarded unchanged.
Returns
Selected filename or empty on cancellation.
Note
Remembers the accepted regular file's folder through QSettings; does not open/read the selected file contents.
Here is the caller graph for this function:

◆ getOpenFileNames()

static QStringList openswmmvis::ui::FileOpenDialog::getOpenFileNames ( const QString &  type,
QWidget *  parent = nullptr,
const QString &  caption = {},
const QString &  directory = {},
const QString &  filter = {},
QString *  selectedFilter = nullptr,
QFileDialog::Options  options = {} 
)
inlinestatic

Open the standard modal file picker with per-category folder memory.

Parameters
[in]typeStable untranslated history category.
[in]parentOptional owner for the dialog; call on the GUI thread.
[in]captionDialog title.
[in]directoryFallback initial directory/filename after preferred/remembered locations.
[in]filterQt filename filters, optionally empty.
[in,out]selectedFilterOptional initial/returned active filter string.
[in]optionsQFileDialog options forwarded unchanged.
Returns
Selected filenames or empty on cancellation.
Note
Remembers the accepted regular file's folder through QSettings; does not open/read the selected file contents.

◆ rememberSelection()

static void openswmmvis::ui::FileOpenDialog::rememberSelection ( const QString &  type,
const QStringList &  paths 
)
inlinestatic

Persist the parent of the last nonempty selected regular file.

Parameters
[in]typeStable category key; empty uses other-files.
[in]pathsSelection list traversed backward; missing/nonregular paths are skipped and cancellation preserves history.
Note
Writes and synchronizes QSettings without separately reporting persistence errors.

◆ startDirectory()

static QString openswmmvis::ui::FileOpenDialog::startDirectory ( const QString &  type,
const QString &  fallback = {} 
)
inlinestatic

Choose the most applicable existing directory for an open/import category.

Parameters
[in]typeStable untranslated category key; models first consults the preferred project-open directory.
[in]fallbackCandidate directory or filename whose parent may supply a fallback.
Returns
Preferred project folder, remembered category folder, valid fallback/parent, or home directory. No settings are written.

◆ typeForFilter()

static QString openswmmvis::ui::FileOpenDialog::typeForFilter ( const QString &  filter)
inlinestatic

Map a filename filter to a shared category or deterministic extension-set key.

Parameters
[in]filterQt filter text whose *.extension patterns are extracted/lowercased/deduplicated/sorted.
Returns
First matching category by fixed precedence (mesh, results, models, styles, world/raster/vector/series), other-files for no patterns, or filter- plus a SHA-256 extension-set digest.
Here is the caller graph for this function:

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