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

#include <attributetablepanel.h>

Inheritance diagram for AttributeTablePanel:
Collaboration diagram for AttributeTablePanel:

Public Slots

void copySelectionToClipboard ()
 
void onObjectEditedExternally (const QString &name)
 

Signals

void objectEdited (const QString &name)
 

Public Member Functions

 AttributeTablePanel (QWidget *parent=nullptr)
 
 ~AttributeTablePanel () override
 
void setProject (SWMMModelLayer *layer, SelectionManager *selMgr, MapCanvas *canvas=nullptr)
 
void refresh ()
 
void setResultsSource (SWMMResultsLayer *layer)
 
void refreshHeaders ()
 
void showLayerSource (OpenSWMMVisLayer *layer)
 
QString selectionAsTsv () const
 
int deleteObjects (const QStringList &names)
 
bool featureSourceIsEditable () const
 
int deleteSelectedFeatures ()
 
bool categoryIsDeletable () const
 
QAction * copyAction () const
 

Constructor & Destructor Documentation

◆ AttributeTablePanel()

AttributeTablePanel::AttributeTablePanel ( QWidget *  parent = nullptr)
explicit
Here is the call graph for this function:

◆ ~AttributeTablePanel()

AttributeTablePanel::~AttributeTablePanel ( )
override
Here is the call graph for this function:

Member Function Documentation

◆ categoryIsDeletable()

bool AttributeTablePanel::categoryIsDeletable ( ) const

True when the bound category maps to a deletable object kind (junction/outfall/storage/divider/conduit/pump/orifice/weir/outlet/ subcatchment/rain gage); false for data-object categories.

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

◆ copyAction()

QAction * AttributeTablePanel::copyAction ( ) const
inline

The Copy action — surfaced on the panel toolbar and in the right-click menu. It carries no shortcut of its own: Ctrl+C is registered once, on the main window's actionCopy, which routes to the focused panel (a second registration here would make Qt's shortcut map treat Ctrl+C as ambiguous).

◆ copySelectionToClipboard

void AttributeTablePanel::copySelectionToClipboard ( )
slot

Put selectionAsTsv() on the clipboard. No-op when empty.

Here is the call graph for this function:

◆ deleteObjects()

int AttributeTablePanel::deleteObjects ( const QStringList &  names)

Delete the named objects of the current category from the model.

The non-interactive core behind the Delete key / right-click "Delete" (which add a confirmation dialog on top). When a map canvas + undo stack are present the deletes go through DeleteObjectCommand so they are undoable and cascade node→link exactly like the map; otherwise they fall back to the layer's applyXDelete helpers — the SAME mutation the undo command performs, minus the undo record. Names not present, or a non-deletable category (a read-only data-object list), are skipped. Returns the number actually deleted. Kept public and dialog-free so the delete path is unit-testable without a modal, mirroring selectionAsTsv().

Here is the call graph for this function:

◆ deleteSelectedFeatures()

int AttributeTablePanel::deleteSelectedFeatures ( )

Delete the selected rows' features (undoable). Dialog-free, like deleteObjects, so the path is testable without a modal. Returns the number deleted; 0 when the source is not an editable feature layer.

Here is the call graph for this function:

◆ featureSourceIsEditable()

bool AttributeTablePanel::featureSourceIsEditable ( ) const

True when the active source is an editable FeatureLayer in an open edit session AND there is an undo stack to push onto. Gates cell editing and the Delete path for feature layers; every other vector source (shapefile, WFS, …) stays read-only.

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

◆ objectEdited

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

Forwarded from SWMMAttributeTableModel::objectEdited when the user commits a cell edit. Wired by SWMMVis to the Property Browser so both views always show the same engine state.

◆ onObjectEditedExternally

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

Round-4 follow-up 2026-05-12 — refresh the row for name in response to an external edit (e.g. via the Property Browser). No-op if the named object isn't in the current category.

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

◆ refresh()

void AttributeTablePanel::refresh ( )

Rebuild the category combo + reload the table model. Called on modelLoaded.

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

◆ refreshHeaders()

void AttributeTablePanel::refreshHeaders ( )

Re-query the header strip without touching the data or the user's selection. Used when a render-time label changes (LINK_OFFSETS mode flips the offset columns to "… Elevation").

Here is the call graph for this function:

◆ selectionAsTsv()

QString AttributeTablePanel::selectionAsTsv ( ) const

The current selection rendered as TSV: a header line plus one line per selected row, in the view's current sort and column order, hidden columns skipped. Falls back to every visible row (i.e. what the query / show-selected-only filters leave) when no row is selected. Empty string when there is nothing to copy.

Kept separate from copySelectionToClipboard() so the format can be unit-tested without a platform clipboard. Reads through the proxy, so it works for both the SWMM model source and the Z.4 tabular-file source.

Here is the caller graph for this function:

◆ setProject()

void AttributeTablePanel::setProject ( SWMMModelLayer layer,
SelectionManager selMgr,
MapCanvas canvas = nullptr 
)

Bind to the active project — model layer + selection bus + canvas (used for "Zoom to selected"). Pass nulls to detach.

Here is the call graph for this function:

◆ setResultsSource()

void AttributeTablePanel::setResultsSource ( SWMMResultsLayer layer)

Point the post-run "dynamics" columns at a loaded 1D output.

Wired by SWMMVis to the project window's ACTIVE results layer — the run chosen in the Analysis toolbar's "Results (1D)" combo — so the table's right-hand statistics block always describes the run the rest of the GUI is showing. Pass nullptr to fall back to the editing engine (which has no statistics; see SWMMAttributeTableModel::setResultsSource).

Here is the call graph for this function:

◆ showLayerSource()

void AttributeTablePanel::showLayerSource ( OpenSWMMVisLayer layer)

Switch the source combo to layer's entry (a GIS feature layer or tabular layer). Model / results layers keep the current SWMM category selection — the panel is already bound to the model. Called from the layer tree's "Open Attribute Table" action.

Here is the call graph for this function:

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