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

QGLWidget in a layout crashes on Android

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.3.0
    • 5.2.1
    • GUI: OpenGL
    • None
    • Android 4.2.2, armv7

    Description

      Using a QGLWidget in a QMainWindow with a layout crashes on startup on an Android device. It works fine on my desktop computer.

      #include <QApplication>
      #include <QMainWindow>
      #include <QVBoxLayout>
      #include <QGLWidget>
      
      int main (int argc, char *argv[]) {
      	QApplication app (argc, argv);
      	QMainWindow mainwindow;
      
      	QWidget *centralwidget = new QWidget (&mainwindow);
      	QVBoxLayout *layout = new QVBoxLayout (centralwidget);
      	QGLWidget *glwidget = new QGLWidget (centralwidget);
      	layout->addWidget (glwidget);
      	mainwindow.setCentralWidget (centralwidget);
      
      	mainwindow.show ();
      	return app.exec ();
      }
      

      This code crashes when calling mainwindow.show (). It looks like there are infinite recursive calls between QWidget::create and QWidgetPrivate::createWinId leading to a stack overflow. Sorry, I cannot get the full backtrace from Qt Creator.

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            clementvuchener Clément Vuchener
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes