File: README-incorrect-emit.md

package info (click to toggle)
clazy 1.17-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,248 kB
  • sloc: cpp: 23,552; python: 1,450; xml: 450; sh: 237; makefile: 45
file content (9 lines) | stat: -rw-r--r-- 502 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
# incorrect-emit

For readability purposes you should always use emit (or Q_EMIT) when calling a signal.
Conversely, you should not use those macros when calling a non-signal.

clazy will warn if you forget to use emit (or Q_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).