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

A dock widget that displays and edits object attributes using QPropertyModel. More...

#include <propertiespanel.h>

Inheritance diagram for PropertiesPanel:
Collaboration diagram for PropertiesPanel:

Public Slots

void onIdentifyResult (const QList< IdentifyResult > &results)
 
void onObjectEditedExternally (const QString &name)
 
void onOffsetModeChanged ()
 

Signals

void propertyChanged (QObject *object, const QString &propertyName, const QVariant &oldValue, const QVariant &newValue)
 Emitted when the user changes a property value in the view.
 
void objectEdited (const QString &name)
 
void rainfallPlotRequested (const QString &gageId)
 The rain gage "Plot Rainfall…" button was clicked; the main window opens the shared Rainfall Visualization dialog focused on gageId (the bound gage — empty if no adapter is bound).
 

Public Member Functions

 PropertiesPanel (QWidget *parent=nullptr)
 
 ~PropertiesPanel () override
 
void showObject (QObject *object, const QString &title={})
 Switches the panel to show the Q_PROPERTY attributes of object.
 
void showIdentifyResults (const QList< IdentifyResult > &results)
 Shows the attribute results from an identify operation.
 
void showLayerProperties (OpenSWMMVisLayer *layer)
 Shows the editable properties of the given layer.
 
void clear ()
 Clears the panel.
 
void setProject (SWMMModelLayer *layer)
 
void setStatsRegistry (openswmmvis::OutputStatsRegistry *registry)
 
void setActiveResultsLayer (SWMMResultsLayer *layer)
 
void showDataObject (SWMMModelLayer *layer, int objectKind, const QString &name)
 

Detailed Description

A dock widget that displays and edits object attributes using QPropertyModel.

The panel shows:

  • The attributes of identified (clicked) features or SWMM elements.
  • The properties of the currently selected map layer.

It uses QPropertyModel / QPropertyItemDelegate so any Q_PROPERTY exposed by a QObject (layer, feature, SWMM element) is automatically displayed with the correct editor widget (check box, spin box, colour picker, …).

The panel has a layer drop-down so the user can switch between the properties of any of the layers that returned results in the last identify operation.

Constructor & Destructor Documentation

◆ PropertiesPanel()

PropertiesPanel::PropertiesPanel ( QWidget *  parent = nullptr)
explicit

◆ ~PropertiesPanel()

PropertiesPanel::~PropertiesPanel ( )
override

Member Function Documentation

◆ clear()

void PropertiesPanel::clear ( )

Clears the panel.

◆ objectEdited

void PropertiesPanel::objectEdited ( const QString &  name)
signal

Round-4 follow-up 2026-05-12 — emitted after a property- browser edit so the Attribute Table dock can mirror the change. Wired in SWMMVis. Suppressed when the adapter's changed() was triggered by onObjectEditedExternally.

Here is the caller graph for this function:

◆ onIdentifyResult

void PropertiesPanel::onIdentifyResult ( const QList< IdentifyResult > &  results)
slot
Here is the call graph for this function:

◆ onObjectEditedExternally

void PropertiesPanel::onObjectEditedExternally ( const QString &  name)
slot

Round-4 follow-up 2026-05-12 — refresh the bound adapter if its object name matches name, so a table-side edit is reflected in the Property Browser. No-op when no adapter is bound or the name doesn't match.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onOffsetModeChanged

void PropertiesPanel::onOffsetModeChanged ( )
slot

LINK_OFFSETS mode changed: a bound link's offset rows are labelled "Inlet/Outlet Offset" vs "… Elevation", and the label is captured when the adapter is bound, so replay the bind. No-op unless a link is shown.

◆ propertyChanged

void PropertiesPanel::propertyChanged ( QObject *  object,
const QString &  propertyName,
const QVariant &  oldValue,
const QVariant &  newValue 
)
signal

Emitted when the user changes a property value in the view.

Parameters
objectThe source QObject.
propertyNameQ_PROPERTY name.
oldValuePrevious value.
newValueNew value.

◆ rainfallPlotRequested

void PropertiesPanel::rainfallPlotRequested ( const QString &  gageId)
signal

The rain gage "Plot Rainfall…" button was clicked; the main window opens the shared Rainfall Visualization dialog focused on gageId (the bound gage — empty if no adapter is bound).

◆ setActiveResultsLayer()

void PropertiesPanel::setActiveResultsLayer ( SWMMResultsLayer layer)

Bind the project's ACTIVE 1D results layer so the panel's post-run summary rows follow the active run the same way the Attribute Table's dynamics columns do (SWMMVis calls this on tab activation and on every activeResultsLayerChanged). Selects the layer's row in the Stats-source combo — the combo remains a manual override until the active layer next changes — and re-reads the stat rows whenever the bound layer's results are (re)opened or finalized, so a re-run into the same .out refreshes in place. Pass nullptr to fall back to the "(editing engine)" sentinel.

Here is the call graph for this function:

◆ setProject()

void PropertiesPanel::setProject ( SWMMModelLayer layer)

Slice Z.5.3 — bind to the active project's model layer so identify results that resolve to a SWMM node can be shown via a typed SWMMNodePropertyAdapter (editable via existing QPropertyModel auto-delegates). Pass nullptr to detach.

Here is the call graph for this function:

◆ setStatsRegistry()

void PropertiesPanel::setStatsRegistry ( openswmmvis::OutputStatsRegistry registry)

Slice QA.2 — bind the per-project OutputStatsRegistry so the Stats-source combo above the property tree can populate from every loaded SWMMResultsLayer. Pass nullptr to hide the combo (matches today's behaviour for projects with no results loaded yet). Idempotent — repeated calls re-wire signals safely.

Here is the call graph for this function:

◆ showDataObject()

void PropertiesPanel::showDataObject ( SWMMModelLayer layer,
int  objectKind,
const QString &  name 
)

Slice DA.2 — show a non-spatial Data Object (curve, time series, pattern, LID control, pollutant, land use, aquifer, snowpack, control rule, transect, hydrograph group, street, inlet, or rain gage) using the typed property adapter for its kind.

Bypasses the identify-result flow; called directly when an Object Browser leaf is clicked. The kind value is an SWMMObjectRef::ObjectType (cast to int to keep the header forward-declaration-friendly).

Here is the call graph for this function:

◆ showIdentifyResults()

void PropertiesPanel::showIdentifyResults ( const QList< IdentifyResult > &  results)

Shows the attribute results from an identify operation.

Parameters
resultsOne IdentifyResult per layer.
Here is the caller graph for this function:

◆ showLayerProperties()

void PropertiesPanel::showLayerProperties ( OpenSWMMVisLayer layer)

Shows the editable properties of the given layer.

Here is the call graph for this function:

◆ showObject()

void PropertiesPanel::showObject ( QObject *  object,
const QString &  title = {} 
)

Switches the panel to show the Q_PROPERTY attributes of object.

Parameters
objectAny QObject whose Q_PROPERTYs should be displayed. Pass nullptr to clear the panel.
titleOptional title shown in the tab or header.
Here is the caller graph for this function:

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