From kde-devel Tue Jun 23 13:01:29 2009 From: David Johnson Date: Tue, 23 Jun 2009 13:01:29 +0000 To: kde-devel Subject: Re: Problem with QT designer Qt3 -> Qt4 Message-Id: <200906230601.29593.david () usermode ! org> X-MARC-Message: https://marc.info/?l=kde-devel&m=124576229605884 On Tuesday 23 June 2009 05:14:57 am Robin Atwood wrote: > This seems to be quite different from QT3 generated code but shouldn't > Ui_ReniceUI at least be inheriting QDialog? Qt4 uic no longer generates a QWidget class. It instead generates a Ui class. This class contains all the child widgets and layouts, along with two functions. On function translates the UI, but the other, setupUi() is the key to everything. It is passed a host widget, and then instantiates all the child widgets, sets their properties, lays them out, and reparents them to the host widget. There are several ways to use this Ui class. The most common is multiple inheritance. Your dialog inherits from both QDialog and your new Ui class. Then in the constructor you call "setupUi(this)". From that point in it should behave just like a Qt3 uic generated file. For example: #include "ui_mydialog.h" class MyDialog: public QDialog, private Ui::MyDialog { MyDialog(QWidget *parent) { setupUi(this); ... } ... }; -- David Johnson >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<