Fix various compiler warnings

tst_QDebug: variable is only used conditionally

tst_QTimeZone: fix string literal format

QRhiWidgetPrivate: unused local variable `q`

Change-Id: I8f9d7f86df2ff781f8ab64bee44dbebbe67eb6f3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Ahmad Samir 2025-04-20 15:46:35 +02:00
parent 42ee6adff7
commit 8df6859f08
4 changed files with 3 additions and 4 deletions

View File

@ -875,7 +875,7 @@ void tst_QDebug::qDebugStdUnorderedMap() const
void tst_QDebug::qDebugStdUnorderedSet() const
{
QByteArray file, function;
int line = 0;
[[maybe_unused]] int line = 0;
MessageHandlerSetter mhs(myMessageHandler);
{

View File

@ -2135,7 +2135,7 @@ void tst_QTimeZone::stdCompatibility_data()
qDebug() << "Using tzdb version:" << QByteArrayView(tzdb.version);
for (const std::chrono::time_zone &zone : tzdb.zones)
QTest::addRow(zone.name().data()) << &zone;
QTest::addRow("%s", zone.name().data()) << &zone;
#else
QSKIP("This test requires C++20's <chrono>.");
#endif

View File

@ -24,7 +24,7 @@ public:
int port() { return portnum; }
protected:
void run();
void run() override;
private slots:
void handleConnection();

View File

@ -154,7 +154,6 @@ QPlatformBackingStoreRhiConfig QRhiWidgetPrivate::rhiConfig() const
void QRhiWidgetPrivate::ensureRhi()
{
Q_Q(QRhiWidget);
QRhi *currentRhi = QWidgetPrivate::rhi();
if (currentRhi && currentRhi->backend() != QBackingStoreRhiSupport::apiToRhiBackend(config.api())) {
qWarning("The top-level window is already using another graphics API for composition, "