Important: Please read the Qt Code of Conduct -

NativeEvnet(winEvent) function with QGLWidget in Qt5

  • Hi All,

    I made a app which works on windows.
    It is made by QMainWindow without titlebar and I enabled aero snap using nativeEvent function of MainWindow.
    But I have a problem on my nativeEvent function with QGLWidget.
    I uses nativeEvent Function to handle WM_NCHITTEST event on my mainwindow class.
    But when I add a QGLWidget widget on my mainwindow, I cannot receive WM_NCHITTEST event in the mainwindow anymore.
    Instead, I caught the event on MenuWidget.
    I struggled with this problem in this week but I can't find any solution.
    Why it occurs? and How can I fix it?

    I attached whole source code at
    I tested the code with Qt5.0 beta (Compiled under 64bit env.) on windows 7 64bit.

  • I solved the problem posting messeg(using PostMessage function) to mainwindow.
    It occurs because when I create openGL context, it changes widget to native window from non-native one.

  • hello, could you explain the detail? how to postevent to mainwindow?

Log in to reply