Re: Private classes and Q_Objects
- Date: Fri, 2 May 2008 22:41:37 +0200
- From: Thiago Macieira <thiago@xxxxxxx>
- Subject: Re: Private classes and Q_Objects
Nathan Bradshaw wrote: >Hi all, I have a situation where I have a library with a private class / >s_ptr arrangement. I need to create an instance of a Q_OBJECT derived > class in the private class. What is the best method of parenting the > Q_OBJECT in the private class? > >Should I derive the private class from Q_OBJECT and make it the parent? >Should I use Q_DECLARE_PUBLIC / Q_Q() to get the private class' parent >(itself a Q_OBJECT derived class) and use that as the parent? The private class(es) should derive from QObject, have the Q_OBJECT macro, but they should have no parent. You'll control the lifetime of that class directly. -- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org PGP/GPG: 0x6EF45358; fingerprint: E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
Attachment:
signature.asc
Description: This is a digitally signed message part.
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
- Follow-Ups:
- Re: Private classes and Q_Objects
- From: Nathan Bradshaw
- Re: Private classes and Q_Objects
- References:
- Private classes and Q_Objects
- From: Nathan Bradshaw
- Private classes and Q_Objects
- From: Nathan Bradshaw
- Private classes and Q_Objects
- Prev by Date: Re: kdepimlibs building error
- Next by Date: Re: kdepimlibs building error
- Previous by thread: Private classes and Q_Objects
- Next by thread: Re: Private classes and Q_Objects
- Index(es):