├── .clang-format ├── .gitignore ├── .gitlab-ci.yml ├── .kde-ci.yml ├── AUTHORS ├── CMakeLists.txt ├── COPYING-CMAKE-SCRIPTS ├── COPYING.LIB ├── INSTALL.md ├── README.md ├── autotests ├── CMakeLists.txt ├── KPropertySetTest.cpp ├── KPropertyTest.cpp └── headers │ ├── CMakeLists.txt │ ├── HeadersTestInclude.cmake │ └── headers_test.sh ├── cmake └── modules │ ├── FindQHelpGenerator.cmake │ ├── GetGitRevisionDescription.cmake │ ├── GetGitRevisionDescription.cmake.in │ ├── KPropertyAddIconsRccFile.cmake │ ├── KPropertyMacros.cmake │ ├── KPropertyQueryQmake.cmake │ ├── SetKPropertyCMakePolicies.cmake │ └── update_icon_list.sh ├── examples ├── CMakeLists.txt ├── main.cpp ├── window.cpp └── window.h ├── metainfo.yaml ├── poqm ├── ca │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── ca@valencia │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── cs │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── de │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── en_GB │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── eo │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── es │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── et │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── eu │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── fi │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── fr │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── gl │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── he │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── hi │ └── kpropertycore_qt.po ├── ia │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── it │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── ja │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── ka │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── ko │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── lt │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── nl │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── nn │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── pl │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── pt │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── pt_BR │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── ro │ └── kpropertywidgets_qt.po ├── ru │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── sk │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── sl │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── sv │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── tr │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── uk │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po ├── zh_CN │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po └── zh_TW │ ├── kpropertycore_qt.po │ └── kpropertywidgets_qt.po └── src ├── CMakeLists.txt ├── KDefaultPropertyFactory.cpp ├── KDefaultPropertyFactory.h ├── KProperty.cpp ├── KProperty.h ├── KPropertyComposedUrl.cpp ├── KPropertyComposedUrl.h ├── KPropertyCoreConfig.cmake.in ├── KPropertyCoreUtils.cpp ├── KPropertyCoreUtils_p.h ├── KPropertyEditorDataModel_p.cpp ├── KPropertyEditorDataModel_p.h ├── KPropertyEditorItemEvent.cpp ├── KPropertyEditorItemEvent.h ├── KPropertyEditorView.cpp ├── KPropertyEditorView.h ├── KPropertyFactory.cpp ├── KPropertyFactory.h ├── KPropertyLineStyleItemDelegate_p.cpp ├── KPropertyLineStyleItemDelegate_p.h ├── KPropertyLineStyleModel_p.cpp ├── KPropertyLineStyleModel_p.h ├── KPropertyLineStyleSelector_p.cpp ├── KPropertyLineStyleSelector_p.h ├── KPropertyListData.cpp ├── KPropertyListData.h ├── KPropertySet.cpp ├── KPropertySet.h ├── KPropertySetBuffer.cpp ├── KPropertySetBuffer.h ├── KPropertySet_p.h ├── KPropertyUtils.cpp ├── KPropertyUtils.h ├── KPropertyUtils_p.cpp ├── KPropertyUtils_p.h ├── KPropertyWidgetsConfig.cmake.in ├── KPropertyWidgetsFactory.cpp ├── KPropertyWidgetsFactory.h ├── KPropertyWidgetsPluginManager.cpp ├── KPropertyWidgetsPluginManager.h ├── KProperty_p.h ├── Mainpage.dox ├── Messages.sh ├── config-kproperty.h.cmake ├── editors ├── 3rdparty │ ├── KColorCollection │ ├── KColorCollection.cpp │ ├── KColorCollection.h │ ├── KColorCombo │ ├── KColorCombo.cpp │ └── KColorCombo.h ├── CMakeLists.txt ├── KPropertyComposedUrlEditor.cpp ├── KPropertyComposedUrlEditor.h ├── KPropertyGenericSelectionEditor.cpp ├── KPropertyGenericSelectionEditor.h ├── KPropertyMultiLineStringEditor.cpp ├── KPropertyMultiLineStringEditor.h ├── KPropertyRectFEditor.cpp ├── KPropertyRectFEditor.h ├── KPropertyStringEditor.cpp ├── KPropertyStringEditor.h ├── KPropertyUrlEditor.cpp ├── KPropertyUrlEditor.h ├── KPropertyUrlEditor_p.cpp ├── KPropertyUrlEditor_p.h ├── booledit.cpp ├── booledit.h ├── coloredit.cpp ├── coloredit.h ├── combobox.cpp ├── combobox.h ├── cursoredit.cpp ├── cursoredit.h ├── dateedit.cpp ├── dateedit.h ├── datetimeedit.cpp ├── datetimeedit.h ├── dummywidget.cpp ├── dummywidget.h ├── fontedit.cpp ├── fontedit.h ├── fontedit_p.h ├── linestyleedit.cpp ├── linestyleedit.h ├── pixmapedit.cpp ├── pixmapedit.h ├── pointedit.cpp ├── pointedit.h ├── pointfedit.cpp ├── pointfedit.h ├── rectedit.cpp ├── rectedit.h ├── sizeedit.cpp ├── sizeedit.h ├── sizefedit.cpp ├── sizefedit.h ├── sizepolicyedit.cpp ├── sizepolicyedit.h ├── spinbox.cpp ├── spinbox.h ├── stringlistedit.cpp ├── stringlistedit.h ├── symbolcombo.cpp ├── symbolcombo.h ├── timeedit.cpp ├── timeedit.h ├── utils.cpp ├── utils.h └── xpm │ ├── arrow_cursor.xpm │ ├── bdiag_cursor.xpm │ ├── blank_cursor.xpm │ ├── busy_cursor.xpm │ ├── closedhand_cursor.xpm │ ├── cross_cursor.xpm │ ├── fdiag_cursor.xpm │ ├── forbidden_cursor.xpm │ ├── hand_cursor.xpm │ ├── ibeam_cursor.xpm │ ├── openhand_cursor.xpm │ ├── sizeall_cursor.xpm │ ├── sizehor_cursor.xpm │ ├── sizever_cursor.xpm │ ├── splith_cursor.xpm │ ├── splitv_cursor.xpm │ ├── uparrow_cursor.xpm │ ├── wait_cursor.xpm │ └── whatsthis_cursor.xpm ├── kproperty_debug.cpp ├── kproperty_debug.h └── pics ├── CMakeLists.txt └── icons └── breeze ├── actions ├── 16 │ └── kproperty-value-false.svg └── 22 │ └── kproperty-value-false.svg └── files.cmake /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: WebKit 3 | Language: Cpp 4 | AlignAfterOpenBracket: true 5 | AlwaysBreakTemplateDeclarations: true 6 | AllowShortFunctionsOnASingleLine: Inline 7 | BreakBeforeBraces: Linux 8 | ColumnLimit: 100 9 | Standard: Cpp11 10 | IndentWidth: 4 11 | TabWidth: 8 12 | UseTab: Never 13 | PointerAlignment: Right 14 | SpacesInParentheses: false 15 | SpacesInAngles: false 16 | SpaceInEmptyParentheses: false 17 | SpacesInCStyleCastParentheses: false 18 | SpaceAfterControlStatementKeyword: true 19 | SpaceBeforeAssignmentOperators: true 20 | ContinuationIndentWidth: 4 21 | IncludeCategories: 22 | - Regex: '^ 12 | 13 | *If you are reading this on GitHub, be aware that this is just a mirror. 14 | Our real code repository [is located here](https://invent.kde.org/libraries/kproperty).* 15 | 16 | ## Building KProperty 17 | 18 | KProperty uses the CMake build system. 19 | 20 | ``` 21 | mkdir build && cd build 22 | cmake .. -GNinja -DCMAKE_INSTALL_PREFIX=~/.local/kde 23 | ninja 24 | ``` 25 | 26 | ## Donate Money 27 | 28 | If you love KProperty, you can help developers to build new incredible features or 29 | enhance new ones. Thanks in advance for your generous donations. 30 | For more information, [look here](https://community.kde.org/Kexi/Contact#Donations). 31 | -------------------------------------------------------------------------------- /autotests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | remove_definitions( 2 | -DQT_NO_KEYWORDS 3 | -DQT_NO_SIGNALS_SLOTS_KEYWORDS 4 | -DQT_NO_CAST_FROM_ASCII 5 | -DQT_USE_QSTRINGBUILDER 6 | ) 7 | 8 | include(ECMAddTests) 9 | 10 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 11 | 12 | set(FILES_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}) 13 | add_definitions( 14 | -DFILES_OUTPUT_DIR=\"${FILES_OUTPUT_DIR}\" 15 | ) 16 | 17 | include_directories( 18 | ${CMAKE_BINARY_DIR}/src/kproperty 19 | ${CMAKE_BINARY_DIR}/src/editors/kproperty 20 | ) 21 | 22 | include(ECMAddTests) 23 | 24 | find_package(Qt5Test REQUIRED) 25 | 26 | ecm_add_tests( 27 | KPropertyTest.cpp 28 | KPropertySetTest.cpp 29 | LINK_LIBRARIES 30 | Qt5::Test 31 | KPropertyWidgets 32 | ) 33 | 34 | if(NOT WIN32) #TODO enable for Windows when headers_test.sh is ported e.g. to python 35 | add_subdirectory(headers) 36 | endif() 37 | -------------------------------------------------------------------------------- /autotests/headers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Test if all the installed headers can be included individually. Requires installed headers. 2 | 3 | add_test( 4 | NAME HeadersTest 5 | COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/headers_test.sh 6 | "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}" KPropertyWidgets kproperty . 7 | WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" 8 | ) 9 | 10 | # Just show dependent files in the project: 11 | add_custom_target(HeadersTest SOURCES headers_test.sh HeadersTestInclude.cmake) 12 | -------------------------------------------------------------------------------- /autotests/headers/HeadersTestInclude.cmake: -------------------------------------------------------------------------------- 1 | set(REQUIRED_QT_VERSION "5.2.0") 2 | find_package(Qt5 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED Core Widgets) 3 | #TODO: test KPROPERTY_KF 4 | find_package(KF5 5.7.0 REQUIRED Config CoreAddons WidgetsAddons GuiAddons) 5 | find_package(KPropertyCore ${PROJECT_VERSION} REQUIRED) 6 | find_package(KPropertyWidgets ${PROJECT_VERSION} REQUIRED) 7 | set(LIB_INSTALL_DIR "lib") 8 | include(KDECMakeSettings NO_POLICY_SCOPE) 9 | include(KDECompilerSettings NO_POLICY_SCOPE) 10 | if(POLICY CMP0063) # Honor visibility properties for all target types (since cmake 3.3) 11 | cmake_policy(SET CMP0063 NEW) 12 | endif() 13 | if(POLICY CMP0071) # Don't warn when combining AUTOMOC with qt5_wrap_ui() or qt5_add_resources() (since cmake 3.10) 14 | cmake_policy(SET CMP0071 NEW) 15 | endif() 16 | -------------------------------------------------------------------------------- /autotests/headers/headers_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Generates a full project for a HeadersTest app. 4 | # This is a compile-time test checking if all the installed headers can be included individually. 5 | # 6 | # Example for KDb: 7 | # % ./headers_test.sh ~/kde/build/kdb ~/kde/src/kdb KDb kdb . 8 | # 9 | # It is assumed that this script is executed from the current build subdirectory. 10 | # Source dir goes to the app/ subdirectory, build dir goes to the app-build subdirectory. 11 | # Nothing is cached, both dirs are fully recreated on each run. 12 | 13 | set -e 14 | builddir="$1" 15 | current_builddir="`pwd`" 16 | shift 17 | srcdir="$1" 18 | 19 | if [ ! -d "$builddir" -o ! -d "$srcdir" -o $# -lt 4 ] ; then 20 | echo "Usage: $me ..." 21 | exit 1 22 | fi 23 | 24 | test_app_dir="$current_builddir/app" 25 | rm -rf "$test_app_dir" 26 | mkdir -p "$test_app_dir" 27 | 28 | test_app_builddir="$current_builddir/app-build" 29 | rm -rf "$test_app_builddir" 30 | mkdir -p "$test_app_builddir" 31 | 32 | me=headers_test.sh 33 | current_srcdir="`dirname \"$0\"`" 34 | 35 | shift 36 | link_libs="$1" 37 | shift 38 | prefix="$1" 39 | shift 40 | 41 | cd "$srcdir" 42 | 43 | cat < "$test_app_dir/CMakeLists.txt" 44 | # Generated by $current_srcdir/$me 45 | # prefix: $prefix 46 | # link_libs: $link_libs 47 | # subdirs: $@ 48 | # 49 | # WARNING! All changes made in this file will be lost! 50 | # 51 | # Test if all the installed headers can be included individually. 52 | # This is a compile-time test. 53 | 54 | cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) 55 | find_package(ECM 1.8.0 REQUIRED NO_MODULE) 56 | set(CMAKE_MODULE_PATH "$current_srcdir" "$srcdir/cmake/modules" \${ECM_MODULE_PATH}) 57 | 58 | project(HeadersTest) 59 | include(HeadersTestInclude NO_POLICY_SCOPE) 60 | 61 | add_executable( 62 | HeadersTest 63 | HeadersTest.cpp 64 | EOT 65 | 66 | cat < "$test_app_dir/HeadersTest.cpp" 67 | // Generated by $me 68 | // WARNING! All changes made in this file will be lost! 69 | 70 | // Nothing to do here 71 | int main(int, char**) 72 | { 73 | return 0; 74 | } 75 | EOT 76 | 77 | # files to include using , forward headers + some *.h headers 78 | find_files() 79 | { 80 | for subdir in "$@" ; do 81 | find "$builddir/src/$subdir" -maxdepth 1 -type f -printf "%f\n" 82 | done 83 | } 84 | 85 | for f in `find_files $@ | grep -v "\.h\$" | grep -vE "(\\.|Makefile)" | sort`; do 86 | fname=${f}_HeaderTest.cpp 87 | echo "#include <$f>" > $test_app_dir/$fname 88 | echo " $fname" >> $test_app_dir/CMakeLists.txt 89 | done 90 | 91 | # files to include using , these are .h files 92 | for f in `find_files $@ | grep "\.h\$" | grep -vE "^ui_.*\.h" | sort`; do 93 | fname=${f}_HeaderTest.cpp 94 | echo "#include <$f>" > $test_app_dir/$fname 95 | echo " $fname" >> $test_app_dir/CMakeLists.txt 96 | done 97 | 98 | cat <> "$test_app_dir/CMakeLists.txt" 99 | ) 100 | 101 | target_link_libraries(HeadersTest 102 | PUBLIC 103 | $link_libs 104 | ) 105 | 106 | feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) 107 | EOT 108 | 109 | # Finally, build: 110 | cd "$test_app_builddir" 111 | cmake ../app 112 | make 113 | -------------------------------------------------------------------------------- /cmake/modules/FindQHelpGenerator.cmake: -------------------------------------------------------------------------------- 1 | # Finds the Qt5 QHelpGenerator 2 | # 3 | # QHelpGenerator_FOUND - True if QHelpGenerator found. 4 | # QHelpGenerator_EXECUTABLE - Path to executable 5 | 6 | find_package(Qt5Core QUIET) 7 | if (TARGET Qt5::qhelpgenerator) 8 | get_target_property(QHelpGenerator_EXECUTABLE Qt5::qhelpgenerator LOCATION) 9 | else() 10 | # assume same folder as qmake executable 11 | if (TARGET Qt5::qmake) 12 | get_target_property(_qmake_EXECUTABLE Qt5::qmake LOCATION) 13 | get_filename_component(_path ${_qmake_EXECUTABLE} DIRECTORY) 14 | else() 15 | set(_path) 16 | endif() 17 | # TODO: prevent that the Qt4 version is picked up 18 | find_program(QHelpGenerator_EXECUTABLE 19 | NAMES 20 | qhelpgenerator-qt5 21 | qhelpgenerator 22 | PATH 23 | ${_path} 24 | ) 25 | endif() 26 | mark_as_advanced(QHelpGenerator_EXECUTABLE) 27 | 28 | if(QHelpGenerator_EXECUTABLE) 29 | set(QHelpGenerator_FOUND TRUE) 30 | else() 31 | set(QHelpGenerator_FOUND FALSE) 32 | endif() 33 | 34 | if(QHelpGenerator_FOUND) 35 | if(NOT QHelpGenerator_FIND_QUIETLY ) 36 | message( STATUS "Found QHelpGenerator executable: ${QHelpGenerator_EXECUTABLE}") 37 | endif() 38 | else() 39 | if(QHelpGenerator_FIND_REQUIRED) 40 | message( FATAL_ERROR "Could not find QHelpGenerator executable" ) 41 | else() 42 | message( STATUS "Optional QHelpGenerator executable was not found" ) 43 | endif() 44 | endif() 45 | 46 | -------------------------------------------------------------------------------- /cmake/modules/GetGitRevisionDescription.cmake.in: -------------------------------------------------------------------------------- 1 | # 2 | # Internal file for GetGitRevisionDescription.cmake 3 | # 4 | # Requires CMake 2.6 or newer (uses the 'function' command) 5 | # 6 | # Original Author: 7 | # 2009-2010 Ryan Pavlik 8 | # http://academic.cleardefinition.com 9 | # Iowa State University HCI Graduate Program/VRAC 10 | # 11 | # Copyright Iowa State University 2009-2010. 12 | # Distributed under the Boost Software License, Version 1.0. 13 | # (See accompanying file LICENSE_1_0.txt or copy at 14 | # http://www.boost.org/LICENSE_1_0.txt) 15 | 16 | set(HEAD_HASH) 17 | 18 | file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) 19 | 20 | string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) 21 | if(HEAD_CONTENTS MATCHES "ref") 22 | # named branch 23 | string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") 24 | if(EXISTS "@GIT_DIR@/${HEAD_REF}") 25 | configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 26 | elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}") 27 | configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 28 | set(HEAD_HASH "${HEAD_REF}") 29 | endif() 30 | else() 31 | # detached HEAD 32 | configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) 33 | endif() 34 | 35 | if(NOT HEAD_HASH) 36 | file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) 37 | string(STRIP "${HEAD_HASH}" HEAD_HASH) 38 | endif() 39 | -------------------------------------------------------------------------------- /cmake/modules/KPropertyAddIconsRccFile.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Jarosław Staniek 2 | # 3 | # Redistribution and use is allowed according to the terms of the BSD license. 4 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 5 | 6 | add_custom_target(update_all_rcc 7 | COMMENT "Updating all file lists for rcc icons files" 8 | ) 9 | 10 | # Builds and install an rcc file with icons. 11 | # - resource subdirectory in the current build subdir is created 12 | # - ${_target}.qrc is created based on icons/${_theme}/files.cmake 13 | # - ${_target}.rcc is generated using rcc-qt5 14 | # - if _prefix is not empty, icons are placed in icons/${_prefix}/${_theme} path (useful for plugins) 15 | # - dependency for the parent target ${_parent_target} is added 16 | # - the .rcc file is installed to ${ICONS_INSTALL_DIR} 17 | # - update_${_target} target is added for requesting update of icons/${_theme}/files.cmake 18 | # - adds a update_all_rcc target that executes commands for all targets created with kproperty_add_icons_rcc_file() 19 | macro(kproperty_add_icons_rcc_file _target _parent_target _theme _prefix) 20 | set(_BASE_DIR ${CMAKE_CURRENT_BINARY_DIR}/resource) 21 | set(_QRC_FILE "${_BASE_DIR}/${_target}.qrc") 22 | set(_RCC_DIR "${CMAKE_BINARY_DIR}/bin/data/icons") 23 | set(_RCC_FILE "${_RCC_DIR}/${_target}.rcc") 24 | include(icons/${_theme}/files.cmake) 25 | 26 | add_custom_target(${_target}_copy_icons 27 | COMMAND ${CMAKE_COMMAND} -E remove_directory ${_BASE_DIR} 28 | COMMAND ${CMAKE_COMMAND} -E make_directory ${_BASE_DIR} 29 | COMMAND ${CMAKE_COMMAND} -E make_directory ${_RCC_DIR} 30 | COMMAND ${CMAKE_COMMAND} -E copy_directory icons/${_theme} ${_BASE_DIR}/icons/${_prefix}/${_theme} 31 | COMMAND ${CMAKE_COMMAND} -E remove -f ${_BASE_DIR}/CMakeLists.txt 32 | COMMAND ${CMAKE_COMMAND} -E remove -f ${_BASE_DIR}/icons/${_prefix}/${_theme}/files.cmake 33 | DEPENDS "${_FILES}" 34 | SOURCES "${_FILES}" 35 | WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" 36 | COMMENT "Copying icon files to ${_BASE_DIR}" 37 | VERBATIM 38 | ) 39 | 40 | add_custom_target(${_target}_build_qrc 41 | COMMAND ${Qt5Core_RCC_EXECUTABLE} --project -o "${CMAKE_CURRENT_BINARY_DIR}/${_target}.qrc" 42 | # avoid adding the .qrc file to rcc due to rcc misfeature 43 | COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR}/${_target}.qrc" "${_QRC_FILE}" 44 | DEPENDS "${_FILES}" 45 | SOURCES "${_FILES}" 46 | WORKING_DIRECTORY "${_BASE_DIR}" 47 | COMMENT "Building Qt resource file ${_QRC_FILE}" 48 | VERBATIM 49 | ) 50 | add_dependencies(${_target}_build_qrc ${_target}_copy_icons) 51 | 52 | add_custom_target(${_target}_build_rcc 53 | COMMAND ${Qt5Core_RCC_EXECUTABLE} --compress 9 --threshold 0 --binary 54 | --output "${_RCC_FILE}" "${_QRC_FILE}" 55 | #COMMAND ${CMAKE_COMMAND} -E remove -f ${_QRC_FILE} 56 | DEPENDS "${_QRC_FILE}" "${_FILES}" 57 | WORKING_DIRECTORY "${_BASE_DIR}" 58 | COMMENT "Building external Qt resource ${_RCC_FILE}" 59 | VERBATIM 60 | ) 61 | add_dependencies(${_target}_build_rcc ${_target}_build_qrc) 62 | 63 | add_dependencies(${_parent_target} ${_target}_build_rcc) 64 | 65 | install(FILES 66 | ${_RCC_FILE} 67 | DESTINATION "${ICONS_INSTALL_DIR}" 68 | ) 69 | 70 | add_update_file_target( 71 | TARGET update_${_target} 72 | COMMAND "${PROJECT_SOURCE_DIR}/cmake/modules/update_icon_list.sh" 73 | ${_theme} icons/${_theme}/files.cmake 74 | FILE ${_target}_files.cmake 75 | SOURCES "${PROJECT_SOURCE_DIR}/cmake/modules/update_icon_list.sh" 76 | ) 77 | add_dependencies(update_all_rcc update_${_target}) 78 | 79 | unset(_BASE_DIR) 80 | unset(_QRC_FILE) 81 | unset(_RCC_FILE) 82 | endmacro() 83 | -------------------------------------------------------------------------------- /cmake/modules/KPropertyQueryQmake.cmake: -------------------------------------------------------------------------------- 1 | # Copied from ECM 5.28.0, ECMQueryQmake.cmake 2 | 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # 7 | # 1. Redistributions of source code must retain the copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # 2. Redistributions in binary form must reproduce the copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # 3. The name of the author may not be used to endorse or promote products 13 | # derived from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | 26 | find_package(Qt5Core QUIET) 27 | 28 | if (Qt5Core_FOUND) 29 | set(_qmake_executable_default "qmake-qt5") 30 | endif () 31 | if (TARGET Qt5::qmake) 32 | get_target_property(_qmake_executable_default Qt5::qmake LOCATION) 33 | endif() 34 | set(QMAKE_EXECUTABLE ${_qmake_executable_default} 35 | CACHE FILEPATH "Location of the Qt5 qmake executable") 36 | 37 | # This is not public API (yet)! 38 | function(query_qmake result_variable qt_variable) 39 | if(NOT QMAKE_EXECUTABLE) 40 | set(${result_variable} "" PARENT_SCOPE) 41 | message(WARNING "Should specify a qmake Qt5 binary. Can't check ${qt_variable}") 42 | return() 43 | endif() 44 | execute_process( 45 | COMMAND ${QMAKE_EXECUTABLE} -query "${qt_variable}" 46 | RESULT_VARIABLE return_code 47 | OUTPUT_VARIABLE output 48 | ) 49 | if(return_code EQUAL 0) 50 | string(STRIP "${output}" output) 51 | file(TO_CMAKE_PATH "${output}" output_path) 52 | set(${result_variable} "${output_path}" PARENT_SCOPE) 53 | else() 54 | message(WARNING "Failed call: ${QMAKE_EXECUTABLE} -query \"${qt_variable}\"") 55 | message(FATAL_ERROR "QMake call failed: ${return_code}") 56 | endif() 57 | endfunction() 58 | -------------------------------------------------------------------------------- /cmake/modules/SetKPropertyCMakePolicies.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2003-2016 Jarosław Staniek 2 | # 3 | # Redistribution and use is allowed according to the terms of the BSD license. 4 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 5 | 6 | cmake_policy(SET CMP0017 NEW) 7 | cmake_policy(SET CMP0048 NEW) # for PROJECT_VERSION 8 | cmake_policy(SET CMP0053 NEW) # TODO remove, temporary fix for a bug in Qt 5.8's Qt5ModuleLocation.cmake 9 | # "Simplify variable reference and escape sequence evaluation" 10 | 11 | if(POLICY CMP0059) # Don’t treat DEFINITIONS as a built-in directory property. 12 | cmake_policy(SET CMP0059 NEW) 13 | endif() 14 | if(POLICY CMP0063) # Honor visibility properties for all target types (since cmake 3.3) 15 | cmake_policy(SET CMP0063 NEW) 16 | endif() 17 | if(POLICY CMP0071) # Don't warn when combining AUTOMOC with qt5_wrap_ui() or qt5_add_resources() (since cmake 3.10) 18 | cmake_policy(SET CMP0071 NEW) 19 | endif() 20 | -------------------------------------------------------------------------------- /cmake/modules/update_icon_list.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This file is part of the KDE project 4 | # Copyright (C) 2016 Jarosław Staniek 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU Library General Public 8 | # License as published by the Free Software Foundation; either 9 | # version 2.1 of the License, or (at your option) any later version. 10 | # 11 | # This library is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | # Library General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Library General Public License 17 | # along with this library; see the file COPYING.LIB. If not, write to 18 | # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | # Boston, MA 02110-1301, USA. 20 | # 21 | # Updates list of icon files in icons/$1/ and outputs to $2. 22 | # Used by kreport_add_icons_rcc_file() cmake macro. 23 | # 24 | set -e 25 | 26 | theme=$1 27 | output=$2 28 | if [ -z "$theme" ] ; then echo "Theme name required as first argument"; exit 1; fi 29 | if [ -z "$output" ] ; then echo "Output .cmake file required as second argument"; exit 1; fi 30 | script=$(basename $0) 31 | 32 | function content() 33 | { 34 | echo "# List of project's own icon files" 35 | echo "# This file is generated by $script" 36 | echo "# WARNING! All changes made in this file will be lost!" 37 | echo 38 | echo "set(_PNG_FILES" 39 | find icons/$theme/ -name \*png | sed "s/\.\///g" | sort 40 | echo ")" 41 | echo 42 | 43 | echo "set(_SVG_FILES" 44 | find icons/$theme/ -name \*svg | sed "s/\.\///g" | sort 45 | echo ")" 46 | echo 47 | 48 | echo "set(_FILES \${_PNG_FILES} \${_SVG_FILES})" 49 | } 50 | 51 | content > $output 52 | -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | remove_definitions( 2 | -DQT_NO_KEYWORDS 3 | -DQT_NO_SIGNALS_SLOTS_KEYWORDS 4 | -DQT_NO_CAST_FROM_ASCII 5 | ) 6 | 7 | set(kpropertyexample_SRCS main.cpp window.cpp) 8 | add_executable(kpropertyexample ${kpropertyexample_SRCS}) 9 | target_link_libraries(kpropertyexample 10 | KPropertyWidgets 11 | KPropertyUtilsPrivate 12 | ) 13 | if(KPROPERTY_KF) 14 | target_link_libraries(kpropertyexample 15 | KF5::ConfigGui #KConfigGroup 16 | ) 17 | endif() 18 | -------------------------------------------------------------------------------- /examples/main.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include "KPropertyUtils_p.h" 24 | #include "window.h" 25 | 26 | static const char version[] = "0.2"; 27 | 28 | int main(int argc, char **argv) 29 | { 30 | QApplication app(argc, argv); 31 | 32 | QCoreApplication::setApplicationName("KPropertyExample"); 33 | QCoreApplication::setApplicationVersion(version); 34 | (void)KPropertyUtilsPrivate::setupGlobalIconTheme(); 35 | 36 | Window window; 37 | 38 | window.show(); 39 | return app.exec(); 40 | } 41 | -------------------------------------------------------------------------------- /examples/window.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004-2005 Cedric Pasteur 3 | Copyright (C) 2008-2018 Jarosław Staniek 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public License 16 | along with this library; see the file COPYING.LIB. If not, write to 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef WINDOW_H 22 | #define WINDOW_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | class KPropertyEditorView; 29 | 30 | /*! @internal 31 | * @short KPropertyExample application's main window */ 32 | class Window : public QWidget 33 | { 34 | Q_OBJECT 35 | public: 36 | Window(); 37 | ~Window() override; 38 | 39 | protected Q_SLOTS: 40 | void showGrid(int state); 41 | void showFrame(int state); 42 | 43 | //! Reaction on changed value of property 44 | void propertyChanged(KPropertySet& set, KProperty& property); 45 | 46 | private: 47 | void parseCommandLine(); 48 | 49 | KPropertySet m_set; 50 | QCommandLineParser m_parser; 51 | QCommandLineOption m_flatOption; 52 | QCommandLineOption m_fontSizeOption; 53 | QCommandLineOption m_propertyOption; 54 | QCommandLineOption m_roOption; 55 | KPropertyEditorView *m_editorView; 56 | KProperty *m_dynamicToolTipProperty = nullptr; 57 | }; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /metainfo.yaml: -------------------------------------------------------------------------------- 1 | # kapidox info 2 | description: KProperty is a property editing framework with editor widget similar to what is known from Qt Designer. 3 | #logo: TODO 4 | group: kexiframeworks 5 | type: functional 6 | 7 | platforms: 8 | - name: Linux 9 | - name: Windows 10 | # - name: MacOSX 11 | # - name: Android 12 | 13 | public_lib: true 14 | public_source_dirs: 15 | - src 16 | # TODO: kapidox currently assumes: one product == one metainfo.yaml == one cmake config file 17 | # listing KPropertyWidgets as separate package in CMake's worldview needs changing kapidox first 18 | # -> https://bugs.kde.org/show_bug.cgi?id=410452 19 | #libraries: 20 | # - cmake: KPropertyCore 21 | #cmakename: KPropertyCore 22 | 23 | maintainer: 24 | - staniek 25 | -------------------------------------------------------------------------------- /poqm/ca/kpropertycore_qt.po: -------------------------------------------------------------------------------- 1 | # Translation of kpropertycore_qt.po to Catalan 2 | # Copyright (C) 2015-2017 This_file_is_part_of_KDE 3 | # This file is distributed under the license LGPL version 2.1 or 4 | # version 3 or later versions approved by the membership of KDE e.V. 5 | # 6 | # Josep M. Ferrer , 2015, 2016, 2017. 7 | # Antoni Bella Pérez , 2015, 2016, 2017. 8 | msgid "" 9 | msgstr "" 10 | "Project-Id-Version: kproperty\n" 11 | "Report-Msgid-Bugs-To: https://bugs.kde.org\n" 12 | "PO-Revision-Date: 2017-10-11 18:03+0100\n" 13 | "Last-Translator: Josep M. Ferrer \n" 14 | "Language-Team: Catalan \n" 15 | "Language: ca\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "X-Qt-Contexts: true\n" 20 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 21 | "X-Accelerator-Marker: &\n" 22 | "X-Generator: Lokalize 2.0\n" 23 | 24 | #: KPropertyFactory.cpp:148 25 | #, qt-format 26 | msgctxt "QObject|Truncated string" 27 | msgid "%1..." 28 | msgstr "%1..." 29 | 30 | #: KPropertySet.cpp:31 31 | msgctxt "QObject|General properties" 32 | msgid "General" 33 | msgstr "General" 34 | -------------------------------------------------------------------------------- /poqm/ca@valencia/kpropertycore_qt.po: -------------------------------------------------------------------------------- 1 | # Translation of kpropertycore_qt.po to Catalan (Valencian) 2 | # Copyright (C) 2015-2017 This_file_is_part_of_KDE 3 | # This file is distributed under the license LGPL version 2.1 or 4 | # version 3 or later versions approved by the membership of KDE e.V. 5 | # 6 | # Josep M. Ferrer , 2015, 2016, 2017. 7 | # Antoni Bella Pérez , 2015, 2016, 2017. 8 | msgid "" 9 | msgstr "" 10 | "Project-Id-Version: kproperty\n" 11 | "Report-Msgid-Bugs-To: https://bugs.kde.org\n" 12 | "PO-Revision-Date: 2017-10-11 18:03+0100\n" 13 | "Last-Translator: Josep M. Ferrer \n" 14 | "Language-Team: Catalan \n" 15 | "Language: ca@valencia\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "X-Qt-Contexts: true\n" 20 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 21 | "X-Accelerator-Marker: &\n" 22 | "X-Generator: Lokalize 2.0\n" 23 | 24 | #: KPropertyFactory.cpp:148 25 | #, qt-format 26 | msgctxt "QObject|Truncated string" 27 | msgid "%1..." 28 | msgstr "%1…" 29 | 30 | #: KPropertySet.cpp:31 31 | msgctxt "QObject|General properties" 32 | msgid "General" 33 | msgstr "General" 34 | -------------------------------------------------------------------------------- /poqm/cs/kpropertycore_qt.po: -------------------------------------------------------------------------------- 1 | # Vít Pelčák , 2015, 2016, 2017. 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: \n" 5 | "PO-Revision-Date: 2017-04-18 13:17+0100\n" 6 | "Last-Translator: Vít Pelčák \n" 7 | "Language-Team: Czech \n" 8 | "Language: cs\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" 13 | "X-Generator: Lokalize 2.0\n" 14 | "X-Qt-Contexts: true\n" 15 | 16 | #: KPropertyFactory.cpp:148 17 | #, qt-format 18 | msgctxt "QObject|Truncated string" 19 | msgid "%1..." 20 | msgstr "%1..." 21 | 22 | #: KPropertySet.cpp:31 23 | msgctxt "QObject|General properties" 24 | msgid "General" 25 | msgstr "Obecné" 26 | -------------------------------------------------------------------------------- /poqm/eo/kpropertycore_qt.po: -------------------------------------------------------------------------------- 1 | # translation of kpropertycore_qt.pot to esperanto 2 | # Copyright (C) 2017, Free Software Foundation, Inc. 3 | # This file is distributed under the same license as the kproperty package. 4 | # Oliver Kellogg \n" 13 | "Language-Team: Esperanto \n" 14 | "Language: eo\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "X-Qt-Contexts: true\n" 19 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 20 | 21 | #: KPropertyFactory.cpp:148 22 | #, qt-format 23 | msgctxt "QObject|Truncated string" 24 | msgid "%1..." 25 | msgstr "%1..." 26 | 27 | #: KPropertySet.cpp:31 28 | msgctxt "QObject|General properties" 29 | msgid "General" 30 | msgstr "Ĝenerala" 31 | -------------------------------------------------------------------------------- /poqm/et/kpropertycore_qt.po: -------------------------------------------------------------------------------- 1 | # Marek Laane , 2019. 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: \n" 5 | "PO-Revision-Date: 2019-11-29 12:43+0200\n" 6 | "Last-Translator: Marek Laane \n" 7 | "Language-Team: Estonian \n" 8 | "Language: et\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Qt-Contexts: true\n" 13 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 14 | "X-Generator: Lokalize 19.08.1\n" 15 | 16 | #: KPropertyFactory.cpp:148 17 | #, qt-format 18 | msgctxt "QObject|Truncated string" 19 | msgid "%1..." 20 | msgstr "%1 ..." 21 | 22 | #: KPropertySet.cpp:31 23 | msgctxt "QObject|General properties" 24 | msgid "General" 25 | msgstr "Üldine" 26 | -------------------------------------------------------------------------------- /poqm/eu/kpropertycore_qt.po: -------------------------------------------------------------------------------- 1 | # Translation of kpropertycore_qt.po to Euskara/Basque (eu). 2 | # Copyright (C) 2019, This file is copyright: 3 | # This file is distributed under the same license as the original file. 4 | # KDE euskaratzeko proiektuaren arduraduna 5 | # 6 | # Translators: 7 | # Iñigo Salvador Azurmendi , 2019. 8 | msgid "" 9 | msgstr "" 10 | "Project-Id-Version: \n" 11 | "PO-Revision-Date: 2019-11-12 22:03+0100\n" 12 | "Last-Translator: Iñigo Salvador Azurmendi \n" 13 | "Language-Team: Basque \n" 14 | "Language: eu\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "X-Qt-Contexts: true\n" 19 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 20 | "X-Generator: Lokalize 19.08.3\n" 21 | 22 | #: KPropertyFactory.cpp:148 23 | #, qt-format 24 | msgctxt "QObject|Truncated string" 25 | msgid "%1..." 26 | msgstr "%1..." 27 | 28 | #: KPropertySet.cpp:31 29 | msgctxt "QObject|General properties" 30 | msgid "General" 31 | msgstr "Orokorra" 32 | -------------------------------------------------------------------------------- /poqm/he/kpropertycore_qt.po: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2025 Yaron Shahrabani 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: \n" 5 | "PO-Revision-Date: 2025-02-25 08:29+0200\n" 6 | "Last-Translator: Yaron Shahrabani \n" 7 | "Language-Team: צוות התרגום של KDE ישראל\n" 8 | "Language: he\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Qt-Contexts: true\n" 13 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 14 | "X-Generator: Lokalize 24.12.2\n" 15 | 16 | #: KPropertyFactory.cpp:148 17 | #, qt-format 18 | msgctxt "QObject|Truncated string" 19 | msgid "%1..." 20 | msgstr "%1…" 21 | 22 | #: KPropertySet.cpp:31 23 | msgctxt "QObject|General properties" 24 | msgid "General" 25 | msgstr "כללי" 26 | -------------------------------------------------------------------------------- /poqm/hi/kpropertycore_qt.po: -------------------------------------------------------------------------------- 1 | # G Karunakar , 2020. 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: \n" 5 | "PO-Revision-Date: 2020-08-26 23:33+0530\n" 6 | "Last-Translator: G Karunakar \n" 7 | "Language-Team: Hindi \n" 8 | "Language: hi\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Qt-Contexts: true\n" 13 | "Plural-Forms: nplurals=2; plural=(n!=1);\n" 14 | "X-Generator: Lokalize 2.0\n" 15 | 16 | #: KPropertyFactory.cpp:148 17 | #, qt-format 18 | msgctxt "QObject|Truncated string" 19 | msgid "%1..." 20 | msgstr "%1..." 21 | 22 | #: KPropertySet.cpp:31 23 | msgctxt "QObject|General properties" 24 | msgid "General" 25 | msgstr "साधारण" 26 | -------------------------------------------------------------------------------- /poqm/ja/kpropertycore_qt.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: kproperty\n" 4 | "PO-Revision-Date: 2023-05-28 23:12-0700\n" 5 | "Last-Translator: Fumiaki Okushi \n" 6 | "Language-Team: Japanese \n" 7 | "Language: ja\n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | "Plural-Forms: nplurals=1; plural=0;\n" 12 | "X-Accelerator-Marker: &\n" 13 | "X-Text-Markup: qtrich\n" 14 | "X-Qt-Contexts: true\n" 15 | 16 | #: KPropertyFactory.cpp:148 17 | #, qt-format 18 | msgctxt "QObject|Truncated string" 19 | msgid "%1..." 20 | msgstr "" 21 | 22 | #: KPropertySet.cpp:31 23 | msgctxt "QObject|General properties" 24 | msgid "General" 25 | msgstr "" 26 | -------------------------------------------------------------------------------- /poqm/ka/kpropertycore_qt.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: \n" 4 | "POT-Creation-Date: \n" 5 | "PO-Revision-Date: \n" 6 | "Last-Translator: Temuri Doghonadze \n" 7 | "Language-Team: \n" 8 | "Language: ka\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 13 | "X-Qt-Contexts: true\n" 14 | "X-Generator: Poedit 3.1.1\n" 15 | 16 | #: KPropertyFactory.cpp:148 17 | #, qt-format 18 | msgctxt "QObject|Truncated string" 19 | msgid "%1..." 20 | msgstr "%1..." 21 | 22 | #: KPropertySet.cpp:31 23 | msgctxt "QObject|General properties" 24 | msgid "General" 25 | msgstr "ზოგადი" 26 | -------------------------------------------------------------------------------- /poqm/ko/kpropertycore_qt.po: -------------------------------------------------------------------------------- 1 | # Copyright (C) YEAR This_file_is_part_of_KDE 2 | # This file is distributed under the same license as the PACKAGE package. 3 | # Jung Hee Lee , 2019. 4 | # Shinjo Park , 2019. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: \n" 9 | "PO-Revision-Date: 2019-03-08 14:37+0100\n" 10 | "Last-Translator: Shinjo Park \n" 11 | "Language-Team: Korean \n" 12 | "Language: ko\n" 13 | "MIME-Version: 1.0\n" 14 | "Content-Type: text/plain; charset=UTF-8\n" 15 | "Content-Transfer-Encoding: 8bit\n" 16 | "X-Qt-Contexts: true\n" 17 | "X-Generator: Lokalize 2.0\n" 18 | "Plural-Forms: nplurals=1; plural=0;\n" 19 | 20 | #: KPropertyFactory.cpp:148 21 | #, qt-format 22 | msgctxt "QObject|Truncated string" 23 | msgid "%1..." 24 | msgstr "%1..." 25 | 26 | #: KPropertySet.cpp:31 27 | msgctxt "QObject|General properties" 28 | msgid "General" 29 | msgstr "일반" 30 | -------------------------------------------------------------------------------- /poqm/lt/kpropertycore_qt.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: trunk-kf 5\n" 4 | "Last-Translator: Automatically generated\n" 5 | "Language-Team: lt\n" 6 | "Language: lt\n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=UTF-8\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | "X-Qt-Contexts: true\n" 11 | "Plural-Forms: nplurals=4; plural=(n==1 ? 0 : n%10>=2 && (n%100<10 || n" 12 | "%100>=20) ? 1 : n%10==0 || (n%100>10 && n%100<20) ? 2 : 3);\n" 13 | 14 | #: KPropertyFactory.cpp:148 15 | #, qt-format 16 | msgctxt "QObject|Truncated string" 17 | msgid "%1..." 18 | msgstr "" 19 | 20 | #: KPropertySet.cpp:31 21 | msgctxt "QObject|General properties" 22 | msgid "General" 23 | msgstr "" 24 | -------------------------------------------------------------------------------- /poqm/nn/kpropertycore_qt.po: -------------------------------------------------------------------------------- 1 | # Translation of kpropertycore_qt to Norwegian Nynorsk 2 | # 3 | # Karl Ove Hufthammer , 2018. 4 | msgid "" 5 | msgstr "" 6 | "Project-Id-Version: \n" 7 | "PO-Revision-Date: 2018-07-22 18:09+0100\n" 8 | "Last-Translator: Karl Ove Hufthammer \n" 9 | "Language-Team: Norwegian Nynorsk \n" 10 | "Language: nn\n" 11 | "MIME-Version: 1.0\n" 12 | "Content-Type: text/plain; charset=UTF-8\n" 13 | "Content-Transfer-Encoding: 8bit\n" 14 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 15 | "X-Generator: Lokalize 2.0\n" 16 | "X-Environment: kde\n" 17 | "X-Accelerator-Marker: &\n" 18 | "X-Text-Markup: qtrich\n" 19 | "X-Qt-Contexts: true\n" 20 | 21 | #: KPropertyFactory.cpp:148 22 | #, qt-format 23 | msgctxt "QObject|Truncated string" 24 | msgid "%1..." 25 | msgstr "%1 …" 26 | 27 | #: KPropertySet.cpp:31 28 | msgctxt "QObject|General properties" 29 | msgid "General" 30 | msgstr "Generelt" 31 | -------------------------------------------------------------------------------- /poqm/sl/kpropertycore_qt.po: -------------------------------------------------------------------------------- 1 | # Matjaž Jeran , 2020. 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: \n" 5 | "POT-Creation-Date: \n" 6 | "PO-Revision-Date: 2020-06-11 11:50+0200\n" 7 | "Last-Translator: Matjaž Jeran \n" 8 | "Language-Team: Slovenian \n" 9 | "Language: sl\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Qt-Contexts: true\n" 14 | "X-Generator: Poedit 2.3.1\n" 15 | "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100>=3 && n" 16 | "%100<=4 ? 2 : 3);\n" 17 | 18 | #: KPropertyFactory.cpp:148 19 | #, qt-format 20 | msgctxt "QObject|Truncated string" 21 | msgid "%1..." 22 | msgstr "%1..." 23 | 24 | #: KPropertySet.cpp:31 25 | msgctxt "QObject|General properties" 26 | msgid "General" 27 | msgstr "Splošno" 28 | -------------------------------------------------------------------------------- /poqm/tr/kpropertycore_qt.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Content-Transfer-Encoding: 8bit\n" 6 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 7 | "X-Qt-Contexts: true\n" 8 | 9 | #: KPropertyFactory.cpp:148 10 | #, qt-format 11 | msgctxt "QObject|Truncated string" 12 | msgid "%1..." 13 | msgstr "%1..." 14 | 15 | #: KPropertySet.cpp:31 16 | msgctxt "QObject|General properties" 17 | msgid "General" 18 | msgstr "Genel" 19 | -------------------------------------------------------------------------------- /poqm/uk/kpropertycore_qt.po: -------------------------------------------------------------------------------- 1 | # Translation of kpropertycore_qt.po to Ukrainian 2 | # Copyright (C) 2017 This_file_is_part_of_KDE 3 | # This file is distributed under the license LGPL version 2.1 or 4 | # version 3 or later versions approved by the membership of KDE e.V. 5 | # 6 | # Yuri Chornoivan , 2017. 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: kpropertycore_qt\n" 10 | "PO-Revision-Date: 2017-10-31 07:37+0200\n" 11 | "Last-Translator: Yuri Chornoivan \n" 12 | "Language-Team: Ukrainian \n" 13 | "Language: uk\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "X-Qt-Contexts: true\n" 18 | "X-Qt-Contexts: true\n" 19 | "Plural-Forms: nplurals=4; plural=n==1 ? 3 : n%10==1 && n%100!=11 ? 0 : n" 20 | "%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" 21 | "X-Generator: Lokalize 2.0\n" 22 | 23 | #: KPropertyFactory.cpp:148 24 | #, qt-format 25 | msgctxt "QObject|Truncated string" 26 | msgid "%1..." 27 | msgstr "%1…" 28 | 29 | #: KPropertySet.cpp:31 30 | msgctxt "QObject|General properties" 31 | msgid "General" 32 | msgstr "Загальні" 33 | -------------------------------------------------------------------------------- /poqm/zh_CN/kpropertycore_qt.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: kdeorg\n" 4 | "PO-Revision-Date: 2024-04-21 04:52\n" 5 | "Language-Team: Chinese Simplified\n" 6 | "Language: zh_CN\n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=UTF-8\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | "X-Qt-Contexts: true\n" 11 | "Plural-Forms: nplurals=1; plural=0;\n" 12 | "X-Crowdin-Project: kdeorg\n" 13 | "X-Crowdin-Project-ID: 269464\n" 14 | "X-Crowdin-Language: zh-CN\n" 15 | "X-Crowdin-File: /kf5-trunk/messages/kproperty/kpropertycore_qt.pot\n" 16 | "X-Crowdin-File-ID: 6499\n" 17 | 18 | #: KPropertyFactory.cpp:148 19 | #, qt-format 20 | msgctxt "QObject|Truncated string" 21 | msgid "%1..." 22 | msgstr "%1..." 23 | 24 | #: KPropertySet.cpp:31 25 | msgctxt "QObject|General properties" 26 | msgid "General" 27 | msgstr "常规" 28 | -------------------------------------------------------------------------------- /poqm/zh_TW/kpropertycore_qt.po: -------------------------------------------------------------------------------- 1 | # pan93412 , 2018. 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: kproperty_qt\n" 5 | "Report-Msgid-Bugs-To: \n" 6 | "POT-Creation-Date: 2016-09-22 20:41+0800\n" 7 | "PO-Revision-Date: 2018-12-02 23:03+0800\n" 8 | "Last-Translator: pan93412 \n" 9 | "Language-Team: Chinese \n" 10 | "Language: zh_TW\n" 11 | "MIME-Version: 1.0\n" 12 | "Content-Type: text/plain; charset=UTF-8\n" 13 | "Content-Transfer-Encoding: 8bit\n" 14 | "X-Generator: Lokalize 2.0\n" 15 | "X-Qt-Contexts: true\n" 16 | "Plural-Forms: nplurals=1; plural=0;\n" 17 | 18 | #: KPropertyFactory.cpp:148 19 | #, qt-format 20 | msgctxt "QObject|Truncated string" 21 | msgid "%1..." 22 | msgstr "%1..." 23 | 24 | #: KPropertySet.cpp:31 25 | msgctxt "QObject|General properties" 26 | msgid "General" 27 | msgstr "一般" 28 | -------------------------------------------------------------------------------- /src/KDefaultPropertyFactory.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2008 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef KDEFAULTPROPERTYFACTORY_H 21 | #define KDEFAULTPROPERTYFACTORY_H 22 | 23 | #include "KPropertyWidgetsFactory.h" 24 | 25 | class KDefaultPropertyFactory : public KPropertyWidgetsFactory 26 | { 27 | public: 28 | KDefaultPropertyFactory(); 29 | ~KDefaultPropertyFactory() override; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/KPropertyCoreConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # KPropertyCoreConfig.cmake provides information about the installed KPropertyCore library. 2 | # It can be used directly from CMake via find_package(KPropertyCore NO_MODULE) 3 | # 4 | # Any changes in this ".cmake" file will be overwritten by CMake, the source is the ".cmake.in" file. 5 | # 6 | # The following CMake variables are provided: 7 | # KPropertyCore_VERSION_MAJOR - the major version number of KPropertyCore 8 | # KPropertyCore_VERSION_MINOR - the minor version number of KPropertyCore 9 | # KPropertyCore_VERSION_PATCH - the patch version number of KPropertyCore 10 | # KPropertyCore_INCLUDE_DIRS - the include directories to use 11 | # 12 | # Additionally, the following imported library targets are created, which may be used directly 13 | # with target_link_libraries(): 14 | # KPropertyCore - the KPropertyCore library 15 | 16 | @PACKAGE_INIT@ 17 | 18 | include(CMakeFindDependencyMacro) 19 | include(FeatureSummary) 20 | 21 | find_dependency(Qt5Core @REQUIRED_QT_VERSION@) 22 | 23 | include("${CMAKE_CURRENT_LIST_DIR}/KPropertyCoreTargets.cmake") 24 | include("${CMAKE_CURRENT_LIST_DIR}/KPropertyCoreQCHTargets.cmake") 25 | 26 | set_package_properties(KPropertyCore PROPERTIES 27 | DESCRIPTION "A property editing framework (core)" 28 | URL "https://community.kde.org/KProperty") 29 | 30 | # "public" variables: 31 | # TODO 32 | -------------------------------------------------------------------------------- /src/KPropertyCoreUtils.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2015 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include "KPropertyCoreUtils_p.h" 21 | 22 | #include 23 | 24 | //! @internal Needed by keyForEnumValue() to get access to staticQtMetaObject 25 | struct StaticQtMetaObject : public QObject 26 | { 27 | static inline const QMetaObject& get() {return staticQtMetaObject;} 28 | }; 29 | 30 | QString KPropertyUtils::keyForEnumValue(const char *enumName, int enumIndex) 31 | { 32 | const QMetaObject& mo = StaticQtMetaObject::get(); 33 | const int index = mo.indexOfEnumerator(enumName); 34 | if (index < 0) { 35 | return QString(); 36 | } 37 | QMetaEnum me = mo.enumerator(index); 38 | return QString::fromLatin1(me.valueToKey(enumIndex)); 39 | } 40 | -------------------------------------------------------------------------------- /src/KPropertyCoreUtils_p.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2015 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef KPROPERTYCORE_UTILS_P_H 21 | #define KPROPERTYCORE_UTILS_P_H 22 | 23 | #include "kpropertycore_export.h" 24 | #include 25 | 26 | namespace KPropertyUtils 27 | { 28 | 29 | //! @return key for enum value with @a enumIndex of enum @a enumName 30 | //! Example call: keyForEnumValue("CursorShape", Qt::WaitCursor) returns "WaitCursor". 31 | KPROPERTYCORE_EXPORT QString keyForEnumValue(const char *enumName, int enumIndex); 32 | 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/KPropertyEditorItemEvent.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2018 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include "KPropertyEditorItemEvent.h" 21 | 22 | class Q_DECL_HIDDEN KPropertyEditorItemEvent::Private 23 | { 24 | public: 25 | Private() 26 | { 27 | } 28 | const KProperty *property; 29 | QString name; 30 | QVariantMap parameters; 31 | QVariant result; 32 | bool hasResult = false; 33 | }; 34 | 35 | KPropertyEditorItemEvent::KPropertyEditorItemEvent(const KProperty &property, const QString &name, 36 | const QVariantMap ¶meters) 37 | : d(new Private) 38 | { 39 | d->property = &property; 40 | d->name = name; 41 | d->parameters = parameters; 42 | } 43 | 44 | KPropertyEditorItemEvent::~KPropertyEditorItemEvent() 45 | { 46 | } 47 | 48 | const KProperty *KPropertyEditorItemEvent::property() const 49 | { 50 | return d->property; 51 | } 52 | 53 | QString KPropertyEditorItemEvent::name() const 54 | { 55 | return d->name; 56 | } 57 | 58 | QVariantMap KPropertyEditorItemEvent::parameters() const 59 | { 60 | return d->parameters; 61 | } 62 | 63 | void KPropertyEditorItemEvent::setResult(const QVariant &result) 64 | { 65 | d->hasResult = true; 66 | d->result = result; 67 | } 68 | 69 | QVariant KPropertyEditorItemEvent::result() const 70 | { 71 | return d->result; 72 | } 73 | 74 | bool KPropertyEditorItemEvent::hasResult() const 75 | { 76 | return d->hasResult; 77 | } 78 | -------------------------------------------------------------------------------- /src/KPropertyLineStyleItemDelegate_p.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | * Copyright (C) 2007 Jan Hambrecht 3 | * Copyright (C) 2015 Jarosław Staniek 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public License 16 | * along with this library; see the file COPYING.LIB. If not, write to 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | #ifndef KPROPERTYLINESTYLEITEMDELEGATE_H 21 | #define KPROPERTYLINESTYLEITEMDELEGATE_H 22 | 23 | #include 24 | 25 | //! Line style item delegate for rendering the styles 26 | class KPropertyLineStyleItemDelegate : public QAbstractItemDelegate 27 | { 28 | public: 29 | explicit KPropertyLineStyleItemDelegate(QObject *parent = nullptr); 30 | ~KPropertyLineStyleItemDelegate() override; 31 | void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; 32 | QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; 33 | 34 | static void paintItem(QPainter *painter, const QPen &pen_, const QRect &rect, const QStyleOption &option); 35 | 36 | static QString styleName(Qt::PenStyle style, const QLocale &locale); 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/KPropertyLineStyleModel_p.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | * Copyright (C) 2007 Jan Hambrecht 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public License 15 | * along with this library; see the file COPYING.LIB. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include "KPropertyLineStyleModel_p.h" 21 | 22 | #include 23 | 24 | KPropertyLineStyleModel::KPropertyLineStyleModel(QObject *parent) 25 | : QAbstractListModel(parent), 26 | m_hasTempStyle(false) 27 | { 28 | // add standard dash patterns 29 | for (int i = Qt::NoPen; i < Qt::CustomDashLine; i++) { 30 | QPen pen(static_cast(i)); 31 | m_styles << pen.dashPattern(); 32 | } 33 | } 34 | 35 | int KPropertyLineStyleModel::rowCount(const QModelIndex &/*parent*/) const 36 | { 37 | return m_styles.count() + (m_hasTempStyle ? 1 : 0); 38 | } 39 | 40 | QVariant KPropertyLineStyleModel::data(const QModelIndex &index, int role) const 41 | { 42 | if (!index.isValid()) 43 | return QVariant(); 44 | 45 | switch(role) { 46 | case Qt::DecorationRole: { 47 | QPen pen(Qt::black); 48 | pen.setWidth(3); 49 | if (index.row() < Qt::CustomDashLine) 50 | pen.setStyle(static_cast(index.row())); 51 | else if (index.row() < m_styles.count()) 52 | pen.setDashPattern(m_styles[index.row()]); 53 | else if (m_hasTempStyle) 54 | pen.setDashPattern(m_tempStyle); 55 | else 56 | pen.setStyle(Qt::NoPen); 57 | 58 | return QVariant(pen); 59 | } 60 | case Qt::SizeHintRole: 61 | return QSize(100, 15); 62 | default: 63 | return QVariant(); 64 | } 65 | } 66 | 67 | bool KPropertyLineStyleModel::addCustomStyle(const QVector &style) 68 | { 69 | if (m_styles.contains(style)) 70 | return false; 71 | 72 | m_styles.append(style); 73 | return true; 74 | } 75 | 76 | int KPropertyLineStyleModel::setLineStyle(Qt::PenStyle style, const QVector &dashes) 77 | { 78 | // check if we select a standard or custom style 79 | if (style < Qt::CustomDashLine) { 80 | // a standard style 81 | m_hasTempStyle = false; 82 | return style; 83 | } else if (style == Qt::CustomDashLine) { 84 | // a custom style -> check if already added 85 | int index = m_styles.indexOf(dashes, Qt::CustomDashLine); 86 | if (index < 0) { 87 | // not already added -> add temporarly 88 | m_tempStyle = dashes; 89 | m_hasTempStyle = true; 90 | //reset(); 91 | return m_styles.count(); 92 | } else { 93 | // already added -> return index 94 | m_hasTempStyle = false; 95 | //reset(); 96 | return index; 97 | } 98 | } 99 | return -1; 100 | } 101 | -------------------------------------------------------------------------------- /src/KPropertyLineStyleModel_p.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | * Copyright (C) 2007 Jan Hambrecht 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public License 15 | * along with this library; see the file COPYING.LIB. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef KPROPERTYLINESTYLEMODEL_H 21 | #define KPROPERTYLINESTYLEMODEL_H 22 | 23 | #include 24 | 25 | #include 26 | 27 | //! Line style model managing the style data 28 | class KPropertyLineStyleModel : public QAbstractListModel 29 | { 30 | public: 31 | explicit KPropertyLineStyleModel(QObject *parent = nullptr); 32 | ~KPropertyLineStyleModel() override {} 33 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; 34 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; 35 | 36 | //! Adds the given style to the model 37 | bool addCustomStyle(const QVector &style); 38 | //! Selects the given style 39 | int setLineStyle(Qt::PenStyle style, const QVector &dashes); 40 | private: 41 | QList > m_styles; ///< the added styles 42 | QVector m_tempStyle; ///< a temporary added style 43 | bool m_hasTempStyle; ///< state of the temporary style 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/KPropertyLineStyleSelector_p.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | * Copyright (C) 2007 Jan Hambrecht 3 | * Copyright (C) 2015 Jarosław Staniek 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public License 16 | * along with this library; see the file COPYING.LIB. If not, write to 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #include "KPropertyLineStyleSelector_p.h" 22 | #include "KPropertyLineStyleModel_p.h" 23 | #include "KPropertyLineStyleItemDelegate_p.h" 24 | #include "KPropertyWidgetsFactory.h" 25 | 26 | #include 27 | #include 28 | 29 | class Q_DECL_HIDDEN KPropertyLineStyleSelector::Private 30 | { 31 | public: 32 | Private(QWidget *parent) 33 | : model(new KPropertyLineStyleModel(parent)) 34 | { 35 | } 36 | 37 | KPropertyLineStyleModel *model; 38 | }; 39 | 40 | KPropertyLineStyleSelector::KPropertyLineStyleSelector(QWidget *parent) 41 | : QComboBox(parent), d(new Private(this)) 42 | { 43 | setModel(d->model); 44 | setItemDelegate(new KPropertyLineStyleItemDelegate(this)); 45 | setEditable(false); 46 | setInsertPolicy(QComboBox::NoInsert); 47 | setContextMenuPolicy(Qt::NoContextMenu); 48 | } 49 | 50 | KPropertyLineStyleSelector::~KPropertyLineStyleSelector() 51 | { 52 | delete d; 53 | } 54 | 55 | void KPropertyLineStyleSelector::paintEvent(QPaintEvent *pe) 56 | { 57 | QComboBox::paintEvent(pe); 58 | 59 | QStyleOptionComboBox option; 60 | option.initFrom(this); 61 | option.frame = hasFrame(); 62 | QRect r = style()->subControlRect(QStyle::CC_ComboBox, &option, QStyle::SC_ComboBoxEditField, this); 63 | QPen pen = itemData(currentIndex(), Qt::DecorationRole).value(); 64 | QPainter painter(this); 65 | KPropertyLineStyleItemDelegate::paintItem(&painter, pen, r, option); 66 | KPropertyWidgetsFactory::paintTopGridLine(this); 67 | } 68 | 69 | bool KPropertyLineStyleSelector::addCustomStyle(const QVector &style) 70 | { 71 | return d->model->addCustomStyle(style); 72 | } 73 | 74 | void KPropertyLineStyleSelector::setLineStyle(Qt::PenStyle style, const QVector &dashes) 75 | { 76 | int index = d->model->setLineStyle(style, dashes); 77 | if (index >= 0) 78 | setCurrentIndex(index); 79 | } 80 | 81 | Qt::PenStyle KPropertyLineStyleSelector::lineStyle() const 82 | { 83 | QPen pen = itemData(currentIndex(), Qt::DecorationRole).value(); 84 | return pen.style(); 85 | } 86 | 87 | QVector KPropertyLineStyleSelector::lineDashes() const 88 | { 89 | QPen pen = itemData(currentIndex(), Qt::DecorationRole).value(); 90 | return pen.dashPattern(); 91 | } 92 | -------------------------------------------------------------------------------- /src/KPropertyLineStyleSelector_p.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | * Copyright (C) 2007 Jan Hambrecht 3 | * Copyright (C) 2015 Jarosław Staniek 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public License 16 | * along with this library; see the file COPYING.LIB. If not, write to 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef KPROPERTYLINESTYLESELECTOR_H 22 | #define KPROPERTYLINESTYLESELECTOR_H 23 | 24 | #include "kpropertywidgets_export.h" 25 | 26 | #include 27 | 28 | /** 29 | * A custom combobox widget for selecting line styles. 30 | */ 31 | class KPROPERTYWIDGETS_EXPORT KPropertyLineStyleSelector : public QComboBox 32 | { 33 | Q_OBJECT 34 | public: 35 | explicit KPropertyLineStyleSelector(QWidget *parent = nullptr); 36 | ~KPropertyLineStyleSelector() override; 37 | 38 | //! @return the current line style 39 | Qt::PenStyle lineStyle() const; 40 | 41 | //! @return the dashes of the current line style 42 | QVector lineDashes() const; 43 | 44 | public Q_SLOTS: 45 | /** 46 | * Adds a new line style to the combobox. 47 | * 48 | * If the style already exists, it is not added to the selector. 49 | * 50 | * @param style the line style to add 51 | * @return true if style is unique among the existing styles and was added, else false 52 | */ 53 | bool addCustomStyle(const QVector &style); 54 | 55 | /** 56 | * Selects the specified style. 57 | * 58 | * If the style was already added it gets selected. If the style was not added already 59 | * it gets temporary added and selected. 60 | * 61 | * @param style the style to display 62 | * @param dashes the dashes of the style if style == Qt::CustomDashLine 63 | */ 64 | void setLineStyle(Qt::PenStyle style, const QVector &dashes = QVector()); 65 | 66 | protected: 67 | void paintEvent(QPaintEvent *pe) override; 68 | 69 | private: 70 | Q_DISABLE_COPY(KPropertyLineStyleSelector) 71 | class Private; 72 | Private * const d; 73 | }; 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /src/KPropertySetBuffer.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2004-2017 Jarosław Staniek 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public License 17 | along with this library; see the file COPYING.LIB. If not, write to 18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef KPROPERTYSETBUFFER_H 23 | #define KPROPERTYSETBUFFER_H 24 | 25 | #include "KPropertySet.h" 26 | 27 | /** 28 | * @brief A property set's buffer 29 | */ 30 | class KPROPERTYCORE_EXPORT KPropertySetBuffer : public KPropertySet 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | KPropertySetBuffer(); 36 | 37 | explicit KPropertySetBuffer(const KPropertySet &set); 38 | 39 | ~KPropertySetBuffer() override; 40 | 41 | /*! Intersects with other KPropertySet.*/ 42 | virtual void intersect(const KPropertySet& set); 43 | 44 | protected Q_SLOTS: 45 | void intersectedChanged(KPropertySet& set, KProperty& prop); 46 | void intersectedReset(KPropertySet& set, KProperty& prop); 47 | 48 | private: 49 | void init(const KPropertySet& set); 50 | 51 | Q_DISABLE_COPY(KPropertySetBuffer) 52 | class Private; 53 | Private * const d; 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/KPropertyUtils.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2006-2016 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef KPROPERTY_UTILS_H 21 | #define KPROPERTY_UTILS_H 22 | 23 | #include "kpropertywidgets_export.h" 24 | 25 | #include 26 | 27 | class KProperty; 28 | 29 | //! @short A container widget that can be used to split information into hideable sections 30 | //! for a property editor-like panes. 31 | class KPROPERTYWIDGETS_EXPORT KPropertyGroupWidget : public QWidget 32 | { 33 | Q_OBJECT 34 | public: 35 | explicit KPropertyGroupWidget(const QString& title, QWidget* parent = nullptr); 36 | ~KPropertyGroupWidget() override; 37 | 38 | public Q_SLOTS: 39 | void setContents(QWidget* contents); 40 | 41 | protected: 42 | bool event(QEvent * e) override; 43 | 44 | Q_DISABLE_COPY(KPropertyGroupWidget) 45 | class Private; 46 | Private * const d; 47 | }; 48 | 49 | namespace KPropertyUtils { 50 | 51 | //! @return property object for model index @a index or @c nullptr if there is no property 52 | //! referenced by the index. 53 | KPROPERTYWIDGETS_EXPORT KProperty* propertyForIndex(const QModelIndex &index); 54 | 55 | } // KPropertyUtils 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/KPropertyWidgetsConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # KPropertyWidgetsConfig.cmake provides information about the installed KPropertyWidgets library. 2 | # It can be used directly from CMake via find_package(KPropertyWidgets NO_MODULE) 3 | # 4 | # Any changes in this ".cmake" file will be overwritten by CMake, the source is the ".cmake.in" file. 5 | # 6 | # The following CMake variables are provided: 7 | # KPropertyWidgets_VERSION_MAJOR - the major version number of KPropertyWidgets 8 | # KPropertyWidgets_VERSION_MINOR - the minor version number of KPropertyWidgets 9 | # KPropertyWidgets_VERSION_PATCH - the patch version number of KPropertyWidgets 10 | # KPropertyWidgets_INCLUDE_DIRS - the include directories to use 11 | # 12 | # Additionally, the following imported library targets are created, which may be used directly 13 | # with target_link_libraries(): 14 | # KPropertyWidgets - the KPropertyWidgets library 15 | 16 | @PACKAGE_INIT@ 17 | 18 | include(CMakeFindDependencyMacro) 19 | include(FeatureSummary) 20 | 21 | find_dependency(Qt5Widgets @REQUIRED_QT_VERSION@) 22 | find_dependency(KPropertyCore @PROJECT_VERSION@ EXACT) 23 | 24 | include("${CMAKE_CURRENT_LIST_DIR}/KPropertyWidgetsTargets.cmake") 25 | include("${CMAKE_CURRENT_LIST_DIR}/KPropertyWidgetsQCHTargets.cmake") 26 | 27 | # Features 28 | set(KPROPERTY_KF @KPROPERTY_KF@) 29 | 30 | # Match COMPONENTS to features (KPROPERTY_ prefixes) 31 | foreach (_COMP ${KPropertyWidgets_FIND_COMPONENTS}) 32 | if(NOT DEFINED KPROPERTY_${_COMP} OR NOT ${KPROPERTY_${_COMP}}) 33 | message(FATAL_ERROR "KPropertyWidgets does not contain required component ${_COMP}. Update KPropertyWidgets or remove this requirement.") 34 | endif() 35 | endforeach() 36 | 37 | set_package_properties(KPropertyWidgets PROPERTIES 38 | DESCRIPTION "A property editing framework with editor widget" 39 | URL "https://community.kde.org/KProperty") 40 | -------------------------------------------------------------------------------- /src/KPropertyWidgetsPluginManager.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2008-2016 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef KPROPERTYWIDGETSPLUGINMANAGER_H 21 | #define KPROPERTYWIDGETSPLUGINMANAGER_H 22 | 23 | #include "kpropertywidgets_export.h" 24 | #include 25 | 26 | class QModelIndex; 27 | class QPainter; 28 | class QStyleOptionViewItem; 29 | class QWidget; 30 | class KProperty; 31 | class KPropertyWidgetsFactory; 32 | class KCustomProperty; 33 | 34 | class KPROPERTYWIDGETS_EXPORT KPropertyWidgetsPluginManager : public QObject 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | //! @return a pointer to the instance of plugin manager 40 | static KPropertyWidgetsPluginManager* self(); 41 | 42 | bool isEditorForTypeAvailable(int type) const; 43 | 44 | QWidget* createEditor(int type, QWidget *parent, const QStyleOptionViewItem & option, 45 | const QModelIndex &index) const; 46 | 47 | bool paint(int type, QPainter *painter, const QStyleOptionViewItem &option, 48 | const QModelIndex &index) const; 49 | 50 | //! Registers factory @a factory. It becomes owned by the manager. 51 | void registerFactory(KPropertyWidgetsFactory *factory); 52 | 53 | private: 54 | // to get access to the constructor 55 | friend class KPropertyWidgetsPluginManagerSingleton; 56 | 57 | KPropertyWidgetsPluginManager(); 58 | 59 | ~KPropertyWidgetsPluginManager() override; 60 | 61 | Q_DISABLE_COPY(KPropertyWidgetsPluginManager) 62 | class Private; 63 | Private * const d; 64 | }; 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /src/Mainpage.dox: -------------------------------------------------------------------------------- 1 | /** 2 | @mainpage KProperty 3 | 4 | %KProperty is a property editing framework with editor widget similar to what is known from Qt Designer. 5 | 6 | Main classes of this framework are: 7 | - KProperty, representing model for a single property with its own type and value. 8 | - KPropertySet, a model for for a set of properties (KProperty objects). 9 | - KPropertyEditorView, a view widget for displaying and editing properties provided by 10 | a KPropertySet object. Each property has its own row displayed within view widget. 11 | The view widget provides inline editing for properties objects. 12 | 13 | The %KProperty framework also supports adding new property types and property editors 14 | using KPropertyFactory and KPropertyFactoryManager classes. Complex value types can 15 | be defined as composed properties. 16 | 17 | To see how to use %KProperty take a look at the KPropertyExample application available 18 | in examples/ directory. 19 | 20 | Project's home page: https://community.kde.org/KProperty 21 | 22 | @authors 23 | - Jarosław Staniek - Maintainer, main author 24 | - Cédric Pasteur - improvements and fixes 25 | 26 | Contributors: 27 | - Adam Pigg - fixes 28 | - Friedrich W. H. Kossebau - cleanups 29 | - Laurent Montel - cleanups 30 | 31 | @licenses 32 | @lgpl 33 | */ 34 | // DOXYGEN_SET_PROJECT_NAME = KProperty 35 | // DOXYGEN_SET_IGNORE_PREFIX = KProperty 36 | // DOXYGEN_SET_EXCLUDE_PATTERNS += *_p.h 37 | -------------------------------------------------------------------------------- /src/Messages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Extract strings from all source files. 4 | # EXTRACT_TR_STRINGS extracts strings with lupdate and convert them to .pot with 5 | # lconvert. 6 | 7 | function find_files() 8 | { 9 | while IFS='' read -r line ; do 10 | if echo "$line" | grep -q "${1}_LIB_SRCS" > /dev/null; then 11 | while IFS=' ' read -a file ; do 12 | if [ "$file" == ")" ]; then 13 | break 14 | elif echo "$file" | grep -q "^\w*#" > /dev/null || [ ! -f "$file" ] || \ 15 | echo "$file" | grep -qv "\.cpp\w*$" > /dev/null; then 16 | continue 17 | fi 18 | echo $file 19 | done 20 | fi 21 | done < CMakeLists.txt 22 | } 23 | 24 | $EXTRACT_TR_STRINGS `find_files kpropertycore` -o $podir/kpropertycore_qt.pot 25 | $EXTRACT_TR_STRINGS `find_files kpropertywidgets` -o $podir/kpropertywidgets_qt.pot 26 | -------------------------------------------------------------------------------- /src/config-kproperty.h.cmake: -------------------------------------------------------------------------------- 1 | #ifndef KPROPERTY_CONFIG_H 2 | #define KPROPERTY_CONFIG_H 3 | 4 | /* config-kproperty.h. Generated by cmake from config-kproperty.h.cmake */ 5 | 6 | /*! @file config-kproperty.h 7 | Global KProperty configuration (build time) 8 | */ 9 | 10 | //! @def KPROPERTY_GIT_SHA1_STRING 11 | //! @brief Indicates the git sha1 commit which was used for compilation of KProperty 12 | #cmakedefine KPROPERTY_GIT_SHA1_STRING "@KPROPERTY_GIT_SHA1_STRING@" 13 | 14 | //! @def KPROPERTY_GIT_BRANCH_STRING 15 | //! @brief Indicates the git branch which was used for compilation of KProperty 16 | #cmakedefine KPROPERTY_GIT_BRANCH_STRING "@KPROPERTY_GIT_BRANCH_STRING@" 17 | 18 | //! @def BIN_INSTALL_DIR 19 | //! @brief The subdirectory relative to the install prefix for executables. 20 | #define BIN_INSTALL_DIR "${BIN_INSTALL_DIR}" 21 | 22 | //! @def KPROPERTY_TESTING_EXPORT 23 | //! @brief Export symbols for testing 24 | #ifdef BUILD_TESTING 25 | # define KPROPERTY_TESTING_EXPORT KPROPERTY_EXPORT 26 | #else 27 | # define KPROPERTY_TESTING_EXPORT 28 | #endif 29 | 30 | //! @def KPROPERTY_UNFINISHED 31 | //! @brief Defined if unfinished features of KProperty are enabled 32 | #cmakedefine KPROPERTY_UNFINISHED 33 | 34 | //! @def KPROPERTY_WIDGETS 35 | //! @brief Defined if QtWidgets components of KProperty are enabled 36 | #cmakedefine KPROPERTY_WIDGETS 37 | 38 | //! @def KPROPERTYCORE_BASE_NAME 39 | //! @brief Base name for the KPropertyCore library, based on major stable version. 40 | //! Useful for co-installability. 41 | #define KPROPERTYCORE_BASE_NAME "@KPROPERTYCORE_BASE_NAME@" 42 | 43 | //! @def KPROPERTYCORE_BASE_NAME_LOWER 44 | //! @brief Like KPROPERTYCORE_BASE_NAME but lowercase. 45 | #define KPROPERTYCORE_BASE_NAME_LOWER "@KPROPERTYCORE_BASE_NAME_LOWER@" 46 | 47 | //! @def KPROPERTYWIDGETS_BASE_NAME 48 | //! @brief Base name for the KPropertyCore library, based on major stable version. 49 | //! Useful for co-installability. 50 | #define KPROPERTYWIDGETS_BASE_NAME "@KPROPERTYWIDGETS_BASE_NAME@" 51 | 52 | //! @def KPROPERTYWIDGETS_BASE_NAME_LOWER 53 | //! @brief Like KPROPERTYWIDGETS_BASE_NAME but lowercase. 54 | #define KPROPERTYWIDGETS_BASE_NAME_LOWER "@KPROPERTYWIDGETS_BASE_NAME_LOWER@" 55 | 56 | //! @def KPROPERTY_STABLE_VERSION_MAJOR 57 | //! @brief Extra version info, stable major, e.g. 3 for 3.1.0 Alpha (3.0.90) 58 | #define KPROPERTY_STABLE_VERSION_MAJOR @PROJECT_STABLE_VERSION_MAJOR@ 59 | 60 | //! @def KPROPERTY_STABLE_VERSION_MINOR 61 | //! @brief Extra version info, stable minor, e.g. 1 for 3.1.0 Alpha (3.0.90) 62 | #define KPROPERTY_STABLE_VERSION_MINOR @PROJECT_STABLE_VERSION_MINOR@ 63 | 64 | //! @def KPROPERTY_STABLE_VERSION_PATCH 65 | //! @brief Extra version info, stable patch, e.g. 0 for 3.1.0 Alpha (3.0.90) 66 | #define KPROPERTY_STABLE_VERSION_PATCH @PROJECT_STABLE_VERSION_PATCH@ 67 | 68 | //! @def KPROPERTY_KF 69 | //! @brief Defined if components depending on KDE Frameworks are enabled 70 | #cmakedefine KPROPERTY_KF 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /src/editors/3rdparty/KColorCollection: -------------------------------------------------------------------------------- 1 | #include "KColorCollection.h" 2 | -------------------------------------------------------------------------------- /src/editors/3rdparty/KColorCombo: -------------------------------------------------------------------------------- 1 | #include "KColorCombo.h" 2 | -------------------------------------------------------------------------------- /src/editors/3rdparty/KColorCombo.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE libraries 2 | Copyright (C) 1997 Martin Jones (mjones@kde.org) 3 | Copyright (c) 2007 David Jarvie (software@astrojar.org.uk) 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public License 16 | along with this library; see the file COPYING.LIB. If not, write to 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | Boston, MA 02110-1301, USA. 19 | */ 20 | //----------------------------------------------------------------------------- 21 | // KDE color selection combo box 22 | 23 | // layout management added Oct 1997 by Mario Weilguni 24 | // 25 | 26 | #ifndef KCOLORCOMBO_H 27 | #define KCOLORCOMBO_H 28 | 29 | #include 30 | #include 31 | 32 | class KColorComboPrivate; 33 | 34 | /** 35 | * Combobox for colors. 36 | * 37 | * The combobox provides some preset colors to be selected, and an entry to 38 | * select a custom color using a color dialog. 39 | * 40 | * \image html kcolorcombo.png "KDE Color Combo Box" 41 | */ 42 | class KColorCombo : public QComboBox 43 | { 44 | Q_OBJECT 45 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY activated USER true) 46 | Q_PROPERTY(QList colors READ colors WRITE setColors) 47 | 48 | public: 49 | /** 50 | * Constructs a color combo box. 51 | */ 52 | explicit KColorCombo(QWidget *parent = 0); 53 | ~KColorCombo(); 54 | 55 | /** 56 | * Selects the color @p col. 57 | */ 58 | void setColor(const QColor &col); 59 | 60 | /** 61 | * Returns the currently selected color. 62 | **/ 63 | QColor color() const; 64 | 65 | /** 66 | * Find whether the currently selected color is a custom color selected 67 | * using a color dialog. 68 | **/ 69 | bool isCustomColor() const; 70 | 71 | /** 72 | * Set a custom list of colors to choose from, in place of the standard 73 | * list. 74 | * @param cols list of colors. If empty, the selection list reverts to 75 | * the standard list. 76 | **/ 77 | void setColors(const QList &colors); 78 | 79 | /** 80 | * Return the list of colors available for selection. 81 | * @return list of colors 82 | **/ 83 | QList colors() const; 84 | 85 | /** 86 | * Clear the color list and don't show it, till the next setColor() call 87 | **/ 88 | void showEmptyList(); 89 | 90 | Q_SIGNALS: 91 | /** 92 | * Emitted when a new color box has been selected. 93 | */ 94 | void activated(const QColor &col); 95 | /** 96 | * Emitted when a new item has been highlighted. 97 | */ 98 | void highlighted(const QColor &col); 99 | 100 | protected: 101 | void paintEvent(QPaintEvent *event) override; 102 | 103 | private: 104 | friend class KColorComboPrivate; 105 | KColorComboPrivate *const d; 106 | 107 | Q_DISABLE_COPY(KColorCombo) 108 | 109 | Q_PRIVATE_SLOT(d, void _k_slotActivated(int)) 110 | Q_PRIVATE_SLOT(d, void _k_slotHighlighted(int)) 111 | }; 112 | 113 | #endif // KCOLORCOMBO_H 114 | -------------------------------------------------------------------------------- /src/editors/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(KPROPERTY_EDITORS_HEADERS 2 | Utils 3 | BoolEdit 4 | ColorEdit 5 | ComboBox 6 | CursorEdit 7 | DateEdit 8 | DateTimeEdit 9 | #DummyWidget 10 | FontEdit 11 | LineStyleEdit 12 | PixmapEdit 13 | PointEdit 14 | RectEdit 15 | SizeEdit 16 | SizePolicyEdit 17 | SpinBox 18 | #StringListEdit 19 | #SymbolCombo 20 | TimeEdit 21 | ) 22 | 23 | ecm_generate_headers(kproperty_editors_FORWARDING_HEADERS 24 | REQUIRED_HEADERS kproperty_editors_HEADERS 25 | # TODO: rename to camelcase, then uncomment "ORIGINAL CAMELCASE" 26 | HEADER_NAMES ${KPROPERTY_EDITORS_HEADERS} 27 | ) 28 | 29 | ecm_generate_headers(kproperty_editors_FORWARDING_HEADERS 30 | REQUIRED_HEADERS kproperty_editors_HEADERS 31 | ORIGINAL CAMELCASE 32 | HEADER_NAMES 33 | KPropertyGenericSelectionEditor 34 | KPropertyMultiLineStringEditor 35 | KPropertyRectFEditor 36 | KPropertyStringEditor 37 | KPropertyUrlEditor 38 | ) 39 | 40 | set(kproperty_editors_HEADERS ${kproperty_editors_HEADERS} PARENT_SCOPE) 41 | set(kproperty_editors_FORWARDING_HEADERS ${kproperty_editors_FORWARDING_HEADERS} PARENT_SCOPE) 42 | -------------------------------------------------------------------------------- /src/editors/KPropertyComposedUrlEditor.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2016-2018 Jarosław Staniek 5 | Copyright (C) 2018 Dmitry Baryshev 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Library General Public 9 | License as published by the Free Software Foundation; either 10 | version 2 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Library General Public License for more details. 16 | 17 | You should have received a copy of the GNU Library General Public License 18 | along with this library; see the file COPYING.LIB. If not, write to 19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #include "KPropertyComposedUrlEditor.h" 24 | #include "KPropertyUrlEditor.h" // KPropertyUrlDelegate 25 | #include "KPropertyUrlEditor_p.h" 26 | 27 | #include 28 | 29 | KPropertyComposedUrlEditor::KPropertyComposedUrlEditor(const KProperty &property, QWidget *parent) 30 | : KPropertyGenericSelectionEditor(parent) 31 | , d(new KPropertyUrlEditorPrivate(this, property)) 32 | { 33 | setMainWidget(d->lineEdit); 34 | connect(d.data(), &KPropertyUrlEditorPrivate::commitData, this, 35 | [this] { emit commitData(this); }); 36 | } 37 | 38 | KPropertyComposedUrlEditor::~KPropertyComposedUrlEditor() {} 39 | 40 | KPropertyComposedUrl KPropertyComposedUrlEditor::value() const 41 | { 42 | return d->value.value(); 43 | } 44 | 45 | void KPropertyComposedUrlEditor::setValue(const KPropertyComposedUrl &value) 46 | { 47 | d->setValue(QVariant::fromValue(value)); 48 | const KPropertyUrlDelegate delegate; 49 | d->updateLineEdit(delegate.valueToString(d->value, locale())); 50 | } 51 | 52 | void KPropertyComposedUrlEditor::selectButtonClicked() 53 | { 54 | QUrl url = d->getUrl(); 55 | if (url.isValid() && d->checkAndUpdate(&url)) { 56 | KPropertyComposedUrl composedUrl = value(); 57 | composedUrl.setAbsoluteUrl(url); 58 | setValue(composedUrl); 59 | emit commitData(this); 60 | } 61 | } 62 | 63 | bool KPropertyComposedUrlEditor::eventFilter(QObject *o, QEvent *event) 64 | { 65 | d->processEvent(o, event); 66 | return KPropertyGenericSelectionEditor::eventFilter(o, event); 67 | } 68 | -------------------------------------------------------------------------------- /src/editors/KPropertyComposedUrlEditor.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2016-2018 Jarosław Staniek 5 | Copyright (C) 2018 Dmitry Baryshev 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Library General Public 9 | License as published by the Free Software Foundation; either 10 | version 2 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Library General Public License for more details. 16 | 17 | You should have received a copy of the GNU Library General Public License 18 | along with this library; see the file COPYING.LIB. If not, write to 19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifndef KPROPERTYCOMPOSEDURLEDITOR_H 24 | #define KPROPERTYCOMPOSEDURLEDITOR_H 25 | 26 | #include "KPropertyComposedUrl.h" 27 | #include "KPropertyGenericSelectionEditor.h" 28 | 29 | #include 30 | 31 | class KProperty; 32 | class KPropertyUrlEditorPrivate; 33 | 34 | /** 35 | * Editor for ComposedUrl type 36 | * 37 | * @since 3.2 38 | */ 39 | class KPROPERTYWIDGETS_EXPORT KPropertyComposedUrlEditor : public KPropertyGenericSelectionEditor 40 | { 41 | Q_PROPERTY(KPropertyComposedUrl value READ value WRITE setValue USER true) 42 | Q_OBJECT 43 | 44 | public: 45 | explicit KPropertyComposedUrlEditor(const KProperty &property, QWidget *parent = nullptr); 46 | ~KPropertyComposedUrlEditor() override; 47 | 48 | virtual KPropertyComposedUrl value() const; 49 | 50 | Q_SIGNALS: 51 | void commitData(QWidget * editor); 52 | 53 | public Q_SLOTS: 54 | virtual void setValue(const KPropertyComposedUrl &value); 55 | 56 | protected Q_SLOTS: 57 | void selectButtonClicked() override; 58 | 59 | protected: 60 | bool eventFilter(QObject *o, QEvent *event) override; 61 | 62 | private: 63 | Q_DISABLE_COPY(KPropertyComposedUrlEditor) 64 | QScopedPointer const d; 65 | }; 66 | 67 | #endif // KPROPERTYCOMPOSEDURLEDITOR_H 68 | -------------------------------------------------------------------------------- /src/editors/KPropertyGenericSelectionEditor.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2016 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include "KPropertyGenericSelectionEditor.h" 21 | 22 | #include 23 | #include 24 | 25 | class Q_DECL_HIDDEN KPropertyGenericSelectionEditor::Private 26 | { 27 | public: 28 | Private() { 29 | } 30 | QHBoxLayout *lyr; 31 | QPushButton *btn; 32 | }; 33 | 34 | KPropertyGenericSelectionEditor::KPropertyGenericSelectionEditor(QWidget *parent) 35 | : QWidget(parent), d(new Private) 36 | { 37 | setAutoFillBackground(true); 38 | d->lyr = new QHBoxLayout(this); 39 | d->lyr->setContentsMargins(0, 0, 0, 0); 40 | d->lyr->setSpacing(2); 41 | d->btn = new QPushButton(tr("...", "... button")); 42 | d->btn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); 43 | d->btn->setFixedWidth(d->btn->fontMetrics().width(d->btn->text() + QLatin1String(" "))); 44 | d->btn->setFocusPolicy(Qt::NoFocus); 45 | connect(d->btn, &QPushButton::clicked, this, &KPropertyGenericSelectionEditor::selectButtonClicked); 46 | d->lyr->addWidget(d->btn); 47 | } 48 | 49 | KPropertyGenericSelectionEditor::~KPropertyGenericSelectionEditor() 50 | { 51 | } 52 | 53 | void KPropertyGenericSelectionEditor::setMainWidget(QWidget *widget) 54 | { 55 | if (d->lyr->count() > 1) { 56 | delete d->lyr->takeAt(0)->widget(); 57 | } 58 | if (widget) { 59 | d->lyr->insertWidget(0, widget); 60 | widget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); 61 | setFocusProxy(widget); 62 | } 63 | } 64 | 65 | void KPropertyGenericSelectionEditor::setSelectionButtonVisible(bool set) 66 | { 67 | d->btn->setVisible(set); 68 | } 69 | 70 | void KPropertyGenericSelectionEditor::selectButtonClicked() 71 | { 72 | } 73 | -------------------------------------------------------------------------------- /src/editors/KPropertyGenericSelectionEditor.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2016 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef KPROPERTYGENERICSELECTIONEDITOR_H 21 | #define KPROPERTYGENERICSELECTIONEDITOR_H 22 | 23 | #include "kpropertywidgets_export.h" 24 | 25 | #include 26 | #include 27 | 28 | //! A base class for use by editors that have widget on the left and "..." select button on the right 29 | class KPROPERTYWIDGETS_EXPORT KPropertyGenericSelectionEditor : public QWidget 30 | { 31 | Q_OBJECT 32 | public: 33 | explicit KPropertyGenericSelectionEditor(QWidget *parent = nullptr); 34 | 35 | ~KPropertyGenericSelectionEditor() override; 36 | 37 | public Q_SLOTS: 38 | //! Sets the visibility of the "..." select button 39 | void setSelectionButtonVisible(bool set); 40 | 41 | protected: 42 | void setMainWidget(QWidget *widget); 43 | 44 | protected Q_SLOTS: 45 | //! Reimplement to react on clicking the "..." select button 46 | virtual void selectButtonClicked(); 47 | 48 | private: 49 | Q_DISABLE_COPY(KPropertyGenericSelectionEditor) 50 | class Private; 51 | QScopedPointer const d; 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/editors/KPropertyMultiLineStringEditor.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2016 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include "KPropertyMultiLineStringEditor.h" 21 | #include "KPropertyEditorView.h" 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | class Q_DECL_HIDDEN KPropertyMultiLineStringEditor::Private 28 | { 29 | public: 30 | Private() {} 31 | QPlainTextEdit *editor; 32 | bool slotTextChangedEnabled = true; 33 | }; 34 | 35 | KPropertyMultiLineStringEditor::KPropertyMultiLineStringEditor(QWidget *parent) 36 | : QWidget(parent) 37 | , d(new Private) 38 | { 39 | setAutoFillBackground(true); 40 | QHBoxLayout *lyr = new QHBoxLayout(this); 41 | lyr->setContentsMargins(0, 1, 0, 0); 42 | lyr->addSpacing(2); 43 | d->editor = new QPlainTextEdit; 44 | lyr->addWidget(d->editor); 45 | d->editor->setFrameStyle(0); 46 | d->editor->setTabChangesFocus(true); 47 | d->editor->setContentsMargins(0,0,0,0); 48 | d->editor->document()->setDocumentMargin(1); 49 | connect(d->editor, &QPlainTextEdit::textChanged, this, &KPropertyMultiLineStringEditor::slotTextChanged); 50 | d->editor->verticalScrollBar()->installEventFilter(this); 51 | } 52 | 53 | KPropertyMultiLineStringEditor::~KPropertyMultiLineStringEditor() 54 | { 55 | delete d; 56 | } 57 | 58 | QString KPropertyMultiLineStringEditor::value() const 59 | { 60 | return d->editor->toPlainText(); 61 | } 62 | 63 | void KPropertyMultiLineStringEditor::setValue(const QString& value) 64 | { 65 | d->slotTextChangedEnabled = false; 66 | d->editor->setPlainText(value); 67 | d->slotTextChangedEnabled = true; 68 | } 69 | 70 | void KPropertyMultiLineStringEditor::slotTextChanged() 71 | { 72 | if (!d->slotTextChangedEnabled) { 73 | return; 74 | } 75 | emit commitData(this); 76 | } 77 | 78 | bool KPropertyMultiLineStringEditor::eventFilter(QObject *o, QEvent *ev) 79 | { 80 | const bool result = QWidget::eventFilter(o, ev); 81 | if (o == d->editor->verticalScrollBar() && ev->type() == QEvent::Paint) { 82 | KPropertyWidgetsFactory::paintTopGridLine(qobject_cast(o)); 83 | } 84 | return result; 85 | } 86 | 87 | void KPropertyMultiLineStringEditor::paintEvent(QPaintEvent * event) 88 | { 89 | QWidget::paintEvent(event); 90 | KPropertyWidgetsFactory::paintTopGridLine(this); 91 | } 92 | -------------------------------------------------------------------------------- /src/editors/KPropertyMultiLineStringEditor.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2016 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef KPROPERTY_MULTILINESTRINGEDITOR_H 21 | #define KPROPERTY_MULTILINESTRINGEDITOR_H 22 | 23 | #include "KPropertyWidgetsFactory.h" 24 | 25 | //! Editor for string type supporting multiple lines of plain text 26 | //! @since 3.1 27 | class KPROPERTYWIDGETS_EXPORT KPropertyMultiLineStringEditor : public QWidget 28 | { 29 | Q_OBJECT 30 | Q_PROPERTY(QString value READ value WRITE setValue USER true) 31 | public: 32 | explicit KPropertyMultiLineStringEditor(QWidget *parent = nullptr); 33 | 34 | ~KPropertyMultiLineStringEditor() override; 35 | 36 | QString value() const; 37 | 38 | Q_SIGNALS: 39 | void commitData(QWidget *editor); 40 | 41 | public Q_SLOTS: 42 | void setValue(const QString &value); 43 | 44 | private Q_SLOTS: 45 | void slotTextChanged(); 46 | 47 | protected: 48 | bool eventFilter(QObject *o, QEvent *ev) override; 49 | void paintEvent(QPaintEvent * event) override; 50 | 51 | private: 52 | Q_DISABLE_COPY(KPropertyMultiLineStringEditor) 53 | class Private; 54 | Private * const d; 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/editors/KPropertyRectFEditor.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2015-2017 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef KPROPERTY_RECTFEDITOR_H 21 | #define KPROPERTY_RECTFEDITOR_H 22 | 23 | #include "KPropertyWidgetsFactory.h" 24 | 25 | class KPROPERTYWIDGETS_EXPORT KRectFComposedProperty : public KComposedPropertyInterface 26 | { 27 | public: 28 | explicit KRectFComposedProperty(KProperty *parent); 29 | 30 | void setValue(KProperty *property, 31 | const QVariant &value, KProperty::ValueOptions valueOptions) override; 32 | 33 | void childValueChanged(KProperty *child, 34 | const QVariant &value, KProperty::ValueOptions valueOptions) override; 35 | }; 36 | 37 | class KPROPERTYWIDGETS_EXPORT KPropertyRectFDelegate : public KPropertyLabelCreator, 38 | public KComposedPropertyCreator 39 | { 40 | public: 41 | KPropertyRectFDelegate(); 42 | 43 | QString propertyValueToString(const KProperty *property, 44 | const QLocale &locale) const override; 45 | 46 | QString valueToString(const QVariant& value, const QLocale &locale) const override; 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/editors/KPropertyStringEditor.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2008-2016 Jarosław Staniek 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public License 17 | along with this library; see the file COPYING.LIB. If not, write to 18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef KPROPERTY_STRINGEDIT_H 23 | #define KPROPERTY_STRINGEDIT_H 24 | 25 | #include "KPropertyWidgetsFactory.h" 26 | 27 | #include 28 | 29 | class KPROPERTYWIDGETS_EXPORT KPropertyStringEditor : public QLineEdit 30 | { 31 | Q_OBJECT 32 | Q_PROPERTY(QString value READ value WRITE setValue USER true) 33 | public: 34 | explicit KPropertyStringEditor(QWidget *parent = nullptr); 35 | 36 | ~KPropertyStringEditor() override; 37 | 38 | QString value() const; 39 | 40 | Q_SIGNALS: 41 | void commitData( QWidget * editor ); 42 | 43 | public Q_SLOTS: 44 | void setValue(const QString& value); 45 | 46 | private Q_SLOTS: 47 | void slotTextChanged( const QString & text ); 48 | 49 | private: 50 | Q_DISABLE_COPY(KPropertyStringEditor) 51 | class Private; 52 | Private * const d; 53 | }; 54 | 55 | class KPROPERTYWIDGETS_EXPORT KPropertyStringDelegate : public KPropertyEditorCreatorInterface, 56 | public KPropertyValuePainterInterface, 57 | public KPropertyValueDisplayInterface 58 | { 59 | public: 60 | KPropertyStringDelegate(); 61 | 62 | QWidget *createEditor(int type, QWidget *parent, const QStyleOptionViewItem &option, 63 | const QModelIndex &index) const override; 64 | 65 | void paint(QPainter *painter, 66 | const QStyleOptionViewItem &option, const QModelIndex &index) const override; 67 | 68 | QString valueToString(const QVariant& value, const QLocale &locale) const override; 69 | }; 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /src/editors/KPropertyUrlEditor.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2016-2018 Jarosław Staniek 5 | Copyright (C) 2018 Dmitry Baryshev 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Library General Public 9 | License as published by the Free Software Foundation; either 10 | version 2 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Library General Public License for more details. 16 | 17 | You should have received a copy of the GNU Library General Public License 18 | along with this library; see the file COPYING.LIB. If not, write to 19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifndef KPROPERTYURLEDITOR_H 24 | #define KPROPERTYURLEDITOR_H 25 | 26 | #include "KPropertyComposedUrl.h" 27 | #include "KPropertyWidgetsFactory.h" 28 | #include "KPropertyGenericSelectionEditor.h" 29 | 30 | #include 31 | 32 | class KPropertyUrlEditorPrivate; 33 | 34 | //! Editor for Url type 35 | class KPROPERTYWIDGETS_EXPORT KPropertyUrlEditor : public KPropertyGenericSelectionEditor 36 | { 37 | Q_PROPERTY(QUrl value READ value WRITE setValue USER true) 38 | Q_OBJECT 39 | 40 | public: 41 | explicit KPropertyUrlEditor(const KProperty &property, QWidget *parent = nullptr); 42 | 43 | ~KPropertyUrlEditor() override; 44 | 45 | virtual QUrl value() const; 46 | 47 | Q_SIGNALS: 48 | void commitData(QWidget * editor); 49 | 50 | public Q_SLOTS: 51 | virtual void setValue(const QUrl &value); 52 | 53 | protected Q_SLOTS: 54 | void selectButtonClicked() override; 55 | 56 | protected: 57 | bool eventFilter(QObject *o, QEvent *event) override; 58 | 59 | private: 60 | Q_DISABLE_COPY(KPropertyUrlEditor) 61 | QScopedPointer const d; 62 | }; 63 | 64 | //! Delegate for Url and ComposedUrl types 65 | class KPROPERTYWIDGETS_EXPORT KPropertyUrlDelegate : public KPropertyEditorCreatorInterface, 66 | public KPropertyValueDisplayInterface 67 | { 68 | public: 69 | KPropertyUrlDelegate(); 70 | 71 | QWidget *createEditor(int type, QWidget *parent, const QStyleOptionViewItem &option, 72 | const QModelIndex &index) const override; 73 | 74 | QString valueToString(const QVariant &value, const QLocale &locale) const override; 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /src/editors/KPropertyUrlEditor_p.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2016-2018 Jarosław Staniek 5 | Copyright (C) 2018 Dmitry Baryshev 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Library General Public 9 | License as published by the Free Software Foundation; either 10 | version 2 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Library General Public License for more details. 16 | 17 | You should have received a copy of the GNU Library General Public License 18 | along with this library; see the file COPYING.LIB. If not, write to 19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifndef KPROPERTYURLEDITORPRIVATE_H 24 | #define KPROPERTYURLEDITORPRIVATE_H 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | class KPropertyGenericSelectionEditor; 32 | class KProperty; 33 | 34 | class QEvent; 35 | class QLineEdit; 36 | class QLocale; 37 | 38 | /*! 39 | * A private implementation of KPropertyUrlEditor and KPropertyComposedUrlEditor 40 | * 41 | * @warning This file is not a part of public API and must not be used by clients 42 | */ 43 | class KPropertyUrlEditorPrivate : public QObject 44 | { 45 | Q_OBJECT 46 | 47 | public: 48 | KPropertyUrlEditorPrivate(KPropertyGenericSelectionEditor *editor, const KProperty &property); 49 | 50 | //! Save a new value as a variant. Additionally allow saving regular URLs 51 | //! if the underlying type is KPropertyComposedUrl 52 | void setValue(const QVariant &newValue); 53 | 54 | //! Update the line edit after setting a new value 55 | void updateLineEdit(const QString &textToDisplay); 56 | 57 | //! @return @c true is @a url is valid for the property options 58 | //! @param[in,out] url - the URL to check and update 59 | bool checkAndUpdate(QUrl *url) const; 60 | 61 | //! Get a new URL value either from a custom or the built-in dialog 62 | QUrl getUrl(); 63 | 64 | //! Process an input event from the editor 65 | void processEvent(QObject *o, QEvent *event); 66 | 67 | private: 68 | //! @return @c true if @a event is a key press event for Enter or Return key 69 | bool enterPressed(QEvent *event) const; 70 | 71 | QString fixUp(const QString &path, bool isRelative) const; 72 | 73 | Q_SIGNALS: 74 | void commitData(); 75 | 76 | public: 77 | QVariant value; 78 | bool isComposedUrl; 79 | QString savedText; 80 | QLineEdit *lineEdit; 81 | QByteArray fileMode; 82 | bool confirmOverwrites; 83 | QByteArray propertyName; 84 | 85 | private: 86 | KPropertyGenericSelectionEditor *const m_editor; 87 | }; 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /src/editors/coloredit.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2010-2016 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef KPROPERTY_COLOREDIT_H 21 | #define KPROPERTY_COLOREDIT_H 22 | 23 | #include "KPropertyWidgetsFactory.h" 24 | 25 | //! Color combo box 26 | //! @todo enable transparency selection 27 | //! @todo add transparency option 28 | //! @todo reimplement view using KColorCells 29 | class KPROPERTYWIDGETS_EXPORT KPropertyColorComboEditor : public QWidget 30 | { 31 | Q_OBJECT 32 | Q_PROPERTY(QVariant value READ value WRITE setValue USER true) 33 | 34 | public: 35 | explicit KPropertyColorComboEditor(QWidget *parent = nullptr); 36 | 37 | ~KPropertyColorComboEditor() override; 38 | 39 | QVariant value() const; 40 | 41 | Q_SIGNALS: 42 | void commitData( QWidget * editor ); 43 | 44 | public Q_SLOTS: 45 | void setValue(const QVariant &value); 46 | 47 | protected Q_SLOTS: 48 | void slotValueChanged(const QColor&); 49 | 50 | protected: 51 | bool eventFilter(QObject *o, QEvent *e) override; 52 | 53 | private: 54 | Q_DISABLE_COPY(KPropertyColorComboEditor) 55 | class Private; 56 | Private * const d; 57 | }; 58 | 59 | class KPROPERTYWIDGETS_EXPORT KPropertyColorComboDelegate : public KPropertyEditorCreatorInterface, 60 | public KPropertyValuePainterInterface, 61 | public KPropertyValueDisplayInterface 62 | { 63 | public: 64 | KPropertyColorComboDelegate(); 65 | ~KPropertyColorComboDelegate() override; 66 | 67 | QWidget *createEditor(int type, QWidget *parent, const QStyleOptionViewItem &option, 68 | const QModelIndex &index) const override; 69 | 70 | void paint(QPainter *painter, const QStyleOptionViewItem &option, 71 | const QModelIndex &index) const override; 72 | 73 | QString valueToString(const QVariant& value, const QLocale &locale) const override; 74 | 75 | private: 76 | Q_DISABLE_COPY(KPropertyColorComboDelegate) 77 | class Private; 78 | Private * const d; 79 | }; 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /src/editors/cursoredit.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2008-2015 Jarosław Staniek 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public License 17 | along with this library; see the file COPYING.LIB. If not, write to 18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef KPROPERTY_CURSOREDIT_H 23 | #define KPROPERTY_CURSOREDIT_H 24 | 25 | #include "combobox.h" 26 | 27 | class KPROPERTYWIDGETS_EXPORT KPropertyCursorEditor : public KPropertyComboBoxEditor 28 | { 29 | Q_OBJECT 30 | Q_PROPERTY(QCursor value READ cursorValue WRITE setCursorValue USER true) 31 | 32 | public: 33 | explicit KPropertyCursorEditor(QWidget *parent = nullptr); 34 | ~KPropertyCursorEditor() override; 35 | 36 | virtual QCursor cursorValue() const; 37 | 38 | public Q_SLOTS: 39 | virtual void setCursorValue(const QCursor &value); 40 | 41 | private: 42 | Q_DISABLE_COPY(KPropertyCursorEditor) 43 | class Private; 44 | Private * const d; 45 | }; 46 | 47 | class KPROPERTYWIDGETS_EXPORT KPropertyCursorDelegate : public KPropertyEditorCreatorInterface, 48 | public KPropertyValuePainterInterface, 49 | public KPropertyValueDisplayInterface 50 | { 51 | public: 52 | KPropertyCursorDelegate(); 53 | 54 | QWidget *createEditor(int type, QWidget *parent, const QStyleOptionViewItem &option, 55 | const QModelIndex &index) const override; 56 | 57 | void paint(QPainter *painter, const QStyleOptionViewItem &option, 58 | const QModelIndex &index) const override; 59 | 60 | QString valueToString(const QVariant &value, const QLocale &locale) const override; 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /src/editors/dateedit.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2012 Friedrich W. H. Kossebau 5 | Copyright (C) 2015 Jarosław Staniek 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Library General Public 9 | License as published by the Free Software Foundation; either 10 | version 2 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Library General Public License for more details. 16 | 17 | You should have received a copy of the GNU Library General Public License 18 | along with this library; see the file COPYING.LIB. If not, write to 19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #include "dateedit.h" 24 | 25 | #include "KPropertyUtils.h" 26 | 27 | #include 28 | 29 | class Q_DECL_HIDDEN KPropertyDateEditor::Private 30 | { 31 | public: 32 | Private() 33 | { 34 | } 35 | }; 36 | 37 | KPropertyDateEditor::KPropertyDateEditor(const KProperty* prop, QWidget* parent) 38 | : QDateEdit(parent), d(new Private) 39 | { 40 | setFrame(false); 41 | setCalendarPopup(true); 42 | 43 | if (prop->hasOptions()) { 44 | const QDate minDate = prop->option("min", minimumDate()).toDate(); 45 | const QDate maxDate = prop->option("max", maximumDate()).toDate(); 46 | if (minDate.isValid() && maxDate.isValid() && minDate <= maxDate) { 47 | setDateRange(minDate, maxDate); 48 | } 49 | const QString minValueText(prop->option("minValueText").toString()); 50 | if (!minValueText.isEmpty()) { 51 | setSpecialValueText(minValueText); 52 | } 53 | } 54 | connect(this, SIGNAL(dateChanged(QDate)), this, SLOT(onDateChanged())); 55 | } 56 | 57 | KPropertyDateEditor::~KPropertyDateEditor() 58 | { 59 | delete d; 60 | } 61 | 62 | QVariant KPropertyDateEditor::value() const 63 | { 64 | return QVariant(date()); 65 | } 66 | 67 | void KPropertyDateEditor::setValue(const QVariant& value) 68 | { 69 | blockSignals(true); 70 | setDate(value.toDate()); 71 | blockSignals(false); 72 | } 73 | 74 | void KPropertyDateEditor::paintEvent(QPaintEvent* event) 75 | { 76 | QDateEdit::paintEvent(event); 77 | KPropertyWidgetsFactory::paintTopGridLine(this); 78 | } 79 | 80 | 81 | void KPropertyDateEditor::onDateChanged() 82 | { 83 | emit commitData(this); 84 | } 85 | 86 | 87 | //! @todo Port to KLocale, be inspired by KexiDateTableEdit (with Kexi*Formatter) 88 | KPropertyDateDelegate::KPropertyDateDelegate() 89 | { 90 | } 91 | 92 | QString KPropertyDateDelegate::valueToString(const QVariant& value, const QLocale &locale) const 93 | { 94 | const QString defaultDateFormat = locale.dateFormat(QLocale::ShortFormat); 95 | return value.toDate().toString(defaultDateFormat); 96 | } 97 | 98 | QWidget* KPropertyDateDelegate::createEditor(int type, QWidget* parent, 99 | const QStyleOptionViewItem& option, const QModelIndex& index) const 100 | { 101 | Q_UNUSED(type); 102 | Q_UNUSED(option); 103 | 104 | KProperty *prop = KPropertyUtils::propertyForIndex(index); 105 | if (!prop) { 106 | return nullptr; 107 | } 108 | return new KPropertyDateEditor(prop, parent); 109 | } 110 | -------------------------------------------------------------------------------- /src/editors/dateedit.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2012 Friedrich W. H. Kossebau 5 | Copyright (C) 2015 Jarosław Staniek 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Library General Public 9 | License as published by the Free Software Foundation; either 10 | version 2 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Library General Public License for more details. 16 | 17 | You should have received a copy of the GNU Library General Public License 18 | along with this library; see the file COPYING.LIB. If not, write to 19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifndef KPROPERTY_DATEEDIT_H 24 | #define KPROPERTY_DATEEDIT_H 25 | 26 | #include "KPropertyWidgetsFactory.h" 27 | #include 28 | 29 | class KPROPERTYWIDGETS_EXPORT KPropertyDateEditor : public QDateEdit 30 | { 31 | Q_OBJECT 32 | Q_PROPERTY(QVariant value READ value WRITE setValue USER true) 33 | 34 | public: 35 | KPropertyDateEditor(const KProperty* prop, QWidget* parent); 36 | ~KPropertyDateEditor() override; 37 | 38 | QVariant value() const; 39 | 40 | Q_SIGNALS: 41 | void commitData(QWidget* editor); 42 | 43 | public Q_SLOTS: 44 | void setValue(const QVariant& value); 45 | 46 | protected: 47 | void paintEvent(QPaintEvent *event) override; 48 | 49 | protected Q_SLOTS: 50 | void onDateChanged(); 51 | 52 | private: 53 | Q_DISABLE_COPY(KPropertyDateEditor) 54 | class Private; 55 | Private * const d; 56 | }; 57 | 58 | class KPROPERTYWIDGETS_EXPORT KPropertyDateDelegate : public KPropertyEditorCreatorInterface, 59 | public KPropertyValueDisplayInterface 60 | { 61 | public: 62 | KPropertyDateDelegate(); 63 | 64 | QString valueToString(const QVariant &value, const QLocale &locale) const override; 65 | 66 | QWidget *createEditor(int type, QWidget *parent, const QStyleOptionViewItem &option, 67 | const QModelIndex &index) const override; 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /src/editors/datetimeedit.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2012 Friedrich W. H. Kossebau 5 | Copyright (C) 2015 Jarosław Staniek 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Library General Public 9 | License as published by the Free Software Foundation; either 10 | version 2 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Library General Public License for more details. 16 | 17 | You should have received a copy of the GNU Library General Public License 18 | along with this library; see the file COPYING.LIB. If not, write to 19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifndef KPROPERTY_DATETIMEEDIT_H 24 | #define KPROPERTY_DATETIMEEDIT_H 25 | 26 | #include "KPropertyWidgetsFactory.h" 27 | #include 28 | 29 | class KPROPERTYWIDGETS_EXPORT KPropertyDateTimeEditor : public QDateTimeEdit 30 | { 31 | Q_OBJECT 32 | Q_PROPERTY(QVariant value READ value WRITE setValue USER true) 33 | 34 | public: 35 | KPropertyDateTimeEditor(const KProperty* prop, QWidget* parent); 36 | ~KPropertyDateTimeEditor() override; 37 | 38 | QVariant value() const; 39 | 40 | Q_SIGNALS: 41 | void commitData(QWidget* editor); 42 | 43 | public Q_SLOTS: 44 | void setValue(const QVariant& value); 45 | 46 | protected: 47 | void paintEvent(QPaintEvent *event) override; 48 | 49 | protected Q_SLOTS: 50 | void onDateTimeChanged(); 51 | 52 | private: 53 | Q_DISABLE_COPY(KPropertyDateTimeEditor) 54 | class Private; 55 | Private * const d; 56 | }; 57 | 58 | class KPROPERTYWIDGETS_EXPORT KPropertyDateTimeDelegate : public KPropertyEditorCreatorInterface, 59 | public KPropertyValueDisplayInterface 60 | { 61 | public: 62 | KPropertyDateTimeDelegate(); 63 | 64 | QString valueToString(const QVariant &value, const QLocale &locale) const override; 65 | 66 | QWidget *createEditor(int type, QWidget *parent, const QStyleOptionViewItem &option, 67 | const QModelIndex &index) const override; 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /src/editors/dummywidget.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public License 16 | along with this library; see the file COPYING.LIB. If not, write to 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #include "dummywidget.h" 22 | 23 | #include 24 | 25 | class Q_DECL_HIDDEN KPropertyDummyWidget::Private 26 | { 27 | public: 28 | Private() { 29 | } 30 | QVariant value; 31 | }; 32 | 33 | KPropertyDummyWidget::KPropertyDummyWidget(KProperty *property, QWidget *parent) 34 | : Widget(property, parent), d(new Private) 35 | { 36 | } 37 | 38 | KPropertyDummyWidget::~KPropertyDummyWidget() 39 | { 40 | delete d; 41 | } 42 | 43 | QVariant 44 | KPropertyDummyWidget::value() const 45 | { 46 | return d->value; 47 | } 48 | 49 | void 50 | KPropertyDummyWidget::setValue(const QVariant &value, bool emitChange) 51 | { 52 | d->value = value; 53 | if (emitChange) 54 | emit valueChanged(this); 55 | } 56 | 57 | void 58 | KPropertyDummyWidget::drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &) 59 | { 60 | p->setBrush(cg.window()); 61 | p->setPen(Qt::NoPen); 62 | p->drawRect(r); 63 | } 64 | 65 | void 66 | KPropertyDummyWidget::setReadOnlyInternal(bool readOnly) 67 | { 68 | Q_UNUSED(readOnly); 69 | } 70 | -------------------------------------------------------------------------------- /src/editors/dummywidget.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public License 16 | along with this library; see the file COPYING.LIB. If not, write to 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef KPROPERTY_DUMMYWIDGET_H 22 | #define KPROPERTY_DUMMYWIDGET_H 23 | 24 | #include "KPropertyFactory.h" 25 | 26 | #include 27 | 28 | class KPROPERTYWIDGETS_EXPORT KPropertyDummyWidget: public Widget 29 | { 30 | Q_OBJECT 31 | public: 32 | explicit KPropertyDummyWidget(KProperty *property, QWidget *parent = 0); 33 | virtual ~KPropertyDummyWidget(); 34 | 35 | virtual QVariant value() const; 36 | 37 | virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value); 38 | 39 | public Q_SLOTS: 40 | virtual void setValue(const QVariant &value, bool emitChange = true); 41 | 42 | protected Q_SLOTS: 43 | virtual void setReadOnlyInternal(bool readOnly); 44 | 45 | private: 46 | Q_DISABLE_COPY(KPropertyDummyWidget) 47 | class Private; 48 | Private * const d; 49 | }; 50 | 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /src/editors/fontedit.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2005-2015 Jarosław Staniek 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public License 17 | along with this library; see the file COPYING.LIB. If not, write to 18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef KPROPERTY_FONTEDIT_H 23 | #define KPROPERTY_FONTEDIT_H 24 | 25 | #include "KPropertyWidgetsFactory.h" 26 | 27 | 28 | class KPROPERTYWIDGETS_EXPORT KPropertyFontDelegate : public KPropertyEditorCreatorInterface, 29 | public KPropertyValuePainterInterface, 30 | public KPropertyValueDisplayInterface 31 | { 32 | public: 33 | KPropertyFontDelegate(); 34 | 35 | QWidget *createEditor(int type, QWidget *parent, const QStyleOptionViewItem &option, 36 | const QModelIndex &index) const override; 37 | 38 | void paint(QPainter *painter, const QStyleOptionViewItem &option, 39 | const QModelIndex &index) const override; 40 | 41 | QString valueToString(const QVariant &value, const QLocale &locale) const override; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/editors/fontedit_p.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2005-2009 Jarosław Staniek 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public License 17 | along with this library; see the file COPYING.LIB. If not, write to 18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef KPROPERTY_FONTEDIT_P_H 23 | #define KPROPERTY_FONTEDIT_P_H 24 | 25 | #include 26 | 27 | class QPushButton; 28 | 29 | //! @internal 30 | //! Reimplemented to better button and label's positioning 31 | class KPropertyFontEditRequester : public QWidget 32 | { 33 | Q_OBJECT 34 | Q_PROPERTY(QFont value READ value WRITE setValue USER true) 35 | public: 36 | explicit KPropertyFontEditRequester(QWidget *parent); 37 | 38 | QFont value() const; 39 | 40 | public Q_SLOTS: 41 | void setValue(const QFont &value); 42 | 43 | Q_SIGNALS: 44 | void commitData(QWidget *editor); 45 | 46 | protected Q_SLOTS: 47 | void slotSelectFontClicked(); 48 | 49 | protected: 50 | bool event(QEvent *event) override; 51 | 52 | QPushButton *m_button; 53 | QFont m_font; 54 | bool m_paletteChangedEnabled; 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/editors/linestyleedit.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2010-2015 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef KPROPERTY_LINESTYLEEDIT_H 21 | #define KPROPERTY_LINESTYLEEDIT_H 22 | 23 | #include "KPropertyWidgetsFactory.h" 24 | #include "KPropertyLineStyleSelector_p.h" 25 | 26 | //! Line style combo box (KProperty::LineStyle, equivalent of Qt::PenStyle) 27 | //! @todo enable transparency selection 28 | //! @todo add transparency option 29 | //! @todo reimplement view using KColorCells 30 | class KPROPERTYWIDGETS_EXPORT KPropertyLineStyleComboEditor : public KPropertyLineStyleSelector 31 | { 32 | Q_OBJECT 33 | Q_PROPERTY(QVariant value READ value WRITE setValue USER true) 34 | 35 | public: 36 | explicit KPropertyLineStyleComboEditor(QWidget *parent = nullptr); 37 | 38 | ~KPropertyLineStyleComboEditor() override; 39 | 40 | QVariant value() const; 41 | 42 | Q_SIGNALS: 43 | void commitData(QWidget * editor); 44 | 45 | public Q_SLOTS: 46 | void setValue(const QVariant &value); 47 | 48 | protected Q_SLOTS: 49 | void slotValueChanged(int index); 50 | 51 | private: 52 | Q_DISABLE_COPY(KPropertyLineStyleComboEditor) 53 | class Private; 54 | Private * const d; 55 | }; 56 | 57 | class KPROPERTYWIDGETS_EXPORT KPropertyLineStyleComboDelegate : public KPropertyEditorCreatorInterface, 58 | public KPropertyValuePainterInterface, 59 | public KPropertyValueDisplayInterface 60 | { 61 | public: 62 | KPropertyLineStyleComboDelegate(); 63 | 64 | QWidget *createEditor(int type, QWidget *parent, const QStyleOptionViewItem &option, 65 | const QModelIndex &index) const override; 66 | 67 | void paint(QPainter *painter, const QStyleOptionViewItem &option, 68 | const QModelIndex &index) const override; 69 | 70 | QString valueToString(const QVariant &value, const QLocale &locale) const override; 71 | }; 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /src/editors/pixmapedit.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2005-2015 Jarosław Staniek 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public License 17 | along with this library; see the file COPYING.LIB. If not, write to 18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef KPROPERTY_PIXMAPEDIT_H 23 | #define KPROPERTY_PIXMAPEDIT_H 24 | 25 | #include "KPropertyWidgetsFactory.h" 26 | 27 | #include 28 | #include 29 | 30 | class QLabel; 31 | class QPushButton; 32 | 33 | class KPROPERTYWIDGETS_EXPORT KPropertyPixmapEditor : public QWidget 34 | { 35 | Q_OBJECT 36 | Q_PROPERTY(QVariant value READ value WRITE setValue USER true) 37 | 38 | public: 39 | explicit KPropertyPixmapEditor(KProperty *prop, QWidget *parent = nullptr); 40 | ~KPropertyPixmapEditor() override; 41 | 42 | QVariant value() const; 43 | 44 | public Q_SLOTS: 45 | void setValue(const QVariant &value); 46 | 47 | Q_SIGNALS: 48 | void commitData( QWidget * editor ); 49 | 50 | protected: 51 | bool eventFilter(QObject *o, QEvent *ev) override; 52 | 53 | protected Q_SLOTS: 54 | /*! Helper used by selectPixmap(). Can be also used by subclassess. 55 | Selected path will be stored in "lastVisitedImagePath" config entry within "Recent Dirs" 56 | config group of application's settings. This entry can be later reused when file dialogs 57 | are opened for selecting image files. */ 58 | QString selectPixmapFileName(); 59 | 60 | /*! Selects a new pixmap using "open" file dialog. Can be reimplemented. */ 61 | virtual void selectPixmap(); 62 | 63 | private: 64 | Q_DISABLE_COPY(KPropertyPixmapEditor) 65 | class Private; 66 | Private * const d; 67 | }; 68 | 69 | class KPROPERTYWIDGETS_EXPORT KPropertyPixmapDelegate : public KPropertyEditorCreatorInterface, 70 | public KPropertyValuePainterInterface, 71 | public KPropertyValueDisplayInterface 72 | { 73 | public: 74 | KPropertyPixmapDelegate(); 75 | 76 | QWidget *createEditor(int type, QWidget *parent, const QStyleOptionViewItem &option, 77 | const QModelIndex &index) const override; 78 | 79 | void paint(QPainter *painter, const QStyleOptionViewItem &option, 80 | const QModelIndex &index) const override; 81 | 82 | QString valueToString(const QVariant &value, const QLocale &locale) const override; 83 | }; 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /src/editors/pointedit.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2008-2015 Jarosław Staniek 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public License 17 | along with this library; see the file COPYING.LIB. If not, write to 18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #include "pointedit.h" 23 | 24 | #include 25 | 26 | KPropertyPointDelegate::KPropertyPointDelegate() 27 | { 28 | } 29 | 30 | QString KPropertyPointDelegate::valueToString(const QVariant& value, const QLocale &locale) const 31 | { 32 | const QPoint p(value.toPoint()); 33 | if (locale.language() == QLocale::C) { 34 | return QString::fromLatin1("%1, %2").arg(p.x()).arg(p.y()); 35 | } 36 | return QObject::tr("%1, %2", "Point") 37 | .arg(locale.toString(p.x())) 38 | .arg(locale.toString(p.y())); 39 | } 40 | 41 | //------------ 42 | 43 | KPointComposedProperty::KPointComposedProperty(KProperty *property) 44 | : KComposedPropertyInterface(property) 45 | { 46 | (void)new KProperty("x", 47 | QVariant(), QObject::tr("X", "Property: X coordinate"), 48 | QObject::tr("X Coordinate", "Property: X coordinate"), KProperty::Int, property); 49 | (void)new KProperty("y", 50 | QVariant(), QObject::tr("Y", "Property: Y coordinate"), 51 | QObject::tr("Y Coordinate", "Property: Y coordinate"), KProperty::Int, property); 52 | } 53 | 54 | void KPointComposedProperty::setValue(KProperty *property, 55 | const QVariant &value, KProperty::ValueOptions valueOptions) 56 | { 57 | const QPoint p( value.toPoint() ); 58 | property->child("x")->setValue(p.x(), valueOptions); 59 | property->child("y")->setValue(p.y(), valueOptions); 60 | } 61 | 62 | void KPointComposedProperty::childValueChanged(KProperty *child, 63 | const QVariant &value, KProperty::ValueOptions valueOptions) 64 | { 65 | QPoint p( child->parent()->value().toPoint() ); 66 | 67 | if (child->name() == "x") 68 | p.setX(value.toInt()); 69 | else if (child->name() == "y") 70 | p.setY(value.toInt()); 71 | 72 | child->parent()->setValue(p, valueOptions); 73 | } 74 | -------------------------------------------------------------------------------- /src/editors/pointedit.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2008-2015 Jarosław Staniek 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public License 17 | along with this library; see the file COPYING.LIB. If not, write to 18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef KPROPERTY_POINTEDIT_H 23 | #define KPROPERTY_POINTEDIT_H 24 | 25 | #include "KPropertyWidgetsFactory.h" 26 | 27 | class KPROPERTYWIDGETS_EXPORT KPointComposedProperty : public KComposedPropertyInterface 28 | { 29 | public: 30 | explicit KPointComposedProperty(KProperty *parent); 31 | 32 | void setValue(KProperty *property, 33 | const QVariant &value, KProperty::ValueOptions valueOptions) override; 34 | 35 | void childValueChanged(KProperty *child, 36 | const QVariant &value, KProperty::ValueOptions valueOptions) override; 37 | }; 38 | 39 | class KPROPERTYWIDGETS_EXPORT KPropertyPointDelegate : public KPropertyLabelCreator, 40 | public KComposedPropertyCreator 41 | { 42 | public: 43 | KPropertyPointDelegate(); 44 | 45 | QString valueToString(const QVariant &value, const QLocale &locale) const override; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/editors/pointfedit.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2008-2017 Jarosław Staniek 5 | Copyright (C) 2010 Adam Pigg 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Library General Public 9 | License as published by the Free Software Foundation; either 10 | version 2 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Library General Public License for more details. 16 | 17 | You should have received a copy of the GNU Library General Public License 18 | along with this library; see the file COPYING.LIB. If not, write to 19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #include "pointfedit.h" 24 | #include "KPropertyUtils_p.h" 25 | 26 | #include 27 | 28 | KPropertyPointFDelegate::KPropertyPointFDelegate() 29 | { 30 | } 31 | 32 | QString KPropertyPointFDelegate::propertyValueToString(const KProperty *property, 33 | const QLocale &locale) const 34 | { 35 | const KPropertyUtilsPrivate::ValueOptionsHandler options(*property); 36 | return options.valueWithPrefixAndSuffix(valueToString(property->value(), locale), locale); 37 | } 38 | 39 | QString KPropertyPointFDelegate::valueToString(const QVariant& value, const QLocale &locale) const 40 | { 41 | const QPointF p(value.toPointF()); 42 | if (locale.language() == QLocale::C) { 43 | return QString::fromLatin1("%1, %2").arg(p.x()).arg(p.y()); 44 | } 45 | return QObject::tr("%1, %2", "Point") 46 | .arg(locale.toString(p.x())) 47 | .arg(locale.toString(p.y())); 48 | } 49 | 50 | //------------ 51 | 52 | KPointFComposedProperty::KPointFComposedProperty(KProperty *property) 53 | : KComposedPropertyInterface(property) 54 | { 55 | (void)new KProperty("x", 56 | QVariant(), QObject::tr("X", "Property: X coordinate"), 57 | QObject::tr("X Coordinate", "Property: X coordinate"), KProperty::Double, property); 58 | (void)new KProperty("y", 59 | QVariant(), QObject::tr("Y", "Property: Y coordinate"), 60 | QObject::tr("Y Coordinate", "Property: Y coordinate"), KProperty::Double, property); 61 | } 62 | 63 | void KPointFComposedProperty::setValue(KProperty *property, 64 | const QVariant &value, KProperty::ValueOptions valueOptions) 65 | { 66 | const QPointF p( value.toPointF() ); 67 | property->child("x")->setValue(p.x(), valueOptions); 68 | property->child("y")->setValue(p.y(), valueOptions); 69 | } 70 | 71 | void KPointFComposedProperty::childValueChanged(KProperty *child, 72 | const QVariant &value, KProperty::ValueOptions valueOptions) 73 | { 74 | QPointF p( child->parent()->value().toPointF() ); 75 | 76 | if (child->name() == "x") 77 | p.setX(value.toDouble()); 78 | else if (child->name() == "y") 79 | p.setY(value.toDouble()); 80 | 81 | child->parent()->setValue(p, valueOptions); 82 | } 83 | -------------------------------------------------------------------------------- /src/editors/pointfedit.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2008-2015 Jarosław Staniek 5 | Copyright (C) 2010 Adam Pigg 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Library General Public 9 | License as published by the Free Software Foundation; either 10 | version 2 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Library General Public License for more details. 16 | 17 | You should have received a copy of the GNU Library General Public License 18 | along with this library; see the file COPYING.LIB. If not, write to 19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifndef KPROPERTY_POINTFEDIT_H 24 | #define KPROPERTY_POINTFEDIT_H 25 | 26 | #include "KPropertyWidgetsFactory.h" 27 | 28 | class KPROPERTYWIDGETS_EXPORT KPointFComposedProperty : public KComposedPropertyInterface 29 | { 30 | public: 31 | explicit KPointFComposedProperty(KProperty *parent); 32 | 33 | void setValue(KProperty *property, 34 | const QVariant &value, KProperty::ValueOptions valueOptions) override; 35 | 36 | void childValueChanged(KProperty *child, 37 | const QVariant &value, KProperty::ValueOptions valueOptions) override; 38 | }; 39 | 40 | class KPROPERTYWIDGETS_EXPORT KPropertyPointFDelegate : public KPropertyLabelCreator, 41 | public KComposedPropertyCreator 42 | { 43 | public: 44 | KPropertyPointFDelegate(); 45 | 46 | QString propertyValueToString(const KProperty *property, 47 | const QLocale &locale) const override; 48 | 49 | QString valueToString(const QVariant& value, const QLocale &locale) const override; 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/editors/rectedit.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2008-2015 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include "rectedit.h" 21 | 22 | #include 23 | 24 | KPropertyRectDelegate::KPropertyRectDelegate() 25 | { 26 | } 27 | 28 | QString KPropertyRectDelegate::valueToString(const QVariant& value, const QLocale &locale) const 29 | { 30 | const QRect r(value.toRect()); 31 | if (locale.language() == QLocale::C) { 32 | return QString::fromLatin1("%1, %2, %3x%4").arg(r.x()).arg(r.y()).arg(r.width()).arg(r.height()); 33 | } 34 | return QObject::tr("%1, %2, %3x%4", "Rectangle") 35 | .arg(locale.toString(r.x())) 36 | .arg(locale.toString(r.y())) 37 | .arg(locale.toString(r.width())) 38 | .arg(locale.toString(r.height())); 39 | } 40 | 41 | //------------ 42 | 43 | KRectComposedProperty::KRectComposedProperty(KProperty *property) 44 | : KComposedPropertyInterface(property) 45 | { 46 | (void)new KProperty("x", 47 | QVariant(), QObject::tr("X", "Property: X coordinate"), 48 | QObject::tr("X Coordinate", "Property: X coordinate"), KProperty::Int, property); 49 | (void)new KProperty("y", 50 | QVariant(), QObject::tr("Y", "Property: Y coordinate"), 51 | QObject::tr("Y Coordinate", "Property: Y coordinate"), KProperty::Int, property); 52 | (void)new KProperty("width", 53 | QVariant(), QObject::tr("Width", "Property: width of rectangle"), 54 | QObject::tr("Width", "Property: width of rectangle"), KProperty::UInt, property); 55 | (void)new KProperty("height", 56 | QVariant(), QObject::tr("Height", "Property: height of rectangle"), 57 | QObject::tr("Height", "Property: height of rectangle"), KProperty::UInt, property); 58 | } 59 | 60 | void KRectComposedProperty::setValue(KProperty *property, 61 | const QVariant &value, KProperty::ValueOptions valueOptions) 62 | { 63 | const QRect r( value.toRect() ); 64 | property->child("x")->setValue(r.x(), valueOptions); 65 | property->child("y")->setValue(r.y(), valueOptions); 66 | property->child("width")->setValue(r.width(), valueOptions); 67 | property->child("height")->setValue(r.height(), valueOptions); 68 | } 69 | 70 | void KRectComposedProperty::childValueChanged(KProperty *child, 71 | const QVariant &value, KProperty::ValueOptions valueOptions) 72 | { 73 | QRect r( child->parent()->value().toRect() ); 74 | 75 | if (child->name() == "x") 76 | r.moveLeft(value.toInt()); 77 | else if (child->name() == "y") 78 | r.moveTop(value.toInt()); 79 | else if (child->name() == "width") 80 | r.setWidth(value.toInt()); 81 | else if (child->name() == "height") 82 | r.setHeight(value.toInt()); 83 | 84 | child->parent()->setValue(r, valueOptions); 85 | } 86 | -------------------------------------------------------------------------------- /src/editors/rectedit.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2008-2015 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef KPROPERTY_RECTEDIT_H 21 | #define KPROPERTY_RECTEDIT_H 22 | 23 | #include "KPropertyWidgetsFactory.h" 24 | 25 | class KPROPERTYWIDGETS_EXPORT KRectComposedProperty : public KComposedPropertyInterface 26 | { 27 | public: 28 | explicit KRectComposedProperty(KProperty *parent); 29 | 30 | void setValue(KProperty *property, 31 | const QVariant &value, KProperty::ValueOptions valueOptions) override; 32 | 33 | void childValueChanged(KProperty *child, 34 | const QVariant &value, KProperty::ValueOptions valueOptions) override; 35 | }; 36 | 37 | class KPROPERTYWIDGETS_EXPORT KPropertyRectDelegate : public KPropertyLabelCreator, 38 | public KComposedPropertyCreator 39 | { 40 | public: 41 | KPropertyRectDelegate(); 42 | 43 | QString valueToString(const QVariant &value, const QLocale &locale) const override; 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/editors/sizeedit.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2008-2015 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include "sizeedit.h" 21 | 22 | #include 23 | 24 | KPropertySizeDelegate::KPropertySizeDelegate() 25 | { 26 | } 27 | 28 | QString KPropertySizeDelegate::valueToString(const QVariant& value, const QLocale &locale) const 29 | { 30 | const QSize s(value.toSize()); 31 | if (locale.language() == QLocale::C) { 32 | return QString::fromLatin1("%1x%2").arg(s.width()).arg(s.height()); 33 | } 34 | return QObject::tr("%1x%2", "Size") 35 | .arg(locale.toString(s.width())) 36 | .arg(locale.toString(s.height())); 37 | } 38 | 39 | //------------ 40 | 41 | KSizeComposedProperty::KSizeComposedProperty(KProperty *property) 42 | : KComposedPropertyInterface(property) 43 | { 44 | (void)new KProperty("width", 45 | QVariant(), QObject::tr("Width"), QObject::tr("Width"), KProperty::UInt, property); 46 | (void)new KProperty("height", 47 | QVariant(), QObject::tr("Height"), QObject::tr("Height"), KProperty::UInt, property); 48 | } 49 | 50 | void KSizeComposedProperty::setValue(KProperty *property, 51 | const QVariant &value, KProperty::ValueOptions valueOptions) 52 | { 53 | const QSize s( value.toSize() ); 54 | property->child("width")->setValue(s.width(), valueOptions); 55 | property->child("height")->setValue(s.height(), valueOptions); 56 | } 57 | 58 | void KSizeComposedProperty::childValueChanged(KProperty *child, 59 | const QVariant &value, KProperty::ValueOptions valueOptions) 60 | { 61 | QSize s( child->parent()->value().toSize() ); 62 | if (child->name() == "width") 63 | s.setWidth(value.toInt()); 64 | else if (child->name() == "height") 65 | s.setHeight(value.toInt()); 66 | 67 | child->parent()->setValue(s, valueOptions); 68 | } 69 | -------------------------------------------------------------------------------- /src/editors/sizeedit.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2008-2015 Jarosław Staniek 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public License 17 | along with this library; see the file COPYING.LIB. If not, write to 18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef KPROPERTY_SIZEEDIT_H 23 | #define KPROPERTY_SIZEEDIT_H 24 | 25 | #include "KPropertyWidgetsFactory.h" 26 | 27 | class KPROPERTYWIDGETS_EXPORT KSizeComposedProperty : public KComposedPropertyInterface 28 | { 29 | public: 30 | explicit KSizeComposedProperty(KProperty *parent); 31 | 32 | void setValue(KProperty *property, 33 | const QVariant &value, KProperty::ValueOptions valueOptions) override; 34 | 35 | void childValueChanged(KProperty *child, 36 | const QVariant &value, KProperty::ValueOptions valueOptions) override; 37 | }; 38 | 39 | class KPROPERTYWIDGETS_EXPORT KPropertySizeDelegate : public KPropertyLabelCreator, 40 | public KComposedPropertyCreator 41 | { 42 | public: 43 | KPropertySizeDelegate(); 44 | 45 | QString valueToString(const QVariant &value, const QLocale &locale) const override; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/editors/sizefedit.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2008-2017 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include "sizefedit.h" 21 | #include "KPropertyUtils_p.h" 22 | 23 | #include 24 | 25 | KPropertySizeFDelegate::KPropertySizeFDelegate() 26 | { 27 | } 28 | 29 | QString KPropertySizeFDelegate::propertyValueToString(const KProperty *property, 30 | const QLocale &locale) const 31 | { 32 | const KPropertyUtilsPrivate::ValueOptionsHandler options(*property); 33 | return options.valueWithPrefixAndSuffix(valueToString(property->value(), locale), locale); 34 | } 35 | 36 | QString KPropertySizeFDelegate::valueToString(const QVariant& value, const QLocale &locale) const 37 | { 38 | const QSizeF s(value.toSizeF()); 39 | if (locale.language() == QLocale::C) { 40 | return QString::fromLatin1("%1x%2").arg(s.width()).arg(s.height()); 41 | } 42 | return QObject::tr("%1x%2", "Size") 43 | .arg(locale.toString(s.width())) 44 | .arg(locale.toString(s.height())); 45 | } 46 | 47 | //------------ 48 | 49 | KSizeFComposedProperty::KSizeFComposedProperty(KProperty *property) 50 | : KComposedPropertyInterface(property) 51 | { 52 | (void)new KProperty("width", 53 | QVariant(), QObject::tr("Width"), QObject::tr("Width"), KProperty::Double, property); 54 | (void)new KProperty("height", 55 | QVariant(), QObject::tr("Height"), QObject::tr("Height"), KProperty::Double, property); 56 | } 57 | 58 | void KSizeFComposedProperty::setValue(KProperty *property, 59 | const QVariant &value, KProperty::ValueOptions valueOptions) 60 | { 61 | const QSizeF s( value.toSizeF() ); 62 | property->child("width")->setValue(s.width(), valueOptions); 63 | property->child("height")->setValue(s.height(), valueOptions); 64 | } 65 | 66 | void KSizeFComposedProperty::childValueChanged(KProperty *child, 67 | const QVariant &value, KProperty::ValueOptions valueOptions) 68 | { 69 | QSizeF s( child->parent()->value().toSizeF() ); 70 | if (child->name() == "width") 71 | s.setWidth(value.toDouble()); 72 | else if (child->name() == "height") 73 | s.setHeight(value.toDouble()); 74 | 75 | child->parent()->setValue(s, valueOptions); 76 | } 77 | -------------------------------------------------------------------------------- /src/editors/sizefedit.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2008-2017 Jarosław Staniek 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public License 17 | along with this library; see the file COPYING.LIB. If not, write to 18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef KPROPERTY_SIZEFEDIT_H 23 | #define KPROPERTY_SIZEFEDIT_H 24 | 25 | #include "KPropertyWidgetsFactory.h" 26 | 27 | class KPROPERTYWIDGETS_EXPORT KSizeFComposedProperty : public KComposedPropertyInterface 28 | { 29 | public: 30 | explicit KSizeFComposedProperty(KProperty *parent); 31 | 32 | void setValue(KProperty *property, 33 | const QVariant &value, KProperty::ValueOptions valueOptions) override; 34 | 35 | void childValueChanged(KProperty *child, 36 | const QVariant &value, KProperty::ValueOptions valueOptions) override; 37 | }; 38 | 39 | class KPROPERTYWIDGETS_EXPORT KPropertySizeFDelegate : public KPropertyLabelCreator, 40 | public KComposedPropertyCreator 41 | { 42 | public: 43 | KPropertySizeFDelegate(); 44 | 45 | QString propertyValueToString(const KProperty *property, 46 | const QLocale &locale) const override; 47 | 48 | QString valueToString(const QVariant& value, const QLocale &locale) const override; 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/editors/sizepolicyedit.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2008-2015 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef KPROPERTY_SIZEPOLICYEDIT_H 21 | #define KPROPERTY_SIZEPOLICYEDIT_H 22 | 23 | #include "KPropertyWidgetsFactory.h" 24 | 25 | class KPROPERTYWIDGETS_EXPORT KSizePolicyComposedProperty : public KComposedPropertyInterface 26 | { 27 | public: 28 | explicit KSizePolicyComposedProperty(KProperty *parent); 29 | 30 | void setValue(KProperty *property, 31 | const QVariant &value, KProperty::ValueOptions valueOptions) override; 32 | 33 | void childValueChanged(KProperty *child, 34 | const QVariant &value, KProperty::ValueOptions valueOptions) override; 35 | 36 | bool valuesEqual(const QVariant &first, const QVariant &second) override; 37 | }; 38 | 39 | class KPROPERTYWIDGETS_EXPORT KPropertySizePolicyDelegate : public KPropertyLabelCreator, 40 | public KComposedPropertyCreator 41 | { 42 | public: 43 | KPropertySizePolicyDelegate(); 44 | 45 | QString valueToString(const QVariant &value, const QLocale &locale) const override; 46 | 47 | static const KPropertyListData &listData(); 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/editors/stringlistedit.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public License 16 | along with this library; see the file COPYING.LIB. If not, write to 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef KPROPERTY_STRINGLISTEDIT_H 22 | #define KPROPERTY_STRINGLISTEDIT_H 23 | 24 | #include "KPropertyFactory.h" 25 | 26 | #include 27 | 28 | class QLineEdit; 29 | class QPushButton; 30 | 31 | class KPROPERTYWIDGETS_EXPORT KPropertyStringListEditor : public Widget 32 | { 33 | Q_OBJECT 34 | public: 35 | explicit KPropertyStringListEditor(KProperty *property, QWidget *parent = 0); 36 | virtual ~KPropertyStringListEditor(); 37 | 38 | virtual QVariant value() const; 39 | 40 | virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value); 41 | 42 | public Q_SLOTS: 43 | virtual void setValue(const QVariant &value, bool emitChange = true); 44 | 45 | protected Q_SLOTS: 46 | virtual void setReadOnlyInternal(bool readOnly); 47 | 48 | protected Q_SLOTS: 49 | void showEditor(); 50 | 51 | private: 52 | Q_DISABLE_COPY(KPropertyStringListEditor) 53 | class Private; 54 | Private * const d; 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/editors/symbolcombo.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public License 16 | along with this library; see the file COPYING.LIB. If not, write to 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef KPROPERTY_SYMBOLCOMBO_H 22 | #define KPROPERTY_SYMBOLCOMBO_H 23 | 24 | #include "KPropertyFactory.h" 25 | 26 | class QLineEdit; 27 | class QPushButton; 28 | 29 | class KPROPERTYWIDGETS_EXPORT KPropertySymbolComboEditor : public Widget 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | explicit KPropertySymbolComboEditor(KProperty *property, QWidget *parent = 0); 35 | virtual ~KPropertySymbolComboEditor(); 36 | 37 | virtual QVariant value() const; 38 | 39 | virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value); 40 | 41 | public Q_SLOTS: 42 | virtual void setValue(const QVariant &value, bool emitChange = true); 43 | 44 | protected Q_SLOTS: 45 | virtual void setReadOnlyInternal(bool readOnly); 46 | 47 | protected Q_SLOTS: 48 | void selectChar(); 49 | void slotValueChanged(const QString &text); 50 | 51 | private: 52 | Q_DISABLE_COPY(KPropertySymbolComboEditor) 53 | class Private; 54 | Private * const d; 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/editors/timeedit.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2004 Cedric Pasteur 3 | Copyright (C) 2004 Alexander Dymo 4 | Copyright (C) 2012 Friedrich W. H. Kossebau 5 | Copyright (C) 2015 Jarosław Staniek 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Library General Public 9 | License as published by the Free Software Foundation; either 10 | version 2 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Library General Public License for more details. 16 | 17 | You should have received a copy of the GNU Library General Public License 18 | along with this library; see the file COPYING.LIB. If not, write to 19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | 23 | #ifndef KPROPERTY_TIMEEDIT_H 24 | #define KPROPERTY_TIMEEDIT_H 25 | 26 | #include "KPropertyWidgetsFactory.h" 27 | #include 28 | 29 | class KPROPERTYWIDGETS_EXPORT KPropertyTimeEditor : public QTimeEdit 30 | { 31 | Q_OBJECT 32 | Q_PROPERTY(QVariant value READ value WRITE setValue USER true) 33 | 34 | public: 35 | KPropertyTimeEditor(const KProperty* prop, QWidget* parent); 36 | ~KPropertyTimeEditor() override; 37 | 38 | QVariant value() const; 39 | 40 | Q_SIGNALS: 41 | void commitData(QWidget* editor); 42 | 43 | public Q_SLOTS: 44 | void setValue(const QVariant& value); 45 | 46 | protected: 47 | void paintEvent(QPaintEvent *event) override; 48 | 49 | protected Q_SLOTS: 50 | void onTimeChanged(); 51 | 52 | private: 53 | Q_DISABLE_COPY(KPropertyTimeEditor) 54 | class Private; 55 | Private * const d; 56 | }; 57 | 58 | class KPROPERTYWIDGETS_EXPORT KPropertyTimeDelegate : public KPropertyEditorCreatorInterface, 59 | public KPropertyValueDisplayInterface 60 | { 61 | public: 62 | KPropertyTimeDelegate(); 63 | 64 | QString valueToString(const QVariant &value, const QLocale &locale) const override; 65 | 66 | QWidget *createEditor(int type, QWidget *parent, const QStyleOptionViewItem &option, 67 | const QModelIndex &index) const override; 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /src/editors/utils.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2008 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include "utils.h" 21 | 22 | #include 23 | #include 24 | 25 | KPROPERTYWIDGETS_EXPORT void KPropertyUtils::setupDotDotDotButton(QPushButton *button, const QString& toolTip, const QString& whatsThis) 26 | { 27 | button->setText(QObject::tr("...", "Three dots for 'Insert image from file' button")); 28 | if (!toolTip.isEmpty()) 29 | button->setToolTip(toolTip); 30 | if (!whatsThis.isEmpty()) 31 | button->setWhatsThis(whatsThis); 32 | button->setFocusPolicy(Qt::NoFocus); 33 | button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); 34 | const QFontMetrics fm(button->font()); 35 | button->setFixedWidth(fm.width(button->text() + QLatin1String(" "))); 36 | } 37 | -------------------------------------------------------------------------------- /src/editors/utils.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2008 Jarosław Staniek 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef KPROPERTY_EDITORS_UTILS_H 21 | #define KPROPERTY_EDITORS_UTILS_H 22 | 23 | #include "kpropertywidgets_export.h" 24 | 25 | #include 26 | 27 | class QPushButton; 28 | 29 | namespace KPropertyUtils 30 | { 31 | 32 | //! Sets up a "..." button with fine-tuned settings. 33 | KPROPERTYWIDGETS_EXPORT void setupDotDotDotButton(QPushButton *button, 34 | const QString& toolTip = QString(), const QString& whatsThis = QString()); 35 | 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/editors/xpm/arrow_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const arrow_cursor_xpm[] = { 3 | "32 32 3 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #FFFFFF", 7 | " . ", 8 | " .. ", 9 | " ... ", 10 | " .+.. ", 11 | " .++.. ", 12 | " .+++.. ", 13 | " .++++.. ", 14 | " .+++++.. ", 15 | " .++++++.. ", 16 | " .+++++++.. ", 17 | " .++++++++.. ", 18 | " .+++++++++.. ", 19 | " .++++++++++.. ", 20 | " .+++++++++++.. ", 21 | " .++++++++++++.. ", 22 | " .+++++++++++++.. ", 23 | " .++++++++++++++.. ", 24 | " .+++++.++......... ", 25 | " .++++...++. ", 26 | " .+++.. .++. ", 27 | " .++.. ..++. ", 28 | " .+.. .++. ", 29 | " ... ..++. ", 30 | " .. .++. ", 31 | " . ..++. ", 32 | " .++. ", 33 | " ..++. ", 34 | " .++. ", 35 | " ..++. ", 36 | " .++. ", 37 | " .++. ", 38 | " ... "}; 39 | -------------------------------------------------------------------------------- /src/editors/xpm/bdiag_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const bdiag_cursor_xpm[] = { 3 | "32 32 3 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #FFFFFF", 7 | " ", 8 | " ", 9 | " ", 10 | " ", 11 | " ", 12 | " ", 13 | " ......... ", 14 | " ........ ", 15 | " ....... ", 16 | " ...... ", 17 | " ...... ", 18 | " ....... ", 19 | " .... ... ", 20 | " .... .. ", 21 | " .... . ", 22 | " .... ", 23 | " .... ", 24 | " .... ", 25 | " . .... ", 26 | " .. .... ", 27 | " ... .... ", 28 | " ....... ", 29 | " ...... ", 30 | " ...... ", 31 | " ........ ", 32 | " ......... ", 33 | " ......... ", 34 | " ", 35 | " ", 36 | " ", 37 | " ", 38 | " "}; 39 | -------------------------------------------------------------------------------- /src/editors/xpm/blank_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const blank_cursor_xpm[] = { 3 | "32 32 1 1", 4 | " c None", 5 | " ", 6 | " ", 7 | " ", 8 | " ", 9 | " ", 10 | " ", 11 | " ", 12 | " ", 13 | " ", 14 | " ", 15 | " ", 16 | " ", 17 | " ", 18 | " ", 19 | " ", 20 | " ", 21 | " ", 22 | " ", 23 | " ", 24 | " ", 25 | " ", 26 | " ", 27 | " ", 28 | " ", 29 | " ", 30 | " ", 31 | " ", 32 | " ", 33 | " ", 34 | " ", 35 | " ", 36 | " "}; 37 | -------------------------------------------------------------------------------- /src/editors/xpm/busy_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const busy_cursor_xpm[] = { 3 | "32 32 3 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #FFFFFF", 7 | " ", 8 | " ", 9 | " ", 10 | " ", 11 | " . ", 12 | " .. ", 13 | " .+. ", 14 | " .++. ", 15 | " .+++. ", 16 | " .++++. ", 17 | " .+++++. ........... ", 18 | " .++++++. .+++++++++. ", 19 | " .+++++++. ........... ", 20 | " .++++++++. .+++++++. ", 21 | " .+++++..... .+++++++. ", 22 | " .++.++. .+.+.+.+. ", 23 | " .+. .++. .+.+.+. ", 24 | " .. .++. .+.+. ", 25 | " . .++. .+. ", 26 | " .++. .+++. ", 27 | " .++. .+++++. ", 28 | " .++. .+++.+++. ", 29 | " .. .++.+.++. ", 30 | " .+.+.+.+. ", 31 | " ........... ", 32 | " .+++++++++. ", 33 | " ........... ", 34 | " ", 35 | " ", 36 | " ", 37 | " ", 38 | " "}; 39 | -------------------------------------------------------------------------------- /src/editors/xpm/closedhand_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const closedhand_cursor_xpm[] = { 3 | "32 32 3 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #FFFFFF", 7 | " ", 8 | " ", 9 | " ", 10 | " ", 11 | " ", 12 | " ", 13 | " .. .. .. ", 14 | " .... .... .... ", 15 | " ..++....++....++.. .. ", 16 | " ..++++..++++..++++..... ", 17 | " ..++++++++++++++++..+... ", 18 | " ..+++++++++++++++.+++.. ", 19 | " ..++++++++++++++++++.. ", 20 | " ..++++++++++++++++++.. ", 21 | " ...++++++++++++++++++.. ", 22 | " ....+++++++++++++++++++.. ", 23 | " ...+++++++++++++++++++++.. ", 24 | " ..++++++++++++++++++++++.. ", 25 | " ..+++++++++++++++++++++.. ", 26 | " ..++++++++++++++++++++.. ", 27 | " ..++++++++++++++++++.. ", 28 | " ..+++++++++++++++++.. ", 29 | " ..+++++++++++++++.. ", 30 | " ..+++++++++++++++.. ", 31 | " ..+++++++++++++.. ", 32 | " ..++++++++++++.. ", 33 | " ..++++++++++++.. ", 34 | " ..++++++++++++.. ", 35 | " ", 36 | " ", 37 | " ", 38 | " "}; 39 | -------------------------------------------------------------------------------- /src/editors/xpm/cross_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const cross_cursor_xpm[] = { 3 | "32 32 2 1", 4 | " c None", 5 | ". c #0B0B0B", 6 | " ", 7 | " ", 8 | " ", 9 | " ", 10 | " .. ", 11 | " .. ", 12 | " .. ", 13 | " .. ", 14 | " .. ", 15 | " .. ", 16 | " .. ", 17 | " .. ", 18 | " .. ", 19 | " .. ", 20 | " .......... .......... ", 21 | " .......... .......... ", 22 | " .. ", 23 | " .. ", 24 | " .. ", 25 | " .. ", 26 | " .. ", 27 | " .. ", 28 | " .. ", 29 | " .. ", 30 | " .. ", 31 | " .. ", 32 | " ", 33 | " ", 34 | " ", 35 | " ", 36 | " ", 37 | " "}; 38 | -------------------------------------------------------------------------------- /src/editors/xpm/fdiag_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const fdiag_cursor_xpm[] = { 3 | "32 32 2 1", 4 | " c None", 5 | ". c #000000", 6 | " ", 7 | " ", 8 | " ", 9 | " ", 10 | " ", 11 | " ", 12 | " ......... ", 13 | " ........ ", 14 | " ....... ", 15 | " ...... ", 16 | " ...... ", 17 | " ....... ", 18 | " ... .... ", 19 | " .. .... ", 20 | " . .... ", 21 | " .... ", 22 | " .... ", 23 | " .... ", 24 | " .... . ", 25 | " .... .. ", 26 | " .... ... ", 27 | " ....... ", 28 | " ...... ", 29 | " ...... ", 30 | " ........ ", 31 | " ......... ", 32 | " ......... ", 33 | " ", 34 | " ", 35 | " ", 36 | " ", 37 | " "}; 38 | -------------------------------------------------------------------------------- /src/editors/xpm/forbidden_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const forbidden_cursor_xpm[] = { 3 | "32 32 2 1", 4 | " c None", 5 | ". c #000000", 6 | " ", 7 | " ", 8 | " .......... ", 9 | " .............. ", 10 | " .................. ", 11 | " ...... ...... ", 12 | " ..... ..... ", 13 | " ...... ..... ", 14 | " ....... .... ", 15 | " .... .... .... ", 16 | " ... .... ... ", 17 | " .... .... .... ", 18 | " ... .... ... ", 19 | " ... .... ... ", 20 | " ... .... ... ", 21 | " ... .... ... ", 22 | " ... .... ... ", 23 | " ... .... ... ", 24 | " ... .... ... ", 25 | " ... .... ... ", 26 | " .... .... ... ", 27 | " ... .... ... ", 28 | " .... .... ... ", 29 | " .... ...... ", 30 | " ..... ..... ", 31 | " ..... .... ", 32 | " ...... ...... ", 33 | " .................. ", 34 | " .............. ", 35 | " .......... ", 36 | " ", 37 | " "}; 38 | -------------------------------------------------------------------------------- /src/editors/xpm/hand_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const hand_cursor_xpm[] = { 3 | "32 32 3 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #FFFFFF", 7 | " ", 8 | " ", 9 | " .. ", 10 | " .++. ", 11 | " .++. ", 12 | " .++. ", 13 | " .++. ", 14 | " .++. ", 15 | " .++. ", 16 | " .++. ", 17 | " .++.... ", 18 | " .++..++.... ", 19 | " .++.+++..++ ", 20 | " .++.+++.+++.. ", 21 | " ... .++.+++.+++.+.. ", 22 | " .+++. .++.+++.+++.++. ", 23 | " .++++..+++++++++++++. ", 24 | " .+++++.+++++++++++++. ", 25 | " .++++++++++++++++++. ", 26 | " .+++++++++++++++++. ", 27 | " .++++++++++++++++. ", 28 | " .+++++++++++++++. ", 29 | " .+++++++++++++. ", 30 | " .+++++++++++++. ", 31 | " .+++++++++++. ", 32 | " .+++++++++++. ", 33 | " ..++++++++++. ", 34 | " ..++++++++++. ", 35 | " ............. ", 36 | " ............. ", 37 | " ", 38 | " "}; 39 | -------------------------------------------------------------------------------- /src/editors/xpm/ibeam_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const ibeam_cursor_xpm[] = { 3 | "32 32 3 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #FFFFFF", 7 | " ", 8 | " ", 9 | " ", 10 | " ... ... ", 11 | " ... ... ", 12 | " ....... ", 13 | " ... ", 14 | " ... ", 15 | " ... ", 16 | " ... ", 17 | " ... ", 18 | " ... ", 19 | " ... ", 20 | " ... ", 21 | " ... ", 22 | " ... ", 23 | " ... ", 24 | " ... ", 25 | " ... ", 26 | " ... ", 27 | " ... ", 28 | " ... ", 29 | " ... ", 30 | " ... ", 31 | " ... ", 32 | " ....... ", 33 | " ... ... ", 34 | " ... ... ", 35 | " ", 36 | " ", 37 | " ", 38 | " "}; 39 | -------------------------------------------------------------------------------- /src/editors/xpm/openhand_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const openhand_cursor_xpm[] = { 3 | "32 32 3 1", 4 | " g None", 5 | ". g #000000", 6 | "+ g #FFFFFF", 7 | " .... ", 8 | " ...... ", 9 | " ... ...++.. .... ", 10 | " ..... ..++++....... ", 11 | " ..+++....++++..++++.. ", 12 | " ..++++....++++..++++.. ", 13 | " ..+++++...++++..++++.. .. ", 14 | " ..++++...++++..++++.. .... ", 15 | " ..+++++..++++..++++....++..", 16 | " ..++++..++++..++++...+++..", 17 | " ..++++..++++.+++++..++++..", 18 | " ..++++.++++.+++++..++++..", 19 | " .... ..+++++++++++++++..++++..", 20 | " ..... .+++++++++++++++.+++++..", 21 | "...++.....+++++++++++++++++++...", 22 | "..++++....+++++++++++++++++++...", 23 | "..++++++..+++++++++++++++++++.. ", 24 | "...+++++..++++++++++++++++++... ", 25 | " ..++++++++++++++++++++++++.. ", 26 | " ..++++++++++++++++++++++++.. ", 27 | " ..++++++++++++++++++++++... ", 28 | " ..+++++++++++++++++++++.. ", 29 | " ..++++++++++++++++++++... ", 30 | " ..+++++++++++++++++++.. ", 31 | " ..++++++++++++++++++.. ", 32 | " ..++++++++++++++++.. ", 33 | " ..++++++++++++++... ", 34 | " ..+++++++++++++.. ", 35 | " ..++++++++++++.. ", 36 | " ..++++++++++++.. ", 37 | " ", 38 | " "}; 39 | -------------------------------------------------------------------------------- /src/editors/xpm/sizeall_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const sizeall_cursor_xpm[] = { 3 | "32 32 3 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #FFFFFF", 7 | " ", 8 | " ", 9 | " ", 10 | " ", 11 | " . ", 12 | " ... ", 13 | " ..... ", 14 | " ....... ", 15 | " ......... ", 16 | " ... ", 17 | " ... ", 18 | " . ... . ", 19 | " .. ... .. ", 20 | " ... ... ... ", 21 | " ..................... ", 22 | " ....................... ", 23 | " ..................... ", 24 | " ... ... ... ", 25 | " .. ... .. ", 26 | " . ... . ", 27 | " ... ", 28 | " ... ", 29 | " ......... ", 30 | " ....... ", 31 | " ..... ", 32 | " ... ", 33 | " . ", 34 | " ", 35 | " ", 36 | " ", 37 | " ", 38 | " "}; 39 | -------------------------------------------------------------------------------- /src/editors/xpm/sizehor_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const sizehor_cursor_xpm[] = { 3 | "32 32 3 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #FFFFFF", 7 | " ", 8 | " ", 9 | " ", 10 | " ", 11 | " ", 12 | " ", 13 | " ", 14 | " ", 15 | " ", 16 | " ", 17 | " ", 18 | " . . ", 19 | " .. .. ", 20 | " ... ... ", 21 | " ..................... ", 22 | " ....................... ", 23 | " ..................... ", 24 | " ... ... ", 25 | " .. .. ", 26 | " . . ", 27 | " ", 28 | " ", 29 | " ", 30 | " ", 31 | " ", 32 | " ", 33 | " ", 34 | " ", 35 | " ", 36 | " ", 37 | " ", 38 | " "}; 39 | -------------------------------------------------------------------------------- /src/editors/xpm/sizever_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const sizever_cursor_xpm[] = { 3 | "32 32 2 1", 4 | " c None", 5 | ". c #000000", 6 | " ", 7 | " ", 8 | " ", 9 | " ", 10 | " .. ", 11 | " .... ", 12 | " ...... ", 13 | " ........ ", 14 | " .......... ", 15 | " .... ", 16 | " .... ", 17 | " .... ", 18 | " .... ", 19 | " .... ", 20 | " .... ", 21 | " .... ", 22 | " .... ", 23 | " .... ", 24 | " .... ", 25 | " .... ", 26 | " .... ", 27 | " .... ", 28 | " .......... ", 29 | " ........ ", 30 | " ...... ", 31 | " .... ", 32 | " .. ", 33 | " ", 34 | " ", 35 | " ", 36 | " ", 37 | " "}; 38 | -------------------------------------------------------------------------------- /src/editors/xpm/splith_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const splith_cursor_xpm[] = { 3 | "32 32 2 1", 4 | " c None", 5 | ". c #000000", 6 | " ", 7 | " ", 8 | " ", 9 | " .. .. ", 10 | " .. .. ", 11 | " .. .. ", 12 | " .. .. ", 13 | " .. .. ", 14 | " .. .. ", 15 | " .. .. ", 16 | " .. .. ", 17 | " . .. .. . ", 18 | " .. .. .. .. ", 19 | " ... .. .. ... ", 20 | " .... .. .. .... ", 21 | " ........... ........... ", 22 | " ........... ........... ", 23 | " .... .. .. .... ", 24 | " ... .. .. ... ", 25 | " .. .. .. .. ", 26 | " . .. .. . ", 27 | " .. .. ", 28 | " .. .. ", 29 | " .. .. ", 30 | " .. .. ", 31 | " .. .. ", 32 | " .. .. ", 33 | " .. .. ", 34 | " .. .. ", 35 | " ", 36 | " ", 37 | " "}; 38 | -------------------------------------------------------------------------------- /src/editors/xpm/splitv_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const splitv_cursor_xpm[] = { 3 | "32 32 2 1", 4 | " c None", 5 | ". c #000000", 6 | " ", 7 | " ", 8 | " ", 9 | " ", 10 | " ", 11 | " ", 12 | " .. ", 13 | " .... ", 14 | " ...... ", 15 | " ........ ", 16 | " .......... ", 17 | " .. ", 18 | " .. ", 19 | " .. ", 20 | " .. ", 21 | " .......................... ", 22 | " .......................... ", 23 | " ", 24 | " ", 25 | " .......................... ", 26 | " .......................... ", 27 | " .. ", 28 | " .. ", 29 | " .. ", 30 | " .. ", 31 | " .......... ", 32 | " ........ ", 33 | " ...... ", 34 | " .... ", 35 | " .. ", 36 | " ", 37 | " "}; 38 | -------------------------------------------------------------------------------- /src/editors/xpm/uparrow_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const uparrow_cursor_xpm[] = { 3 | "32 32 2 1", 4 | " c None", 5 | ". c #000000", 6 | " ", 7 | " ", 8 | " ", 9 | " . ", 10 | " ... ", 11 | " ..... ", 12 | " ....... ", 13 | " ......... ", 14 | " ........... ", 15 | " ... ", 16 | " ... ", 17 | " ... ", 18 | " ... ", 19 | " ... ", 20 | " ... ", 21 | " ... ", 22 | " ... ", 23 | " ... ", 24 | " ... ", 25 | " ... ", 26 | " ... ", 27 | " ... ", 28 | " ... ", 29 | " ... ", 30 | " ... ", 31 | " ... ", 32 | " ... ", 33 | " ... ", 34 | " ", 35 | " ", 36 | " ", 37 | " "}; 38 | -------------------------------------------------------------------------------- /src/editors/xpm/wait_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const wait_cursor_xpm[] = { 3 | "32 32 3 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #FFFFFF", 7 | " ", 8 | " ", 9 | " ", 10 | " ................ ", 11 | " ..++++++++++++.. ", 12 | " ................ ", 13 | " .++++++++++++. ", 14 | " .++++++++++++. ", 15 | " .++.+.++.+.++. ", 16 | " .+++.+..+.+++. ", 17 | " .++++.++.++++. ", 18 | " ..++++..++++.. ", 19 | " ..++++++++.. ", 20 | " ..++++++.. ", 21 | " ..+..+.. ", 22 | " ..++.. ", 23 | " ..++.. ", 24 | " ..++++.. ", 25 | " ..++..++.. ", 26 | " ..++++++++.. ", 27 | " ..++++..++++.. ", 28 | " .++++++++++++. ", 29 | " .++++.++.++++. ", 30 | " .+++.+..+.+++. ", 31 | " .++.+.++.+.++. ", 32 | " .+.+.+..+.+.+. ", 33 | " ................ ", 34 | " ..++++++++++++.. ", 35 | " ................ ", 36 | " ", 37 | " ", 38 | " "}; 39 | -------------------------------------------------------------------------------- /src/editors/xpm/whatsthis_cursor.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * const whatsthis_cursor_xpm[] = { 3 | "32 32 3 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #FFFFFF", 7 | " ", 8 | " ", 9 | " ", 10 | " ", 11 | " ", 12 | " . ", 13 | " .. ..... ", 14 | " .+. ....... ", 15 | " .++. ......... ", 16 | " .+++. .... ... ", 17 | " .++++. ... ... ", 18 | " .+++++. ... ... ", 19 | " .++++++. ... ... ", 20 | " .+++++++. ... ", 21 | " .++++++++. ... ", 22 | " .+++++..... ... ", 23 | " .++.++. ... ", 24 | " .+. .++. ... ", 25 | " .. .++. ... ", 26 | " . .++. ", 27 | " .++. ", 28 | " .++. ... ", 29 | " .++. ... ", 30 | " .. ", 31 | " ", 32 | " ", 33 | " ", 34 | " ", 35 | " ", 36 | " ", 37 | " ", 38 | " "}; 39 | -------------------------------------------------------------------------------- /src/kproperty_debug.cpp: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2015 Laurent Montel 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include "kproperty_debug.h" 21 | Q_LOGGING_CATEGORY(KPROPERTY_LOG, "org.kde.kproperty") 22 | 23 | -------------------------------------------------------------------------------- /src/kproperty_debug.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the KDE project 2 | Copyright (C) 2015 Laurent Montel 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef KPROPERTY_DEBUG_H 21 | #define KPROPERTY_DEBUG_H 22 | 23 | #include 24 | Q_DECLARE_LOGGING_CATEGORY(KPROPERTY_LOG) 25 | 26 | #define kprDebug(...) qCDebug(KPROPERTY_LOG, __VA_ARGS__) 27 | #define kprWarning(...) qCWarning(KPROPERTY_LOG, __VA_ARGS__) 28 | #define kprCritical(...) qCCritical(KPROPERTY_LOG, __VA_ARGS__) 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/pics/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | kproperty_add_icons_rcc_file(kproperty_breeze KPropertyWidgets breeze "") 2 | -------------------------------------------------------------------------------- /src/pics/icons/breeze/actions/16/kproperty-value-false.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 51 | 54 | 58 | 62 | 66 | 70 | 71 | 73 | 74 | 76 | image/svg+xml 77 | 79 | 80 | 81 | 82 | 83 | 88 | 92 | 96 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /src/pics/icons/breeze/actions/22/kproperty-value-false.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 44 | 47 | 51 | 55 | 59 | 63 | 67 | 71 | 75 | 79 | 80 | 82 | 83 | 85 | image/svg+xml 86 | 88 | 89 | 90 | 91 | 92 | 97 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /src/pics/icons/breeze/files.cmake: -------------------------------------------------------------------------------- 1 | # List of project's own icon files 2 | # This file is generated by update_icon_list.sh 3 | # WARNING! All changes made in this file will be lost! 4 | 5 | set(_PNG_FILES 6 | ) 7 | 8 | set(_SVG_FILES 9 | icons/breeze/actions/16/kproperty-value-false.svg 10 | icons/breeze/actions/22/kproperty-value-false.svg 11 | ) 12 | 13 | set(_FILES ${_PNG_FILES} ${_SVG_FILES}) 14 | --------------------------------------------------------------------------------