Qt-MissingQObjectMacro¶
Finds QObject derived classes that do not have a Q_OBJECT macro
Required inputs: IR
Reasons to use Q_OBJECT
- Signals and slots
QObject::inheritsqobject_castmetaObject()->className()- Use your custom widget as a selector in Qt stylesheets
Reasons not to use Q_OBJECT
- Templated QObjects
- Compilation time
This check can not be used with pre-compiled headers support.
This check does not have false positives, but it is not included in level ≤ 1
because the missing Q_OBJECT might be intentional.
This rule is based on clazy rule missing-qobject-macro
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
missing_qobject_macro |
Class is missing a Q_OBJECT macro. |
None |
False |
no_macros |
Qt macros are missing in Qt system include files. Either include Qt via user files or disable the advanced toolchain option “no_macro_invocations_for_system_headers”. |
None |
False |
Options¶
This rule shares the following common options: exclude_in_macros, exclude_messages_in_system_headers, excludes, extend_exclude_to_macro_invocations, includes, justification_checker, languages, post_processing, provider, report_at, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
level¶
level : int = 2