View Full Version : Can't add an object derived from QWidget in a layout.

14th January 2010, 22:20
Hi, i have one widget defined lik this:

class TestWidget: public QWidget, private Ui::TestWidget

I thougt that is it is derived from QWidget, can be added in a layout using ->addWidget().

Is this wrong? How can I put it in the MainWindow?


14th January 2010, 22:55
If i use a cast to QWidget i can insert it, but why i can addWidget(QSpinBox) and cannot addWidget(QSpinBox) ??