magist3r/QtWeb — pull request #6 by peteristhegreat (2014-04-29 05:12:20+00:00)
Title: Ported from Qt 4.8 to Qt 5.2!

Hi magist3r,

I'm not sure when or if I'll work on this more, so I thought I better submit a pull request.

I haven't tested it built statically yet. But I don't know when I'll get back to working on this project. Hope this commit helps!

http://qt-project.org/wiki/Transition_from_Qt_4.x_to_Qt5

I fixed the headers by running this perl script from the source folder directory of QtWeb:

~/Qt5.2.1/5.2.1/Src/qtbase/bin/fixqt4headers.pl --qtdir ~/Qt5.2.1/5.2.1/Src/qtbase

The first dozen or so I did by hand.

Since QtFtp and QtHttp are now add-on plugins instead of standard elements I built those:

http://qt-project.org/forums/viewthread/24466/#121595

Most of the changes were pretty straightforward. The differences in the CookieJar and History class with their use of `reset()` on their `QAbstractItemModel`s could use a second set of eyes, because they recommend wrapping the changes with `beginResetModel()` and `endResetModel()`. I did it over a few minutes with really digging into the mechanics of those classes.

http://qt-project.org/doc/qt-5/qabstractitemmodel-compat.html#reset

Also the standardPaths changed to a `QStringList`, and for now I just put `.first()`. Later error checking could be added in the bizarre case that an OS doesn't have any standardPaths available.

There are still a number of warnings, mostly

-Woverloaded-virtual
-Wunused-parameter
-Wsometimes-uninitialized
-Wreorder
-Wreorder
-Wsign-compare

and one

-Wcomment
Below are the screenshots of all the warnings (83 of them) thrown by a release build after a build clean.

![image](https://cloud.githubusercontent.com/assets/2342284/2825833/c3c34b54-cf5b-11e3-8ad0-a5a62beae2e7.png)

![image](https://cloud.githubusercontent.com/assets/2342284/2825834/dd4657d8-cf5b-11e3-8344-b7b4ca9a9b02.png)