S
S
sanchas2014-12-05 14:25:14
Qt
sanchas, 2014-12-05 14:25:14

How to implement multiple inheritance in Qt?

As far as I know, multiple inheritance from two or more classes of the Qt library is prohibited due to the presence of a common ancestor of QObject. Is there any way to get around this limitation? I don't want to use aggregation because I have to write methods to access the aggregated object. Does anyone know an elegant solution to this problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DancingOnWater, 2014-12-05
@DancingOnWater

And only the gang of four say it's better to use aggregation than inheritance....
Inheritance is an architectural trick, not a method of code reuse.

T
tugo, 2014-12-05
@tugo

Multiple inheritance is rarely useful.
Show the code, tell us about the task.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question