Plain old casting and doubble inheritance do not work as expected. Look at this line:
mw.setCentralWidget((QWidget*)c);
To copy to clipboard, switch view to plain text mode
Try using qobject_cast or dynamic_cast:
mw.setCentralWidget( qobject_cast<QWidget*>(c) );
mw.setCentralWidget( dynamic_cast<QWidget*>(c) );
mw.setCentralWidget( qobject_cast<QWidget*>(c) );
mw.setCentralWidget( dynamic_cast<QWidget*>(c) );
To copy to clipboard, switch view to plain text mode
or just no cast at all:
mw.setCentralWidget( c );
mw.setCentralWidget( c );
To copy to clipboard, switch view to plain text mode
And do try to put the QObject first in the double inheritance.
Bookmarks