Il 08/03/2015 12:28, Constantin Makshin ha scritto:
Both advantages and disadvantages will come from the fact that MOC won't
generate anything for methods in these sections.

There's an extra pro that comes with that: visibility markers actually come into play.

A slot is always publicly invokable via QMetaObject::invokeMethod or a suitable connection statement; "public/protected/private" only influence its invocation as a normal (member) function.

Instead now you can have "truly private slots" by connecting to private, non-slot member functions. Noone but your class and its friends can use those functions.

(Note that Qt has also another mechanism for that -- Q_PRIVATE_SLOT -- but that doesn't solve the problem, it simply allows to move a slot declaration/definition into the pimpl).

HTH,
--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel. UK +44-1738-450410, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions

Attachment: smime.p7s
Description: Firma crittografica S/MIME

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to