Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-35000

text rendered with QOpenglPaintDevice looks scrambled on Windows and Android

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.1.1, 5.2.0 Beta1
    • Fix Version/s: None
    • Component/s: GUI: OpenGL
    • Labels:
    • Environment:
      Qt 5.2-beta1. On Windows I tried with both mingw32 (32 bit) and msvc 2010, nvida GPU.
    • Platform/s:
      Android

      Description

      When trying to render some text using a QOpenglPaintDevice, I get a correct result on linux as well as my Kindle Fire and my Sony Xperia J, but scrambled text on windows and my Samsung Galaxy W. I attach 2 screenshots that shows the incorrect rendering.

      Here is a the code that I used:

      #include <QGuiApplication>
      #include <QQuickWindow>
      #include <QOpenGLPaintDevice>
      #include <QPainter>
      
      void render()
      {
          glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
          QOpenGLPaintDevice device;
          device.setSize(QSize(200, 200));
          QPainter painter(&device);
          painter.beginNativePainting();
          painter.setPen(QColor(0, 0, 255, 255));
          painter.drawText(100, 100, "hello");
          painter.endNativePainting();
      }
      
      int main(int argc, char **argv)
      {
          QGuiApplication app(argc, argv);
          QQuickWindow window;
          window.setClearBeforeRendering(false);
          QObject::connect(&window, &QQuickWindow::beforeRendering, &render);
          window.show();
          return app.exec();
      }
      

        Attachments

        1. main.cpp
          0.7 kB
        2. samsung-galaxy-w.png
          samsung-galaxy-w.png
          11 kB
        3. windows.png
          windows.png
          7 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            sletta Gunnar Sletta
            Reporter:
            guillaumec Guillaume Chereau
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes