From fcc6c6d526cc3d1112f9e36e8e1d2640f61f259d Mon Sep 17 00:00:00 2001 From: Mabel Zhang Date: Thu, 20 Aug 2020 12:40:15 -0400 Subject: [PATCH] Qt auto scale factor for HiDPI displays (#291) Signed-off-by: Mabel Zhang --- src/gui/Gui.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/Gui.cc b/src/gui/Gui.cc index 04340d116d..f3fdd9bbda 100644 --- a/src/gui/Gui.cc +++ b/src/gui/Gui.cc @@ -56,6 +56,12 @@ std::unique_ptr createGui( ignmsg << "Ignition Gazebo GUI v" << IGNITION_GAZEBO_VERSION_FULL << std::endl; + // Set auto scaling factor for HiDPI displays + if (QString::fromLocal8Bit(qgetenv("QT_AUTO_SCREEN_SCALE_FACTOR")).isEmpty()) + { + qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1"); + } + // Initialize Qt app auto app = std::make_unique(_argc, _argv); app->AddPluginPath(IGN_GAZEBO_GUI_PLUGIN_INSTALL_DIR);