diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index 7559979f330..8f3081e276c 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -322,7 +322,10 @@ QDpi QIOSScreen::logicalBaseDpi() const qreal QIOSScreen::devicePixelRatio() const { #if defined(Q_OS_VISIONOS) - return 2.0; // Based on what iPad app reports + // Based on what iPad app reports, and what Apple + // documents to be the default scale factor on + // visionOS, and the minimum scale for assets. + return 2.0; #else return [m_uiScreen scale]; #endif diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm index 932b4eca603..cc4b92b92b2 100644 --- a/src/plugins/platforms/ios/quiview.mm +++ b/src/plugins/platforms/ios/quiview.mm @@ -139,6 +139,14 @@ inline ulong getTimeStamp(UIEvent *event) }; } #endif + +#if defined(Q_OS_VISIONOS) + // Although the "Drawing sharp layer-based content in visionOS" docs + // claim that by default a CALayer rasterizes at a 2x scale this does + // not seem to be the case in practice. So we explicitly set the view's + // scale factor based on the screen, where we hard-code it to 2.0. + self.contentScaleFactor = self.platformWindow->screen()->devicePixelRatio(); +#endif } return self;