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

QGLWidget in a layout crashes on Android

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: 5.2.1
    • Fix Version/s: 5.3.0
    • Component/s: GUI: OpenGL
    • Labels:
      None
    • Environment:
      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

            Assignee:
            esabraha Eskil Abrahamsen Blomfeldt
            Reporter:
            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