This reverts commit 41c8ec56e0e1b231e089d4cc6bc45b0b4615e499. Does not work due to code relying on getting the non-const Ptr from the widget. Further refactoring is needed.