Hi,

since current master allows for using qt5 only features in Creator's source 
code, I propose the following (independent) changes/additions to our coding 
style.

** Qt5 connects vs Qt4 connects

- Prefer to use qt5 style connects with member function pointers to the qt4 
style of using SIGNAL and SLOT macros. 

- Avoid overloading signals or slots
- Avoid calling connect via "object->connect()"
- Be careful with lambda slots

Reasons:
 The qt5 connects are type checked at compile time, which eliminates a huge
 error source. Also the code model can understand them better than the SIGNAL
 and SLOT macros.

** Qt Logging Framework
- This is the preferred solution for logging in Creator.

Reasons: This allows for one way to disable/enable logging for all of Creator.


** QRegularExpression
- Prefer to use QRegularExpression to QRegExp, except if you need QRegExp's
  features, e.g. wildcard matching.
- If the code is performance critical measure which regular expression engine
  is faster.

Reasons:
QRegularExpression has a better api and a more commonly used pattern syntax. 
In general performance should be better, but if it matters, you need to 
measure.

** QStringLiteral
- Prefer to use instead of QString::fromLatin1()
- QLatin1String is still fine to use, if you don't need a QString

Reasons:
There's no huge difference to using QStringLiteral or not.

daniel
_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qt-creator

Reply via email to