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 and chapulina committed Mar 10, 2021
1 parent c06874c commit fcc6c6d
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 @@ -56,6 +56,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 fcc6c6d

Please sign in to comment.