Results 1 to 2 of 2

Thread: How to enable OpenGL after porting from Qt 4 to Qt 5.1.1

  1. #1
    Join Date
    Oct 2013
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default How to enable OpenGL after porting from Qt 4 to Qt 5.1.1

    I compiled and installed Qt 5.1.1 on Ubuntu 12.04.
    I ported our code from Qt 4 to Qt 5.1.1. The code runs with "-opengl false" option, but when OpenGL is used it crashes with the following message:

    QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled

    What do I need to do to enable these features?

    Below is the call stack from gdb at the crash point:

    #1 0x00007fffeeb804c6 in ?? () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Gui.so.5
    (gdb)
    #2 0x00007fffeeb8060b in QOpenGLFunctions::initializeOpenGLFunctions() () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Gui.so.5
    (gdb)where
    #0 0x00007fffee963c80 in QOpenGLContext::shareGroup() const () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Gui.so.5
    #1 0x00007fffeeb804c6 in ?? () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Gui.so.5
    #2 0x00007fffeeb8060b in QOpenGLFunctions::initializeOpenGLFunctions() () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Gui.so.5
    #3 0x00007fffede3fe2e in QGL2PaintEngineEx::begin(QPaintDevice*) () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5OpenGL.so.5
    #4 0x00007fffeeb0b967 in QPainter::begin(QPaintDevice*) () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Gui.so.5
    #5 0x00007fffee4ad0a9 in QGraphicsView:aintEvent(QPaintEvent*) () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Widgets.so.5
    #6 0x00007fffee1d1740 in QWidget::event(QEvent*) () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Widgets.so.5
    #7 0x00007fffee2b8d06 in QFrame::event(QEvent*) () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Widgets.so.5
    #8 0x00007fffee4ae3bb in QGraphicsView::viewportEvent(QEvent*) () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Widgets.so.5
    #9 0x00007fffef108c6d in QCoreApplicationPrivate::sendThroughObjectEventFil ters(QObject*, QEvent*) () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Core.so.5
    #10 0x00007fffee19ab3f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Widgets.so.5
    #11 0x00007fffee19e006 in QApplication::notify(QObject*, QEvent*) () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Widgets.so.5
    #12 0x00000000018dccee in azui::Application::notify (this=0x2eba040, receiver=0x4ad4330, qevent=0x7fffffffccd0) at /home/zach/p5/arptop/arp/ui5/azmain/azmain.cpp:390
    #13 0x00007fffef108a44 in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Core.so.5
    #14 0x00007fffee1ce61b in ?? () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Widgets.so.5
    #15 0x00007fffee1a2c18 in QWidgetPrivate::repaint_sys(QRegion const&) () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Widgets.so.5
    #16 0x00007fffee1f2778 in ?? () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Widgets.so.5
    #17 0x00007fffee19ab74 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Widgets.so.5
    #18 0x00007fffee19e006 in QApplication::notify(QObject*, QEvent*) () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Widgets.so.5
    #19 0x00000000018dccee in azui::Application::notify (this=0x2eba040, receiver=0x4b5c140, qevent=0x7fffffffd5c0) at /home/zach/p5/arptop/arp/ui5/azmain/azmain.cpp:390
    #20 0x00007fffef108a44 in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Core.so.5
    #21 0x00007fffee92eec5 in QGuiApplicationPrivate:rocessExposeEvent(QWindowSystemInterfacePrivate::E xposeEvent*) () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Gui.so.5
    #22 0x00007fffee9373fd in QGuiApplicationPrivate:rocessWindowSystemEvent(QWindowSystemInterfacePriv ate::WindowSystemEvent*) () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Gui.so.5
    #23 0x00007fffee920568 in QWindowSystemInterface::sendWindowSystemEventsImpl ementation(QFlags<QEventLoop::ProcessEventsFlag>) () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Gui.so.5
    #24 0x00007fffe08633d0 in ?? () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/stow/qt-everywhere-opensource-src-5.1.1/plugins/platforms/libqxcb.so
    #25 0x00007fffef10780b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsF lag>) () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Core.so.5
    #26 0x00007fffef10b82e in QCoreApplication::exec() () from /AZ/x86_64/kernel-3.2.0-25-virtual/glibc-2.15/2013-09-19-12.16.39/lib/libQt5Core.so.5
    #27 0x00000000018dc4b5 in azui::Arp::start_gui (this=0x2efe000) at /home/zach/p5/arptop/arp/ui5/azmain/azmain.cpp:301
    #28 0x00000000018db0a8 in azui::Arp::run (this=0x2efe000, argc=15, argv=0x7fffffffd9d8) at /home/zach/p5/arptop/arp/ui5/azmain/azmain.cpp:100
    #29 0x00000000018dac74 in main (argc=15, argv=0x7fffffffd9d8) at /home/zach/p5/arptop/arp/ui5/azmain/azmain.cpp:48

    Thanks, Zach.

  2. #2
    Join Date
    Oct 2013
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: How to enable OpenGL after porting from Qt 4 to Qt 5.1.1

    I resolved the issue. I am running Ubuntu 12.04 under VirtualBox. I ran glxinfo and it told me to enable 3D acceleration.
    I had to power down the VM to change display settings. OpenGL works after that.

Similar Threads

  1. converting GLUT/OpenGL to Qt/OpenGL - displaying issue
    By yoti13 in forum Qt Programming
    Replies: 1
    Last Post: 25th November 2012, 00:45
  2. Replies: 0
    Last Post: 6th December 2009, 00:41
  3. Qt with OpenGL ES for ARM9 - All OpenGL ES tests have failed!
    By vinpa in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 3rd December 2009, 10:10
  4. How to Enable Touchscreen
    By Rajeshsan in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 7th September 2009, 07:51
  5. cannot enable opengl-overlay
    By xylosper in forum Qt Programming
    Replies: 1
    Last Post: 27th November 2008, 01:44

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.