Migrating from 4.x to 5.x Problem with QHttp class addon



  • Hi everybody,

    I have downloaded a whole project that was created using Qt 4.4, i need to work and improve this project but im currently using the latest version of Qt. Ive read the guide http://qt-project.org/wiki/Transition_from_Qt_4.x_to_Qt5 and with its help, i was able to remove most of the errors I get while compiling.
    Now im stuck with one thats not mentioned in that guide, and its with the QHttp class, that according to Qt Creator, it doesnt exist.

    Ive been doing some research, and indeed, that class no longer exists, according to the official documentation

    bq. The QFtp, QUrlInfo, QHttp classes are not public anymore. Use QNetworkAccessManager instead to avoid binary breaks in the future. Programs that require raw FTP/HTTP streams, can use the compatibility add-ons QtFtp and QtHttp which provides the QFtp and QHttp classes as they existed in Qt 4.bq.

    In my case, migrating to a newer class is out of the question, i need to get this project working first. So ive downloaded the add-on, but i havent found a guide on how to make it work. Im really new to this part of Qt (I just have experience working with QtCreator and making apps with it, i have never for example, ran qmake through a console, so im probably doing everything extremely bad.)

    Searching through the forums I found the following guidelines im trying to follow:

    bq. Download the sources for the add-on from gitorious [qt.gitorious.org]
    Extract the sources somewhere (e.g. Qt5.x.y/Src/qtmyaddon)
    Open a console in that folder
    Run qmake
    Run make (or nmake or mingw32-make or whatever)
    Run make install (nmake install, mingw32-make install, …)
    In the .pro file of your project, add “QT += myaddon” (e.g. “QT += http”)
    Run qmake on your project
    Compile your project.

    Ok, so ive Downloaded the sources, extracted them in Src and opened the console in that folder, so far so good. I have no clue on how to "Run Qmake" so ive read the guide found in http://qt-project.org/doc/qt-4.8/qmake-tutorial.html
    This guide first explains how to create a .pro file. As the sources ive downloaded already have a .pro file, i skipped that part (should i?). The files I have in my main QHttp folder are:

    Folders: include, mkscpecs, modules, src, test
    Files: .qmake.conf, .tag, LGPL_EXCEPTION.txt, LICENCE.FDL, LICENCE.LGPL, LICENCE.PREVIEW.COMMERCIAL, qthttp.pro, readme.txt, sync.profile.

    So in my console I run

    qmake -o Makefile qthttp.pro

    A Makefile is created! So far so good, so then in the console i run

    nmake

    I get the following output

    //--------------------------------------------------------------------------------------------------
    Utilidad de mantenimiento de programas de Microsoft (R) versión 10.00.40219.01
    (C) Microsoft Corporation. Reservados todos los derechos.

        cd src\ && ( if not exist Makefile C:\Qt\Qt5.3.2\5.3\mingw482_32\bin\qma
    

    ke.exe C:\Qt\Qt5.3.2\5.3\Src\qhttp\src\src.pro -o Makefile ) && "C:\Program File
    s\Microsoft Visual Studio 10.0\VC\bin\nmake.exe" -f Makefile

    Utilidad de mantenimiento de programas de Microsoft (R) versión 10.00.40219.01
    (C) Microsoft Corporation. Reservados todos los derechos.

        cd qhttp\ && ( if not exist Makefile C:\Qt\Qt5.3.2\5.3\mingw482_32\bin\q
    

    make.exe C:\Qt\Qt5.3.2\5.3\Src\qhttp\src\qhttp\qhttp.pro -o Makefile ) && "C:\Pr
    ogram Files\Microsoft Visual Studio 10.0\VC\bin\nmake.exe" -f Makefile
    Project ERROR: Missing CMake tests.

    NMAKE : fatal error U1077: 'cd' : código devuelto '0x3'
    Stop.

    NMAKE : fatal error U1077: 'cd' : código devuelto '0x2'
    Stop.
    //---------------------------------------------------------------------------------------

    So now, I am 100% lost. Navigating through the QHttp folder i find that theres other .pro file, on the following directory
    QtHttp >> src >> QHttp

    Where I find the following files

    qhttp.cpp
    qhttp.h
    qhttp.pro
    qhttpauthehticator.cpp
    qhttpauthenticator_p.h
    qringbuffer_p.h

    So i thought maybe this is the place where I should use the qmake etc etc, but when i try to do so and i run

    qmake -o Makefile qhttp.pro

    I get an inmediate

    Project ERROR: Missing CMake tests.

    So i guess this is even worse.

    Ok, im sorry for the extremelly long post, I tried to be as detailed as i could be in order to help you guys help me :D
    I know that Im probably making huge mistakes as i really have no clue of what im doing, please be patient with me.
    Could someone guide me, or point me to a guide/tutorial that could help me?
    I tried to investigate as much as i could do before asking for help.

    Thanks in advance!

    Edit:: Forgot to mention (dont know if its neccesary at all, but as i have already made a huge and annoying post, thought adding a few extra info wouldnt hurt)

    Im running Qt Creator 3.2.1 (opensource)
    Based on Qt 5.3.2 (MSVC 2010, 32bit)
    Built on Sep 12 2014 at 15:47:18


  • Moderators

    "Run qmake" should actually be treated literally:
    @
    qmake
    @

    No need to specify the output or input file, qmake is smart enough to do that automatically. But what you did is still correct.

    You are getting errors because you are mixing compilers, which are not compatible. Your Qt source code seems to be compiled with MinGW, but you are running qmake using MSVC environment.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.