QGraphicsObject uses multiple inheritance?
-
That is the question, in the documentation appear this: "QGraphicsObject":http://qt-project.org/doc/qt-4.8/qgraphicsobject.html - Inherits: QObject and QGraphicsItem.
-
Yes, what's wrong with this?
[quote author="Mariø™" date="1340064631"]That is the question, in the documentation appear this: "QGraphicsObject":http://qt-project.org/doc/qt-4.8/qgraphicsobject.html - Inherits: QObject and QGraphicsItem.[/quote]
BYW, many other class use multiple inheritance too. such as
@
class QWidget : public QObject, public QPaintDevice
@ -
The multiple inheritance restriction in Qt only applies to QObject, which means that you cannot directly or indirectly inherit from multiple QObject classes.
-
1+1=2, Lukas Geyer Thks!
I did read about multiple inheritance, and a lot of people says that is not good use it. But I think that If you know how to use, you can use it. Qt Framework is an example of this argument.
-
Multiple inheritance is not bad at all, it just requires that you know what you are doing.
But this is true for a lot of other stuff in C++ as well ;-)