1 Attachment(s)
Multiple inheritance problem
I have created a ChartView class that inherits "QChartView" and "QObject".
I need to generate a SIGNAL from the ChartView class and connect to the MainWindow SLOT.
However, currently, I am getting the following error.
"direct base 'QObject' is inaccessible due to ambiguity"
Code:
class ChartView
: public QChartView ,
public QObject{
Q_OBJECT
private:
}
If I don't add QObject, then SIGNAL and SLOT don't work.
Any suggestion?
Re: Multiple inheritance problem
Quote:
Originally Posted by
Mohsin
If I don't add QObject, then SIGNAL and SLOT don't work.
What does this mean? You don't need to derive from QObject since QChartView also has QObject as base class.
1 Attachment(s)
Re: Multiple inheritance problem
Quote:
Originally Posted by
ChristianEhrlicher
What does this mean? You don't need to derive from QObject since QChartView also has QObject as base class.
I am getting errors (shown in the image) even when I use the following code
Code:
class ChartView : public QChartView
{
Q_OBJECT
signals:
void updateGraphOrder();
}
Re: Multiple inheritance problem
What build system do you use? You most likely forgot to include moc_charview.h
Re: Multiple inheritance problem
Did you try running qmake again and then a clean rebuild?
1 Attachment(s)
Re: Multiple inheritance problem
I tried but it didn't work.
The attached image contains the information about my system and Qt Version.