Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Getting data from a web page.
Forum Updated to NodeBB v4.3 + New Features

Getting data from a web page.

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 491 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jenya7
    wrote on last edited by
    #1

    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?

    JonBJ 1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      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

      J 1 Reply Last reply
      2
      • C ChrisW67

        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

        J Offline
        J Offline
        jenya7
        wrote on last edited by
        #3

        @ChrisW67
        Thank you. Works good.

        1 Reply Last reply
        0
        • J jenya7

          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?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @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.

          J 1 Reply Last reply
          1
          • JonBJ JonB

            @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.

            J Offline
            J Offline
            jenya7
            wrote on last edited by
            #5

            @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.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved