[Marble-devel] Review Request 113392: Support for Qt5

Dennis Nienhüser earthwings at gentoo.org
Wed Oct 23 07:11:14 UTC 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/113392/
-----------------------------------------------------------

(Updated Oct. 23, 2013, 7:11 a.m.)


Review request for Marble.


Changes
-------

Updates LocalOsmSearchPlugin to link against Qt5 Sql libraries.


Repository: marble


Description
-------

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.


Diffs (updated)
-----

  src/lib/MapWizard.cpp 63eca5d 
  src/lib/CMakeLists.txt 4f2eee1 
  src/lib/AbstractDataPluginModel.cpp 6504941 
  src/lib/AbstractDataPlugin.cpp 70b24c2 
  src/lib/AbstractDataPlugin.h fc4829a 
  src/ControlView.h 0f3274e 
  src/CMakeLists.txt 7f54f85 
  MarbleMacros.cmake 02e1ada 
  CMakeLists.txt d150ed4 
  src/lib/MarblePlacemarkModel.h 38286a6 
  src/lib/MarblePlacemarkModel.cpp 2737850 
  src/lib/NewstuffModel.h 415890b 
  src/lib/NewstuffModel.cpp 995fa25 
  src/lib/ServerLayout.cpp 46c2aa3 
  src/lib/SphericalScanlineTextureMapper.cpp 6d665ae 
  src/lib/VectorComposer.cpp f4ac0c7 
  src/lib/cloudsync/CloudRouteModel.h 7e0355f 
  src/lib/cloudsync/CloudRouteModel.cpp e3e5ef7 
  src/lib/geodata/data/GeoDataCoordinates.cpp 49490f0 
  src/lib/geodata/data/GeoDataFeature.cpp 6d4cfcd 
  src/lib/geodata/data/GeoDataGeometry.cpp 7f32c89 
  src/lib/geodata/handlers/dgml/DgmlDownloadUrlTagHandler.cpp 9e3b978 
  src/lib/geodata/writers/dgml/DgmlTextureTagWriter.cpp eb00c09 
  src/lib/kbihash_p.h fde6669 
  src/lib/marble_export.h 611f4b1 
  src/lib/routing/RoutingModel.h 884d070 
  src/lib/routing/RoutingModel.cpp d5ede57 
  src/lib/routing/SpeakersModel.h 42d4c47 
  src/lib/routing/SpeakersModel.cpp a4f7faa 
  src/marble-mobile/CMakeLists.txt 961a289 
  src/marble-mobile/main.cpp 599a1bf 
  src/plugins/declarative/Bookmarks.cpp 7ec3ee3 
  src/plugins/declarative/CMakeLists.txt a22129a 
  src/plugins/declarative/Coordinate.h 76fa5ed 
  src/plugins/declarative/DeclarativeDataPlugin.h 6ae6930 
  src/plugins/declarative/DeclarativeDataPlugin.cpp f944164 
  src/plugins/declarative/DeclarativeMapThemeManager.h d7e0280 
  src/plugins/declarative/DeclarativeMapThemeManager.cpp d554768 
  src/plugins/declarative/MapThemeModel.h 8572658 
  src/plugins/declarative/MapThemeModel.cpp 7687950 
  src/plugins/declarative/MarbleDeclarativePlugin.h ee10e84 
  src/plugins/declarative/MarbleDeclarativePlugin.cpp 959063b 
  src/plugins/declarative/MarbleDeclarativeWidget.h b466a63 
  src/plugins/declarative/MarbleDeclarativeWidget.cpp 1004a90 
  src/plugins/declarative/Navigation.h fb8163c 
  src/plugins/declarative/OfflineDataModel.h 912d9fb 
  src/plugins/declarative/OfflineDataModel.cpp ca809c7 
  src/plugins/declarative/Placemark.h fbb85ac 
  src/plugins/declarative/PositionSource.h 8edca3c 
  src/plugins/declarative/RouteRequestModel.h ca59f6a 
  src/plugins/declarative/RouteRequestModel.cpp e784c6b 
  src/plugins/declarative/Routing.h bed44d3 
  src/plugins/declarative/Routing.cpp 5848135 
  src/plugins/declarative/Search.h f6587bf 
  src/plugins/declarative/Search.cpp a261b2e 
  src/plugins/declarative/Tracking.h eb2896a 
  src/plugins/declarative/Tracking.cpp d29a1d2 
  src/plugins/designer/CMakeLists.txt 58a5577 
  src/plugins/designer/latloneditwidget/CMakeLists.txt 6572f53 
  src/plugins/designer/latloneditwidget/LatLonEditPlugin.h fedb9ca 
  src/plugins/designer/marblewidget/CMakeLists.txt bd121b9 
  src/plugins/designer/marblewidget/MarbleWidgetPlugin.h 3831913 
  src/plugins/designer/navigator/CMakeLists.txt f8610e3 
  src/plugins/designer/navigator/MarbleNavigatorPlugin.h 8d22c72 
  src/plugins/positionprovider/CMakeLists.txt 8c1f1f4 
  src/plugins/positionprovider/flightgear/CMakeLists.txt d1a7772 
  src/plugins/positionprovider/flightgear/FlightGearPositionProviderPlugin.h 50f2e62 
  src/plugins/positionprovider/geoclue/GeoCluePositionProviderPlugin.h da734e7 
  src/plugins/positionprovider/gpsd/CMakeLists.txt 02a86c0 
  src/plugins/positionprovider/gpsd/GpsdPositionProviderPlugin.h e66c83c 
  src/plugins/positionprovider/maemo/MaemoPositionProviderPlugin.h ed2d746 
  src/plugins/positionprovider/placemark/CMakeLists.txt 6c27c96 
  src/plugins/positionprovider/placemark/PlacemarkPositionProviderPlugin.h f2071b7 
  src/plugins/positionprovider/qtmobility/CMakeLists.txt 24c5952 
  src/plugins/positionprovider/qtmobility/QtMobilityPositionProviderPlugin.h 7d0d534 
  src/plugins/positionprovider/routesimulation/CMakeLists.txt 82f4c8f 
  src/plugins/positionprovider/routesimulation/RouteSimulationPositionProviderPlugin.h 82ec4f6 
  src/plugins/positionprovider/wlocate/CMakeLists.txt 7d7e200 
  src/plugins/positionprovider/wlocate/WlocatePositionProviderPlugin.h 13f171a 
  src/plugins/render/annotate/AnnotatePlugin.h 41ad2cb 
  src/plugins/render/annotate/CMakeLists.txt d6097e2 
  src/plugins/render/aprs/AprsPlugin.h e54abd3 
  src/plugins/render/aprs/CMakeLists.txt 079cd1b 
  src/plugins/render/atmosphere/AtmospherePlugin.h 4386ed3 
  src/plugins/render/atmosphere/CMakeLists.txt e929ebf 
  src/plugins/render/compass/CMakeLists.txt b0a0ca2 
  src/plugins/render/compass/CompassFloatItem.h 77e89f6 
  src/plugins/render/crosshairs/CMakeLists.txt 8cd0abf 
  src/plugins/render/crosshairs/CrosshairsPlugin.h 8a57bd5 
  src/plugins/render/earthquake/CMakeLists.txt 717971c 
  src/plugins/render/earthquake/EarthquakePlugin.h 4d4af6b 
  src/plugins/render/elevationprofilefloatitem/CMakeLists.txt 4a1b016 
  src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.h cb3bff1 
  src/plugins/render/elevationprofilemarker/CMakeLists.txt 9ec0dd2 
  src/plugins/render/elevationprofilemarker/ElevationProfileMarker.h c0b7fcb 
  src/plugins/render/fileview/FileViewFloatItem.h 99d7029 
  src/plugins/render/foursquare/CMakeLists.txt 520322d 
  src/plugins/render/foursquare/FoursquarePlugin.h 6f4e606 
  src/plugins/render/gpsinfo/CMakeLists.txt 819bfcd 
  src/plugins/render/gpsinfo/GpsInfo.h 52331fd 
  src/plugins/render/graticule/CMakeLists.txt f31f236 
  src/plugins/render/graticule/GraticulePlugin.h 6746ed6 
  src/plugins/render/inhibit-screensaver/InhibitScreensaverPlugin.h 5f9a453 
  src/plugins/render/license/CMakeLists.txt 6a1d177 
  src/plugins/render/license/License.h b387c02 
  src/plugins/render/mapscale/CMakeLists.txt be21128 
  src/plugins/render/mapscale/MapScaleFloatItem.h deddc64 
  src/plugins/render/measure/CMakeLists.txt 2b47387 
  src/plugins/render/measure/MeasureToolPlugin.h db90311 
  src/plugins/render/navigation/CMakeLists.txt c10d2b2 
  src/plugins/render/navigation/NavigationFloatItem.h 5651ba7 
  src/plugins/render/opencaching/OpenCachingPlugin.h af55da2 
  src/plugins/render/opencachingcom/CMakeLists.txt 09176d8 
  src/plugins/render/opencachingcom/OpenCachingComPlugin.h c7ce4ed 
  src/plugins/render/opendesktop/CMakeLists.txt 7483487 
  src/plugins/render/opendesktop/OpenDesktopPlugin.h 4f82257 
  src/plugins/render/overviewmap/CMakeLists.txt b8928e6 
  src/plugins/render/overviewmap/OverviewMap.h 1e7ddc5 
  src/plugins/render/panoramio/PanoramioPlugin.h 20ec2de 
  src/plugins/render/photo/CMakeLists.txt 63b9ce2 
  src/plugins/render/photo/PhotoPlugin.h 5dae6e5 
  src/plugins/render/positionmarker/CMakeLists.txt 26eb35b 
  src/plugins/render/positionmarker/PositionMarker.h b3f58ce 
  src/plugins/render/postalcode/CMakeLists.txt 5d8f20c 
  src/plugins/render/postalcode/PostalCodeModel.cpp 49acb18 
  src/plugins/render/postalcode/PostalCodePlugin.h edf086d 
  src/plugins/render/progress/CMakeLists.txt 2edd5dd 
  src/plugins/render/progress/ProgressFloatItem.h 31e8bf1 
  src/plugins/render/routing/CMakeLists.txt a258f8d 
  src/plugins/render/routing/RoutingPlugin.h dc88848 
  src/plugins/render/routing/RoutingPlugin.cpp 1dc1918 
  src/plugins/render/satellites/CMakeLists.txt a38a97f 
  src/plugins/render/satellites/SatellitesPlugin.h 5a27256 
  src/plugins/render/speedometer/CMakeLists.txt ba4ce1b 
  src/plugins/render/speedometer/Speedometer.h 0daba3a 
  src/plugins/render/stars/CMakeLists.txt c95bca9 
  src/plugins/render/stars/StarsPlugin.h e1d34f1 
  src/plugins/render/sun/CMakeLists.txt 8a68464 
  src/plugins/render/sun/SunPlugin.h 93df6b9 
  src/plugins/render/test/TestPlugin.h 3ba3018 
  src/plugins/render/twitter/twitterPlugin.h b059f4f 
  src/plugins/render/weather/BBCParser.cpp 66a0957 
  src/plugins/render/weather/CMakeLists.txt df2b79a 
  src/plugins/render/weather/GeoNamesWeatherService.cpp ecbe56d 
  src/plugins/render/weather/WeatherPlugin.h f6a1e3b 
  src/plugins/render/wikipedia/CMakeLists.txt 18b43b0 
  src/plugins/render/wikipedia/WikipediaModel.cpp c816980 
  src/plugins/render/wikipedia/WikipediaPlugin.h 0aa6bb4 
  src/plugins/runner/cache/CMakeLists.txt 29fa99a 
  src/plugins/runner/cache/CachePlugin.h 4292980 
  src/plugins/runner/gosmore-reversegeocoding/CMakeLists.txt 3137412 
  src/plugins/runner/gosmore-reversegeocoding/GosmoreReverseGeocodingPlugin.h 8884b43 
  src/plugins/runner/gosmore-routing/CMakeLists.txt 66e2b90 
  src/plugins/runner/gosmore-routing/GosmoreRoutingPlugin.h 94bce5f 
  src/plugins/runner/gpx/CMakeLists.txt 74afed1 
  src/plugins/runner/gpx/GpxPlugin.h d005fce 
  src/plugins/runner/hostip/CMakeLists.txt fcdb7a3 
  src/plugins/runner/hostip/HostipPlugin.h 252b2f7 
  src/plugins/runner/json/CMakeLists.txt a5e9f70 
  src/plugins/runner/json/JsonPlugin.h 7377231 
  src/plugins/runner/kml/CMakeLists.txt 1c35096 
  src/plugins/runner/kml/KmlPlugin.h 527c2f1 
  src/plugins/runner/latlon/CMakeLists.txt ff8ff37 
  src/plugins/runner/latlon/LatLonPlugin.h 90efe79 
  src/plugins/runner/local-osm-search/CMakeLists.txt 116f4b3 
  src/plugins/runner/local-osm-search/LocalOsmSearchPlugin.h 818fe3b 
  src/plugins/runner/localdatabase/CMakeLists.txt 5d78a48 
  src/plugins/runner/localdatabase/LocalDatabasePlugin.h 5842f73 
  src/plugins/runner/log/CMakeLists.txt d41b587 
  src/plugins/runner/log/LogPlugin.h 7330254 
  src/plugins/runner/mapquest/CMakeLists.txt cc594b4 
  src/plugins/runner/mapquest/MapQuestPlugin.h fff7275 
  src/plugins/runner/monav/CMakeLists.txt f129104 
  src/plugins/runner/monav/MonavMapsModel.cpp 9af5f40 
  src/plugins/runner/monav/MonavPlugin.h 1234731 
  src/plugins/runner/nominatim-reversegeocoding/CMakeLists.txt 2567c5c 
  src/plugins/runner/nominatim-reversegeocoding/NominatimReverseGeocodingPlugin.h bd9224f 
  src/plugins/runner/nominatim-search/CMakeLists.txt 8b1ef00 
  src/plugins/runner/nominatim-search/NominatimSearchPlugin.h ddf61be 
  src/plugins/runner/open-source-routing-machine/CMakeLists.txt beff781 
  src/plugins/runner/open-source-routing-machine/OSRMPlugin.h 0e520c6 
  src/plugins/runner/openrouteservice/CMakeLists.txt 60184ef 
  src/plugins/runner/openrouteservice/OpenRouteServicePlugin.h 4672478 
  src/plugins/runner/osm/CMakeLists.txt d2cf23a 
  src/plugins/runner/osm/OsmPlugin.h a95a00b 
  src/plugins/runner/pn2/CMakeLists.txt bcd273a 
  src/plugins/runner/pn2/Pn2Plugin.h c9bbd8a 
  src/plugins/runner/pnt/CMakeLists.txt b52f461 
  src/plugins/runner/pnt/PntPlugin.h 3d735bd 
  src/plugins/runner/routino/CMakeLists.txt 49bb68e 
  src/plugins/runner/routino/RoutinoPlugin.h 3e64726 
  src/plugins/runner/shp/CMakeLists.txt f0ade06 
  src/plugins/runner/shp/ShpPlugin.h 3888e6b 
  src/plugins/runner/traveling-salesman/TravelingSalesmanPlugin.h 56b24bb 
  src/plugins/runner/yours/CMakeLists.txt 2cab1e5 
  src/plugins/runner/yours/YoursPlugin.h dd75fec 
  src/plugins/templates/floatitem/FITemplateFloatItem.h 3c13b39 
  src/qt-components/marble-touch/CMakeLists.txt 240d33a 
  src/qt-components/marble-touch/main.cpp 9c60e3a 
  src/qtmain.cpp 4c9a21f 
  src/routing-instructions/CMakeLists.txt 531516d 
  tests/CMakeLists.txt 03ae812 
  tests/FrameGraphicsItemTest.cpp fdc4955 
  tests/MarbleWidgetSpeedTest.cpp e1b4848 
  tests/MarbleWidgetTest.cpp 22fc19d 
  tests/TestUtils.h be0ece6 

Diff: http://git.reviewboard.kde.org/r/113392/diff/


Testing
-------

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.


Thanks,

Dennis Nienhüser

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20131023/974833b1/attachment-0001.html>


More information about the Marble-devel mailing list