1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Mon, 16 Dec 2024 16:01:44 +0100
Subject: qt: use QString::arg() rather than QString::sprintf()
It's deprecated and one of the replacement suggested in the doc [^1].
QString::asprint() might be the more logical choice, but it's also not recommended [^2].
[^1] https://doc.qt.io/qt-5/qstring-obsolete.html#sprintf
[^2] https://doc.qt.io/qt-5/qstring.html#asprintf
---
modules/gui/qt/dialogs/bookmarks.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/gui/qt/dialogs/bookmarks.cpp b/modules/gui/qt/dialogs/bookmarks.cpp
index 1fb05e3..186b4d5 100644
--- a/modules/gui/qt/dialogs/bookmarks.cpp
+++ b/modules/gui/qt/dialogs/bookmarks.cpp
@@ -146,7 +146,7 @@ void BookmarksDialog::update()
QStringList row;
row << QString( qfu( pp_bookmarks[i]->psz_name ) );
row << qfu("-");
- row << QString().sprintf( "%02u:%02u:%06.3f", hours, minutes, seconds );
+ row << QString( "%1:%2:%3" ).arg( hours, 2, 10, QChar('0')).arg( minutes, 2, 10, QChar('0')).arg(seconds, 10, 'f', 3, QChar('0'));
QTreeWidgetItem *item = new QTreeWidgetItem( bookmarksList, row );
item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable |
|