Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Various DPI and QtQuick Designer



  • Hi,

    I develop an application on iOS, Android, MacOS and Windows and i managed to handle various non integer DPI without glitches.
    I do it by specifying every sizes in iPad Retina resolution (264dpi) and a javascript function like this :

    function dp(value)
    {
    return Math.ceil(value * (currentDPI / 264))
    }

    Rectangle {
    width: dp(200)
    }

    It works realy great but i can't use the QtQuick Designer because it can't handle javascript function (Functions are not supported in a Qt Quick UI form. (M222))

    I know there is the QT_SCALE_FACTOR to do that but it create glitches with non integer scale factor because it doesn't round each value to align them on whole pixel.

    I must have missed something. Qt is meant to do cross platform, so there must be a good way to do this.

    Thank you.


Log in to reply