Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Direct2D Rendering Engine...
Qt 6.11 is out! See what's new in the release blog

Direct2D Rendering Engine...

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 2.2k 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.
  • A Offline
    A Offline
    AndyE
    wrote on last edited by
    #1

    I'm attempting to use it in my application. For reference, I built Qt 6.9.1 from source as I wanted static libraries and this an application I am porting from MFC so it's a "mixed" Qt/ MFC project set up using Visual Studio Tools and Visual Studio 2022

    I found this...

    https://forum.qt.io/topic/80508/how-to-use-qwindowsdirect2dpaintengine

    And have attempted to pass those command-line parameters in.

    Application throws an exception in the constructor and informs me that the "Available platform plugins are: windows".
    Any idea how I can add the D2D platform plugin in?
    It feels like it needs to be added to my Visual Studio build config somehow.

    The "qdirect2d.lib" (release) and "qdirect2dd.lib" (debug) libraries have both been built and installed so they are available in my static 6.9.1 version.
    Config summary for QPA backends shows the build was setup for them...

    Windows:
       Direct 2D ............................ yes
       Direct 2D 1.1 ........................ yes
       DirectWrite .......................... yes
       DirectWrite 3 ........................ yes
       DirectWrite COLRv1 Support ........... yes
    

    TIA

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Why do you think you need the Direct2D plugin? What are you think you're missing?
      When you built your Qt as static lib then you should also import your plugins as described here: https://doc.qt.io/qt-6/plugins-howto.html#static-plugins

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      A 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        Why do you think you need the Direct2D plugin? What are you think you're missing?
        When you built your Qt as static lib then you should also import your plugins as described here: https://doc.qt.io/qt-6/plugins-howto.html#static-plugins

        A Offline
        A Offline
        AndyE
        wrote on last edited by
        #3

        @Christian-Ehrlicher said in Direct2D Rendering Engine...:

        Why do you think you need the Direct2D plugin? What are you think you're missing?

        We're looking to move away from GDI/GDI+ which currently is where the vast majority of our apps sit. We already have a D2D wrapper library but it may be that the Qt version is the way to go.

        When you built your Qt as static lib then you should also import your plugins as described here: https://doc.qt.io/qt-6/plugins-howto.html#static-plugins

        Thank you that looks useful. I will have a look.

        Christian EhrlicherC 1 Reply Last reply
        0
        • A AndyE

          @Christian-Ehrlicher said in Direct2D Rendering Engine...:

          Why do you think you need the Direct2D plugin? What are you think you're missing?

          We're looking to move away from GDI/GDI+ which currently is where the vast majority of our apps sit. We already have a D2D wrapper library but it may be that the Qt version is the way to go.

          When you built your Qt as static lib then you should also import your plugins as described here: https://doc.qt.io/qt-6/plugins-howto.html#static-plugins

          Thank you that looks useful. I will have a look.

          Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @AndyE said in Direct2D Rendering Engine...:

          We're looking to move away from GDI/GDI+ which currently is where the vast majority of our apps sit. We already have a D2D wrapper library but it may be that the Qt version is the way to go.

          What's the gain? Do you have performance problems with QtWidgets?

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          A 1 Reply Last reply
          0
          • Christian EhrlicherC Christian Ehrlicher

            @AndyE said in Direct2D Rendering Engine...:

            We're looking to move away from GDI/GDI+ which currently is where the vast majority of our apps sit. We already have a D2D wrapper library but it may be that the Qt version is the way to go.

            What's the gain? Do you have performance problems with QtWidgets?

            A Offline
            A Offline
            AndyE
            wrote on last edited by
            #5

            @Christian-Ehrlicher said in Direct2D Rendering Engine...:

            What's the gain? Do you have performance problems with QtWidgets?

            It's not just about the basic interface - i.e. menus / toobars / dialogs / dialog controls.

            We write games for a living.
            The game map areas for most of them are currently GDI / GDI+ ultimately using an MFC CWnd to draw on.
            PNG support is limited particularly around alpha channels and blend modes.

            Two game series have the game map areas written using our D2D wrapper library.
            The performance and quality of the anti-aliasing because it's offloaded to the GPU is much much better.

            Just wanted to investigate the use of D2D in Qt as well.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              AndyE
              wrote on last edited by AndyE
              #6

              Thanks to the info above I shall be marking this as resolved. However, a further issue has revealed itself for which I shall be raising a new topic.

              For reference, I am using Visual Studio Tools (so it's "qmake" underneath). The Qt Project Settings in the relevant project file need to be amended as per the following screenshot:

              Screenshot 2025-09-08 081810.png

              I turns out I won't be raising a new Topic on my follow-up issue because there is already a bug report for it...

              Win32: the Direct2D platform plugin is totally broken when DPI is not 100%

              1 Reply Last reply
              0
              • A AndyE has marked this topic as solved on

              • Login

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