QtFtp and QtHttp "compatibility add-ons", for QHttp, and QFtp classes in Qt 5
-
As stated in the readme, if you want "#include <QHttp>" to work you have to generate the headers:
@cd qthttp
<QTDIR>/bin/syncqt.pl -version 5.2.0@If you have already run qmake, delete the folder and download QHttp again.
-
How much different is QNetworkAccessManager from QHttp?
I built a little utility for my laptop a long time ago and I am trying to decide between:
- a) Migrate to QNetworkAccessManager
- b) Apply QHttp add-on (i.e put it on life-support)
- c) Trash it :-(
It sounds like some here have gone though the process of migrating or installing the add-on, what was your experience / level of effort?
Thanks! :-)
-
Hello All,
sorry to wipe the dust off of this thread, but it seemed to me that it was smart to put my question here...I have a Qt5 SW which uses QNetworkAccessManager to download files from FTP servers. However, now I have to alter that software to first read contents of that FTP server (Internet refers to QtFTP add/on).
I looked here and found instructions for install of this add on by julrich... Tried them, didn't work.
I downloaded QtFTP from Gitorious, and put its src folder here> C:\Qt\Qt5.4.1\src.
Opened cmd.exe, navigated to that folder
"qmake" ENTER... and 'qmake is not recognized as an internal or external command.. blah blah"I have never before installed a library, and it would mean a lot to me of someone with experience would be kind enough to help.
Thanks in advance.
-
@jelicicm
Hi and welcome to devnetI would question if it is really necessary to go back to the compatibility version. Those have been implemented based on the new network stuff. IMHO they are meant for Qt 4 applications and their easier adaption to Qt5.
If you have Qt creator installed it should be a matter of importing the project (e.g. QtFtp) and compilation.
-
@koahnig
Thank you very much for your reply! Not sure how I managed to be stupid like that :)I included two .h and two .cpp files from /src folder in my project, wrote #include lines for two .h files and it compiled nicely!
Now, I have to ask someone for an example code of printing out files located on FTP server.
So far I have
'''QFtp *ftp=new QFtp();
QObject::connect(&ftp, SIGNAL(listInfo(const QUrlInfo &)), &ftp, SLOT(printout(const QUrlInfo &)));ftp->connectToHost(address);
ftp->login("ars2014","65!tqwGfr0*8");
ftp->list();
ftp->close();And, in qftp.h and qftp.cpp I added printout>
void QFtp::printout(const QUrlInfo &info) {
qDebug()<<info.name().toStdString();
}If it maters in any way its just a console application.
Error I get is> error: no matching function for call to 'QObject::connect(QFtp**, const char*, QFtp**, const char*)'
QObject::connect(&ftp, SIGNAL(listInfo(const QUrlInfo &)), &ftp, SLOT(printout(const QUrlInfo &)));Does someone know what is happening?
Thanks.
EDIT: Figured it out, I have cannot use &ftp when using connect, only just ftp. Duhh
-
The qftp sources are no longer available at https://qt.gitorious.org/qt/qtftp . Any one who can help me get the source?
-
Hi and welcome to devnet,
Qt's sources official repositories is on code.qt.io. For QFtp it's here
-
thanks a lot!
-
@koahnig
can you guide me on how to compile the qftp module as a separate library. I tried adding the module to my project. it works on windows but when I try running it on linux it doesn't work. my guess is I have to install it again on linux for it to work. -
You need to donwload the sources from git here as already noted by SGaist.
When you have downloaded the files you have project files for Qt creator to load and create the libraries.
-
Apparently you need nowadays to use "git" for downloading the whole stuff at once. Before there was a possibility to download all as a complete I believe.
Are you familiar with git?
Otherwise can download file by file, which is not so bad, but takes a bit longer.
[edit:koahnig; Post corrected]
-
Gitorious was a service like Gitlab, Bitbucket or Github which provide a nice graphical front-end to git itself and usually more tools to handle tasks like bug reports, merge request and nowadays continuous integration.
-
@SGaist
Thanks for correction. You are right. "git" is already a complete English word. Was not careful enough to distinguish between git and gitorious. -
We had a side discussion in another part of the forum.
There is also a place to download QFtp as an archive for those not wanting to bother with git. Only drawback is that some minor fixes are missing. -
I found this discussion to be very helpful in my attempt to install QFtp, including the steps listed by julrich, and the download location provided by koahnig. I prepared a folder named "QFtp" under "C:\Qt\5.7\mingw53_32\include", which I put the unzipped files inside. I did receive an error, "Project ERROR: Missing CMake tests." while trying to use mingw32-make, but found discussion here which solved the problem (by creating the folder "cmake" under the "\tests\auto" sub folder.)
- Mike