On 12/15/2015 5:03 AM, Sorvig Morten wrote:
Hi,

I’d like to provide short update on the changes in this space, an also lay out
some plans and possibilities for the future. Thanks to everyone who has helped
out! New changes:

* @3x support landed, both for Qt Widgets and Qt Quick. Implemented as @Nx
   support, with @9x as a maximum value.

* The internal documentation for scaling in Qt has been updated:
   github.com/qtproject/qtbase/blob/dev/src/gui/kernel/qhighdpiscaling.cpp.

* Added C++ API for enabling/disabling high-dpi scaling:
     Qt::AA_EnableHighDpiScaling
     Qt::AA_DisableHighDpiScaling

   Together with the environment variable (QT_AUTO_SCREEN_SCALE_FACTOR=1 or 0)
   these provide comprehensive support for controlling whether scaling in Qt
   should be enabled or not. Several use cases are supported:

   * User wants to enable scaling (perhaps for “legacy” Qt apps):
       QT_AUTO_SCREEN_SCALE_FACTOR=1
   * User wants disable scaling (there may be a hardware config issue):
       QT_AUTO_SCREEN_SCALE_FACTOR=0
   * Developer wants to enable scaling:
       Qt::AA_EnableHighDpiScaling
   * Developer wants application to work in device pixels and disable scaling:
       Qt::AA_DisableHighDpiScaling

   In case of conflicts between the environment and C++ side the logic is 
‘veto’.

   The actual scale factor applied is controlled by the platform plugin, which
   provides it by overriding QPlatformScreen::pixelDensity() The default
   implementation returns 1. pixelDensity() is currently implemented by the
   android, eglfs, windows, and xcb platform plugins.

What’s next?

5.6 series:

* Public overview documentation update.

* Misc fixing in Widgets and Quick. In particular I would like to land a series 
of
   GraphicsView fixes: https://codereview.qt-project.org/#/c/142920

dev:

* Improve support for fractional scale factors for QtWidgets (render at 2x and 
then
   downscale). Will require OpenGL for the scaling. Prototype at
   https://codereview.qt-project.org/143819 (OS X only).

* Refactor qhighdpiscaling_h API and implementation:
   https://codereview.qt-project.org/#/c/140176

* Improve pixmap versioning support, replacing/extending @Nx and QIcon: 
QTBUG-49820

* Figure out auto-testing: We can run entire tests at a given scale factor, or
   individual test functions can test at a range of scale factors. Or we can do 
both.
   We’ve so far relied on manual tests on actual high-dpi hardware. The 
cross-platform
   scaling layer in Qt Gui now gives us the ability to auto test on any hardware
   (including CI virtual hardware).

If anyone is interested or has input on the above, drop me a note or comment on 
the
mentioned task/changes.

Thanks,
Morten

_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development
Morten:

My comment only deals with vector graphics SVG formats QT.

Instead of worrying about @2x and @3x and trying to generate artwork in all of the sizes, would it not be advantageous to only use SVG vector format and allow the svg plugin to generate and scale at run-time a single svg file in the QRC file instead of having to pre-generate files.

Image
{
    id: gicon
    source: qrc:/img/test.svg
    anchors.fill: parent
}

Pro File:

QT += svg

Outside of the app, in the Android Manifext.xml and IOS, you need to provide pre-generated launcher PNG icons, but inside the app as well?

Your thoughts on projects that use ONLY SVG image resources and not PNG/JPEG?

md




_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to