C++ (Qt) QWizardPage *page = qobject_cast<QWizardPage*>(widget); if (!page) { uiLibWarning(QCoreApplication::translate("QAbstractFormBuilder", "Attempt to add child that is not of class QWizardPage to QWizard.")); return false; }