Qt-ConnectByName

Do not use “auto-connection slots”

Required inputs: IR

Warns when "auto-connection slots" are used. They are also known as "connect by name", an old and unpopular feature which is not recommended. Consult the official documentation for more information.

These types of connections are very brittle, as a simple object rename would break your code. Since Qt 5 the pointer-to-member-function connect syntax is recommended as it catches errors at compile time.

This check simply warns for any slot named like on_, because even if you are not using .ui files this naming is misleading and not good for readability, as the reader would think you are using auto-connection.

This rule is based on clazy rule connect-by-name

Possible Messages

Key

Text

Severity

Disabled

bad_slot_name

Slots named {} are error prone.

None

False

Options

level

level : int = 0

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