Qt-OldStyleConnect¶
Warns when using old style connects SIGNAL/SLOT, which is slower than using pointer to member syntax
Required inputs: IR
Finds usages of old style connects. Connecting with old style syntax (SIGNAL/SLOT) is much slower than using pointer to member syntax (PMF).
Here is however a non-exhaustive list of caveats you should be aware of:
- You can not disconnect with new-syntax if the connect was made with old-syntax (and vice-versa)
- You can not disconnect from a static slot with new-syntax (although connecting works)
- Difference in behaviour when calling slots of partially destroyed objects (https://codereview.qt-project.org/#/c/83800)
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
Although this check does not have false-positives it is a level2 check, that is because some connects are tricky to convert to PMF syntax and might introduce bugs if you do not know what you are doing.
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
old_style_connect |
Old style connect (SIGNAL/SLOT) is being used. |
None |
False |
Options¶
ignore_private_slots¶
ignore_private_slots : bool = True
level¶
level : int = 0