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
UserFlagsDialog Class Reference

Staged editor for user-flag definitions. More...

#include <userflagsdialog.h>

Inheritance diagram for UserFlagsDialog:
Collaboration diagram for UserFlagsDialog:

Public Member Functions

 UserFlagsDialog (openswmmvis::ui::UserFlagsModel *model, QWidget *parent=nullptr)
 
bool wroteAnyChanges () const noexcept
 
bool applyChanges (QString *outError=nullptr)
 
void setConfirmationsEnabled (bool enabled)
 
QTableWidget * table () const noexcept
 
void addRow (const QString &name, openswmmvis::ui::UserFlagsModel::FlagType type, const QString &description)
 

Detailed Description

Staged editor for user-flag definitions.

Constructed over the project's shared UserFlagsModel (SWMMModelLayer::ensureUserFlagsModel()); taking the model rather than the layer keeps the dialog independently testable against a bare engine handle.

Constructor & Destructor Documentation

◆ UserFlagsDialog()

UserFlagsDialog::UserFlagsDialog ( openswmmvis::ui::UserFlagsModel model,
QWidget *  parent = nullptr 
)
explicit

Member Function Documentation

◆ addRow()

void UserFlagsDialog::addRow ( const QString &  name,
openswmmvis::ui::UserFlagsModel::FlagType  type,
const QString &  description 
)

Append a staged row. Exposed for the Add button and tests.

◆ applyChanges()

bool UserFlagsDialog::applyChanges ( QString *  outError = nullptr)

Commit the staged table to the engine. Returns false (with *outError set) on validation failure — empty or duplicate names. Public so tests can drive the commit without the button box.

Here is the call graph for this function:

◆ setConfirmationsEnabled()

void UserFlagsDialog::setConfirmationsEnabled ( bool  enabled)
inline

Test hook — when false, destructive confirmations (removing a defined flag, changing the type of a flag that may carry values) are skipped instead of showing a QMessageBox. Defaults to true.

◆ table()

QTableWidget * UserFlagsDialog::table ( ) const
inlinenoexcept

The staged definitions table (rows may not be applied yet).

◆ wroteAnyChanges()

bool UserFlagsDialog::wroteAnyChanges ( ) const
inlinenoexcept

True once any Apply/OK round actually changed the engine.


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