2

I have tried compiling the Webkit FTP example with QT 5.2

As far as I know, they had removed QFtp from QT 5 and only offer it as an add-on from https://qt.gitorious.org/qt/qtftp/source/a2a7f28c0facd7ca946cea54e98c6019fcdb16ae:

I can get the sources for QtFtp just find but there is no build instructions for Windows 7.

So how can I make this work?

Here's that Qt webkit FTP example that compiles and works just fine with Qt 4.7

https://www.dropbox.com/s/slkgw7ex762bx9o/FTP.zip

Cœur
  • 37,241
  • 25
  • 195
  • 267
user3059410
  • 93
  • 1
  • 8

1 Answers1

1

I can get the sources for QtFtp just find but there is no build instructions for Windows 7.

So how can I make this work?

There is no core difference between building QtFtp and other modules. You just need to use the following commands:

qmake -r -spec your-spec-type && make

Note that the -spec option can even be omitted in simple cases.

Community
  • 1
  • 1
László Papp
  • 51,870
  • 39
  • 111
  • 135
  • Thank You! I will try that tonight. Do you know if I have to manually copy some files to somewhere after compilation or is make install enough to put all the stuff into right places? – user3059410 Jan 07 '14 at 16:06
  • @user3059410: make install has been enough for me, and I think it also should be. – László Papp Jan 07 '14 at 16:08
  • @user3059410: you missed the actual content. – László Papp Jan 07 '14 at 18:05
  • I have done so far: 1) downloaded qtftp source from https://qt.gitorious.org/qt/qtftp/source/a2a7f28c0facd7ca946cea54e98c6019fcdb16ae: 2) set QTDIR=C:\Qt\Qt5.2.0\5.2.0\mingw48_32 3) qmake -r -spec win32-g++ && make && make install 4) try qt webkit ftp example. I had to add INCLUDEPATH += $$PWD/include and DEPENDPATH += $$PWD/include to .pro file and then create include & lib folder copy under the qt webkit ftp example folder. Copy files QFtp, qftp.h, QUrlInfo & qurlinfo.h to that include and finally change #inckude to #include . Still not working. – user3059410 Jan 07 '14 at 18:11
  • 1
    @user3059410: you are going the beyond the scope of your question, but you do need to use QT += ftp as usual. The copy all around does not make sense to me, and no, you do not need to change the include lines either. Just install QtFtp to the place where the rest of Qt is installed! – László Papp Jan 07 '14 at 18:13
  • @user3059410: Also, you have questions, but no selected answer in your track record, please read the following page how to select answers: http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – László Papp Jan 07 '14 at 18:14
  • However, when I try plain ftp example (without webkit) from qt-qtftp\examples folder and open, compile & run it with QtCreator it works perfectly. So maybe it's something wrong with the QNetworkReply of Qt 5 ??? That old Qt 4.8 webkit ftp example uses custom QNetworkReply for listing ftp server contents. So this is a bug in Qt 5 QNetworkReply ??? – user3059410 Jan 07 '14 at 18:20
  • @user3059410: See my answer above. There is no any QNetworkReply about it. Just use `QT += ftp` and the proper installation, and it will all work without include, et al, changes. – László Papp Jan 07 '14 at 18:22
  • Yes, I have QT += ftp in .pro file and QtCreator did not find #include after make install. It just says I:\qt-qtftp\examples\qftp\ftpwindow.h:49: error: QtFtp: No such file or directory #include ^ – user3059410 Jan 07 '14 at 18:24
  • @user3059410: because as already written, you need to install qtftp where the rest of qt is. Otherwise, QtCreator will not really see it. Also, do _not_ include the whole module because that is a bad practice in general. – László Papp Jan 07 '14 at 18:25
  • Please check it if it is installed near the other Qt headers and libraries as it should be... Also, build the qt webkit examples with (n)make VERBOSE=1 and see what include path QT+=ftp putting in there. – László Papp Jan 07 '14 at 18:32
  • https://qt.gitorious.org/qt/qtftp/source/a2a7f28c0facd7ca946cea54e98c6019fcdb16ae:src/qftp/qftp.pro#L4 -> You may want to remove those two lines if you want to link against qtftp dynamically. It should be fine, if you intent to link against it statically, though. – László Papp Jan 07 '14 at 18:35
  • I will do this step-by-step so you can show if I did something wrong. First the qmake https://www.dropbox.com/s/mncxko8zy37v4md/qtftp_step1.png – user3059410 Jan 07 '14 at 18:40
  • Then mingw32-make https://www.dropbox.com/s/gxbspkn3gfpysvs/qtftp_step2.png followed with mingw32-make install https://www.dropbox.com/s/k2g1eid1wtd9wwk/qtftp_step3.png. Now the QtFtp should be installed right? – user3059410 Jan 07 '14 at 18:46
  • As written, check the output of the mingw32-make VERBOSE=1 when building the webkit examples, and see what it tries to pass to gcc for the qtftp include path... Also, remove your obsolete comments because the noise is getting high here.... – László Papp Jan 07 '14 at 18:48
  • Here's qt 4.8 webkit ftp with mingw32-make VERBOSE=1 https://www.dropbox.com/s/9iz88n9dhhnwjg1/qt_webkit_ftp1.png and here are the results https://www.dropbox.com/s/u1i87vssg6irg9n/qt_webkit_ftp2.png. It is missing that QUrlInfo file and that's why I originally copied it from 4.8 source and hacked my .pro file to even make it compile. There really is some step missing from that qtftp addon installation stuff – user3059410 Jan 07 '14 at 19:40
  • You should *not* use QtWebKit 4.8 with Qt 5's QtFtp! – László Papp Jan 07 '14 at 19:41
  • And here's the pro file https://www.dropbox.com/s/x3lbbkzr71xf60i/webkitftp_pro_file.png – user3059410 Jan 07 '14 at 19:49
  • There is no webkitftp example in Qt 5. That's the whole point. I want it to make it work with Qt 5 but the idiot developers made it as an separat addon – user3059410 Jan 07 '14 at 19:50
  • So the official build "instructions" don't work. And even when hacked around it it does not work. But the plain FTP example DOES WORK! So like I said earlier it's in the QNetworkReply – user3059410 Jan 07 '14 at 19:52
  • I am afraid I will need to give it up. If you blame Qt, and not your workflow, you put me in a position where I am unable to help. Good luck to solving your issue though. – László Papp Jan 07 '14 at 19:54
  • Damn straight I am plaming Qt ! Only total idiot will remove perfectly working FTP support from new version without giving nothing in return. That's why several folks have had to remove FTP support from their applications when changing from old 4.x to 5.x – user3059410 Jan 07 '14 at 20:00
  • For those who are interested: I managed to solve this. It's because idiotic Qt bug https://bugreports.qt-project.org/browse/QTBUG-32468. So after changing content type to text/HTML instead of text/html for that Qt 4.8 Webkit FTP client example, then it will work with Qt 5 too. Of course you still have to hack lot's of files to make that work but at least it is doable. Problem solved – user3059410 Jan 07 '14 at 21:32
  • see https://stackoverflow.com/questions/33080846/how-to-compile-qftp-example-in-qt-5/47229558#47229558 – demosthenes Nov 10 '17 at 19:10