[clazy] [Bug 468419] New: Add a check that discourages isNull (in favor of isEmpty)

Giuseppe D'Angelo bugzilla_noreply at kde.org
Wed Apr 12 12:22:29 BST 2023


https://bugs.kde.org/show_bug.cgi?id=468419

            Bug ID: 468419
           Summary: Add a check that discourages isNull (in favor of
                    isEmpty)
    Classification: Developer tools
           Product: clazy
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: wishlist
          Priority: NOR
         Component: general
          Assignee: unassigned-bugs at kde.org
          Reporter: dangelog at gmail.com
                CC: smartins at kde.org
  Target Milestone: ---

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.)

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Unassigned-bugs mailing list