hello all,

I have met a problem while using the Multiple Inheritance with Qt with some codes like this:

Qt Code:
  1. class SomeClass: public ClassFromUI, public MyClassDrivedFromQWiget
  2. {
  3. Q_OBJECT
  4. ....
  5. }
To copy to clipboard, switch view to plain text mode 

the class ClassFromUI is generated by the uic from a .ui file that i cannot change the content. It looks like:
Qt Code:
  1. class ClassFromUI : public QWidget
  2. {
  3. Q_OBJECT
  4. ....
  5. }
To copy to clipboard, switch view to plain text mode 

the class MyClassDerivedFromQWidget writen by me, looks like:

Qt Code:
  1. class MyClassDerivedFromQWidget : public virtual QWidget
  2. {
  3. Q_OBJECT
  4. ....
  5. }
To copy to clipboard, switch view to plain text mode 

when i compile them, i get the following errors:
Qt Code:
  1. ...
  2. ...warning: virtual base 'QWidget' inaccessible in 'SomeClass' due to ambiguity
  3. ...error: 'QObject' is an ambiguous base of 'SomeClass'
To copy to clipboard, switch view to plain text mode 

Can anyone tell me, how to deal with this error???

thanks

kefeng