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

GL_UNPACK_ALIGNMENT cause drawText render corrupted image

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P1: Critical
    • None
    • 5.7, 5.8, 5.9.1, 5.10.0
    • GUI: OpenGL
    • None

    Description

      The following code render corrupted text image if  GL_UNPACK_ALIGNMENT was set to 1. 
      (was tested only on windows 10)

      class frmMainGLWnd: public  QOpenGLWidget{
      ...
      }
      
      void frmMainGLWnd::paintGL()
      {
      
      
         glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
         QPainter painter(this);
         painter.setRenderHint(QPainter::Antialiasing);
      
         painter.save();
      
         QFont font = QApplication::font();
         font.setPixelSize(22);
         painter.setFont(font);
         painter.drawText(0,0,painter.window().width(),painter.window().height(),Qt::AlignCenter,
                                         tr("Qt by\nThe Qt Company"));
         painter.restore();
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lagocs Laszlo Agocs
            bialk bialk
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes