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. Why does QPainter with underlying OpenGL module make some graphics items so bluray?
Forum Updated to NodeBB v4.3 + New Features

Why does QPainter with underlying OpenGL module make some graphics items so bluray?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 561 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.
  • Y Offline
    Y Offline
    Yanguam Siliagim
    wrote on last edited by
    #1

    Hi, all! i wanna use OpenGL for handware acceleration, but a phenomenon troubled me. Some items in graphics scene became bluray, and they were very clear before I use OpenGL. What troubled me more, the other items are as clear as before.
    Details:

    The item in the first picture is painted by Qt native GUI module. It's very clear.

    !https://cloud.githubusercontent.com/assets/3531837/3713610/80a3080c-1577-11e4-8c12-77b6d964ffac.jpg(Image1)!

    The following pictures show the graphics painted by underlying OpenGL module:

    The one below is part of my scene and has the same quality with that painted by native module. It works normally as before.

    !https://cloud.githubusercontent.com/assets/3531837/3713609/80a29886-1577-11e4-9860-1acf5103ec6a.jpg(Image2)!

    But this one is a terrible blur. This item and the item in Image1 are both instances of the same subclass of QGraphicsObject. Pixmap loaded is as clear as those image1 actually.

    !https://cloud.githubusercontent.com/assets/3531837/3713619/1afdee1c-1578-11e4-9454-fa31902f4539.jpg(Image3)!

    I used the codes below to set OpenGL as underlying module to render my view:

    @
    FitView(QGraphicsScene *scene) : QGraphicsView(scene) { //constructor
    setSceneRect(Config.Rect); //Config saves user's setting data
    setRenderHints(QPainter::TextAntialiasing | QPainter::Antialiasing);

    #ifndef QT_NO_OPENGL
    if (QGLFormat::hasOpenGL()) {
    QGLWidget *widget = new QGLWidget(QGLFormat(QGL::SampleBuffers));

            setViewport(widget);
            setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
        }
    

    #endif
    }
    @

    Thank you for your concern!

    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