Inaccessible conversion?

I'm running into a compile error that I'm pretty sure I know the solution to, but I'd like to have it cleared up first:

error C2243: 'type cast' : conversion from 'const NHorizonList *' to 'const QObject *' exists, but is inaccessible


This occurs when I call a static function of another class, using an argument that is a private member of the current class. The member is a derived class of QObject, so the use of a pointer should work, but I'm guessing that since it's a private member, the other class' static function doesn't have access to it and it's conversion.

Is that it? Does that mean I'll have to throw the member into the public portion of the class?
It sounds to me like you have private inheritance and are trying to do something that implies public inheritance. I don't think it relates to any members. but it's difficult to tell without seeing any code.

EDIT:

NHorizonList is derived from QObject, right?

But is it derived publically or privately?
Last edited on
Yep, that was it. I accidentally forgot to put the public modifier before the parent class. Now it's working just fine.

However, my doubt still remains. Does this mean that the grand utility of deriving classes, i.e. the capacity to use a pointer to the parent class as a pointer to the derived class, only applies to public derivations?
Topic archived. No new replies allowed.