| Summary: | Add a check that discourages isNull (in favor of isEmpty) | ||
|---|---|---|---|
| Product: | [Developer tools] clazy | Reporter: | Giuseppe D'Angelo <dangelog> |
| Component: | general | Assignee: | Unassigned bugs <unassigned-bugs-null> |
| Status: | REPORTED --- | ||
| Severity: | wishlist | CC: | smartins |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
Qt string-like classes feature two similar but different functions: isNull and isEmpty. There are differences between the two, and the differences are subtle; a null string is always empty but an empty string isn't necessarily null (e.g. QString("") is empty but not null). Usage of isNull is almost always questionable. (One could also extend this to other classes, e.g. QRect, where the null vs. empty semantics are very weird.)