Network programming with Qt
-
Hi all,
-
I wish to get my feet wet and start learning network programming using Qt.
Do you agree that I start from here? If so, what example is better to stick to as the first one?
Or do you have a better idea, please? -
The next question is that, those examples and that link are of QtWidgets. What if I like to learn Qt network programming to be used for QtQuick apps, please?
Thanks in advance.
-
-
Hi,
In addition to the documentation examples, there is this wiki article that adds some more informations.
As for QtQuick, what do you have in mind ?
-
Hi,
In addition to the documentation examples, there is this wiki article that adds some more informations.
As for QtQuick, what do you have in mind ?
there is this wiki article that adds some more informations.
I explored it but for me as a starter of network programming, this seems too sophisticated!
Don't you think the link on docs I provided has simpler examples to get started? Which one do you recommend, please?As for QtQuick, what do you have in mind?
I intend to mostly stick with QtQuick generally, if I have a choice, and QtWidgets only when I have no other choice. So that was why I mentioned QtQuick. So if there's a tutorial/link to get me to get started learning Qt network programming to be doable for QtQuick apps, that will be really wonderful.
-
As I said, this wiki entry is in addition to the examples.
As for QtQuick, again, it depends on what you are going to do. You may have to implement your own classes in C++ if you want to wrap some APIs, etc.
-
As I said, this wiki entry is in addition to the examples.
As for QtQuick, again, it depends on what you are going to do. You may have to implement your own classes in C++ if you want to wrap some APIs, etc.
-
Networking is such a broad concept that if you don't have a specific use case it's hard to give advices.
The client code for a REST API can be very boring. see this code I made a long time ago to display the bike share network of my city as an example : https://github.com/oKcerG/MeetupSFPMMap/blob/master/main.qml the code to fetch the data is barely 10 lines (and simple ones). The model is handled via https://github.com/benlau/qsyncable ,
don't populate data manually in a for loop like done in the QML book.For more advance use case you would use QNetworkAccessManager in C++, potentially with OAuth and expose a nice API to QML. Or maybe you need to use a third party lib or implement a binary protocol with QTcpSocket. Or maybe something with zmq or protobuf ...