Why was this needed? You are not casting since m_widget is already of type QWidget.