diff --git a/src/Gui/Application.h b/src/Gui/Application.h index 060202a880..522ab8e205 100644 --- a/src/Gui/Application.h +++ b/src/Gui/Application.h @@ -203,6 +203,12 @@ public: void hideViewProvider(const App::DocumentObject*); /// Get the view provider of the given object Gui::ViewProvider* getViewProvider(const App::DocumentObject*) const; + /// Get the type safe view provider of the given object + template + T* getViewProvider(const App::DocumentObject* obj) const + { + return freecad_cast(getViewProvider(obj)); + } //@} /// true when the application shutting down