c++ - QTime Buffer Overflow? -
i writing program asks user large number of seconds , waits many seconds. issue waitsecs larger 9999 seconds, launchtime seems become random number. i've outputted waitsecs using qdebug , correct number (even when number larger 9999). help?
qtime launchtime = qtime::currenttime().addsecs(waitsecs);
here code + output:
from qt documentation http://qt-project.org/doc/qt-4.8/qtime.html#addsecs:
qtime qtime::addsecs ( int s ) const
returns qtime object containing time s seconds later time of object (or earlier if s negative).
note time wrap if passes midnight.
consider using qdatetime instead...
Comments
Post a Comment