Qt: Qt 6.8 deprecation fixes

This commit is contained in:
Stenzek 2024-10-18 22:25:31 +10:00
parent 86a28d5dc0
commit 854a109a0f
No known key found for this signature in database
4 changed files with 12 additions and 9 deletions

View File

@ -437,7 +437,9 @@ QVariant GameListModel::data(const QModelIndex& index, int role, const GameList:
if (ge->dbentry && ge->dbentry->release_date != 0) if (ge->dbentry && ge->dbentry->release_date != 0)
{ {
return QStringLiteral("%1").arg( return QStringLiteral("%1").arg(
QDateTime::fromSecsSinceEpoch(static_cast<qint64>(ge->dbentry->release_date), Qt::UTC).date().year()); QDateTime::fromSecsSinceEpoch(static_cast<qint64>(ge->dbentry->release_date), QTimeZone::utc())
.date()
.year());
} }
else else
{ {
@ -514,10 +516,11 @@ QVariant GameListModel::data(const QModelIndex& index, int role, const GameList:
return ge->dbentry ? QtUtils::StringViewToQString(ge->dbentry->genre) : QString(); return ge->dbentry ? QtUtils::StringViewToQString(ge->dbentry->genre) : QString();
case Column_Year: case Column_Year:
return ge->dbentry ? QDateTime::fromSecsSinceEpoch(static_cast<qint64>(ge->dbentry->release_date), Qt::UTC) return ge->dbentry ?
.date() QDateTime::fromSecsSinceEpoch(static_cast<qint64>(ge->dbentry->release_date), QTimeZone::utc())
.year() : .date()
0; .year() :
0;
case Column_Players: case Column_Players:
return static_cast<int>(ge->dbentry ? ge->dbentry->max_players : 0); return static_cast<int>(ge->dbentry ? ge->dbentry->max_players : 0);

View File

@ -100,7 +100,7 @@ void GameSummaryWidget::populateUi(const std::string& path, const std::string& s
QString release_info; QString release_info;
if (entry->release_date != 0) if (entry->release_date != 0)
release_info = release_info =
tr("Released %1").arg(QDateTime::fromSecsSinceEpoch(entry->release_date, Qt::UTC).date().toString()); tr("Released %1").arg(QDateTime::fromSecsSinceEpoch(entry->release_date, QTimeZone::utc()).date().toString());
if (entry->min_players != 0) if (entry->min_players != 0)
{ {
if (!release_info.isEmpty()) if (!release_info.isEmpty())

View File

@ -1078,7 +1078,7 @@ std::optional<bool> MainWindow::promptForResumeState(const std::string& save_sta
msgbox.setWindowModality(Qt::WindowModal); msgbox.setWindowModality(Qt::WindowModal);
msgbox.setText(tr("A resume save state was found for this game, saved at:\n\n%1.\n\nDo you want to load this state, " msgbox.setText(tr("A resume save state was found for this game, saved at:\n\n%1.\n\nDo you want to load this state, "
"or start from a fresh boot?") "or start from a fresh boot?")
.arg(QDateTime::fromSecsSinceEpoch(sd.ModificationTime, Qt::UTC).toLocalTime().toString())); .arg(QDateTime::fromSecsSinceEpoch(sd.ModificationTime, QTimeZone::utc()).toLocalTime().toString()));
QPushButton* load = msgbox.addButton(tr("Load State"), QMessageBox::AcceptRole); QPushButton* load = msgbox.addButton(tr("Load State"), QMessageBox::AcceptRole);
QPushButton* boot = msgbox.addButton(tr("Fresh Boot"), QMessageBox::RejectRole); QPushButton* boot = msgbox.addButton(tr("Fresh Boot"), QMessageBox::RejectRole);

View File

@ -556,8 +556,8 @@ bool OpenGLSwapChain::ResizeBuffers(u32 new_width, u32 new_height, float new_sca
if (m_window_info.surface_width == new_width && m_window_info.surface_height == new_height) if (m_window_info.surface_width == new_width && m_window_info.surface_height == new_height)
return true; return true;
m_window_info.surface_width = new_width; m_window_info.surface_width = static_cast<u16>(new_width);
m_window_info.surface_height = new_height; m_window_info.surface_height = static_cast<u16>(new_height);
OpenGLDevice::GetContext()->ResizeSurface(m_window_info, m_surface_handle); OpenGLDevice::GetContext()->ResizeSurface(m_window_info, m_surface_handle);
return true; return true;