User Tools

Site Tools


best_practices

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
best_practices [2016/03/14 12:29] jmgrbest_practices [2016/03/14 12:34] jmgr
Line 5: Line 5:
 ==== Tips & tricks ==== ==== Tips & tricks ====
  
-=== Always initialise primitive variables (other types do not require this) ===+=== Always initialize primitive variables (other types do not require this) ===
  
 <code cpp> <code cpp>
Line 14: Line 14:
 // Good // Good
 int myVariable{}; int myVariable{};
-std::string myString; // std::string is not a primitive variable, so initialisation is optional+std::string myString; // std::string is not a primitive variable, so initialization is optional
 </code> </code>
  
Line 335: Line 335:
 </code> </code>
  
-When dealing with QObject-based classes you should use qobject_cast.+When dealing with QObject-based classes you should use [[http://doc.qt.io/qt-5/qobject.html#qobject_cast|qobject_cast]].
  
 === Header files should not depend on other #includes === === Header files should not depend on other #includes ===
best_practices.txt · Last modified: 2023/04/25 16:52 by 127.0.0.1