Bug 404330

Summary: don't warn about const signals
Product: [Developer tools] clazy Reporter: Milian Wolff <mail>
Component: generalAssignee: Sergio Martins <smartins>
Status: RESOLVED INTENTIONAL    
Severity: normal CC: smartins
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Milian Wolff 2019-02-14 09:42:02 UTC
cf.: https://stackoverflow.com/questions/39281740/why-are-qt-signals-not-const

when you want to emit a signal from a const method, the signal has to be const. so there is a valid reason for when to make a signal const
Comment 1 Sergio Martins 2019-02-14 11:21:48 UTC
This has been discussed previously, and there's two schools of thought:

The purists say:
- signals are emitted to express that state has changed
- const methods don't change state
- so don't emit from const methods

The rebels say:
- Yeah, but I'm keeping state also in some global variables as I don't care about OOP so much
- And I can change these global variables from any const method


So the only solution is for you to disable the check