Skip to content

Commit

Permalink
Qt auto scale factor for HiDPI displays (#291)
Browse files Browse the repository at this point in the history
Signed-off-by: Mabel Zhang <[email protected]>
  • Loading branch information
mabelzhang authored Aug 20, 2020
1 parent 8ec8d66 commit 1bc1f2d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gui/Gui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ std::unique_ptr<ignition::gui::Application> 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<ignition::gui::Application>(_argc, _argv);
app->AddPluginPath(IGN_GAZEBO_GUI_PLUGIN_INSTALL_DIR);
Expand Down

0 comments on commit 1bc1f2d

Please sign in to comment.