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

            Bug ID: 385801
           Summary: favor function taking or returning std::chrono types
           Product: clazy
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: unassigned-b...@kde.org
          Reporter: eric.lemaniss...@gmail.com
                CC: smart...@kde.org
  Target Milestone: ---

Some members function of Qt classes have one overload taking time as plain
integer, and another taking time as std::chrono::duration or
std::chrono::time_point. Plain integers are error prone, because the unit is
implicit, so one must refer to the doc to make sure there is no error. Clazy
could warn the usage of the plain integer overloads, and propose a fixit. 
in QTimer: setInterval, singleShot, start
in QDeadlineTimer: Constructor, operator=, setDeadline, setRemainingTime,
operator+, operator+=
in QMutex: tryLock can be replaced with try_lock_for or try_lock_until
QObject::startTimer

The other case which could be ambiguous is function returning integer, which
can be replaced with another returning a std::chrono::duration
in QTimer, interval can be replaced with intervalAsDuration. remainingTime can
be replaced with remainingTimeAsDuration
in QDeadLineTimer deadline can be replaced with templated deadline.
remainingTime and remainingTimeNSecs can be replaced with
remainingTimeAsDuration

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to