GLib/GObject+C as the lingua franca?
nf2 at scheinwelt.at
Wed Jul 30 17:08:07 BST 2008
Thiago Macieira wrote:
>>> If you want copiable things, use pointers. I'm implementing a generic
>>> pointer-holding class with atomic reference-counting for Qt 4.5, so
>>> you don't have to write anything.
>> That's cool. Taking the above example, would something like this be
>> QList<QRefCountedPointer<QMount>> VolumeMonitor::getMounts()
Will the refcounter be inside QObject or inside the pointer-holding class?
Because in the latter case you would loose the refcount as soon as you
just pass the pointer to a function or try to cast the pointer:
QRefCountedPointer<A> a = new A();
QRefCountedPointer<B> = dynamic_cast<B*> a.p;
More information about the kde-core-devel