Summary: | Warn on broken Qt autoconnected slots | ||
---|---|---|---|
Product: | [Developer tools] clazy | Reporter: | Nyall Dawson <nyall.dawson> |
Component: | general | Assignee: | Sergio Martins <smartins> |
Status: | RESOLVED INTENTIONAL | ||
Severity: | wishlist | CC: | eric.lemanissier, smartins |
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | All | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Nyall Dawson
2017-10-07 22:37:22 UTC
Any suggestion on how to implement it ? I suppose clazy needs to look inside the generated ui file and check for matching object names. I'd do it in a much cruder way - look for slots which match the regex "on_(.+)_(.+)", where the first group doesn't match a QObject member or the second group doesn't match a signal for the type of that member. Then we'd catch both errors in the member name AND in the signal name. (In reply to Nyall Dawson from comment #2) > I'd do it in a much cruder way - look for slots which match the regex > "on_(.+)_(.+)", where the first group doesn't match a QObject member or the > second group doesn't match a signal for the type of that member. > > Then we'd catch both errors in the member name AND in the signal name. Matching the first group with QObject member won't work in a lot of cases, as the member can actually be a member of the ui member, depending on qt creator's Qt Class Generation setting. clazy should warn for all auto connected slots, as it's a very awful feature, regardless if they are broken or working. That's implemented in #385476 (connect-by-name) |