def METHOD_NAME(self, duration: int) -> None:
    """Set the duration in seconds.
    This will convert the given amount of seconds into an amount of days, hours, minutes and seconds.
    Note that this is mostly a workaround for issues with PyQt, as a value type this class should not
    really have a setter.
    """
    if duration < 0:
        self._days = -1
        self._hours = -1
        self._minutes = -1
        self._seconds = -1
    else:
        try:
            duration = round(duration)
        except OverflowError:
            Logger.log("w", "Duration was too large to convert, so resetting it.")
            duration = 0
        # If a Python int goes above the upper bound of C++ int, which is 2^16 - 1, you will get a error when Qt
        # tries to convert the Python int to C++ int:
        #    TypeError: unable to convert a Python 'int' object to a C++ 'int' instance
        # So we make sure here that the number won't exceed the limit due to CuraEngine bug or whatever, and
        # Cura won't crash.
        if int(duration) >= (2**31):
            Logger.log("w", "Duration was too large to convert, so resetting it.")
            duration = 0
        self._days = math.floor(duration / (3600 * 24))
        duration -= self._days * 3600 * 24
        self._hours = math.floor(duration / 3600)
        duration -= self._hours * 3600
        self._minutes = math.floor(duration / 60)
        duration -= self._minutes * 60
        self._seconds = duration
    self.durationChanged.emit()