MyPrintDialog::MyPrintDialog(QPrinter* p, QWidget* parent) : QPrintDialog(p, parent) { qDebug() << "MyPrintDialog"; QLayout* l = layout(); if (l == 0) { qDebug() << "NO LAYOUT!"; } else { qDebug() << l->metaObject()->className(); } QVBoxLayout* theLayout = dynamic_cast<QVBoxLayout*>(layout()); if (theLayout) { qDebug() << "LAYOUT FOUND!"; QCheckBox* c = new QCheckBox("Additional checkbox", this); theLayout->addWidget(c); } }