Important: Please read the Qt Code of Conduct -

Proper way to create a window from a Qt DLL loaded by a non-Qt app

  • I have a not-created-by-me and not-Qt application called App (compiled with MSVC++) which has its own API and allows users to create DLLs for it.
    I have my Qt DLL (compiled with MSVC++ too) which is correctly loaded from App and can call the various API functions.
    Now I want my DLL to have a QMainWindow.
    The only help that I've found in the entire web is this post:

    But maybe I just missed some other good pages. I expected this problem to be common and I hoped to find more examples of how to do this.

    With little modifications regarding the argc and argv parameters, that code now works.
    I managed to create signal and slots to send information to my QMainWindow.

    The problem that I'm facing is that my Qt Window does not repaint itself. It does only when being resized.
    If I change a button text, the new text doesn't show up until I resize the window.
    I've correctly called app.exec() as in the example.

    My questions:
    1-how to solve this problem?
    2-any good example which shows how to correctly create a Window from a DLL which will be loaded from a program which doesn't know anything about Qt?

  • Bump.
    Summing up: My Qt DLL loaded from a non-Qt-3rd-party-application creates a QMainWindow but this window doesn't repaint itself unless I resize it.
    I've followed this post:

Log in to reply