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

[REG 5.5.1->5.6 RC] iOS: When using QOpenGLWidget, any other widgets are displayed as black

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.9
    • 5.6.0 RC, 5.6.0
    • QPA
    • Xcode 7.2.1, iOS 9.2.1
    • iOS/tvOS/watchOS

    Description

      On iOS, when I create a QOpenGLWidget and any other Qt Widget (e.g. QPushButton), the other widget is displayed as black. The bug can also be observed on iOS simulator.

      Here is a minimalist code to produce the bug:

      #include <QApplication>
      #include <QMainWindow>
      #include <QOpenGLWidget>
      #include <QPushButton>
      
      class GLWidget : public QOpenGLWidget
      {
      public:
          explicit GLWidget(QWidget *parent = 0) : QOpenGLWidget(parent)
          {
          }
      
      private:
          void initializeGL()
          {
              glClearColor(0.3f, 0.6f, 0.9f, 1.f);
          }
      
          void resizeGL(int width, int height)
          {
              glViewport(0, 0, width, height);
          }
      
          void paintGL()
          {
              glClear(GL_COLOR_BUFFER_BIT);
          }
      };
      
      
      class MainWindow : public QMainWindow
      {
      public:
          explicit MainWindow(QWidget *parent = 0) : QMainWindow(parent)
          {
              glWidget_ = new GLWidget(this);
              button_ = new QPushButton("button", this);
          }
      
      private:
          void resizeEvent(QResizeEvent *)
          {
              glWidget_->setGeometry(0, 0, width(), height() - 100);
              button_->setGeometry(0, height() - 100, width(), 100);
          }
      
      private:
          GLWidget *glWidget_;
          QPushButton *button_;
      };
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          MainWindow w;
          w.show();
      
          return a.exec();
      }
      

      Attachments

        1. cube.zip
          40 kB
          Mika Salmela
        2. Screen Shot 2016-02-25 at 13.08.56.png
          437 kB
          user-73be0

        Issue Links

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

          Activity

            People

              vestbo Tor Arne Vestbø
              jirauser39654 user-73be0 (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes