Skip to content

HiDPI on Windows #2468

@sandman7920

Description

@sandman7920

Describe the new feature

It will be nice HiDPI to be enabled by default.

int main( int argc, char ** argv )
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
    QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
    QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
#endif
    QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);

Additional info

Currently one could use QT_AUTO_SCREEN_SCALE_FACTOR and QT_SCALE_FACTOR_ROUNDING_POLICY environment variables, but I'm not sure how many people know about them..

Screenshots

Enabled
image

Disabled
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions