fix error: 'fromTime_t' is not a member of 'QDateTime' when build with Qt6

QDateTime::fromTime_t
QDateTime::fromSecsSinceEpoch
This commit is contained in:
Passw 2025-12-01 12:02:12 +08:00 committed by GitHub
parent 3baf444452
commit a1a0d067df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -242,8 +242,13 @@ void FriendsDialog::chatMessageReceived(const ChatMessage &msg)
if(!msg.chat_id.isBroadcast())
return;
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
QDateTime sendTime = QDateTime::fromSecsSinceEpoch(msg.sendTime);
QDateTime recvTime = QDateTime::fromSecsSinceEpoch(msg.recvTime);
#else
QDateTime sendTime = QDateTime::fromTime_t(msg.sendTime);
QDateTime recvTime = QDateTime::fromTime_t(msg.recvTime);
#endif
QString message = QString::fromUtf8(msg.msg.c_str());
QString name = QString::fromUtf8(rsPeers->getPeerName(msg.broadcast_peer_id).c_str());