Qt6/Example-Guideline: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
mNo edit summary
(Replaced content with "Category:Developing Qt::Examples This page is obsolete and deprecated. For Qt 6 information, see Qt Examples Guidelines")
Tags: Replaced Visual edit
 
(75 intermediate revisions by 12 users not shown)
Line 1: Line 1:
''When creating or updating Qt examples, developer should consider the best practises and guidelines listed in this document.
[[Category:Developing Qt::Examples]]
''
This page is obsolete and deprecated. For Qt 6 information, see [[Qt Examples Guidelines]]
 
== Evaluate if the example is meaningful or should it be removed/merged ==
 
'''MANDATORY'''
* Check if there are similar examples for the same topic and consider if both are really needed or should the other one be merged with the other.
* Check also documentation on the topic and if that includes inline code snippet that would be adequate instead of complete example.
 
== No C++ or qml warnings ==
 
'''MANDATORY'''
* Example's C++ code should be by minimum compiled with the same compiler warning flags as Qt.
* Use qmllint for qml code: https://doc-snapshots.qt.io/qt6-dev/qtquick-tool-qmllint.html
* Enable compiler warnings and check if the reported issues are fixable with meaningful effort. 
 
'''RECOMMENDED'''
Consider also the compilation with the more strict warning flags and fix the found issues.
 
GCC
* Use -Wall and consider -Wextra parameter: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
 
Clang
* Use -Weverything compiler parameter: https://clang.llvm.org/docs/UsersManual.html#diagnostics-enable-everything
 
Visual Studio
* Use /Wall compiler parameter: https://docs.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level

Latest revision as of 15:22, 20 November 2024

This page is obsolete and deprecated. For Qt 6 information, see Qt Examples Guidelines