10c3b9cf5c
Add support for HiDPI in the management frontend This does not fix rendering in guest windows https://doc.qt.io/qt-5/qpainter.html#drawing-high-resolution-versions-of-pixmaps-and-images OBS-URL: https://build.opensuse.org/request/show/442920 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=295
31 lines
1.2 KiB
Diff
31 lines
1.2 KiB
Diff
Index: VirtualBox-5.1.10/src/VBox/Frontends/VirtualBox/src/main.cpp
|
|
===================================================================
|
|
--- VirtualBox-5.1.10.orig/src/VBox/Frontends/VirtualBox/src/main.cpp 2016-11-21 18:31:06.000000000 +0100
|
|
+++ VirtualBox-5.1.10/src/VBox/Frontends/VirtualBox/src/main.cpp 2016-11-30 14:04:31.028269344 +0100
|
|
@@ -446,6 +446,12 @@ extern "C" DECLEXPORT(int) TrustedMain(i
|
|
qInstallMsgHandler(QtMessageOutput);
|
|
#endif /* QT_VERSION < 0x050000 */
|
|
|
|
+#if QT_VERSION >= 0x050600
|
|
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
+#endif
|
|
+#if QT_VERSION >= 0x050700
|
|
+ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
|
+#endif
|
|
/* Create application: */
|
|
QApplication a(argc, argv);
|
|
|
|
@@ -603,6 +609,12 @@ int main(int argc, char **argv, char **e
|
|
/* Initialization failed: */
|
|
if (RT_FAILURE(rc))
|
|
{
|
|
+#if QT_VERSION >= 0x050600
|
|
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
+#endif
|
|
+#if QT_VERSION >= 0x050700
|
|
+ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
|
+#endif
|
|
/* We have to create QApplication anyway
|
|
* just to show the only one error-message: */
|
|
QApplication a(argc, &argv[0]);
|