Declaring variables - Declare each variable on a separate line
https://wiki.qt.io/Qt_Coding_Style Multiple declarations on the same line is not a valid argument as long as they are forbidden. Asterisk position, imho, should be based on the mental model. X* x - is an identifier that names a variable. It's type is a pointer to X and it's size btw is the same as any other pointer to object. I have just chimed in to ask about the state of introducing automatic coding styling. https://bugreports.qt.io/browse/QTCREATORBUG-22149?jql=text%20~%20%22linter%22 https://bugreports.qt.io/browse/QTCREATORBUG-21877?jql=text%20~%20%22coding%20style%22 чт, 17 окт. 2019 г. в 23:13, Kyle Edwards via Development < development@qt-project.org>: > On Thu, 2019-10-17 at 20:01 +0000, Martin Smith wrote: > > But that argues for not allowing the comma. > > > > QObject* x; > > QObject* y; > > > > I've always done it that way. > > +1 for not allowing the comma. It's not as much of an issue for simple > types (int x, y), but combining it with pointers and references > introduces ambiguity and makes the code less readable - and readability > is, IMHO, far more important than saving a few keystrokes. > > Kyle > _______________________________________________ > Development mailing list > Development@qt-project.org > https://lists.qt-project.org/listinfo/development >
_______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development