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

renderPixmap in QT5.1 does not work as it does in QT 4.8

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.2.1
    • 5.1.0
    • GUI: OpenGL
    • None
    • bd5cea5ba8458ab3d34700999654dbd7d7174084

    Description

      Hello,

      I am in the process of porting my application from QT 4.8 to QT 5.1. This is an openGL application that uses an inherited QGLWidget class similar to the hellogl example provided with the 5.1 distribution.

      See: qtbase/examples/opengl/hellogl

      I have a distribution of this application on several platforms but for right now I am working with the Linux platform openSUSE 12.3.

      My application uses the renderPixmap utility provided with the QGLWidget to generate a QPixmap of the current openGL scene.

      The problem I am having is that the renderPixmap routine is returning an empty image under QT 5.1 and not in QT 4.8

      To test this out I have changed the following routine in the hellogl example

      void Window::keyPressEvent(QKeyEvent *e)
      {
      if (e->key() == Qt::Key_Escape)
      close();
      else QWidget::keyPressEvent(e);

      QPixmap glpixmap = glWidget->renderPixmap (100, 100,false );

      std::cerr<<“KeyEvent Width “<<glpixmap.width()<<” height“<<glpixmap.height()<<” depth “<<glpixmap.depth()<<” “<<std::endl;
      }

      When this example is compiled the height, width and depth of the pixmap are zero.

      Interestingly if I do the same thing with the hellogl example provided with QT 4.8 the pixmap is not empty.

      Could someone offer a suggestion as to why this is happening?

      Thanks,

      Jeff

      Attachments

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

        Activity

          People

            lagocs Laszlo Agocs
            cafun Jeff Franklin
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes