You don't need to call Q_DECLARE_METATYPE on your custom widget - since it is a QObject already (its a sublcass of QStackedWidget).
Q_DECLARE_METATYPE is for non Qt types that you would like to add to use with the signal slot system and QVariant usage.
Bookmarks