Qt-IncorrectEmit

The emit (or Q_EMIT) macro shall be used iff emitting a signal

Required inputs: IR

The emit (or Q_EMIT) shall be used if and only if a signal is emitted.

This rule will warn if you forget to use emit or if you use them on a non-signal.

Additionally, it will warn when emitting a signal from a constructor, because there's likely nothing connected to the signal yet (it could happen though, if the constructor itself, or something called by it, connects to that signal).

This rule is based on clazy rule incorrect-emit

Possible Messages

Key

Text

Severity

Disabled

emit_in_constructor

Emitting inside constructor probably has no effect

None

False

emit_non_signal

Emit macro being used with non-signal {}

None

False

emit_signal_without_macro

Missing emit macro on signal call {}

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

level

level : int = 1

Importance level of the rule as given for clazy. 0 is most desirable, higher values fall off in quality.