Enable HiDPI on Windows (#2469)

* Enable HiDPI on Windows

* Fix build with MSVC2019 (use of overloaded operator'=' is ambiguous)

Co-authored-by: Nikolay Zlatev <nik@astrapaging.com>
This commit is contained in:
Nikolay Zlatev
2020-11-11 10:20:22 +02:00
committed by GitHub
parent 7b7cefd382
commit 1dc7ffee4e
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ void RemoteCommitsModel::refresh(const std::string& json_data, const std::string
item->setFont(0, bold_font);
}
parent_id = commit["parent"];
parent_id = commit["parent"].get<std::string>();
}
// Refresh the view
+7
View File
@@ -32,6 +32,13 @@ int main( int argc, char ** argv )
{
#ifdef Q_OS_WIN
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
#endif
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
// In Windows, there is no output to terminal for a graphical application, so we install
// the output to message box, until the main window is shown or the application exits.
qInstallMessageHandler(boxMessageOutput);