Warning, /sdk/clazy/docs/checks/README-const-signal-or-slot.md is written in an unsupported language. File is not indexed.
0001 # const-signal-or-slot 0002 0003 Warns when a signal or non-void slot is const. 0004 0005 This aims to prevent unintentionally marking a getter as slot, or connecting to 0006 the wrong method. 0007 0008 For signals it's more of a minor issue. Prevents you from emitting signals from 0009 const methods, as these methods shouldn't change state, and a signal implies state 0010 was changed. Helps minimizing having global state (which is the only state you can 0011 change from a const method). 0012 0013 Warns for the following cases: 0014 0015 - non-void const method marked as slot 0016 - const method marked as signal 0017 - connecting to a method which isn't marked as slot, is const and returns non-void 0018 0019 For exposing methods to QML prefer either Q_PROPERTY or Q_INVOKABLE.