Trouble with QGLWidget on iPhone 5 and iPad Air 2



  • I have upgraded to Qt 5.4 and am having some issues getting the openGL working properly. I have a QMainWindow with a QGLWidget attached. I am using this code to attach the openGL to the QMainWindow:

    @ QGLFormat format;
    format.setVersion(3,3);
    format.setProfile( QGLFormat::CoreProfile );
    format.setDepth(true);
    m_context = new QGLContext(format);

    m_model = new ModelView(*m_context, this);
    m_model->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    ui->OGLLayer->addWidget(m_model);
    m_model->showMaximized();@

    This code works on on my desktop (Mac) fine. But neither the iPhone or iPad work. With this code, the app never runs. It gets several -111 error and the app just aborts. If I modify this code like this, it will work on my iPad completely. The iPhone appears to work, but the openGL doesn't initialize properly. And it won't work at all on the Mac.

    @ QGLFormat format;
    format.setVersion(3,3);
    format.setProfile( QGLFormat::CoreProfile );
    format.setDepth(true);
    m_context = new QGLContext(format);

    m_model = new ModelView(*m_context, NULL);
    m_model->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    ui->OGLLayer->addWidget(m_model);
    m_model->showMaximized();@

    Any suggestions?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.