Getting data from a web page.
Solved
General and Desktop
-
A weather site suppose to return a JSON data.
void Weather::Get(QUrl url) { QNetworkReply *reply = manager->get(QNetworkRequest(url)); reply-> ///error: member access into incomplete type 'QNetworkReply' }
First - I get the error.
Second - what method should I use to retrieve the data? -
Your IDE knows a QNetworkReply class exists but not its full definition. You need to
include <QNetworkReply>
to address this.
You need to connect() the reply object signals (readyRead(), finished(), errorOccurred()) to slot(s) in to be notified when data is received. Then you can act on it.
This example has most of the necessary components
-
@JonB said in Getting data from a web page.:
@jenya7 said in Getting data from a web page.:
access into incomplete type 'QNetworkReply'
For the record: any time you get an
incomplete type '...'
message it means you have not included the required header file.Thank you. Good to know.