Quote Originally Posted by marcel View Post
You can choose between either the single inheritance approach or the multiple inheritance approach. You can read about both of them in the documentation.

Single inheritance:

For this case is a subclass of QMainWindow and contains a member of type Ui::testClass( this is the one generated by uic ).

Right there...

Assuming you have something like Ui::testClass ui;, then ui.setupUi(this) goes in the constructor of the subclass, meaning testSubClass.

The multiple inheritance approach assumes you subclass QMainWindow but also Ui::testClass. Then you have direct access to it's members.

Regards
hi, thanks for the reply. i read all the documentation multiple times, but it is sparse and does not give complete examples, just snippets, and it's especially useless for mainwindows using multiple inheritance. the docs don't discuss the advantages or disadvantages of either approach.

single inheritance is the approach i was taking for converting things to qt4, but the single inheritance approach doesn't seem correct or in line with the way i worked things in qt3. as a subclass, i had access to all members of the base class, which is a necessity. with this single inheritance, i'd have to do so much reprogramming to point to the right members i'd rather become a monk.

honestly i don't even see the benefit of the single inheritance approach. it looks like i have to have the multiple inheritance.

so, i know how to inherit from both classes, but how do the ui::setup commands change for multiple inheritance?
is there any drawback to using multiple inheritance?

thanks again! -- lou