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::RelativePathPicker Class Reference

A QLineEdit + browse-button widget that normalises display paths against a project anchor. More...

#include <relativepathpicker.h>

Inheritance diagram for openswmmvis::ui::RelativePathPicker:
Collaboration diagram for openswmmvis::ui::RelativePathPicker:

Public Slots

void setPath (const QString &p)
 

Signals

void pathChanged (const QString &absolutePath)
 

Public Member Functions

 RelativePathPicker (QWidget *parent=nullptr)
 
QString projectAnchor () const
 
void setProjectAnchor (const QString &dir)
 
QFileDialog::AcceptMode acceptMode () const
 
void setAcceptMode (QFileDialog::AcceptMode m)
 
QString fileFilter () const
 
void setFileFilter (const QString &filter)
 
QString dialogCaption () const
 
void setDialogCaption (const QString &caption)
 
QString absolutePath () const
 
QString displayPath () const
 
bool isDisplayedRelatively () const
 

Properties

QString absolutePath
 
QString projectAnchor
 
QString fileFilter
 

Detailed Description

A QLineEdit + browse-button widget that normalises display paths against a project anchor.

The widget exposes two views of the same value:

  • absolutePath() — the resolved absolute path (or empty); this is the authoritative value, persisted by callers.
  • displayPath() — what the line edit shows: relative to the anchor when reachable, otherwise absolute (with a warning tooltip).

Setting the path via setPath() accepts either form; the widget re-derives the absolute and display strings internally.

Acceptance mode (open / save) and file filter are configurable.

Constructor & Destructor Documentation

◆ RelativePathPicker()

openswmmvis::ui::RelativePathPicker::RelativePathPicker ( QWidget *  parent = nullptr)
explicit

Member Function Documentation

◆ absolutePath()

QString openswmmvis::ui::RelativePathPicker::absolutePath ( ) const
inline

Current absolute path. Empty when no file is selected.

◆ acceptMode()

QFileDialog::AcceptMode openswmmvis::ui::RelativePathPicker::acceptMode ( ) const
inline

Acceptance mode for the browse dialog. Defaults to AcceptOpen ("pick an existing file").

◆ dialogCaption()

QString openswmmvis::ui::RelativePathPicker::dialogCaption ( ) const
inline

Browse-dialog window title.

◆ displayPath()

QString openswmmvis::ui::RelativePathPicker::displayPath ( ) const

Path string as currently displayed in the line edit — relative to the anchor when reachable, absolute otherwise.

Here is the caller graph for this function:

◆ fileFilter()

QString openswmmvis::ui::RelativePathPicker::fileFilter ( ) const
inline

Browse-dialog file filter, e.g. "Time-series files (*.dat *.csv)".

◆ isDisplayedRelatively()

bool openswmmvis::ui::RelativePathPicker::isDisplayedRelatively ( ) const

Whether the displayed path is currently expressed relatively (informational; the GUI status panel uses this).

Here is the call graph for this function:

◆ pathChanged

void openswmmvis::ui::RelativePathPicker::pathChanged ( const QString &  absolutePath)
signal

Emitted whenever the absolute path changes via setPath() or browse.

Here is the caller graph for this function:

◆ projectAnchor()

QString openswmmvis::ui::RelativePathPicker::projectAnchor ( ) const
inline

Directory that displayed paths are made relative to. Typically the parent directory of the project's .inp file.

◆ setAcceptMode()

void openswmmvis::ui::RelativePathPicker::setAcceptMode ( QFileDialog::AcceptMode  m)
inline

◆ setDialogCaption()

void openswmmvis::ui::RelativePathPicker::setDialogCaption ( const QString &  caption)
inline

◆ setFileFilter()

void openswmmvis::ui::RelativePathPicker::setFileFilter ( const QString &  filter)
inline

◆ setPath

void openswmmvis::ui::RelativePathPicker::setPath ( const QString &  p)
slot

Accepts either an absolute or a relative path. Relative inputs are resolved against projectAnchor() when set; otherwise stored verbatim. Emits pathChanged() on a real change.

Here is the call graph for this function:

◆ setProjectAnchor()

void openswmmvis::ui::RelativePathPicker::setProjectAnchor ( const QString &  dir)
Here is the caller graph for this function:

Property Documentation

◆ absolutePath

QString openswmmvis::ui::RelativePathPicker::absolutePath
readwrite

◆ fileFilter

QString openswmmvis::ui::RelativePathPicker::fileFilter
readwrite

◆ projectAnchor

QString openswmmvis::ui::RelativePathPicker::projectAnchor
readwrite

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