[Development] isValid() as a property

Hausmann Simon Simon.Hausmann at digia.com
Fri Nov 29 20:19:53 CET 2013

Imho isValid is fine, but generally I would suggest a more context specific name, i.e. locationKnown for example.

Think about how much sense "valid" makes in the context of the caller code and see of you can find a better name perhaps.


Fra: Tony Van Eerd
Sendt: 20:16 fredag 29. november 2013
Til: development at qt-project.org
Emne: [Development] isValid() as a property

Is it common/uncommon/unheard-of to have a 'valid' property:

Q_PROPERTY( bool valid READ isValid NOTIFY validChanged )

I'm thinking about classes like 'DeviceLocation' which would update with GPS changes, but at some point might just become invalid (or start invalid, until GPS turns on, etc).

So should isValid() only be used for 'typical' cases of, like default-constructed value-types, or is it fine as a property?

This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

Development mailing list
Development at qt-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131129/3067d03c/attachment.html>

More information about the Development mailing list