diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt
index e4e10e2e..17bed311 100644
--- a/autotests/CMakeLists.txt
+++ b/autotests/CMakeLists.txt
@@ -1,24 +1,24 @@
 remove_definitions(-DQT_NO_CAST_FROM_ASCII)
 
 include(ECMAddTests)
 
 find_package(Qt5Test ${REQUIRED_QT_VERSION} CONFIG QUIET)
 
 if(NOT Qt5Test_FOUND)
     message(STATUS "Qt5Test not found, autotests will not be built.")
     return()
 endif()
 
 ecm_add_test(
     flatkeylistmodeltest.cpp
     abstractkeylistmodeltest.cpp
     TEST_NAME flatkeylistmodeltest
-    LINK_LIBRARIES KF5::Libkleo Qt::Test
+    LINK_LIBRARIES KF5::Libkleo Qt5::Test
 )
 
 ecm_add_test(
     hierarchicalkeylistmodeltest.cpp
     abstractkeylistmodeltest.cpp
     TEST_NAME hierarchicalkeylistmodeltest
-    LINK_LIBRARIES KF5::Libkleo Qt::Test
+    LINK_LIBRARIES KF5::Libkleo Qt5::Test
 )
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9ef7eafd..aa48ed40 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,230 +1,230 @@
 
 # target_include_directories does not handle empty include paths
 include_directories(${GPGME_INCLUDES})
 
 add_definitions(-DTRANSLATION_DOMAIN=\"libkleopatra\")
 
 #add_definitions( -DQT_NO_CAST_FROM_ASCII )
 #add_definitions( -DQT_NO_CAST_TO_ASCII )
 
 kde_enable_exceptions()
 
 add_definitions( -DGPGMEPP_ERR_SOURCE_DEFAULT=13 ) # 13 is GPG_ERR_SOURCE_KLEO, even if gpg-error's too old to know about
 
 add_subdirectory( pics )
 if (BUILD_TESTING)
    add_subdirectory( tests )
 endif()
 
 ########### next target ###############
 set(libkleo_core_SRCS
    kleo/checksumdefinition.cpp
    kleo/defaultkeyfilter.cpp
    kleo/defaultkeygenerationjob.cpp
    kleo/dn.cpp
    kleo/enum.cpp
    kleo/kconfigbasedkeyfilter.cpp
    kleo/keyfiltermanager.cpp
    kleo/keygroup.cpp
    kleo/keyresolver.cpp
    kleo/kleoexception.cpp
    kleo/oidmap.cpp
    models/keycache.cpp
    models/keylistmodel.cpp
    models/keylistmodelinterface.cpp
    models/keylistsortfilterproxymodel.cpp
    models/keyrearrangecolumnsproxymodel.cpp
    models/subkeylistmodel.cpp
    models/useridlistmodel.cpp
    utils/filesystemwatcher.cpp
    utils/formatting.cpp
    utils/classify.cpp
    utils/gnupg.cpp
    utils/gnupg-registry.c
    utils/hex.cpp
    )
 ecm_qt_declare_logging_category(libkleo_core_SRCS HEADER libkleo_debug.h IDENTIFIER LIBKLEO_LOG CATEGORY_NAME org.kde.pim.libkleo
         DESCRIPTION "libkleo (kleo_core)"
         EXPORT LIBKLEO
     )
 
 
 set(libkleo_ui_common_SRCS
    ui/dnattributeorderconfigwidget.cpp
    ui/kdhorizontalline.cpp
    ui/filenamerequester.cpp
    ui/messagebox.cpp
    ui/cryptoconfigmodule.cpp
    ui/cryptoconfigdialog.cpp
    ui/directoryserviceswidget.cpp
    ui/progressbar.cpp
    ui/progressdialog.cpp
    ui/auditlogviewer.cpp
    )
 
 ecm_qt_declare_logging_category(libkleo_ui_common_SRCS HEADER kleo_ui_debug.h IDENTIFIER KLEO_UI_LOG CATEGORY_NAME org.kde.pim.kleo_ui
         DESCRIPTION "libkleo (kleo_ui)"
         OLD_CATEGORY_NAMES log_kleo_ui
         EXPORT LIBKLEO
     )
 
 
 set(libkleo_ui_SRCS    # make this a separate lib.
     ui/keylistview.cpp
     ui/keyselectiondialog.cpp
     ui/keyrequester.cpp
     ui/keyapprovaldialog.cpp
     ui/newkeyapprovaldialog.cpp
     ui/keyselectioncombo.cpp
     )
 
 ki18n_wrap_ui(libkleo_ui_common_SRCS
     ui/directoryserviceswidget.ui
 )
 
 set(kleo_LIB_SRCS ${libkleo_core_SRCS} ${libkleo_ui_SRCS}
                                        ${libkleo_ui_common_SRCS})
 
-set(kleo_LIB_LIBS PUBLIC QGpgme Gpgmepp PRIVATE Qt::Widgets
+set(kleo_LIB_LIBS PUBLIC QGpgme Gpgmepp PRIVATE Qt5::Widgets
                                                 KF5::I18n
                                                 KF5::Completion
                                                 KF5::ConfigCore
                                                 KF5::CoreAddons
                                                 KF5::WidgetsAddons
                                                 KF5::ItemModels
                                                 KF5::Codecs)
 
 if (KF5PimTextEdit_FOUND)
   add_definitions(-DHAVE_PIMTEXTEDIT)
   set(kleo_LIB_LIBS ${kleo_LIB_LIBS} PRIVATE KF5::PimTextEdit)
 endif()
 
 add_library(KF5Libkleo ${kleo_LIB_SRCS})
 if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
     set_target_properties(KF5Libkleo PROPERTIES UNITY_BUILD ON)
 endif()
 generate_export_header(KF5Libkleo BASE_NAME kleo)
 add_library(KF5::Libkleo ALIAS KF5Libkleo)
 if(WIN32)
 target_link_libraries(KF5Libkleo ${kleo_LIB_LIBS}  ${GPGME_VANILLA_LIBRARIES} )
 else()
 target_link_libraries(KF5Libkleo ${kleo_LIB_LIBS} )
 endif()
 
 set_target_properties(KF5Libkleo PROPERTIES
     VERSION ${LIBKLEO_VERSION_STRING}
     SOVERSION ${LIBKLEO_SOVERSION}
     EXPORT_NAME Libkleo
 )
 
 install(TARGETS
     KF5Libkleo
     EXPORT KF5LibkleoTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}
 )
 
 
 
 target_include_directories(KF5Libkleo PUBLIC "$<BUILD_INTERFACE:${libkleo_SOURCE_DIR}/src;${libkleo_BINARY_DIR}/src>")
 target_include_directories(KF5Libkleo INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/Libkleo/;${KDE_INSTALL_INCLUDEDIR_KF5}/libkleo>")
 
 ecm_generate_headers(libkleo_CamelCase_HEADERS
   HEADER_NAMES
   ChecksumDefinition
   DefaultKeyFilter
   DefaultKeyGenerationJob
   Dn
   Enum
   KConfigBasedKeyFilter
   KeyFilter
   KeyFilterManager
   KeyGroup
   KeyResolver
   KleoException
   OidMap
   Predicates
   Stl_Util
   REQUIRED_HEADERS libkleo_HEADERS
   PREFIX Libkleo
   RELATIVE kleo
 )
 
 ecm_generate_headers(libkleo_CamelCase_models_HEADERS
   HEADER_NAMES
   KeyCache
   KeyList
   KeyListModel
   KeyListModelInterface
   KeyListSortFilterProxyModel
   KeyRearrangeColumnsProxyModel
   SubkeyListModel
   UserIDListModel
   REQUIRED_HEADERS libkleo_models_HEADERS
   PREFIX Libkleo
   RELATIVE models
 )
 
 ecm_generate_headers(libkleo_CamelCase_utils_HEADERS
   HEADER_NAMES
   Classify
   FileSystemWatcher
   Formatting
   GnuPG
   REQUIRED_HEADERS libkleo_utils_HEADERS
   PREFIX Libkleo
   RELATIVE utils
 )
 
 ecm_generate_headers(libkleo_CamelCase_ui_HEADERS
   HEADER_NAMES
   CryptoConfigDialog
   CryptoConfigModule
   DNAttributeOrderConfigWidget
   DirectoryServicesWidget
   FileNameRequester
   KDHorizontalLine
   KeyApprovalDialog
   NewKeyApprovalDialog
   KeyRequester
   KeySelectionCombo
   KeySelectionDialog
   MessageBox
   ProgressDialog
   REQUIRED_HEADERS libkleo_ui_HEADERS
   PREFIX Libkleo
   RELATIVE ui
 )
 
 ecm_generate_pri_file(BASE_NAME Libkleo
     LIB_NAME KF5Libkleo
     DEPS "QGpgme" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/Libkleo
 )
 
 
 install(FILES
     ${libkleo_CamelCase_HEADERS}
     ${libkleo_CamelCase_models_HEADERS}
     ${libkleo_CamelCase_ui_HEADERS}
     ${libkleo_CamelCase_utils_HEADERS}
     DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/Libkleo
     COMPONENT Devel
 )
 
 install(FILES
     ${CMAKE_CURRENT_BINARY_DIR}/kleo_export.h
     ${libkleo_HEADERS}
     ${libkleo_models_HEADERS}
     ${libkleo_ui_HEADERS}
     ${libkleo_utils_HEADERS}
     DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/libkleo
     COMPONENT Devel
 )
 install(FILES
     ${PRI_FILENAME}
     DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
 
 
 if ( WIN32 )
 install ( FILES libkleopatrarc-win32.desktop DESTINATION ${KDE_INSTALL_CONFDIR} RENAME libkleopatrarc )
 else ()
 install ( FILES libkleopatrarc.desktop DESTINATION ${KDE_INSTALL_CONFDIR} RENAME libkleopatrarc )
 endif ()
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index b54f264f..e81bdca0 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -1,22 +1,22 @@
 include(ECMMarkAsTest)
 
 # Convenience macro to add kleo unit tests.
 macro( add_kleo_test _source )
   set( _test ${_source} )
   get_filename_component( _name ${_source} NAME_WE )
   add_executable( ${_name} ${_test} )
   ecm_mark_as_test(kleo-${_name})
-  target_link_libraries(${_name} KF5::Libkleo Qt::Widgets KF5::CoreAddons KF5::I18n KF5::WidgetsAddons)
+  target_link_libraries(${_name} KF5::Libkleo Qt5::Widgets KF5::CoreAddons KF5::I18n KF5::WidgetsAddons)
 endmacro()
 
 
 add_kleo_test(test_kdhorizontalline.cpp)
 add_kleo_test(test_jobs.cpp)
 add_kleo_test(test_cryptoconfig.cpp)
 add_kleo_test(test_keyselectiondialog.cpp)
 add_kleo_test(test_keygen.cpp)
 add_kleo_test(test_keylister.cpp)
 add_kleo_test(test_auditlog.cpp)
 add_kleo_test(test_keyformailbox.cpp)
 add_kleo_test(test_keyselectioncombo.cpp)
 add_kleo_test(test_keyresolver.cpp)