What you have done is called "shooting yourself in the leg" .

Use the single inheritance approach ( it is the simple one ). I your class add all the custom code that you add in the ui_*.h.

This is how it needs to be done. Not because I say so, but a lot of people do it.
The Single Inheritance Approach

In this approach, we use the Ui::ImageDialog object as we did in the simple case, but instead of setting up the dialog from the application's main function, we subclass QDialog and set up the user interface from within the constructor. Components used in this way expose the widgets and layouts used in the form to the QDialog subclass, and provide a standard system for making signal and slot connections between the user interface and other objects in your application.
This approach is used in the Calculator Form example.
To ensure that we can use the user interface, we need to include the header file that uic generates before referring to Ui::ImageDialog:
#include "ui_imagedialog.h" The subclass is defined in the following way:
class ImageDialog : public QDialog
{
Q_OBJECT

public:
ImageDialog(QWidget *parent = 0);

private:
Ui::ImageDialog ui;
}; The important features of the class are the private ui object which provides the code for setting up and managing the user interface.
The constructor for the subclass constructs and configures all the widgets and layouts for the dialog just by calling the ui object's setupUi() function. Once this has been done, it is possible to modify the user interface and create items for the combobox:
ImageDialog::ImageDialog(QWidget *parent)
: QDialog(parent)
{
ui.setupUi(this);

ui.colorDepthCombo->addItem(tr("2 colors (1 bit per pixel)"));
ui.colorDepthCombo->addItem(tr("4 colors (2 bits per pixel)"));
ui.colorDepthCombo->addItem(tr("16 colors (4 bits per pixel)"));
ui.colorDepthCombo->addItem(tr("256 colors (8 bits per pixel)"));
ui.colorDepthCombo->addItem(tr("65536 colors (16 bits per pixel)"));
ui.colorDepthCombo->addItem(tr("16 million colors (24 bits per pixel)"));

connect(ui.okButton, SIGNAL(clicked()), this, SLOT(accept()));
connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
} We can connect signals from the user interface widgets to slots in the dialog in the usual way, taking care to prefix the ui object to each widget used.
The main advantages of this approach are its simple use of inheritance to provide a QDialog-based interface, and its encapsulation of the user interface widget variables within the ui data member. We can use this method to define a number of user interfaces within the same widget, each of which is contained within its own namespace, and overlay (or "compose") them. This approach can be used to create individual tabs from existing forms, for example.
Read this http://doc.trolltech.com/4.2/designe...component.html.
Of course, you may also use the multiple inheritance approach.

Regards