diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,12 @@ option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") + +if(SONNET_USE_WIDGETS) + option(BUILD_DESIGNERPLUGIN "Build plugin for Qt Designer" ON) + add_feature_info(DESIGNERPLUGIN ${BUILD_DESIGNERPLUGIN} "Build plugin for Qt Designer") +endif() + add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00) if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") ecm_install_po_files_as_qm(po) diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -71,6 +71,10 @@ ${CMAKE_CURRENT_BINARY_DIR}/sonnetui_export.h DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/SonnetUi/sonnet COMPONENT Devel) +if(BUILD_DESIGNERPLUGIN) + add_subdirectory(designer) +endif() + if (BUILD_QCH) ecm_add_qch( KF5SonnetUi_QCH diff --git a/src/ui/designer/CMakeLists.txt b/src/ui/designer/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/src/ui/designer/CMakeLists.txt @@ -0,0 +1,18 @@ +include(ECMAddQtDesignerPlugin) + +ecm_qtdesignerplugin_widget(Sonnet::DictionaryComboBox + TOOLTIP "Dictionary Combobox" + WHATSTHIS "A combobox to select a dictionary for spellchecking" + GROUP "Sonnet (KF5)" +) + +ecm_add_qtdesignerplugin(sonnetuiwidgets + NAME SonnetUiWidgets + OUTPUT_NAME sonnetui5widgets + WIDGETS + Sonnet::DictionaryComboBox + LINK_LIBRARIES + KF5::SonnetUi + INSTALL_DESTINATION "${KDE_INSTALL_QTPLUGINDIR}/designer" + COMPONENT Devel +)