Search code examples
qtwinapimdi

Show a QWidget in win32 MDI area


I am trying to extend a legacy win32 application functionalities. The legacy application has a Multiple Document Interface(MDI) as it's main window and is purely written in win32 API. Is it possible to show a QWidget in win32 MDI area as a child?


Solution

  • Are you using MFC?

    What's important to understand is that running Qt always requires you have a running Qt event loop. So what you need is to properly process your MFC/win32 events an the Qt events.

    There is the Qt solution QtWinMigrage for that supports Qt 4 and Qt >= 5.4 (Qt 5.0-5.3 are broken). Examples also show your use case.

    This is certainly a good starting point if your application is based on CWinApp.

    Further details can be found by searching the internet and reading about the QAbstractEventDispatcher. Hope this helps!