Andre Poenitz wrote:
On Fri, Aug 25, 2006 at 02:37:58PM +0200, Abdelrazak Younes wrote:
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 {
This is one way to do it out of three canonical versions mentioned in
the docs...
I personally use the
class FloatPlacement : public QWidget
{
private:
Ui::FloatPlacementUi * ui_;
}
approach as this effectively pimpls away everything pulled in by the
ui_*.h files, but it requires an explict constructor.
It's just a matter of taste I suppose.
Yes. When I first ported the dialogs to Qt4, the ui inheritance was the
easiest path because I didn't need to prefix all control access with
ui_->. Afterward I just stick to that convention that's all. Not really
a taste issue for me.
AFAIK, this allows to derive from other kind of widget if needed
(QDialog for example).
All three approaches allow that (nowadays)
Agreed.
Abdel.