[Qt-interest] how to create a class based on 2 base classes which are both based on QObject

Vincent Cai wcai at cypress.com
Thu Oct 13 08:40:12 CEST 2011


Hi,

         I want to create a class based on 2 base classes which are both based on QObject, and then the compiler report error shown below:

debug\/../../MapViewer/TSA/TSAFile/TSAFile.h:9: warning: direct base 'QObject' inaccessible in 'TSAFile' due to ambiguity
debug\moc_TSAFile.cpp: In member function 'virtual const QMetaObject* TSAFile::metaObject() const':
debug\moc_TSAFile.cpp:51: error: 'QObject' is an ambiguous base of 'TSAFile'
debug\moc_TSAFile.cpp:51: error: 'QObject' is an ambiguous base of 'TSAFile'
debug\moc_TSAFile.cpp: In member function 'virtual void* TSAFile::qt_metacast(const char*)':
debug\moc_TSAFile.cpp:61: error: cannot call member function 'virtual void* QObject::qt_metacast(const char*)' without object
debug\moc_TSAFile.cpp: In member function 'virtual int TSAFile::qt_metacall(QMetaObject::Call, int, void**)':
debug\moc_TSAFile.cpp:66: error: cannot call member function 'virtual int QObject::qt_metacall(QMetaObject::Call, int, void**)' without object

         How to solve it?

Thanks,
Vincent.

________________________________
This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20111013/8d82fbfe/attachment.html 


More information about the Qt-interest-old mailing list