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

-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to