#include <attributepickermenu.h>
◆ attributeFrom()
| PlotAttribute openswmmvis::ui::AttributePickerMenu::attributeFrom |
( |
const QAction * |
action | ) |
|
|
static |
Extract the chosen PlotAttribute from a picked action. Returns PlotAttribute::Unknown for the "All attributes" sentinel or when the action is null / unrelated.
- Warning
- Species actions ALSO read as Unknown here (their data is the species name, not an int) — callers offering species must use descriptorFrom, which tells the three cases apart.
◆ createForObjectKind()
Build (and return) a menu of attributes valid for kind. Caller owns the returned menu (set its parent on construction or delete after exec).
Includes an All attributes trailing entry that, when chosen, carries PlotAttribute::Unknown as the action's data() — callers treat that as a request to add one series per attribute.
Mesh kinds (Mesh2DCell / Mesh2DEdge / Mesh2DVertex) get their fixed list from attributesForKind; the caller greys out entries the layer can't serve. Returns nullptr for Kind::Unknown or Kind::Observed (those don't use this picker).
◆ createForSystem()
Build the system-attribute menu (14 entries). Each action's data() carries the PlotAttribute value.
◆ descriptorFrom()
Y2b-2 (amendment D-Y4): extract what the picked action plots — a fixed attribute or a species BY NAME. An INVALID descriptor means the "All attributes" sentinel (or a null action); callers fan out across the run's descriptor list.
◆ execForMeshKind()
Pop a "Plot time series" context menu for a 2D mesh kind at globalPos and return the attributes the user picked — one entry, or every enabled entry when "All attributes" was chosen. Entries availability can't serve (supportsAttribute false) are greyed out with unavailableTip as tooltip; pass nullptr to enable all. Empty on cancel. Blocks in QMenu::exec — call it from a mouse RELEASE handler, never while a button is still down.
The documentation for this class was generated from the following files: