mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-28 16:55:31 +01:00
21 lines
528 B
C
21 lines
528 B
C
|
// 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
|
||
|
}
|