mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-29 13:45:51 +00:00
DolphinQt: Use QFontMetrics::boundingRect instead of QFontMetrics::width
See https://kdepepo.wordpress.com/2019/08/05/about-deprecation-of-qfontmetricswidth/
This commit is contained in:
parent
d89162c8ad
commit
87330ae524
5 changed files with 5 additions and 29 deletions
|
@ -1,20 +0,0 @@
|
|||
// Copyright 2020 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <QFontMetrics>
|
||||
|
||||
// This exists purely to get rid of deprecation warnings while still supporting older Qt versions
|
||||
template <typename... Args>
|
||||
int FontMetricsWidth(const QFontMetrics& fm, Args&&... args)
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
|
||||
return fm.horizontalAdvance(std::forward<Args>(args)...);
|
||||
#else
|
||||
return fm.width(std::forward<Args>(args)...);
|
||||
#endif
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue