Index: aseba/CMakeLists.txt
===================================================================
--- aseba.orig/CMakeLists.txt
+++ aseba/CMakeLists.txt
@@ -70,18 +70,25 @@ include_directories(${dashel_INCLUDE_DIR
 find_package(enki)
 
 # Qt
-# FindQt4 has a bug and does not support OPTIONAL_COMPONENTS
-# see https://cmake.org/pipermail/cmake/2016-March/063047.html
-#find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork QtXml QtHelp QtSvg QtWebKit OPTIONAL_COMPONENTS QtDBus)
-# So we use a two-step mechanism, first try with DBus, and if not found, try without
-find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork QtXml QtHelp QtSvg QtWebKit QtDBus)
-if (NOT QT_QTDBUS_FOUND)
-	find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork QtXml QtHelp QtSvg QtWebKit)
-endif ()
+find_package(Qt5 COMPONENTS Core Gui REQUIRED)
+find_package(Qt5Widgets REQUIRED)
+find_package(Qt5Network REQUIRED)
+find_package(Qt5Xml REQUIRED)
+find_package(Qt5Help REQUIRED)
+find_package(Qt5Svg REQUIRED)
+find_package(Qt5OpenGL REQUIRED)
+find_package(Qt5WebKit REQUIRED)
+find_package(Qt5DBus QUIET) # don't worry if it is not found
+
+include_directories(${Qt5OpenGL_INCLUDE_DIRS})
+
+# enforce the -fPIC option
+# set(CMAKE_POSITION_INDEPENDENT_CODE ON) # is not enough: tests are using -fPIE
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
 
 # Qwt
-find_path(QWT_INCLUDE_DIR qwt_plot.h PATHS /usr/include/ /usr/local/include PATH_SUFFIXES qwt5-qt4 qwt-qt4 qwt)
-find_library(QWT_LIBRARIES NAMES qwt5-qt4 qwt-qt4 qwt PATHS /usr/lib /usr/local/lib)
+find_path(QWT_INCLUDE_DIR qwt_plot.h PATHS /usr/include/ /usr/local/include PATH_SUFFIXES qwt5-qt5 qwt-qt5 qwt)
+find_library(QWT_LIBRARIES NAMES qwt5-qt5 qwt-qt5 qwt PATHS /usr/lib /usr/local/lib)
 if (QWT_LIBRARIES AND QWT_INCLUDE_DIR)
 	message(STATUS "Qwt found")
 else (QWT_LIBRARIES AND QWT_INCLUDE_DIR)
@@ -122,7 +129,7 @@ if (DNSSD_FOUND)
 		endif()
 	endif()
 	set(ASEBA_ZEROCONF_LIBRARIES asebazeroconf ${ASEBA_ZEROCONF_ADDITIONAL_LIBRARIES})
-	if (QT4_FOUND)
+	if (Qt5_FOUND)
 		set(ASEBA_ZEROCONFQT_LIBRARIES asebazeroconfqt asebazeroconf ${ASEBA_ZEROCONF_ADDITIONAL_LIBRARIES})
 	endif()
 endif()
Index: aseba/clients/eventlogger/CMakeLists.txt
===================================================================
--- aseba.orig/clients/eventlogger/CMakeLists.txt
+++ aseba/clients/eventlogger/CMakeLists.txt
@@ -1,5 +1,6 @@
-if (QT4_FOUND)
-	include(${QT_USE_FILE})
+if (Qt5_FOUND)
+        # include(${QT_USE_FILE})
+        find_package(Qt5 COMPONENTS Widgets)
 	
 	if (QWT_INCLUDE_DIR AND QWT_LIBRARIES)
 	
@@ -12,9 +13,9 @@ if (QT4_FOUND)
 		
 		# Only include the qtmain lib if we are on the windows platform
 		if (WIN32)
-			target_link_libraries(asebaeventlogger ${QWT_LIBRARIES} ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY}  ${ASEBA_CORE_LIBRARIES})
+			target_link_libraries(asebaeventlogger ${QWT_LIBRARIES} ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY}  ${ASEBA_CORE_LIBRARIES} Qt5::Widgets)
 		else (WIN32)
-			target_link_libraries(asebaeventlogger ${QWT_LIBRARIES} ${QT_LIBRARIES}  ${ASEBA_CORE_LIBRARIES})
+			target_link_libraries(asebaeventlogger ${QWT_LIBRARIES} ${QT_LIBRARIES}  ${ASEBA_CORE_LIBRARIES} Qt5::Widgets)
 		endif (WIN32)
 	
 	else (QWT_INCLUDE_DIR AND QWT_LIBRARIES)
@@ -23,4 +24,4 @@ if (QT4_FOUND)
 		
 	endif (QWT_INCLUDE_DIR AND QWT_LIBRARIES)
 	
-endif (QT4_FOUND)
+endif (Qt5_FOUND)
Index: aseba/clients/massloader/CMakeLists.txt
===================================================================
--- aseba.orig/clients/massloader/CMakeLists.txt
+++ aseba/clients/massloader/CMakeLists.txt
@@ -1,11 +1,12 @@
-if (QT4_FOUND)
+if (Qt5_FOUND)
+        find_package(Qt5 COMPONENTS Core Xml)
 	set(QT_USE_QTXML ON)
 	set(QT_DONT_USE_QTGUI ON)
-	include(${QT_USE_FILE})
+	# include(${QT_USE_FILE})
 
 # 	set(thymioupgrader_SRCS
 # 		ThymioUpgrader.cpp)
-# 	qt4_wrap_cpp(thymioupgrader_MOCS
+# 	qt5_wrap_cpp(thymioupgrader_MOCS
 # 		ThymioUpgrader.h
 # 	)
 	
@@ -13,8 +14,8 @@ if (QT4_FOUND)
 	
 	add_executable(asebamassloader massloader.cpp)
 
-	target_link_libraries(asebamassloader asebacompiler ${QT_LIBRARIES} ${ASEBA_CORE_LIBRARIES})
+	target_link_libraries(asebamassloader asebacompiler ${QT_LIBRARIES} ${ASEBA_CORE_LIBRARIES} Qt5::Core Qt5::Xml)
 
 	install(TARGETS asebamassloader RUNTIME DESTINATION bin)
 
-endif (QT4_FOUND)
+endif (Qt5_FOUND)
Index: aseba/clients/studio/CMakeLists.txt
===================================================================
--- aseba.orig/clients/studio/CMakeLists.txt
+++ aseba/clients/studio/CMakeLists.txt
@@ -33,7 +33,7 @@ if (DNSSD_FOUND)
 	set(ADDITIONAL_LIBRARIES ${ADDITIONAL_LIBRARIES} ${ASEBA_ZEROCONFQT_LIBRARIES})
 endif()
 
-if (QT4_FOUND AND QT_QTWEBKIT_FOUND)
+if (Qt5_FOUND)
 	set(QT_USE_QTXML ON)
 	set(QT_USE_QTNETWORK ON)
 	set(QT_USE_QTMAIN ON)
@@ -41,7 +41,15 @@ if (QT4_FOUND AND QT_QTWEBKIT_FOUND)
 	set(QT_USE_QTCONCURRENT ON)
 	set(QT_USE_QTSVG ON)
 	set(QT_USE_QTWEBKIT ON)
-	include(${QT_USE_FILE})
+	#include(${QT_USE_FILE})
+	find_package(Qt5 COMPONENTS Core Gui REQUIRED)
+	find_package(Qt5Widgets REQUIRED)
+	find_package(Qt5Xml  REQUIRED)
+	find_package(Qt5Network  REQUIRED)
+	find_package(Qt5Help  REQUIRED)
+	find_package(Qt5Concurrent  REQUIRED)
+	find_package(Qt5Svg  REQUIRED)
+	find_package(Qt5WebKit  REQUIRED)
 
 	# add a console for debug messages under Windows
 	if (WIN32)
@@ -62,23 +70,15 @@ if (QT4_FOUND AND QT_QTWEBKIT_FOUND)
 	endif (QWT_LIBRARIES AND QWT_INCLUDE_DIR)
 
 	# generates the documentation
-	if (QT_QTHELP_FOUND AND QT_QCOLLECTIONGENERATOR_EXECUTABLE)
-		message(STATUS "qcollectiongenerator executable found")
-		# Use PATH instead of DIRECTORY on next line to support CMake < 2.8.11
-		get_filename_component(QT_QCOLLECTIONGENERATOR_DIRECTORY ${QT_QCOLLECTIONGENERATOR_EXECUTABLE} PATH)
-		get_filename_component(QT_QCOLLECTIONGENERATOR_EXT ${QT_QCOLLECTIONGENERATOR_EXECUTABLE} EXT)
-		set(QT_QHELPGENERATOR_EXECUTABLE "${QT_QCOLLECTIONGENERATOR_DIRECTORY}/qhelpgenerator${QT_QCOLLECTIONGENERATOR_EXT}")
-		add_custom_command(
-			OUTPUT ${DOC_NAME}.qch
-			COMMAND ${QT_QHELPGENERATOR_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${DOC_NAME}.qhp -o ${CMAKE_CURRENT_BINARY_DIR}/${DOC_NAME}.qch
-			DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${DOC_NAME}.qhp)
-		add_custom_command(
-			OUTPUT ${DOC_NAME}.qhc
-			COMMAND ${QT_QCOLLECTIONGENERATOR_EXECUTABLE} ARGS ${DOC_NAME}.qhcp -o ${DOC_NAME}.qhc
-			DEPENDS ${DOC_NAME}.qhcp ${DOC_NAME}.qch)
-	else (QT_QTHELP_FOUND AND QT_QCOLLECTIONGENERATOR_EXECUTABLE)
-		message(WARNING "Qt help support missing, studio online help disabled (hint: on Ubuntu, install package qt4-dev-tools)")
-	endif (QT_QTHELP_FOUND AND QT_QCOLLECTIONGENERATOR_EXECUTABLE)
+	message(STATUS "Qt5tools-dev is here, ensured by debian/control")
+	add_custom_command(
+	  OUTPUT ${DOC_NAME}.qch
+	  COMMAND qhelpgenerator ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${DOC_NAME}.qhp -o ${CMAKE_CURRENT_BINARY_DIR}/${DOC_NAME}.qch
+	  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${DOC_NAME}.qhp)
+	add_custom_command(
+	  OUTPUT ${DOC_NAME}.qhc
+	  COMMAND qcollectiongenerator ARGS ${DOC_NAME}.qhcp -o ${DOC_NAME}.qhc
+	  DEPENDS ${DOC_NAME}.qhcp ${DOC_NAME}.qch)
 	
 	# code common to the use of Aseba under Qt
 	set(qt_common_SRCS
@@ -90,7 +90,7 @@ if (QT4_FOUND AND QT_QTWEBKIT_FOUND)
 		Plugin.cpp
 		translations/CompilerTranslator.cpp
 	)
-	qt4_wrap_cpp(qt_common_MOCS
+	qt5_wrap_cpp(qt_common_MOCS
 		Target.h
 		DashelTarget.h
 		TargetModels.h
@@ -103,53 +103,49 @@ if (QT4_FOUND AND QT_QTWEBKIT_FOUND)
 	add_subdirectory(plugins)
 	
 	# resources
-	qt4_add_resources(resfiles asebastudio.qrc)
+	qt5_add_resources(resfiles asebastudio.qrc)
 	
 	include_directories (${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
 
-	if (QT_QTHELP_FOUND)
-		# studio for desktop use
-		set(studio_SRCS
-			StudioAeslEditor.cpp
-			PluginRegistry.cpp
-			MainWindow.cpp
-			NamedValuesVectorModel.cpp
-			ClickableLabel.cpp
-			CustomDelegate.cpp
-			main.cpp
-			FindDialog.cpp
-			EventViewer.cpp
-			HelpViewer.cpp
-			ConfigDialog.cpp
-			ModelAggregator.cpp
-		)
-		qt4_wrap_cpp(studio_MOCS
-			StudioAeslEditor.h
-			MainWindow.h
-			NamedValuesVectorModel.h
-			ClickableLabel.h
-			CustomDelegate.h
-			FindDialog.h
-			EventViewer.h
-			HelpViewer.h
-			ConfigDialog.h
-			ModelAggregator.h
-		)
-
-		if (QT_QCOLLECTIONGENERATOR_EXECUTABLE)
-			file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/asebastudiohelp.qrc ${CMAKE_CURRENT_SOURCE_DIR}/aseba-doc.qhcp DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-			qt4_add_resources(resfiles ${CMAKE_CURRENT_BINARY_DIR}/asebastudiohelp.qrc)
-		endif (QT_QCOLLECTIONGENERATOR_EXECUTABLE)
-
-		add_executable(asebastudio WIN32 ${studio_SRCS} ${studio_MOCS} ${resfiles} ${CMAKE_BINARY_DIR}/version.h)
-		if (HAS_DYN_VERSION)
-			add_dependencies(asebastudio versionheader)
-		endif (HAS_DYN_VERSION)
-
-		target_link_libraries(asebastudio asebaqtplugins asebaqtcommon asebaqtabout asebacompiler ${ASEBA_CORE_LIBRARIES} ${ADDITIONAL_LIBRARIES} ${QT_LIBRARIES})
-		
-		install(TARGETS asebastudio RUNTIME DESTINATION bin LIBRARY DESTINATION bin)
-	endif (QT_QTHELP_FOUND)
+	# studio for desktop use
+	set(studio_SRCS
+	  StudioAeslEditor.cpp
+	  PluginRegistry.cpp
+	  MainWindow.cpp
+	  NamedValuesVectorModel.cpp
+	  ClickableLabel.cpp
+	  CustomDelegate.cpp
+	  main.cpp
+	  FindDialog.cpp
+	  EventViewer.cpp
+	  HelpViewer.cpp
+	  ConfigDialog.cpp
+	  ModelAggregator.cpp
+	  )
+	qt5_wrap_cpp(studio_MOCS
+	  StudioAeslEditor.h
+	  MainWindow.h
+	  NamedValuesVectorModel.h
+	  ClickableLabel.h
+	  CustomDelegate.h
+	  FindDialog.h
+	  EventViewer.h
+	  HelpViewer.h
+	  ConfigDialog.h
+	  ModelAggregator.h
+	  )
+
+	file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/asebastudiohelp.qrc ${CMAKE_CURRENT_SOURCE_DIR}/aseba-doc.qhcp DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+	qt5_add_resources(resfiles ${CMAKE_CURRENT_BINARY_DIR}/asebastudiohelp.qrc)
+
+	add_executable(asebastudio WIN32 ${studio_SRCS} ${studio_MOCS} ${resfiles} ${CMAKE_BINARY_DIR}/version.h)
+	if (HAS_DYN_VERSION)
+	  add_dependencies(asebastudio versionheader)
+	endif (HAS_DYN_VERSION)
+
+	target_link_libraries(asebastudio asebaqtplugins asebaqtcommon asebaqtabout asebacompiler ${ASEBA_CORE_LIBRARIES} ${ADDITIONAL_LIBRARIES} ${QT_LIBRARIES} ${Qt5Xml_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Help_LIBRARIES} ${Qt5Concurrent_LIBRARIES} ${Qt5WebKit_LIBRARIES})
+
+	install(TARGETS asebastudio RUNTIME DESTINATION bin LIBRARY DESTINATION bin)
 	
 	# Thymio VPL standalone
 	include_directories(${CMAKE_CURRENT_BINARY_DIR}/plugins/ThymioVPL)
@@ -157,7 +153,7 @@ if (QT4_FOUND AND QT_QTWEBKIT_FOUND)
 		ThymioVPLStandalone.cpp
 		thymiovpl.cpp
 	)
-	qt4_wrap_cpp(thymiovpl_MOCS
+	qt5_wrap_cpp(thymiovpl_MOCS
 		ThymioVPLStandalone.h
 	)
 
@@ -170,7 +166,7 @@ if (QT4_FOUND AND QT_QTWEBKIT_FOUND)
 		add_dependencies(thymiovpl versionheader)
 	endif (HAS_DYN_VERSION)
 	
-	target_link_libraries(thymiovpl asebaqtplugins asebaqtcommon asebaqtabout asebacompiler ${ASEBA_CORE_LIBRARIES} ${ADDITIONAL_LIBRARIES} ${QT_LIBRARIES})
+	target_link_libraries(thymiovpl asebaqtplugins asebaqtcommon asebaqtabout asebacompiler ${ASEBA_CORE_LIBRARIES} ${ADDITIONAL_LIBRARIES} ${QT_LIBRARIES} ${Qt5Xml_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Help_LIBRARIES} ${Qt5Concurrent_LIBRARIES} ${Qt5WebKit_LIBRARIES})
 	
 	# Render blocks helper
 	set(rendervplblocks_SRCS
@@ -178,7 +174,7 @@ if (QT4_FOUND AND QT_QTWEBKIT_FOUND)
 	)
 	add_executable(rendervplblocks WIN32 ${rendervplblocks_SRCS} ${resfiles} ${CMAKE_BINARY_DIR}/version.h)
 	# Note: it is ugly to link so much libraries that are not used, but it allows to avoid splitting VPL into several libraries
-	target_link_libraries(rendervplblocks asebaqtplugins asebaqtcommon asebaqtabout ${ASEBA_CORE_LIBRARIES} ${ADDITIONAL_LIBRARIES} ${QT_LIBRARIES})
+	target_link_libraries(rendervplblocks asebaqtplugins asebaqtcommon asebaqtabout ${ASEBA_CORE_LIBRARIES} ${ADDITIONAL_LIBRARIES} ${QT_LIBRARIES} ${Qt5Xml_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Help_LIBRARIES} ${Qt5Concurrent_LIBRARIES} ${Qt5WebKit_LIBRARIES})
 
 	install(TARGETS thymiovpl RUNTIME DESTINATION bin LIBRARY DESTINATION bin)
-endif (QT4_FOUND AND QT_QTWEBKIT_FOUND)
+endif (Qt5_FOUND)
Index: aseba/clients/studio/plugins/CMakeLists.txt
===================================================================
--- aseba.orig/clients/studio/plugins/CMakeLists.txt
+++ aseba/clients/studio/plugins/CMakeLists.txt
@@ -17,7 +17,7 @@ set(qt_plugins_SRCS
 	ThymioVPL/LogSignalMapper.cpp
 )
 
-qt4_wrap_cpp(qt_plugins_MOCS
+qt5_wrap_cpp(qt_plugins_MOCS
 	VariablesViewPlugin.h
 	StopThymioPlugin.h
 	ThymioVPL/ThymioVisualProgramming.h
@@ -34,7 +34,7 @@ qt4_wrap_cpp(qt_plugins_MOCS
 
 if(ASEBA_ENABLE_BLOCKLY_PLUGIN)
 	list(APPEND qt_plugins_SRCS ThymioBlockly/ThymioBlockly.cpp)
-	qt4_wrap_cpp(qt_plugins_MOCS ThymioBlockly/AsebaJavascriptInterface.h ThymioBlockly/ThymioBlockly.h)
+	qt5_wrap_cpp(qt_plugins_MOCS ThymioBlockly/AsebaJavascriptInterface.h ThymioBlockly/ThymioBlockly.h)
 endif(ASEBA_ENABLE_BLOCKLY_PLUGIN)
 
 if (PROTOBUF_FOUND AND PROTOBUF_PROTOC_EXECUTABLE)
Index: aseba/clients/thymioupgrader/CMakeLists.txt
===================================================================
--- aseba.orig/clients/thymioupgrader/CMakeLists.txt
+++ aseba/clients/thymioupgrader/CMakeLists.txt
@@ -1,7 +1,8 @@
-if (QT4_FOUND)
+if (Qt5_FOUND)
+        find_package(Qt5 COMPONENTS Widgets Concurrent Network Xml)
 	set(QT_USE_QTMAIN ON)
 	set(QT_USE_QTCONCURRENT ON)
-	include(${QT_USE_FILE})
+	# include(${QT_USE_FILE})
 
 	# add a console for debug messages under Windows
 	if (WIN32)
@@ -10,11 +11,11 @@ if (QT4_FOUND)
 	
 	set(thymioupgrader_SRCS
 		ThymioUpgrader.cpp)
-	qt4_wrap_cpp(thymioupgrader_MOCS
+	qt5_wrap_cpp(thymioupgrader_MOCS
 		ThymioUpgrader.h
 	)
 	
-	qt4_add_resources(resfiles thymioupgrader.qrc)
+	qt5_add_resources(resfiles thymioupgrader.qrc)
 	
 	include_directories (${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
 	
@@ -23,8 +24,8 @@ if (QT4_FOUND)
 		add_dependencies(thymioupgrader versionheader)
 	endif (HAS_DYN_VERSION)
 
-	target_link_libraries(thymioupgrader ${QT_LIBRARIES} ${ASEBA_CORE_LIBRARIES})
+	target_link_libraries(thymioupgrader ${QT_LIBRARIES} ${ASEBA_CORE_LIBRARIES} Qt5::Widgets Qt5::Concurrent Qt5::Network Qt5::Xml)
 
 	install(TARGETS thymioupgrader RUNTIME DESTINATION bin LIBRARY DESTINATION bin)
 
-endif (QT4_FOUND)
+endif (Qt5_FOUND)
Index: aseba/clients/thymiownetconfig/CMakeLists.txt
===================================================================
--- aseba.orig/clients/thymiownetconfig/CMakeLists.txt
+++ aseba/clients/thymiownetconfig/CMakeLists.txt
@@ -1,14 +1,15 @@
-if (QT4_FOUND)
+if (Qt5_FOUND)
 	set(QT_USE_QTMAIN ON)
-	include(${QT_USE_FILE})
+	#include(${QT_USE_FILE})
+	find_package(Qt5 COMPONENTS Widgets)
 	
 	set(thymiownetconfig_SRCS
 		ThymioWNetConfig.cpp)
-	qt4_wrap_cpp(thymiownetconfig_MOCS
+	qt5_wrap_cpp(thymiownetconfig_MOCS
 		ThymioWNetConfig.h
 	)
 	
-	qt4_add_resources(resfiles thymiownetconfig.qrc)
+	qt5_add_resources(resfiles thymiownetconfig.qrc)
 	
 	include_directories (${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
 	
@@ -17,11 +18,11 @@ if (QT4_FOUND)
 		add_dependencies(thymiownetconfig versionheader)
 	endif (HAS_DYN_VERSION)
 
-	target_link_libraries(thymiownetconfig ${QT_LIBRARIES} ${ASEBA_CORE_LIBRARIES})
+	target_link_libraries(thymiownetconfig ${QT_LIBRARIES} ${ASEBA_CORE_LIBRARIES} Qt5::Widgets)
 
 	install(TARGETS thymiownetconfig RUNTIME DESTINATION bin LIBRARY DESTINATION bin)
 
-endif (QT4_FOUND)
+endif (Qt5_FOUND)
 
 if (UNIX)
 	add_executable(thymiownetconfig-cli thymiownetconfig-cli.c)
Index: aseba/common/about/CMakeLists.txt
===================================================================
--- aseba.orig/common/about/CMakeLists.txt
+++ aseba/common/about/CMakeLists.txt
@@ -1,6 +1,5 @@
-if (QT4_FOUND AND QT_QTWEBKIT_FOUND)
-	set(QT_USE_QTSVG ON)
-	include(${QT_USE_FILE})
+if (Qt5_FOUND)
+	find_package(Qt5 COMPONENTS Gui Widgets Svg)
 	include_directories(${CMAKE_BINARY_DIR})
 	
 	if (QWT_LIBRARIES AND QWT_INCLUDE_DIR)
@@ -11,14 +10,16 @@ if (QT4_FOUND AND QT_QTWEBKIT_FOUND)
 		add_definitions(-DHAVE_ENKI)
 	endif (ENKI_FOUND)
 	
-	qt4_add_resources(resfiles asebaqtabout.qrc)
-	qt4_wrap_cpp(qt_about_MOCS AboutDialog.h)
+	qt5_add_resources(resfiles asebaqtabout.qrc)
+	qt5_wrap_cpp(qt_about_MOCS AboutDialog.h)
 	add_library(asebaqtabout AboutDialog.cpp ${qt_about_MOCS} ${resfiles})
 	if (HAS_DYN_VERSION)
 		add_dependencies(asebaqtabout versionheader)
 	endif (HAS_DYN_VERSION)
 	set_target_properties(asebaqtabout PROPERTIES VERSION ${LIB_VERSION_STRING})
 
+	target_link_libraries(asebaqtabout ${QT_LIBRARIES} ${ASEBA_CORE_LIBRARIES} Qt5::Widgets Qt5::Svg)
+
 	install(TARGETS asebaqtabout
 		LIBRARY DESTINATION ${LIB_INSTALL_DIR}
 		ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
Index: aseba/common/zeroconf/CMakeLists.txt
===================================================================
--- aseba.orig/common/zeroconf/CMakeLists.txt
+++ aseba/common/zeroconf/CMakeLists.txt
@@ -33,10 +33,10 @@ if (DNSSD_FOUND)
 	)
 
 	# Zeroconf with Qt
-	if (QT4_FOUND)
+	if (Qt5_FOUND)
 		set(QT_DONT_USE_QTGUI ON)
-		include(${QT_USE_FILE})
-		qt4_wrap_cpp(asebacommon_zeroconf_MOCS
+		# include(${QT_USE_FILE})
+		qt5_wrap_cpp(asebacommon_zeroconf_MOCS
 			zeroconf-qt.h
 		)
 		set(ASEBA_ZEROCONFQT_SRC
@@ -59,7 +59,7 @@ if (DNSSD_FOUND)
 			DESTINATION include/aseba/common/zeroconf
 		)
 		
-	endif (QT4_FOUND)
+	endif (Qt5_FOUND)
 endif (DNSSD_FOUND)
 
 
Index: aseba/examples/clients/cpp-qt-dbus/CMakeLists.txt
===================================================================
--- aseba.orig/examples/clients/cpp-qt-dbus/CMakeLists.txt
+++ aseba/examples/clients/cpp-qt-dbus/CMakeLists.txt
@@ -2,7 +2,7 @@ include(CheckCXXCompilerFlag)
 CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
 
 if(COMPILER_SUPPORTS_CXX0X)
-	if(QT4_FOUND AND QT_QTDBUS_FOUND)
+	if(Qt5_FOUND AND QT_QTDBUS_FOUND)
 		set(CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
 
 		set(QT_USE_QTMAIN ON)
@@ -19,7 +19,7 @@ if(COMPILER_SUPPORTS_CXX0X)
 			dbusinterface.h
 		)
 
-		qt4_wrap_cpp(aseba-qt-dbus_MOC_SRCS ${aseba-qt-dbus_MOC_HDRS})
+		qt5_wrap_cpp(aseba-qt-dbus_MOC_SRCS ${aseba-qt-dbus_MOC_HDRS})
 	
 		include_directories (${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
 
Index: aseba/examples/clients/cpp-qt-gui/CMakeLists.txt
===================================================================
--- aseba.orig/examples/clients/cpp-qt-gui/CMakeLists.txt
+++ aseba/examples/clients/cpp-qt-gui/CMakeLists.txt
@@ -1,7 +1,8 @@
-if (QT4_FOUND)
+if (Qt5_FOUND)
+        find_package(Qt5 COMPONENTS Widgets)
 	set(QT_USE_QTNETWORK ON)
 	set(QT_USE_QTMAIN ON)
-	include(${QT_USE_FILE})
+	#include(${QT_USE_FILE})
 	
 	set(aseba-qt-gui_SRCS
 		main.cpp
@@ -14,10 +15,10 @@ if (QT4_FOUND)
 		mainwindow.h
 	)
 	
-	qt4_wrap_cpp(aseba-qt-gui_MOC_SRCS ${aseba-qt-gui_MOC_HDRS})
+	qt5_wrap_cpp(aseba-qt-gui_MOC_SRCS ${aseba-qt-gui_MOC_HDRS})
 
 	include_directories (${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
 
 	add_executable(aseba-qt-gui WIN32 ${aseba-qt-gui_SRCS} ${aseba-qt-gui_MOC_SRCS})
-	target_link_libraries(aseba-qt-gui ${ASEBA_CORE_LIBRARIES} ${QT_LIBRARIES} ${EXTRA_LIBS})
-endif (QT4_FOUND)
+	target_link_libraries(aseba-qt-gui ${ASEBA_CORE_LIBRARIES} ${QT_LIBRARIES} ${EXTRA_LIBS} Qt5::Widgets)
+endif (Qt5_FOUND)
Index: aseba/examples/zeroconf/CMakeLists.txt
===================================================================
--- aseba.orig/examples/zeroconf/CMakeLists.txt
+++ aseba/examples/zeroconf/CMakeLists.txt
@@ -21,13 +21,14 @@ target_link_libraries(asebatargetlist-th
 
 # Using QtZeroconf
 
-if (QT4_FOUND)
+if (Qt5_FOUND)
+        find_package (Qt5 COMPONENTS Core)
 	set(QT_USE_QTNETWORK ON)
 	set(QT_DONT_USE_QTGUI ON)
-	qt4_wrap_cpp(examples_targetlist_qt_MOCS
+	qt5_wrap_cpp(examples_targetlist_qt_MOCS
 		targetlist-qt.h
 	)
-	include(${QT_USE_FILE})
+	# include(${QT_USE_FILE})
 
 	include_directories (${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
 
@@ -35,5 +36,5 @@ if (QT4_FOUND)
 		${examples_targetlist_qt_MOCS}
 		targetlist-qt.cpp
 	)
-	target_link_libraries(asebatargetlist-qt ${ASEBA_ZEROCONFQT_LIBRARIES} ${ASEBA_CORE_LIBRARIES} ${QT_LIBRARIES})
-endif (QT4_FOUND)
+	target_link_libraries(asebatargetlist-qt ${ASEBA_ZEROCONFQT_LIBRARIES} ${ASEBA_CORE_LIBRARIES} ${QT_LIBRARIES} Qt5::Core)
+endif (Qt5_FOUND)
Index: aseba/switches/medulla/CMakeLists.txt
===================================================================
--- aseba.orig/switches/medulla/CMakeLists.txt
+++ aseba/switches/medulla/CMakeLists.txt
@@ -1,4 +1,4 @@
-if (QT4_FOUND AND QT_QTDBUS_FOUND)
+if (Qt5_FOUND AND QT_QTDBUS_FOUND)
 	set(QT_USE_QTDBUS ON)
 	set(QT_USE_QTXML ON)
 	set(QT_USE_QTMAIN ON)
@@ -6,7 +6,7 @@ if (QT4_FOUND AND QT_QTDBUS_FOUND)
 	include(${QT_USE_FILE})
 	
 	set(medulla_SRCS medulla.cpp)
-	qt4_wrap_cpp(medulla_MOCS medulla.h)
+	qt5_wrap_cpp(medulla_MOCS medulla.h)
 	
 	add_executable(asebamedulla ${medulla_SRCS} ${medulla_MOCS})
 	
@@ -15,4 +15,4 @@ if (QT4_FOUND AND QT_QTDBUS_FOUND)
 	install(TARGETS asebamedulla RUNTIME
 		DESTINATION bin
 	)
-endif (QT4_FOUND AND QT_QTDBUS_FOUND)
+endif (Qt5_FOUND AND QT_QTDBUS_FOUND)
Index: aseba/targets/challenge/CMakeLists.txt
===================================================================
--- aseba.orig/targets/challenge/CMakeLists.txt
+++ aseba/targets/challenge/CMakeLists.txt
@@ -1,9 +1,10 @@
-if (QT4_FOUND AND ENKI_FOUND)
+if (Qt5_FOUND AND ENKI_FOUND)
 	find_package(OpenGL REQUIRED)
+	find_package(Qt5 COMPONENTS Widgets OpenGL)
 	
 	set(QT_USE_QTMAIN ON)
 	set(QT_USE_QTOPENGL ON)
-	include(${QT_USE_FILE})
+	# include(${QT_USE_FILE})
 	
 	include_directories(${enki_INCLUDE_DIR})
 	
@@ -17,15 +18,15 @@ if (QT4_FOUND AND ENKI_FOUND)
 		objects/food_charge3.cpp
 		objects/food_ring.cpp
 	)
-	qt4_wrap_cpp(challenge_MOCS
+	qt5_wrap_cpp(challenge_MOCS
 		challenge.h
 	)
 	
-	qt4_add_resources(challenge_RCC_SRCS challenge-textures.qrc)
+	qt5_add_resources(challenge_RCC_SRCS challenge-textures.qrc)
 	
 	add_executable(asebachallenge WIN32 ${challenge_SRCS} ${challenge_RCC_SRCS} ${challenge_MOCS})
 	
-	target_link_libraries(asebachallenge asebavmbuffer asebavm ${enki_VIEWER_LIBRARIES} ${enki_LIBRARY} ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${ASEBA_CORE_LIBRARIES})
+	target_link_libraries(asebachallenge asebavmbuffer asebavm ${enki_VIEWER_LIBRARIES} ${enki_LIBRARY} ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${ASEBA_CORE_LIBRARIES} Qt5::Widgets Qt5::OpenGL)
 	install(TARGETS asebachallenge RUNTIME DESTINATION bin LIBRARY DESTINATION bin)
 
-endif (QT4_FOUND AND ENKI_FOUND)
+endif (Qt5_FOUND AND ENKI_FOUND)
Index: aseba/targets/enki-marxbot/CMakeLists.txt
===================================================================
--- aseba.orig/targets/enki-marxbot/CMakeLists.txt
+++ aseba/targets/enki-marxbot/CMakeLists.txt
@@ -1,9 +1,10 @@
-if (QT4_FOUND AND ENKI_FOUND)
+if (Qt5_FOUND AND ENKI_FOUND)
 	find_package(OpenGL REQUIRED)
+	find_package(Qt5 COMPONENTS Widgets OpenGL)
 	
 	set(QT_USE_QTMAIN ON)
 	set(QT_USE_QTOPENGL ON)
-	include(${QT_USE_FILE})
+	# include(${QT_USE_FILE})
 	
 	include_directories(${enki_INCLUDE_DIR})
 	
@@ -15,6 +16,6 @@ if (QT4_FOUND AND ENKI_FOUND)
 	
 	add_executable(asebamarxbot WIN32 ${enki_SRCS})
 	
-	target_link_libraries(asebamarxbot asebavmbuffer asebavm ${enki_VIEWER_LIBRARIES} ${enki_LIBRARY} ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${ASEBA_CORE_LIBRARIES})
+	target_link_libraries(asebamarxbot asebavmbuffer asebavm ${enki_VIEWER_LIBRARIES} ${enki_LIBRARY} ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${ASEBA_CORE_LIBRARIES} Qt5::Widgets Qt5::OpenGL)
 
-endif (QT4_FOUND AND ENKI_FOUND)
+endif (Qt5_FOUND AND ENKI_FOUND)
Index: aseba/targets/playground/CMakeLists.txt
===================================================================
--- aseba.orig/targets/playground/CMakeLists.txt
+++ aseba/targets/playground/CMakeLists.txt
@@ -22,9 +22,10 @@ if (ENKI_FOUND)
 			ARCHIVE DESTINATION ${LIB_INSTALL_DIR} 
 	)
 	
-	if (QT4_FOUND)
+	if (Qt5_FOUND)
 
-		find_package(OpenGL REQUIRED)
+	  find_package(OpenGL REQUIRED)
+	  find_package(Qt5 COMPONENTS Widgets Xml OpenGL Network)
 		
 		set(QT_USE_QTMAIN ON)
 		set(QT_USE_QTOPENGL ON)
@@ -35,9 +36,9 @@ if (ENKI_FOUND)
 			set(QT_USE_QTDBUS ON)
 			add_definitions("-DHAVE_DBUS")
 		endif (QT_QTDBUS_FOUND AND NOT WIN32)
-		include(${QT_USE_FILE})
+		# include(${QT_USE_FILE})
 		
-		qt4_add_resources(resfiles asebaplayground.qrc)
+		qt5_add_resources(resfiles asebaplayground.qrc)
 		
 		set(playground_SRCS
 			DashelAsebaGlue.cpp
@@ -45,7 +46,7 @@ if (ENKI_FOUND)
 			PlaygroundDBusAdaptors.cpp
 			playground.cpp
 		)
-		qt4_wrap_cpp(playground_MOCS
+		qt5_wrap_cpp(playground_MOCS
 			robots/thymio2/Thymio2.h
 			PlaygroundViewer.h
 			PlaygroundDBusAdaptors.h
@@ -53,8 +54,8 @@ if (ENKI_FOUND)
 		
 		add_executable(asebaplayground WIN32 ${playground_SRCS} ${playground_MOCS} ${resfiles})
 		
-		target_link_libraries(asebaplayground asebasim asebavmbuffer asebavm asebaqtabout ${ASEBA_ZEROCONFQT_LIBRARIES} ${enki_VIEWER_LIBRARIES} ${enki_LIBRARY} ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${ASEBA_CORE_LIBRARIES} ${EXTRA_LIBS})
+		target_link_libraries(asebaplayground asebasim asebavmbuffer asebavm asebaqtabout ${ASEBA_ZEROCONFQT_LIBRARIES} ${enki_VIEWER_LIBRARIES} ${enki_LIBRARY} ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${ASEBA_CORE_LIBRARIES} ${EXTRA_LIBS} Qt5::Widgets Qt5::Xml Qt5::OpenGL Qt5::Network)
 		install(TARGETS asebaplayground RUNTIME DESTINATION bin LIBRARY DESTINATION bin)
 
-	endif (QT4_FOUND)
+	endif (Qt5_FOUND)
 endif (ENKI_FOUND)
Index: aseba/tests/simulator/CMakeLists.txt
===================================================================
--- aseba.orig/tests/simulator/CMakeLists.txt
+++ aseba/tests/simulator/CMakeLists.txt
@@ -2,9 +2,8 @@ if (ENKI_FOUND)
     include_directories(${enki_INCLUDE_DIR})
 
     add_executable(aseba-test-simulator aseba-test-simulator.cpp)
-    target_link_libraries(aseba-test-simulator asebasim asebacompiler asebavmbuffer asebavm ${ASEBA_CORE_LIBRARIES} ${enki_LIBRARY})
+    target_link_libraries(aseba-test-simulator asebasim asebacompiler asebavmbuffer asebavm ${ASEBA_CORE_LIBRARIES} ${enki_LIBRARY} Qt5::Core)
 
     # the following tests should succeed
     add_test(robot-simulator-thymio ${EXECUTABLE_OUTPUT_PATH}/aseba-test-simulator)
-
 endif()
Index: aseba/examples/clients/cpp-qt-gui/main.cpp
===================================================================
--- aseba.orig/examples/clients/cpp-qt-gui/main.cpp
+++ aseba/examples/clients/cpp-qt-gui/main.cpp
@@ -21,7 +21,7 @@
 	along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <QtGui/QApplication>
+#include <QApplication>
 #include "mainwindow.h"
 #include "transport/dashel_plugins/dashel-plugins.h"
 
Index: aseba/targets/challenge/challenge.cpp
===================================================================
--- aseba.orig/targets/challenge/challenge.cpp
+++ aseba/targets/challenge/challenge.cpp
@@ -39,6 +39,7 @@
 #include <enki/robots/e-puck/EPuck.h>
 #include <iostream>
 #include <QtGui>
+#include <QtWidgets>
 #include <QtDebug>
 #include "challenge.h"
 #include <string.h>
@@ -1131,8 +1132,8 @@ int main(int argc, char *argv[])
 {
 	QApplication app(argc, argv);
 	
-	// Translation support
-	QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
+	// Translation support ... for Qt5, UTF-8 is the default!
+	// QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
 	
 	QTranslator qtTranslator;
 	qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
Index: aseba/clients/eventlogger/eventlogger.cpp
===================================================================
--- aseba.orig/clients/eventlogger/eventlogger.cpp
+++ aseba/clients/eventlogger/eventlogger.cpp
@@ -4,6 +4,7 @@
 #include "../../transport/dashel_plugins/dashel-plugins.h"
 #include <cmath>
 #include <QtGui>
+#include <QtWidgets>
 #include <cassert>
 #include <fstream>
 #include <iostream>
Index: aseba/clients/thymioupgrader/ThymioUpgrader.cpp
===================================================================
--- aseba.orig/clients/thymioupgrader/ThymioUpgrader.cpp
+++ aseba/clients/thymioupgrader/ThymioUpgrader.cpp
@@ -486,8 +486,9 @@ namespace Aseba
 int main(int argc, char *argv[])
 {
 	QApplication app(argc, argv);
-	
-	QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
+
+	// for Qt5, the only Codec for C strings is definitely UTF-8
+	// QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
 	
 	QTranslator qtTranslator;
 	QTranslator translator;
Index: aseba/clients/thymiownetconfig/ThymioWNetConfig.cpp
===================================================================
--- aseba.orig/clients/thymiownetconfig/ThymioWNetConfig.cpp
+++ aseba/clients/thymiownetconfig/ThymioWNetConfig.cpp
@@ -244,8 +244,9 @@ namespace Aseba
 int main(int argc, char *argv[])
 {
 	QApplication app(argc, argv);
-	
-	QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
+
+	// No longer useful with Qt5!
+	// QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
 	
 	QTranslator qtTranslator;
 	QTranslator translator;
Index: aseba/targets/enki-marxbot/EnkiMarxbot.cpp
===================================================================
--- aseba.orig/targets/enki-marxbot/EnkiMarxbot.cpp
+++ aseba/targets/enki-marxbot/EnkiMarxbot.cpp
@@ -24,6 +24,7 @@
 #include "AsebaMarxbot.h"
 #include <iostream>
 #include <QtGui>
+#include <QtWidgets>
 #include <QtDebug>
 
 namespace Enki
Index: aseba/targets/playground/playground.cpp
===================================================================
--- aseba.orig/targets/playground/playground.cpp
+++ aseba/targets/playground/playground.cpp
@@ -72,7 +72,7 @@ namespace Enki
 		virtual std::string getSDFilePath(const std::string& robotName, unsigned fileNumber) const override
 		{
 			auto fileName(QString("%1/%2/%3/U%4.DAT")
-				.arg(QDesktopServices::storageLocation(QDesktopServices::DataLocation))
+				.arg(QStandardPaths::displayName(QStandardPaths::DataLocation))
 				.arg(qHash(QDir(sceneFileName).canonicalPath()), 8, 16, QChar('0'))
 				.arg(QString::fromStdString(robotName))
 				.arg(fileNumber)
@@ -132,9 +132,10 @@ int main(int argc, char *argv[])
 	QCoreApplication::setOrganizationName(ASEBA_ORGANIZATION_NAME);
 	QCoreApplication::setOrganizationDomain(ASEBA_ORGANIZATION_DOMAIN);
 	app.setApplicationName("Playground");
-	
-	QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
-	QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
+
+	// for Qt5, UTF-8 is definitely the default
+	// QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
+	// QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
 	
 	// Translation support
 	QTranslator qtTranslator;
Index: aseba/examples/clients/cpp-qt-gui/mainwindow.h
===================================================================
--- aseba.orig/examples/clients/cpp-qt-gui/mainwindow.h
+++ aseba/examples/clients/cpp-qt-gui/mainwindow.h
@@ -26,6 +26,7 @@
 
 #include <QMainWindow>
 #include <QtGui>
+#include <QtWidgets>
 
 #include "dashelinterface.h"
 
Index: aseba/clients/studio/Plugin.h
===================================================================
--- aseba.orig/clients/studio/Plugin.h
+++ aseba/clients/studio/Plugin.h
@@ -22,7 +22,7 @@
 #define PLUGIN_H
 
 #include <QLabel>
-#include <QDomDocument>
+#include <QtXml/QDomDocument>
 #include <QMultiMap>
 #include <stdexcept>
 #include <iostream>
Index: aseba/clients/studio/plugins/VariablesViewPlugin.cpp
===================================================================
--- aseba.orig/clients/studio/plugins/VariablesViewPlugin.cpp
+++ aseba/clients/studio/plugins/VariablesViewPlugin.cpp
@@ -2,6 +2,7 @@
 #include "../Target.h"
 #include "../../../common/productids.h"
 #include <QtGui>
+#include <QtWidgets>
 #include <QtDebug>
 #include <limits>
 #include <cassert>
Index: aseba/clients/studio/plugins/ThymioVPL/ThymioVisualProgramming.cpp
===================================================================
--- aseba.orig/clients/studio/plugins/ThymioVPL/ThymioVisualProgramming.cpp
+++ aseba/clients/studio/plugins/ThymioVPL/ThymioVisualProgramming.cpp
@@ -26,7 +26,7 @@
 #include <QSizePolicy>
 #include <QFileDialog>
 #include <QFile>
-#include <QDomElement>
+#include <QtXml/QDomElement>
 #include <QDesktopWidget>
 #include <QApplication>
 #include <QScrollBar>
@@ -37,7 +37,7 @@
 #include <QImageReader>
 #include <QFileInfo>
 #include <QDir>
-#include <QSvgGenerator>
+#include <QtSvg/QSvgGenerator>
 #include <QtDebug>
 
 #include "ThymioVisualProgramming.h"
@@ -366,7 +366,7 @@ namespace Aseba { namespace ThymioVPL
 		QSettings settings;
 		
 		USAGE_LOG(logSaveSnapshot());
-		QString initialFileName(settings.value("ThymioVPL/snapshotFileName", QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)).toString());
+		QString initialFileName(settings.value("ThymioVPL/snapshotFileName",  QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)).toString());
 		if (initialFileName.isEmpty() && !de->openedFileName().isEmpty())
 		{
 			const QFileInfo pf(de->openedFileName());
Index: aseba/clients/studio/plugins/ThymioVPL/ThymioVisualProgramming.h
===================================================================
--- aseba.orig/clients/studio/plugins/ThymioVPL/ThymioVisualProgramming.h
+++ aseba/clients/studio/plugins/ThymioVPL/ThymioVisualProgramming.h
@@ -25,14 +25,14 @@
 #include <QVBoxLayout>
 #include <QHBoxLayout>
 #include <QGraphicsView>
-#include <QGraphicsSvgItem>
+#include <QtSvg/QGraphicsSvgItem>
 #include <QGraphicsItem>
 #include <QGraphicsWidget>
 #include <QGraphicsLinearLayout>
 #include <QComboBox>
 #include <QToolBar>
 #include <QPushButton>
-#include <QDomDocument>
+#include <QtXml/QDomDocument>
 #include <QStack>
 
 #include <map>
Index: aseba/clients/studio/plugins/ThymioVPL/Block.h
===================================================================
--- aseba.orig/clients/studio/plugins/ThymioVPL/Block.h
+++ aseba/clients/studio/plugins/ThymioVPL/Block.h
@@ -24,7 +24,7 @@
 #include <QObject>
 #include <QGraphicsObject>
 #include <QList>
-#include <QDomElement>
+#include <QtXml/QDomElement>
 
 class QMimeData;
 class QSlider;
Index: aseba/clients/studio/plugins/ThymioVPL/Scene.h
===================================================================
--- aseba.orig/clients/studio/plugins/ThymioVPL/Scene.h
+++ aseba/clients/studio/plugins/ThymioVPL/Scene.h
@@ -22,7 +22,7 @@
 #define VPL_SCENE_H
 
 #include <QGraphicsScene>
-#include <QGraphicsSvgItem>
+#include <QtSvg/QGraphicsSvgItem>
 #include "EventActionsSet.h"
 
 namespace Aseba { namespace ThymioVPL
Index: aseba/clients/studio/plugins/ThymioVPL/EventActionsSet.h
===================================================================
--- aseba.orig/clients/studio/plugins/ThymioVPL/EventActionsSet.h
+++ aseba/clients/studio/plugins/ThymioVPL/EventActionsSet.h
@@ -22,7 +22,7 @@
 #define VPL_EVENT_ACTIONS_SET_H
 
 #include <QGraphicsItem>
-#include <QDomElement>
+#include <QtXml/QDomElement>
 
 #include "Compiler.h"
 
Index: aseba/clients/studio/plugins/ThymioVPL/Buttons.cpp
===================================================================
--- aseba.orig/clients/studio/plugins/ThymioVPL/Buttons.cpp
+++ aseba/clients/studio/plugins/ThymioVPL/Buttons.cpp
@@ -21,7 +21,7 @@
 #include <QPainter>
 #include <QGraphicsSceneMouseEvent>
 #include <QGraphicsScene>
-#include <QSvgRenderer>
+#include <QtSvg/QSvgRenderer>
 #include <QDrag>
 #include <QMimeData>
 #include <QCursor>
Index: aseba/clients/studio/plugins/ThymioVPL/Block.cpp
===================================================================
--- aseba.orig/clients/studio/plugins/ThymioVPL/Block.cpp
+++ aseba/clients/studio/plugins/ThymioVPL/Block.cpp
@@ -21,7 +21,7 @@
 #include <QPainter>
 #include <QGraphicsSceneMouseEvent>
 #include <QGraphicsScene>
-#include <QSvgRenderer>
+#include <QtSvg/QSvgRenderer>
 #include <QDrag>
 #include <QMimeData>
 #include <QCursor>
@@ -31,7 +31,7 @@
 #include <QSlider>
 #include <QDragEnterEvent>
 #include <QDropEvent>
-#include <QX11Info>
+#include <QtX11Extras/QX11Info>
 #include <QDebug>
 #include <cassert>
 #include <cmath>
Index: aseba/clients/studio/plugins/ThymioVPL/EventBlocks.cpp
===================================================================
--- aseba.orig/clients/studio/plugins/ThymioVPL/EventBlocks.cpp
+++ aseba/clients/studio/plugins/ThymioVPL/EventBlocks.cpp
@@ -21,7 +21,7 @@
 #include <cassert>
 #include <QPainter>
 #include <QGraphicsSceneMouseEvent>
-#include <QGraphicsSvgItem>
+#include <QtSvg/QGraphicsSvgItem>
 #include <QSlider>
 #include <QGraphicsProxyWidget>
 #include <QGraphicsEllipseItem>
Index: aseba/clients/studio/plugins/ThymioVPL/ActionBlocks.cpp
===================================================================
--- aseba.orig/clients/studio/plugins/ThymioVPL/ActionBlocks.cpp
+++ aseba/clients/studio/plugins/ThymioVPL/ActionBlocks.cpp
@@ -24,7 +24,7 @@
 #include <QSlider>
 #include <QTimeLine>
 #include <QGraphicsProxyWidget>
-#include <QGraphicsSvgItem>
+#include <QtSvg/QGraphicsSvgItem>
 #include <QtCore/qmath.h>
 #include <QDebug>
 
Index: aseba/clients/studio/plugins/ThymioVPL/EventActionsSet.cpp
===================================================================
--- aseba.orig/clients/studio/plugins/ThymioVPL/EventActionsSet.cpp
+++ aseba/clients/studio/plugins/ThymioVPL/EventActionsSet.cpp
@@ -21,7 +21,7 @@
 #include <QPainter>
 #include <QGraphicsSceneMouseEvent>
 #include <QGraphicsScene>
-#include <QSvgRenderer>
+#include <QtSvg/QSvgRenderer>
 #include <QDrag>
 #include <QMimeData>
 #include <QCursor>
Index: aseba/clients/studio/plugins/ThymioVPL/Utils.cpp
===================================================================
--- aseba.orig/clients/studio/plugins/ThymioVPL/Utils.cpp
+++ aseba/clients/studio/plugins/ThymioVPL/Utils.cpp
@@ -19,7 +19,7 @@
 */
 
 #include "Utils.h"
-#include <QSvgRenderer>
+#include <QtSvg/QSvgRenderer>
 #include <QPainter>
 
 namespace Aseba { namespace ThymioVPL
Index: aseba/clients/studio/plugins/ThymioVPL/LogSignalMapper.h
===================================================================
--- aseba.orig/clients/studio/plugins/ThymioVPL/LogSignalMapper.h
+++ aseba/clients/studio/plugins/ThymioVPL/LogSignalMapper.h
@@ -23,11 +23,12 @@
 
 #include <QPair>
 #include <QHash>
+#include <QtCore>
 
 namespace Aseba { namespace ThymioVPL
 {
 
-typedef QPair<unsigned int, QObject *> SenderInfo;
+  typedef QPair<unsigned int, QObject *> SenderInfo;
 
 class LogSignalMapper : public QObject{
 	Q_OBJECT
Index: aseba/clients/studio/plugins/ThymioVPL/UsageLogger.cpp
===================================================================
--- aseba.orig/clients/studio/plugins/ThymioVPL/UsageLogger.cpp
+++ aseba/clients/studio/plugins/ThymioVPL/UsageLogger.cpp
@@ -241,7 +241,7 @@ void UsageLogger::logBlockMouseRelease(Q
 	logMouseAction(RELEASE_BLOCK,event->scenePos().x(),event->scenePos().y(),mapButtons(event->button()),nullptr,name.toUtf8().constData(),type.toUtf8().constData());
 }
 void UsageLogger::logButtonDrag(QString name, QString type, QMouseEvent *event, QDrag *drag){
-	logMouseAction(DRAG_BUTTON,event->posF().x(),event->posF().y(),mapButtons(event->button()),nullptr,name.toUtf8().constData(),type.toUtf8().constData());
+	logMouseAction(DRAG_BUTTON,event->pos().x(),event->pos().y(),mapButtons(event->button()),nullptr,name.toUtf8().constData(),type.toUtf8().constData());
 }
 
 void UsageLogger::logActionSetDrag(int row,QGraphicsSceneMouseEvent *event, QDrag *drag){
Index: aseba/clients/studio/DashelTarget.cpp
===================================================================
--- aseba.orig/clients/studio/DashelTarget.cpp
+++ aseba/clients/studio/DashelTarget.cpp
@@ -28,9 +28,10 @@
 #include <cassert>
 #include <QInputDialog>
 #include <QtGui>
+#include <QtWidgets>
 #include <QLibraryInfo>
-#include <QHostInfo>
-#include <QNetworkInterface>
+#include <QtNetwork/QHostInfo>
+#include <QtNetwork/QNetworkInterface>
 #include <stdexcept>
 #include <regex>
 
Index: aseba/clients/studio/TargetModels.cpp
===================================================================
--- aseba.orig/clients/studio/TargetModels.cpp
+++ aseba/clients/studio/TargetModels.cpp
@@ -21,6 +21,7 @@
 #include "TargetModels.h"
 #include <QtDebug>
 #include <QtGui>
+#include <QtWidgets>
 
 namespace Aseba
 {
@@ -80,11 +81,15 @@ namespace Aseba
 		else
 			return variables.size();
 	}
-	
+
 	TargetVariablesModel::TargetVariablesModel(QObject *parent) :
 		QAbstractItemModel(parent)
 	{
-		setSupportedDragActions(Qt::CopyAction);
+	  /*setSupportedDragActions(Qt::CopyAction);*/
+	}
+
+        Qt::DropActions TargetVariablesModel::supportedDragActions() const{
+	  return Qt::CopyAction;
 	}
 	
 	int TargetVariablesModel::columnCount(const QModelIndex & parent) const
@@ -526,10 +531,14 @@ namespace Aseba
 		regExp("\\b")
 	{
 		Q_ASSERT(descriptionRead);
-		setSupportedDragActions(Qt::CopyAction);
+		/* setSupportedDragActions(Qt::CopyAction); */
 		recreateTreeFromDescription(showHidden);
 	}
 	
+        Qt::DropActions TargetFunctionsModel::supportedDragActions() const{
+	  return Qt::CopyAction;
+	}
+
 	TargetFunctionsModel::~TargetFunctionsModel()
 	{
 		delete root;
Index: aseba/clients/studio/TargetModels.h
===================================================================
--- aseba.orig/clients/studio/TargetModels.h
+++ aseba/clients/studio/TargetModels.h
@@ -98,6 +98,7 @@ namespace Aseba
 		unsigned getVariablePos(const QString& name) const;
 		unsigned getVariableSize(const QString& name) const;
 		VariablesDataVector getVariableValue(const QString& name) const;
+		Qt::DropActions supportedDragActions() const;
 		
 	public slots:
 		void updateVariablesStructure(const VariablesMap *variablesMap);
@@ -152,7 +153,7 @@ namespace Aseba
 		
 		QStringList mimeTypes () const;
 		QMimeData * mimeData ( const QModelIndexList & indexes ) const;
-		
+		Qt::DropActions supportedDragActions() const;
 	public slots:
 		void recreateTreeFromDescription(bool showHidden);
 		
Index: aseba/clients/studio/CustomWidgets.cpp
===================================================================
--- aseba.orig/clients/studio/CustomWidgets.cpp
+++ aseba/clients/studio/CustomWidgets.cpp
@@ -22,6 +22,7 @@
 #include <QMimeData>
 #include <QResizeEvent>
 #include <QPainter>
+#include <QtWidgets>
 
 namespace Aseba
 {
Index: aseba/clients/studio/AeslEditor.cpp
===================================================================
--- aseba.orig/clients/studio/AeslEditor.cpp
+++ aseba/clients/studio/AeslEditor.cpp
@@ -22,6 +22,7 @@
 #include "CustomWidgets.h"
 #include "../../common/utils/utils.h"
 #include <QtGui>
+#include <QtWidgets>
 #include <QtGlobal>
 
 namespace Aseba
Index: aseba/clients/studio/ThymioVPLStandalone.cpp
===================================================================
--- aseba.orig/clients/studio/ThymioVPLStandalone.cpp
+++ aseba/clients/studio/ThymioVPLStandalone.cpp
@@ -305,7 +305,7 @@ namespace Aseba
 				#ifdef ANDROID
 				fileName = settings.value("ThymioVPLStandalone/fileName", "/sdcard/").toString();
 				#else // ANDROID
-				fileName = settings.value("ThymioVPLStandalone/fileName", QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)).toString();
+				fileName = settings.value("ThymioVPLStandalone/fileName", QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)).toString();
 				#endif // ANDROID
 				// keep only the path of the directory
 				fileName = QFileInfo(fileName).dir().path();
@@ -372,7 +372,7 @@ namespace Aseba
 			#ifdef ANDROID
 			dir = settings.value("ThymioVPLStandalone/fileName", "/sdcard/").toString();
 			#else // ANDROID
-			dir = settings.value("ThymioVPLStandalone/fileName", QDesktopServices::displayName(QDesktopServices::DocumentsLocation)).toString();
+			dir = settings.value("ThymioVPLStandalone/fileName", QStandardPaths::displayName(QStandardPaths::DocumentsLocation)).toString();
 			#endif // ANDROID
 		}
 		else
Index: aseba/clients/studio/thymiovpl.cpp
===================================================================
--- aseba.orig/clients/studio/thymiovpl.cpp
+++ aseba/clients/studio/thymiovpl.cpp
@@ -82,8 +82,8 @@ int main(int argc, char *argv[])
 	QCoreApplication::setOrganizationDomain(ASEBA_ORGANIZATION_DOMAIN);
 	QCoreApplication::setApplicationName("Thymio VPL");
 
-	QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
-	QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
+	//QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
+	//QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
 	
 	// override dashel signal handling
 	signal(SIGTERM, SIG_DFL);
Index: aseba/clients/studio/ConfigDialog.h
===================================================================
--- aseba.orig/clients/studio/ConfigDialog.h
+++ aseba/clients/studio/ConfigDialog.h
@@ -24,6 +24,7 @@
 #include <QWidget>
 #include <QString>
 #include <QtGui>
+#include <QtWidgets>
 
 #include <map>
 
Index: aseba/clients/studio/StudioAeslEditor.cpp
===================================================================
--- aseba.orig/clients/studio/StudioAeslEditor.cpp
+++ aseba/clients/studio/StudioAeslEditor.cpp
@@ -38,7 +38,7 @@ namespace Aseba
 	
 	void StudioAeslEditor::dropEvent(QDropEvent *event)
 	{
-		dropSourceWidget = event->source();
+	  dropSourceWidget = (QWidget *) event->source();
 		QTextEdit::dropEvent(event);
 		dropSourceWidget = 0;
 		setFocus(Qt::MouseFocusReason);
Index: aseba/clients/studio/MainWindow.cpp
===================================================================
--- aseba.orig/clients/studio/MainWindow.cpp
+++ aseba/clients/studio/MainWindow.cpp
@@ -861,7 +861,7 @@ namespace Aseba
 	void NodeTab::saveBytecode()
 	{
 		const QString& nodeName(target->getName(id));
-		QString bytecodeFileName = QFileDialog::getSaveFileName(mainWindow, tr("Save the binary code of %0").arg(nodeName), QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation), "Aseba Binary Object (*.abo);;All Files (*)");
+		QString bytecodeFileName = QFileDialog::getSaveFileName(mainWindow, tr("Save the binary code of %0").arg(nodeName), QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "Aseba Binary Object (*.abo);;All Files (*)");
 		
 		QFile file(bytecodeFileName);
 		if (!file.open(QFile::WriteOnly | QFile::Truncate))
@@ -1713,7 +1713,7 @@ namespace Aseba
 				if (recentFiles.size() > 0)
 					dir = recentFiles[0];
 				else
-					dir = QDesktopServices::displayName(QDesktopServices::DocumentsLocation);
+					dir = QStandardPaths::displayName(QStandardPaths::DocumentsLocation);
 			}
 			
 			fileName = QFileDialog::getOpenFileName(this,
@@ -1899,7 +1899,7 @@ namespace Aseba
 			fileName = QFileDialog::getSaveFileName(
 				this,
 				tr("Save Script"),
-				actualFileName.isEmpty() ? QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation) : actualFileName,
+				actualFileName.isEmpty() ? QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) : actualFileName,
 				"Aseba scripts (*.aesl)"
 			);
 		
@@ -2016,7 +2016,7 @@ namespace Aseba
 	
 	void MainWindow::exportMemoriesContent()
 	{
-		QString exportFileName = QFileDialog::getSaveFileName(this, tr("Export memory content"), QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation), "All Files (*);;CSV files (*.csv);;Text files (*.txt)");
+		QString exportFileName = QFileDialog::getSaveFileName(this, tr("Export memory content"), QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "All Files (*);;CSV files (*.csv);;Text files (*.txt)");
 		
 		QFile file(exportFileName);
 		if (!file.open(QFile::WriteOnly | QFile::Truncate))
Index: aseba/clients/studio/CustomDelegate.cpp
===================================================================
--- aseba.orig/clients/studio/CustomDelegate.cpp
+++ aseba/clients/studio/CustomDelegate.cpp
@@ -20,6 +20,7 @@
 
 #include "CustomDelegate.h"
 #include <QtGui>
+#include <QtWidgets>
 
 namespace Aseba
 {
Index: aseba/clients/studio/main.cpp
===================================================================
--- aseba.orig/clients/studio/main.cpp
+++ aseba/clients/studio/main.cpp
@@ -64,8 +64,8 @@ int main(int argc, char *argv[])
 	QCoreApplication::setOrganizationDomain(ASEBA_ORGANIZATION_DOMAIN);
 	QCoreApplication::setApplicationName("Aseba Studio");
 
-	QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
-	QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
+	//QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
+	//QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
 	
 	// override dashel signal handling
 	signal(SIGTERM, SIG_DFL);
Index: aseba/clients/studio/EventViewer.cpp
===================================================================
--- aseba.orig/clients/studio/EventViewer.cpp
+++ aseba/clients/studio/EventViewer.cpp
@@ -228,7 +228,7 @@ namespace Aseba
 	void EventViewer::saveToFile()
 	{
 		QSettings settings;
-		QString lastFileName(settings.value("EventViewer/exportFileName", QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)).toString());
+		QString lastFileName(settings.value("EventViewer/exportFileName", QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)).toString());
 		QString filter = "Text files (*.txt);;CSV files (*.csv);;All Files (*)";
 		QString fileName = QFileDialog::getSaveFileName(this, tr("Save plot data to file"), lastFileName, filter);
 		
Index: aseba/clients/studio/ModelAggregator.cpp
===================================================================
--- aseba.orig/clients/studio/ModelAggregator.cpp
+++ aseba/clients/studio/ModelAggregator.cpp
@@ -66,7 +66,7 @@ namespace Aseba
 
 	QModelIndex ModelAggregator::index(int row, int column, const QModelIndex &parent) const
 	{
-		return hasIndex(row, column, parent) ? createIndex(row, column, 0) : QModelIndex();
+		return hasIndex(row, column, parent) ? createIndex(row, column, (void *) 0) : QModelIndex();
 	}
 
 	QModelIndex ModelAggregator::parent(const QModelIndex &child) const
@@ -109,7 +109,7 @@ namespace Aseba
 
 	QModelIndex TreeChainsawFilter::index(int row, int column, const QModelIndex &parent) const
 	{
-		return hasIndex(row, column, parent) ? createIndex(row, column, 0) : QModelIndex();
+		return hasIndex(row, column, parent) ? createIndex(row, column, (void *) 0) : QModelIndex();
 	}
 
 	QModelIndex TreeChainsawFilter::parent(const QModelIndex &child) const
@@ -179,7 +179,7 @@ namespace Aseba
 			// leaf!
 			ModelIndexLink indexLink;
 			indexLink.source = parent;
-			indexLink.proxy = createIndex(rowCounter++, 0, 0);
+			indexLink.proxy = createIndex(rowCounter++, 0, (void *) 0);
 			indexList.append(indexLink);
 			return;
 		}
