The class generated from the .ui file is not a widget itself, it contains setup code for a widget's content.

So what you do is create a QWidget subclass, have a member of the type of the generated class, and call its setupUi( this ) in the widget subclass' constructor.

As a very, very, dirty hack you could also just instantiate a QWidget instance and call the UI class setupUi method passing that widget instance.

Cheers,
_