Direct2D Rendering Engine...
-
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 ........... yesTIA
-
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 -
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@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-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.
@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?
-
@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?
@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.
-
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:

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%
-
A AndyE has marked this topic as solved on