Edwin Leuven wrote:
Angus Leeming wrote:
Given that FloatPlacementUi derives from QWidget:
+ <class>FloatPlacementUi</class>
+ <widget class="QWidget" name="FloatPlacementUi" >

I don't think FloatPlacement needs to derive directly from QWidget:
-class FloatPlacement : public QWidget {
+class FloatPlacement : public QWidget, public Ui::FloatPlacementUi {


that's what i thought as well, but if i remove the inheritance from QWidget

- class FloatPlacement : public QWidget, public Ui::FloatPlacementUi {
+ class FloatPlacement : public public Ui::FloatPlacementUi {

then my compiler gives me this:

Indeed, sorry for my last post Edwin I thought that Angus was proposing to inherit from QWidget and that was the other way around.

I don't know why there is this line in the UI file but I know for sure that Ui classes are _not_ QWidget; there are not even QObject. So this QWidget inheritance is the right thing to do:

 class FloatPlacement : public QWidget, public Ui::FloatPlacementUi {

AFAIK, this allows to derive from other kind of widget if needed (QDialog for example).

Abdel.

Reply via email to