hello all,
I have met a problem while using the Multiple Inheritance with Qt with some codes like this:
class SomeClass: public ClassFromUI, public MyClassDrivedFromQWiget
{
Q_OBJECT
....
}
class SomeClass: public ClassFromUI, public MyClassDrivedFromQWiget
{
Q_OBJECT
....
}
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:
{
Q_OBJECT
....
}
class ClassFromUI : public QWidget
{
Q_OBJECT
....
}
To copy to clipboard, switch view to plain text mode
the class MyClassDerivedFromQWidget writen by me, looks like:
class MyClassDerivedFromQWidget
: public virtual QWidget{
Q_OBJECT
....
}
class MyClassDerivedFromQWidget : public virtual QWidget
{
Q_OBJECT
....
}
To copy to clipboard, switch view to plain text mode
when i compile them, i get the following errors:
...
...warning: virtual base 'QWidget' inaccessible in 'SomeClass' due to ambiguity
...error: 'QObject' is an ambiguous base of 'SomeClass'
...
...warning: virtual base 'QWidget' inaccessible in 'SomeClass' due to ambiguity
...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
Bookmarks