Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sensible property/method naming behavior #14

Open
special opened this issue May 17, 2019 · 2 comments
Open

Make sensible property/method naming behavior #14

special opened this issue May 17, 2019 · 2 comments
Labels
api API design and changes documentation go help wanted Extra attention is needed

Comments

@special
Copy link
Contributor

special commented May 17, 2019

There are a variety of weird rules and behaviors around method and property names. Need to decide what behavior actually makes sense and document it.

  • Certain names are disallowed, primarily because the backend QObject uses them. Some of those are fairly generic.
  • The first letter is always made lowercase for QML
    • This leads to awkward results for properties like "URL"
  • Properties can be renamed with the json field tag
  • Setter functions are always set[PropName], with the first letter uppercase
    • Renamed properties from the json tag should use their property name, not field name
  • A field tag to explicitly choose a setter function could be handy
  • Tags in general should be cleaned up a bit
@special special added help wanted Extra attention is needed documentation api API design and changes go labels May 17, 2019
@rburchell
Copy link
Member

This leads to awkward results for properties like "URL"

Qt-side, this would be Url, which would then be lowercased to url -- not a problem. Perhaps the issue is in not respecting the naming rule of not uppercasing an acronym?

@special
Copy link
Contributor Author

special commented May 17, 2019

Which naming rule do you mean, exactly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api API design and changes documentation go help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants