From bee0ec26812f28e97bd1520565229b1885b0de32 Mon Sep 17 00:00:00 2001 From: Greg Date: Fri, 20 Mar 2026 15:54:42 +1300 Subject: [PATCH] Fix PlotWidget moveTo/position resolving to empty EventInterface stubs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PlotWidgetSuper inherits from both ItemT (via Item) and RenderNativeWindow (via EventInterface). Both chains define moveTo() and position(), but classdesc resolves to EventInterface's empty implementations rather than Item's working ones. This makes PlotWidget::moveTo() silently no-op via the REST API, and position() always returns {0,0} — preventing programmatic positioning of plot widgets. Add explicit overrides in PlotWidget that delegate to Item::moveTo() and Item::x()/y(), following the existing disambiguation pattern used for width() and height(). Fixes tickets:#1918 --- model/plotWidget.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/model/plotWidget.h b/model/plotWidget.h index daa758d59..3d2d50c29 100644 --- a/model/plotWidget.h +++ b/model/plotWidget.h @@ -194,6 +194,12 @@ namespace minsky void onMouseLeave() override {valueString="";} /// @} + /// @{ Disambiguate EventInterface vs Item — classdesc resolves to + /// EventInterface's empty stubs otherwise (tickets:#1918) + void moveTo(float x, float y) override {Item::moveTo(x,y);} + std::vector position() const override {return {Item::x(), Item::y()};} + /// @} + /// export the plotted data as a CSV file // implemented as a single argument function here for exposure to TCL void exportAsCSV(const string& filename) {ecolab::Plot::exportAsCSV(filename);}