mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-18 18:26:27 +01:00
Simplify wstring to QString conversion
This commit is contained in:
parent
a06da596e5
commit
5dbabef355
@ -5,8 +5,6 @@
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
#include "Common/StringUtil.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <OptionParser.h>
|
#include <OptionParser.h>
|
||||||
@ -104,16 +102,16 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Get the default system font because Qt's way of obtaining it is outdated
|
// Get the default system font because Qt's way of obtaining it is outdated
|
||||||
NONCLIENTMETRICS metrics = {};
|
NONCLIENTMETRICSW metrics = {};
|
||||||
LOGFONT& logfont = metrics.lfMenuFont;
|
LOGFONTW& logfont = metrics.lfMenuFont;
|
||||||
metrics.cbSize = sizeof(NONCLIENTMETRICS);
|
metrics.cbSize = sizeof(metrics);
|
||||||
|
|
||||||
if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(metrics), &metrics, 0))
|
if (SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(metrics), &metrics, 0))
|
||||||
{
|
{
|
||||||
// Sadly Qt 5 doesn't support turning a native font handle into a QFont so this is the next best
|
// Sadly Qt 5 doesn't support turning a native font handle into a QFont so this is the next best
|
||||||
// thing
|
// thing
|
||||||
QFont font = QApplication::font();
|
QFont font = QApplication::font();
|
||||||
font.setFamily(QString::fromStdString(UTF16ToUTF8(logfont.lfFaceName)));
|
font.setFamily(QString::fromStdWString(logfont.lfFaceName));
|
||||||
|
|
||||||
font.setItalic(logfont.lfItalic);
|
font.setItalic(logfont.lfItalic);
|
||||||
font.setStrikeOut(logfont.lfStrikeOut);
|
font.setStrikeOut(logfont.lfStrikeOut);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user