Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Proper way to create a window from a Qt DLL loaded by a non-Qt app
Qt 6.12 LTS is out! See what's new in the release blog

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

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    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:
    http://stackoverflow.com/a/11056698

    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?

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      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:
      http://stackoverflow.com/a/11056698

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt
      • Unsolved