Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qml / QtQuick #40

Open
Hecatron opened this issue Nov 15, 2015 · 11 comments
Open

Qml / QtQuick #40

Hecatron opened this issue Nov 15, 2015 · 11 comments

Comments

@Hecatron
Copy link
Contributor

This is probably something to be looked at later on for the back burner once we have more of the basic Qt Widgets tested out, but I figured I'd write a bit about it here

The latest QtSharp release now seems to work fine with loading .ui files, and creating widgets.
I've not yet tested all the functionality such as slots etc. But one of the things I noticed is that the latest Qt releases now have a drag and drop visual editor for Qml / QtQuick which is sort of Qt's answer to the next generation gui / windows wpf equivilent.
https://wiki.qt.io/Introduction_to_Qt_Quick_for_C%2B%2B_Developers

I had a quick go at loading in Qml as a module into QtSharp, but it looks like it needs QtNetworking as a dependency. So I added in QtNetworking to see how far I could get with that
this resulted in

d:\SourceControl\GitExternal\QtSharp.ddobrev\QtSharp.CLI\bin\Debug\QtNetwork.cs(16587,28) : error CS0216: The operator 'QtNetwork.QHostAddress.operator ==(QtNetwork.QHostAddress.SpecialAddress, QtNetwork.QHostAddress)' requires a matching operator '!=' to also be defined
@ddobrev
Copy link
Owner

ddobrev commented Nov 16, 2015

QtQuick is definitely on my list but since I am forced to work on Qt# in-between because of paid jobs, there will be a while until it's complete. The time-consuming part there is the integration between the host language (C#) and QML, there has to be a way of defining properties and events (signals) in C# so that they are invoked as needed in QML and vice-versa.
About QtNetwork, I know about this bug. I have actually already filed it at mono/CppSharp#569, you are welcome to track its progress or even send a patch.

@ddobrev
Copy link
Owner

ddobrev commented Nov 18, 2015

QtNetwork works now and is added to my new release: https://github.com/ddobrev/QtSharp/releases/tag/0.0.4 .

@ddobrev
Copy link
Owner

ddobrev commented Nov 19, 2015

QtQml has been added: https://github.com/ddobrev/QtSharp/releases/tag/0.0.5 .
Thank you for testing, please continue with it.

@Hecatron
Copy link
Contributor Author

Thanks for adding QtQml support that's awesome

@dsoronda
Copy link

dsoronda commented Jun 6, 2018

Is there any reason why this issue is not closed ?

@ddobrev
Copy link
Owner

ddobrev commented Jun 8, 2018

@dsoronda because there's no support for QML yet.

@dsoronda
Copy link

dsoronda commented Jun 8, 2018

well, how about this example ?

@Hecatron
Copy link
Contributor Author

Hecatron commented Jun 9, 2018

Some of the stuff within QT uses templates such as

display->findChild<QPushButton *>("bar");
display->findChildren<QWidget *>();

In order for that to work in C# you need to translate it across to generics in C# (same thing but by a different name). But that's not quite in CppSharp yet which is what QtSharp relies on.

so if you happen to use some code that doesn't involve generics / templates then it might work, but you won't be able to use any of the Qt API's that do use generics / templates which may limit what you can do

@pauldotknopf
Copy link

If you need Qml integration, I am working on a project that does exactly this. I'd consider it usable for production.

https://github.com/pauldotknopf/net-core-qml

@ddobrev
Copy link
Owner

ddobrev commented Sep 19, 2018

@pauldotknopf thank you, I'll definitely have it in mind. I can see you've written your own bridge instead of using CppSharp which makes me a little sad but I still think we could collaborate.

@pauldotknopf
Copy link

Yeah, I'm open to a collaboration.

Unfortunately, CppSharp wouldn't work for the QML stuff, since there has to be a native component to work closely with the qml-private headers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants