Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将 a 转换QTime为秒?我已经手动设置了时间time.setHMS(0,1,0);
QTime
time.setHMS(0,1,0);
现在,当我将此变量time转换为时integer,我想要 60 秒。我该如何做到这一点?
time
integer
你可以这样做:
int seconds = QTime(0, 0, 0).secsTo(time);
尝试使用int seconds = QTime(0,0).secsTo(time);它在 Qt 5.3.0 中有效
int seconds = QTime(0,0).secsTo(time);