Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [SOLVED] QT 4.8.3 Mac OS X (Mountain Lion) QHttp/QNetworkAccessManager
Qt 6.11 is out! See what's new in the release blog

[SOLVED] QT 4.8.3 Mac OS X (Mountain Lion) QHttp/QNetworkAccessManager

Scheduled Pinned Locked Moved Installation and Deployment
10 Posts 2 Posters 8.4k Views 1 Watching
  • 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.
  • R Offline
    R Offline
    replay111
    wrote on last edited by
    #1

    Hi,

    I've just installed Qt 4.8.3 on my Mac and I have small problem with including QHttp or QNetworkAccessManager.
    I can see QNetworkAccessManager in /Library/Frameworks/ but when I am trying do add it in header file IDE is giving me error :/

    Can anyone tell me how to install corectly QT on Mac?
    Previously installer was installing IDE in a specific folder and everything was working fine, but now I am little confuesd, especialy that I am not keen on in Qt (not yet ;) ).

    Maciej.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mlong
      wrote on last edited by
      #2

      What is the error that the IDE is giving you?

      Software Engineer
      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        replay111
        wrote on last edited by
        #3

        #include <QHttp>
        .../myjson.h:5: błąd:QHttp: No such file or directory

        #include <QNetworkAccessManager>
        .../myjson.h:5: błąd:QNetworkAccessManager: No such file or directory

        but file is located in:
        /Library/Frameworks/QtNetwork.framework/Versions/4/Headers/qnetworkaccessmanager.h

        1 Reply Last reply
        0
        • R Offline
          R Offline
          replay111
          wrote on last edited by
          #4

          I found that if I do in that way:

          @
          #ifndef MYJSON_H
          #define MYJSON_H

          #include <QObject>
          //#include "QNetworkAccessManager"

          #include "/Library/Frameworks/QtNetwork.framework/Versions/4/Headers/qhttp.h"

          class myJson
          {
          public:
          myJson();

          public slots:
          int getJsonFromUrl(QString aJsonURL);

          };

          #endif // MYJSON_H
          @

          then project is going to compile, but I don't think that is the correct solution :(

          1 Reply Last reply
          0
          • R Offline
            R Offline
            replay111
            wrote on last edited by
            #5

            Does anyone has any idea?
            I've installed Qt from pkg installer in order:

            1. qt-mac-opensource-4.8.3-debug-libs.dmg
            2. qt-mac-opensource-4.8.3.dmg
            3. qt-creator-mac-opensource-2.5.2.dmg

            maybe this generates my problems??

            1 Reply Last reply
            0
            • R Offline
              R Offline
              replay111
              wrote on last edited by
              #6

              Ok - I got it ;-)

              I've just installed qt 1.2.1 and there in QTCreater intelli sense hints this:
              @
              #include <QtNetwork/QHttp>
              #include <QtNetwork/QNetworkAccessManager>
              @

              and this is it ;-)

              For me topic is solved ;)

              1 Reply Last reply
              1
              • M Offline
                M Offline
                mlong
                wrote on last edited by
                #7

                Glad you were able to figure it out! Apparently nobody had anything helpful to offer. I was at a loss, so I didn't comment. Hopefully your solution will help anyone else with a similar problem. Thanks for posting it.

                Be sure and edit your initial post to add [Solved] to the title.

                Software Engineer
                My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  replay111
                  wrote on last edited by
                  #8

                  I know that topic is solved but I've found better and more correct way to solve the case ;-)

                  In file *.pro we need to add line:
                  @QT += network@

                  and then in our module/header file we can use:

                  @ #include <QNetworkAccessManager>
                  #include <QUrl>@

                  In this way compilation is correct and we are not given strange errors ;-)

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    mlong
                    wrote on last edited by
                    #9

                    Oh yes... that's obviously the cause. So simple it never occurred to me that you might not have done that. Sorry about that.

                    Software Engineer
                    My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      replay111
                      wrote on last edited by
                      #10

                      It's ok ;-) I'am newbie and I didn't do the most basic thing: RTFM ;)
                      I looked in example with http and the solution was so clear ad easy to find.

                      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