In building my classes, I have noticed that I have not been very consistent about naming my boolean returns. In Qt; I notice that many of their classes use the is prefix, but checking their coding style and conventions, there is no explicit mention that I have seen thus far.

Does the Qt project use a standard or metric for determining when to affix this is prefix to boolean returns (If so, what is it?)? Or do they play it by ear and just leave it to the developer's discretion?

  • Why would you want a naming convention that is project-specific? Use the same convention that your programming language uses (unless QT has bindings that assume some particular naming scheme). – Robert Harvey Oct 17 '16 at 16:25
  • @RobertHarvey I write libraries that I plan to release open-sourced into the Qt community, with the prefix Q to the front of it. I would like to follow their coding standards as best as I can to offer a consistent experience with other Qt Libraries. I'm also interested if they have a rational or principle behind it. – Akiva Oct 17 '16 at 16:33
  • Have you asked the QT community yet? – Robert Harvey Oct 17 '16 at 17:40
  • @RobertHarvey I was just going to ask here first, figuring the Qt tag would suffice. If no one answered, I would just paste the link in the IRC channel. I like having questions instead of asking the IRC directly, so they don't need to be asked again by anyone else wondering. I hope you understand. – Akiva Oct 17 '16 at 17:48
  • 2
    I would avoid using the prefix Q for your own classes - even if you use namespaces, it will still cause confusion if Qt publish their own class with the exact same name - stackoverflow.com/questions/2921915/… – HorusKol Oct 17 '16 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.