I tried using QDateTime's fromTime_t as follows:
QDateTime t;
time_t elapsedTime;
t.fromTime_t(elapsedTime);
The result is that nothing is assigned to the QDateTime object. However, using the function setTime_t does work (this one isn't static). Is something going on here I'm missing?
fromTime_t
is static and returns a QDateTime
, so you have to use it like this:
time_t elapsedTime;
QDateTime t(QDateTime::fromTime_t(elapsedTime));
or you can do
time_t elapsedTime;
QDateTime t;
t.setTime_t(elapsedTime);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With