Important: Please read the Qt Code of Conduct -

QT + OSG + Mac focus issue

  • Hi

    I have a bug where, after closing an OSG widget, keyboard events don't get sent properly.

    We use Qt4.8.4 and OpenSceneGraph (OSG, latest version from SVN). We create several qwidgets as tabs widgets, and have the ability to close them (using a kb short cut or the close button on the tab). The OSG widget uses osgQt. Everything is built with Apple's llvm-gcc and 10.7 SDK.

    When the OSG widget is closed, I no longer get keyboard event anywhere in the app even though focus appears to be properly set.

    Using the debugger, I see the event is received in QT's code in

    • (void)sendEvent:(NSEvent *)event
      in qcocoasharedwindowmethods_mac_p.h

    which then calls
    [super sendEvent:event];
    but this fails somewhere in Apple's toolkit code and the application beeps (not by calling Qt's beep function).
    It would normally end up calling

    • (void)keyDown:(NSEvent *)theEvent

    I tracked down the closing of the OSG widget to see if it was doing anything weird, but it all seems fine.

    I don't know if the bug is with our code, Qt or OSG but I'm failing to find out why this is happening and was wondering if anyone had come across anything like that.


Log in to reply