<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/113392/">http://git.reviewboard.kde.org/r/113392/</a>
     </td>
    </tr>
   </table>
   <br />




<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Marble.</div>
<div>By Dennis Nienhüser.</div>










<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
marble
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Merge request for the qt5 branch which adds support for compiling against Qt5 (using Qt4 still possible). Kudos to Michael Zanetti who did most of the work.

The first patch here is an excerpt of some files to show the approach done for porting without information overload by thousands of lines of a diff. The second and possibly following patches are the full diff.

1) cmake changes (cf. src/lib/CMakeLists.txt)
Qt4 used one Qt4 cmake module, QT_QT${COMPONENT}_LIBRARY style variables, and qt4_ prefixed commands. Qt5 has been split up into several modules, uses Qt5${Component}_LIBRARIES style variables, and qt5_ prefixed commands. Based on whichever Qt version is found (Qt4 is preferred over Qt5), the necessary include directories are added and link targets set up. Three qt_ macros are introduced to make it easier to call qt4_/qt5_ commands often used.

2) API changes (cf. src/lib/MapWizard.cpp)
A small number of classes has API changes, e.g. QUrl. Checks like
#if QT_VERSION < 0x050000
are introduced to distinguish between the Qt4 and Qt5 counterparts. This can't be avoided really, but fortunately the amount of changes is not too high.

3) Renamed classes (cf. src/lib/AbstractDataPlugin.{h,cpp})
To minimize the number of ifdefs introduced, the patch adds typedefs for renamed classes. typedefs are never introduced in headers to avoid spoiling someone else's code. In cpp files the old (Qt4) class name is typedefed to the new (Qt5) one.

4) new virtual methods (cf. src/lib/AbstractDataPluginModel.cpp)
Actually I'm only aware of QAbstractItemModel::roleNames() here. In Qt4 this method was not virtual, and a protected method setRoleNames() was there to do changes. In Qt5 setRoleNames() is deprecated and roleNames() is virtual. To avoid using the now deprecated setRoleNames the patch introduces a roleNames() overload in the Qt5 version only.
</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Note: Do not apply patch 1, just patch 2 or any later (see description).

Both Qt4 and Qt5 version compile and run fine here. If both are installed, cmake will pick up Qt4. Pass -DQT5BUILD=TRUE to cmake to override that.
</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>src/lib/AbstractDataPlugin.h <span style="color: grey">(fc4829a)</span></li>

 <li>src/lib/AbstractDataPlugin.cpp <span style="color: grey">(70b24c2)</span></li>

 <li>src/lib/AbstractDataPluginModel.cpp <span style="color: grey">(6504941)</span></li>

 <li>src/lib/CMakeLists.txt <span style="color: grey">(4f2eee1)</span></li>

 <li>src/lib/MapWizard.cpp <span style="color: grey">(63eca5d)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/113392/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>




  </div>
 </body>
</html>