我将macOS升级到10.14.6,现在QT屏幕出现故障,使用旧的10.14.5,我为一台显示器获得的几何形状与Quarz API完全相同(l = 7200,t = 0,r = 9120 ,b = 1080),升级到10.14.6后,硬件相同,来自Quartz的结果与上面相同,但获得的QT为 (l = 7200,t = -180,r = 9119,b = 899),此显示器是1080P显示器。
auto allScreens = QGuiApplication::screens();
INFO_LOG( "Total screens: %d", allScreens.count() );
for ( auto i = 0; i < allScreens.count(); i++ )
{
auto thisScreen = allScreens.at( i );
if ( thisScreen->name() == "MyDisplay" )
{
auto rect = thisScreen->geometry();
m_window->move( rect.x(), rect.y() );
INFO_LOG(
"Found the monitor (x=%d, y=%d, w=%d, h=%d) and put my application window on it",
rect.x(),
rect.y(),
rect.width(),
rect.height() );
break;
}
}