Qt Widgets and derived classes
问题 I am wondering if there is a way to do this. I create a Qt Application (using Creator 3.6.1, Qt 5.6.0). I add a widget to the main window. For example a QGraphicsView called myView. I create a C++ class derived from QGraphicsView (called DerivedView) code of DerivedView class: class DerivedView : public QGraphicsView { ... I would like my new DerivedView class to control this widget. I can access a pointer to the object through ui->myView. Is there any way to do get my derived class to work