PDA

View Full Version : Qt-DLLs in a .NET-Application



scary hallo
4th February 2015, 08:50
Hello,
we have a relatively big Qt-Application(for Windows), which is split into many DLLs. On the other hand we are developing a .NET Application. The two applications have a lot in common. So the question is: Is it possible to use Qt-DLLs(c++) in a .NET-Application (Windows Forms)? If yes, what is the best approach?

wysota
4th February 2015, 08:51
It depends what this c++ part is supposed to do for your app.

scary hallo
4th February 2015, 15:37
In the first step I would like to display some GUI-elements (QWidgets) in some kind of wrapper-form in the .NET app.

wysota
4th February 2015, 17:58
To do that first you need to integrate the two event loops so that events for both systems are processed. As for wrapping Qt widgets into .NET form, I have no idea if this is possible. You should be able to show Qt widgets in a new window though.

ChrisW67
4th February 2015, 21:05
I have not done it myself but the docs indicate you should be able to embed a Qt-based ActiveX control into a .Net form. Non GUI classes can be integrated more directly with some wrapper code.
http://doc.qt.io/qt-5/activeqt-dotnet.html