Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QGraphicsView has all corresponding QGraphicsItems blurry due to AA_EnableHighDpiScaling flag
Forum Updated to NodeBB v4.3 + New Features

QGraphicsView has all corresponding QGraphicsItems blurry due to AA_EnableHighDpiScaling flag

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 256 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BornOfIron
    wrote on last edited by BornOfIron
    #1

    Hello,

    I am attempting to use a third party library that uses QGraphicsView / Scene / Items. The application we use uses the EnableHighDpiScaling flag, however this causes all the QGraphicsItems that are rendered in this third-party library to appear blurry. I tried setting the following flags on the graphics view:

    view_->setRenderHint(QPainter::TextAntialiasing, true);
    view_->setRenderHint(QPainter::SmoothPixmapTransform, true);
    view_->setRenderHint(QPainter::HighQualityAntialiasing, true);
    

    I also attempted to do this transformation to the view:

    QScreen *screen = QApplication::primaryScreen();
    qreal dpiScaleFactor = screen->devicePixelRatio(); 
    view->setTransform(QTransform::fromScale(dpiScaleFactor, dpiScaleFactor));
    

    None of these seem to fix the issue. What is the correct way to approach an issue like this? I want to either disable DPI scaling specifically for this graphics view, or somehow get it to scale the items properly.

    Note: we are using Qt 5.12. Plans to upgrade to 6 early next year.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      What happens if you use OpenGL for the viewport ?
      One thing to keep in mind is 5.12 is obsolete and the HighDPI support has greatly improved since then.
      Can you try with 5.15 to check if it goes better with that version since Qt 6 is only for next year ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved