diff --git a/include/app/ModuleWidget.hpp b/include/app/ModuleWidget.hpp index 7eab7a53..ac01720b 100644 --- a/include/app/ModuleWidget.hpp +++ b/include/app/ModuleWidget.hpp @@ -31,7 +31,13 @@ struct ModuleWidget : widget::OpaqueWidget { plugin::Model* getModel(); void setModel(plugin::Model* model); + /** Returns the attached Module. */ engine::Module* getModule(); + /** Returns the attached Module, casted to the given Module type. */ + template + TModule* getModule() { + return dynamic_cast(getModule()); + } /** Associates this ModuleWidget with the Module. Transfers ownership. */