Network connection in QML?
-
Hello I'm new to QML, QT and C ++, but I have some questions for qml.
Is it possible to create an network connection with qml?
Also possible to connect to a server?
If so, how do to do it? -
@Sam009 Hi,
In QML pure you only have XMLHttpRequest.
But you can extend qml with qt c++ for tcp/ftp ..
-
@LeLev Hi
Thanks,There is no code on how to create an internet connection?
But you can extend qml with qt c++ for tcp/ftp ..
If I'm a part in c ++ can I then grab from qml to the c ++ function (which is there for the internet connection)?hi Sam,
@Sam009 said in Network connection in QML?:There is no code on how to create an internet connection?
Of cours there are lot of exemples (with your qt creator go to : HOME > Exemples )
What exactly you want to do ? where you want to connect? what is the protocole ?@Sam009 said in Network connection in QML?:
If I'm a part in c ++ can I then grab from qml to the c ++ function (which is there for the internet connection)?
Yes you can ! To communicate between c++ and qml : http://doc.qt.io/qt-5/qtqml-cppintegration-exposecppattributes.html
you will use Q_PROPERTIES / Q_INVOKABLES / public Slots -
hi Sam,
@Sam009 said in Network connection in QML?:There is no code on how to create an internet connection?
Of cours there are lot of exemples (with your qt creator go to : HOME > Exemples )
What exactly you want to do ? where you want to connect? what is the protocole ?@Sam009 said in Network connection in QML?:
If I'm a part in c ++ can I then grab from qml to the c ++ function (which is there for the internet connection)?
Yes you can ! To communicate between c++ and qml : http://doc.qt.io/qt-5/qtqml-cppintegration-exposecppattributes.html
you will use Q_PROPERTIES / Q_INVOKABLES / public Slots@LeLev
The idea is to make a internet connection to a server or web to open some htmls . The htmls are normaly Json-stings.
I need somthing that i can make use inside a qml(or c++ file) that make a connection to a server/web. My file is a plugin for a software.
Which example can I take?This example are working, so i have only import this examples and set the parameter? (if i find this example /these examples)
Then I didn´t need a c++ file? only a qml file? -
@LeLev
The idea is to make a internet connection to a server or web to open some htmls . The htmls are normaly Json-stings.
I need somthing that i can make use inside a qml(or c++ file) that make a connection to a server/web. My file is a plugin for a software.
Which example can I take?This example are working, so i have only import this examples and set the parameter? (if i find this example /these examples)
Then I didn´t need a c++ file? only a qml file?Hi,
@Sam009 said in Network connection in QML?:
The idea is to make a internet connection to a server or web to open some htmls .
XMLHttpRequest can be used for opening HTML pages : http://doc.qt.io/qt-5/qtqml-xmlhttprequest-example.html (pure QML)
Google "xhr get html page qml" will give you more exemples.
Also, feel free to send me an email and i will share with you (google drive) a little app i made.