On Friday 28 June 2013 14:41:22 Kevin Krammer wrote: > On Friday, 2013-06-28, Pali Rohár wrote: > > I know, so I'm asking if I should remove constructor (and > > compiler will generate one without parent qobject paremeter) > > or move it to public section? > > The compiler will create a default constructor if there would > be no constructor otherwise. > > However, since we are dealing with a QObject subclass here, it > is highly recommended to have all constructors pass the > parent object through to QObject's constructor. > > As Thomas pointed out it does't make any difference call-wise > whether it is public or protected, since the abstract class > can't be instantiated directly anyway. > > I looked at a couple of abstract Qt classes (e.g. > QAbstractItemModel) and they seem to use a public > constructor. > > Cheers, > Kevin
And for example QDBusAbstractAdaptor has constructor protected: http://doc.qt.digia.com/4.7/qdbusabstractadaptor.html -- Pali Rohár pali.ro...@gmail.com
signature.asc
Description: This is a digitally signed message part.