QWidget inside Winform or WPF

140 views
Skip to first unread message

Guillaume

unread,
Sep 30, 2010, 9:12:06 AM9/30/10
to qt4dotnet
Hello everyone,

I was wondering if I can include a QWidget from qt4dotnet inside a
winform or WPF window ? If yes, how can I do that ?

Thanks.
Guillaume

Stefan Monov

unread,
Sep 30, 2010, 10:56:52 AM9/30/10
to qt4d...@googlegroups.com
Never done it, but here's a good google search:
http://www.google.com/search?q=qt+winforms+interop
It produces this helpful link:
http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Windows/qtwinforms/

No such thing for WPF, it seems.

Stefan Monov

unread,
Sep 30, 2010, 11:05:07 AM9/30/10
to qt4d...@googlegroups.com
On Thu, Sep 30, 2010 at 5:56 PM, Stefan Monov <logi...@gmail.com> wrote:
> Never done it, but here's a good google search:
> http://www.google.com/search?q=qt+winforms+interop
> It produces this helpful link:
> http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Windows/qtwinforms/
Ah, forgot you were asking about qt4dotnet rather than plain Qt.
Since you only have access to the Jambi instances of the widgets,
maybe you should additionally call
yourWidget.nativePointer().pointer(). And even then, you'll get a
native pointer which was, in C++, allocated via "new" rather than
"gcnew". So I don't think you can pass it to WinForms's
Application::Run as they do in their example [1]

[1] the example I'm talking about is located at
http://doc.trolltech.com/solutions/4/qtwinforms/qtclock-example.html

Reply all
Reply to author
Forward
0 new messages