mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-06-13 16:23:14 +02:00
Compare commits
168 Commits
2c8797415c
...
qt6-cmake
| Author | SHA1 | Date | |
|---|---|---|---|
| 411fb3c4dc | |||
| 07a07a5719 | |||
| 3913836137 | |||
| 242a601984 | |||
| 635bb15faf | |||
| 2deb37d351 | |||
| 1124a567aa | |||
| 8e7120e923 | |||
| 0a9f62126b | |||
| c0864eced3 | |||
| e01e3d7838 | |||
| 0e85314a84 | |||
| 80e404048c | |||
| 0e5f37503c | |||
| f14f6c6a8d | |||
| b815244494 | |||
| 01d018f8cf | |||
| d7a15d6cb6 | |||
| a53a799da5 | |||
| d4972dc588 | |||
| e66061fdca | |||
| e2e84a56f7 | |||
| 565374f174 | |||
| 7bdca47d8e | |||
| d1ce42a148 | |||
| 6b9837b244 | |||
| f0c954329f | |||
| e99ad6b424 | |||
| 74460a6645 | |||
| 231a1c919a | |||
| 19c9d614e8 | |||
| 43386aa14f | |||
| 181680e6f1 | |||
| 667d25899f | |||
| c9b9165911 | |||
| adbbeca905 | |||
| f8b9edd938 | |||
| 99dfe6a50c | |||
| 78ee65a21b | |||
| 49ce6bc4b3 | |||
| 572d78912c | |||
| aa36bb35e1 | |||
| 4e030943bc | |||
| 1c2d83d586 | |||
| 1a24452e8b | |||
| 3f7192dc68 | |||
| 4ce8fcb0d4 | |||
| 9fefc7aa2a | |||
| c77eb98a15 | |||
| 5973db00f7 | |||
| ee06a71e6f | |||
| 25f9f14b04 | |||
| 4827b23116 | |||
| e332d3bf31 | |||
| 3c4a0ed2b4 | |||
| e8f8304b60 | |||
| 07118d7a11 | |||
| 373fcfb4ea | |||
| 05dfd10952 | |||
| a88d485051 | |||
| 40abc3892c | |||
| 27899c48a3 | |||
| 4fe9687aca | |||
| cfdad56d0e | |||
| 8ba96ac6e2 | |||
| dd521f13aa | |||
| 6c5ff66067 | |||
| 0dc45f056e | |||
| 0b307abf34 | |||
| 9127937bee | |||
| d3f206a387 | |||
| 8a4d7c6cf2 | |||
| bae85624a0 | |||
| 540a248d72 | |||
| d07214ab92 | |||
| 68a2ddde18 | |||
| 8c3343795a | |||
| 2097b24d37 | |||
| 5351746dc7 | |||
| 1af3c5b852 | |||
| c2a2e5f5eb | |||
| dc836248f0 | |||
| a3bf2e2800 | |||
| 83f960a983 | |||
| c223121f00 | |||
| 0f647a5c38 | |||
| 67112bf8e5 | |||
| 1b60f7c52a | |||
| 9a96eb914d | |||
| bf8723015a | |||
| 82d7bbda68 | |||
| 0df3ecb5f7 | |||
| 1e27cac8c5 | |||
| 16dea9f3de | |||
| 20e852cbaf | |||
| 51225d5f59 | |||
| 3fc5469aee | |||
| 6fdc243552 | |||
| da109b1522 | |||
| 2aeae1fe46 | |||
| e98ce4de1d | |||
| da0951d5a0 | |||
| 0be9e2beae | |||
| 52946f9e3a | |||
| 007ce79cee | |||
| 5aee30edee | |||
| b9a8dc0918 | |||
| bd3b39cea3 | |||
| fc286cca22 | |||
| 4d5af028be | |||
| 9afc97108b | |||
| a4a3733670 | |||
| 3471140b64 | |||
| 43f0107eb1 | |||
| dba7caed30 | |||
| adcf77e34a | |||
| 59236170b2 | |||
| 3d82aff4e7 | |||
| 516eb9eb45 | |||
| 0b80d1b5b9 | |||
| 073e4080fd | |||
| b512aee2bf | |||
| 38f5547228 | |||
| 317c90c769 | |||
| f308ea6b93 | |||
| 4808b04a31 | |||
| 3a43fbfa61 | |||
| 29aee8e80c | |||
| 717b257fa0 | |||
| 13f432571d | |||
| 610f4d6dfa | |||
| a20d02f5f0 | |||
| 1fc33aa1ba | |||
| 706eba6612 | |||
| f675ce3452 | |||
| 3ae47a714d | |||
| 58aae63616 | |||
| b8e4fca09f | |||
| 075289797a | |||
| f26733f34e | |||
| ba9fea3fd1 | |||
| bbbf77597a | |||
| 1cf156c47a | |||
| 924d1c1b05 | |||
| 33570ffceb | |||
| 40b7aa999f | |||
| c9ba7bee6c | |||
| 7466793e71 | |||
| 408481a023 | |||
| b0324bd6e8 | |||
| 812ac83ab6 | |||
| d1c6fb7e3c | |||
| 9dad6963cb | |||
| 28df44d1ba | |||
| 25a81f24fa | |||
| 7a39e69a32 | |||
| af33719995 | |||
| 4c12b3c679 | |||
| e1dc978f97 | |||
| 1b2d8061a5 | |||
| b0f0a56a88 | |||
| d6d38141c9 | |||
| 331cecc05c | |||
| de0fa1fa20 | |||
| 1698e062ab | |||
| 3051c225bb | |||
| ffef9aaea5 | |||
| 9fc270c8a8 |
+24
-30
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
include(cmake/hoto_update_cmake_message.cmake)
|
include(cmake/hoto_update_cmake_message.cmake)
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.14...3.19 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.21.1 FATAL_ERROR)
|
||||||
|
|
||||||
project(qelectrotech
|
project(qelectrotech
|
||||||
VERSION 0.9.0
|
VERSION 0.9.0
|
||||||
@@ -27,6 +27,13 @@ project(qelectrotech
|
|||||||
include(cmake/copyright_message.cmake)
|
include(cmake/copyright_message.cmake)
|
||||||
|
|
||||||
set(QET_DIR ${PROJECT_SOURCE_DIR})
|
set(QET_DIR ${PROJECT_SOURCE_DIR})
|
||||||
|
include(cmake/qet_compilation_vars.cmake)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
find_package(Qt6 REQUIRED COMPONENTS ${QET_COMPONENTS})
|
||||||
|
qt_standard_project_setup()
|
||||||
|
|
||||||
# Add sub directories
|
# Add sub directories
|
||||||
option(PACKAGE_TESTS "Build the tests" ON)
|
option(PACKAGE_TESTS "Build the tests" ON)
|
||||||
@@ -43,42 +50,17 @@ include(cmake/git_last_commit_sha.cmake)
|
|||||||
include(cmake/fetch_kdeaddons.cmake)
|
include(cmake/fetch_kdeaddons.cmake)
|
||||||
include(cmake/fetch_singleapplication.cmake)
|
include(cmake/fetch_singleapplication.cmake)
|
||||||
include(cmake/fetch_pugixml.cmake)
|
include(cmake/fetch_pugixml.cmake)
|
||||||
include(cmake/qet_compilation_vars.cmake)
|
|
||||||
|
|
||||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
||||||
set(CMAKE_AUTOMOC ON)
|
|
||||||
set(CMAKE_AUTORCC ON)
|
set(CMAKE_AUTORCC ON)
|
||||||
set(CMAKE_AUTOUIC ON)
|
|
||||||
|
|
||||||
SET(CMAKE_CXX_STANDARD 17)
|
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
||||||
|
|
||||||
find_package(
|
|
||||||
QT
|
|
||||||
NAMES
|
|
||||||
Qt6
|
|
||||||
Qt5
|
|
||||||
COMPONENTS
|
|
||||||
${QET_COMPONENTS}
|
|
||||||
REQUIRED
|
|
||||||
)
|
|
||||||
|
|
||||||
find_package(
|
|
||||||
Qt${QT_VERSION_MAJOR}
|
|
||||||
COMPONENTS
|
|
||||||
${QET_COMPONENTS}
|
|
||||||
REQUIRED)
|
|
||||||
|
|
||||||
set(CMAKE_AUTOUIC_SEARCH_PATHS ${QET_DIR}/sources/ui)
|
set(CMAKE_AUTOUIC_SEARCH_PATHS ${QET_DIR}/sources/ui)
|
||||||
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
|
|
||||||
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${QET_DIR}/lang")
|
|
||||||
qt5_add_translation(QM_FILES ${TS_FILES})
|
|
||||||
|
|
||||||
# als laatse
|
# als laatse
|
||||||
include(cmake/define_definitions.cmake)
|
include(cmake/define_definitions.cmake)
|
||||||
|
|
||||||
add_executable(
|
qt_add_executable(
|
||||||
${PROJECT_NAME}
|
${PROJECT_NAME}
|
||||||
${QET_RES_FILES}
|
${QET_RES_FILES}
|
||||||
${QET_SRC_FILES}
|
${QET_SRC_FILES}
|
||||||
@@ -86,13 +68,24 @@ add_executable(
|
|||||||
${QET_DIR}/qelectrotech.qrc
|
${QET_DIR}/qelectrotech.qrc
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(QMFILES_AS_RESOURCE)
|
||||||
|
qt_add_translations(${PROJECT_NAME} TS_FILES ${TS_FILES} RESOURCE_PREFIX "/lang")
|
||||||
|
else()
|
||||||
|
qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
|
||||||
|
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${QET_DIR}/lang")
|
||||||
|
qt_add_translation(QM_FILES ${TS_FILES})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package(SQLite3 REQUIRED)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
${PROJECT_NAME}
|
${PROJECT_NAME}
|
||||||
PUBLIC
|
PUBLIC
|
||||||
PRIVATE
|
PRIVATE
|
||||||
pugixml::pugixml
|
pugixml::pugixml
|
||||||
SingleApplication::SingleApplication
|
SingleApplication::SingleApplication
|
||||||
${KF5_PRIVATE_LIBRARIES}
|
SQLite::SQLite3
|
||||||
|
${KF6_PRIVATE_LIBRARIES}
|
||||||
${QET_PRIVATE_LIBRARIES}
|
${QET_PRIVATE_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -149,6 +142,7 @@ install(FILES LICENSE ELEMENTS.LICENSE CREDIT README ChangeLog DESTINATION share
|
|||||||
install(FILES misc/org.qelectrotech.qelectrotech.desktop DESTINATION share/applications)
|
install(FILES misc/org.qelectrotech.qelectrotech.desktop DESTINATION share/applications)
|
||||||
install(FILES misc/qelectrotech.xml DESTINATION share/mime/packages)
|
install(FILES misc/qelectrotech.xml DESTINATION share/mime/packages)
|
||||||
install(FILES misc/qelectrotech.appdata.xml DESTINATION ${QET_APPDATA_PATH})
|
install(FILES misc/qelectrotech.appdata.xml DESTINATION ${QET_APPDATA_PATH})
|
||||||
install(FILES ${QM_FILES} DESTINATION ${QET_LANG_PATH})
|
if(NOT QMFILES_AS_RESOURCE)
|
||||||
|
install(FILES ${QM_FILES} DESTINATION ${QET_LANG_PATH})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
{
|
{
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/iwalton3/tkinter-standalone",
|
"url": "https://github.com/iwalton3/tkinter-standalone",
|
||||||
"commit": "2301112d142ebaf7532b25600c77d1a2edc9ef04"
|
"commit": "23c793bad2429f4a81eee9f50e2d07ae845b7785"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modules": [
|
"modules": [
|
||||||
|
|||||||
@@ -125,6 +125,7 @@
|
|||||||
!insertmacro MUI_LANGUAGE "Dutch"
|
!insertmacro MUI_LANGUAGE "Dutch"
|
||||||
!insertmacro MUI_LANGUAGE "Dutch_Belgium"
|
!insertmacro MUI_LANGUAGE "Dutch_Belgium"
|
||||||
!insertmacro MUI_LANGUAGE "Danish"
|
!insertmacro MUI_LANGUAGE "Danish"
|
||||||
|
!insertmacro MUI_LANGUAGE "Swedish"
|
||||||
!insertmacro MUI_RESERVEFILE_LANGDLL
|
!insertmacro MUI_RESERVEFILE_LANGDLL
|
||||||
|
|
||||||
!include lang_extra.nsh
|
!include lang_extra.nsh
|
||||||
|
|||||||
@@ -62,10 +62,15 @@ message("PROJECT_SOURCE_DIR :" ${PROJECT_SOURCE_DIR})
|
|||||||
message("QET_DIR :" ${QET_DIR})
|
message("QET_DIR :" ${QET_DIR})
|
||||||
message("GIT_COMMIT_SHA :" ${GIT_COMMIT_SHA})
|
message("GIT_COMMIT_SHA :" ${GIT_COMMIT_SHA})
|
||||||
|
|
||||||
if(BUILD_WITH_KF5)
|
if(BUILD_WITH_KF6 AND BUILD_KF6)
|
||||||
message("KF5_GIT_TAG :" ${KF5_GIT_TAG})
|
message("KF6_GIT_TAG :" ${KF6_GIT_TAG})
|
||||||
else()
|
endif()
|
||||||
add_definitions(-DBUILD_WITHOUT_KF5)
|
if(NOT BUILD_WITH_KF6)
|
||||||
|
add_definitions(-DBUILD_WITHOUT_KF6)
|
||||||
endif()
|
endif()
|
||||||
message("QET_COMPONENTS :" ${QET_COMPONENTS})
|
message("QET_COMPONENTS :" ${QET_COMPONENTS})
|
||||||
message("QT_VERSION_MAJOR :" ${QT_VERSION_MAJOR})
|
message("Qt version :" ${Qt6_VERSION})
|
||||||
|
|
||||||
|
if(QMFILES_AS_RESOURCE)
|
||||||
|
add_definitions(-DQMFILES_AS_RESOURCE)
|
||||||
|
endif()
|
||||||
@@ -31,5 +31,8 @@ add_definitions(-DQT_MESSAGELOGCONTEXT)
|
|||||||
# In order to do so, uncomment the following line.
|
# In order to do so, uncomment the following line.
|
||||||
#add_definitions(-DTODO_LIST)
|
#add_definitions(-DTODO_LIST)
|
||||||
|
|
||||||
# Build with KF5
|
# Build with KF6
|
||||||
option(BUILD_WITH_KF5 "Build with KF5" ON)
|
option(BUILD_WITH_KF6 "Build with KF6" ON)
|
||||||
|
|
||||||
|
# Use translations as a Qt resource
|
||||||
|
option(QMFILES_AS_RESOURCE "Use .qm files as Qt resource" ON)
|
||||||
|
|||||||
+29
-36
@@ -14,54 +14,47 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
# along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
message(" - fetch_kdeaddons")
|
message(STATUS "fetch_kdeaddons")
|
||||||
|
|
||||||
if(DEFINED BUILD_WITH_KF5)
|
if(BUILD_WITH_KF6)
|
||||||
Include(FetchContent)
|
option(BUILD_KF6 "Build KF6 libraries, use system ones otherwise" OFF)
|
||||||
|
block(PROPAGATE KF6_GIT_TAG)
|
||||||
|
set(BUILD_TESTING OFF)
|
||||||
|
set(KDE_SKIP_TEST_SETTINGS ON)
|
||||||
|
set(BUILD_DESIGNERPLUGIN OFF)
|
||||||
|
set(KCOREADDONS_USE_QML OFF)
|
||||||
|
set(BUILD_QCH OFF)
|
||||||
|
set(BUILD_SHARED_LIBS OFF)
|
||||||
|
find_package(ECM 6.8.0 REQUIRED NO_MODULE)
|
||||||
|
list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
||||||
|
|
||||||
option(BUILD_KF5 "Build KF5 libraries, use system ones otherwise" YES)
|
if(BUILD_KF6)
|
||||||
|
Include(FetchContent)
|
||||||
|
|
||||||
if(BUILD_KF5)
|
if(NOT DEFINED KF6_GIT_TAG)
|
||||||
|
set(KF6_GIT_TAG v6.8.0)
|
||||||
if(NOT DEFINED KF5_GIT_TAG)
|
|
||||||
#https://qelectrotech.org/forum/viewtopic.php?pid=13924#p13924
|
|
||||||
set(KF5_GIT_TAG v5.77.0)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Fix stop the run autotests of kcoreaddons
|
|
||||||
# see
|
|
||||||
# https://invent.kde.org/frameworks/kcoreaddons/-/blob/master/CMakeLists.txt#L98
|
|
||||||
# issue:
|
|
||||||
# CMake Error at /usr/share/ECM/modules/ECMAddTests.cmake:89 (add_executable):
|
|
||||||
# Cannot find source file:
|
|
||||||
# see
|
|
||||||
# https://qelectrotech.org/forum/viewtopic.php?pid=13929#p13929
|
|
||||||
set(KDE_SKIP_TEST_SETTINGS "TRUE")
|
|
||||||
set(BUILD_TESTING "0")
|
|
||||||
FetchContent_Declare(
|
|
||||||
ecm
|
|
||||||
GIT_REPOSITORY https://invent.kde.org/frameworks/extra-cmake-modules.git
|
|
||||||
GIT_TAG ${KF5_GIT_TAG})
|
|
||||||
FetchContent_MakeAvailable(ecm)
|
|
||||||
|
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
kcoreaddons
|
kcoreaddons
|
||||||
GIT_REPOSITORY https://invent.kde.org/frameworks/kcoreaddons.git
|
GIT_REPOSITORY https://invent.kde.org/frameworks/kcoreaddons.git
|
||||||
GIT_TAG ${KF5_GIT_TAG})
|
GIT_TAG ${KF6_GIT_TAG})
|
||||||
FetchContent_MakeAvailable(kcoreaddons)
|
FetchContent_MakeAvailable(kcoreaddons)
|
||||||
|
get_target_property(kca_version KF6::CoreAddons VERSION)
|
||||||
|
|
||||||
FetchContent_Declare(
|
|
||||||
kwidgetsaddons
|
|
||||||
GIT_REPOSITORY https://invent.kde.org/frameworks/kwidgetsaddons.git
|
|
||||||
GIT_TAG ${KF5_GIT_TAG})
|
|
||||||
FetchContent_MakeAvailable(kwidgetsaddons)
|
|
||||||
else()
|
else()
|
||||||
find_package(KF5CoreAddons REQUIRED)
|
find_package(KF6CoreAddons REQUIRED)
|
||||||
find_package(KF5WidgetsAddons REQUIRED)
|
set(kca_version ${KF6CoreAddons_VERSION})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(KF5_PRIVATE_LIBRARIES
|
get_target_property(kwa_type KF6::CoreAddons TYPE)
|
||||||
KF5::WidgetsAddons
|
|
||||||
KF5::CoreAddons
|
message(NOTICE "ecm version : " ${ECM_VERSION})
|
||||||
|
message(NOTICE "kcoreaddons library : " ${kca_type})
|
||||||
|
message(NOTICE "kcoreaddons version : " ${kca_version})
|
||||||
|
endblock()
|
||||||
|
|
||||||
|
set(KF6_PRIVATE_LIBRARIES
|
||||||
|
KF6::CoreAddons
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ if(BUILD_PUGIXML)
|
|||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
pugixml
|
pugixml
|
||||||
GIT_REPOSITORY https://github.com/zeux/pugixml.git
|
GIT_REPOSITORY https://github.com/zeux/pugixml.git
|
||||||
GIT_TAG v1.11.4)
|
GIT_TAG v1.14)
|
||||||
|
|
||||||
FetchContent_MakeAvailable(pugixml)
|
FetchContent_MakeAvailable(pugixml)
|
||||||
else()
|
else()
|
||||||
|
|||||||
@@ -26,6 +26,6 @@ Include(FetchContent)
|
|||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
SingleApplication
|
SingleApplication
|
||||||
GIT_REPOSITORY https://github.com/itay-grudev/SingleApplication.git
|
GIT_REPOSITORY https://github.com/itay-grudev/SingleApplication.git
|
||||||
GIT_TAG v3.2.0)
|
GIT_TAG v3.5.1)
|
||||||
|
|
||||||
FetchContent_MakeAvailable(SingleApplication)
|
FetchContent_MakeAvailable(SingleApplication)
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
message(" - qet_compilation_vars")
|
message(" - qet_compilation_vars")
|
||||||
|
|
||||||
set(QET_COMPONENTS
|
set(QET_COMPONENTS
|
||||||
|
Core
|
||||||
|
Gui
|
||||||
LinguistTools
|
LinguistTools
|
||||||
PrintSupport
|
PrintSupport
|
||||||
Xml
|
Xml
|
||||||
@@ -109,6 +111,12 @@ set(QET_SRC_FILES
|
|||||||
${QET_DIR}/sources/borderproperties.h
|
${QET_DIR}/sources/borderproperties.h
|
||||||
${QET_DIR}/sources/bordertitleblock.cpp
|
${QET_DIR}/sources/bordertitleblock.cpp
|
||||||
${QET_DIR}/sources/bordertitleblock.h
|
${QET_DIR}/sources/bordertitleblock.h
|
||||||
|
${QET_DIR}/sources/colorbutton.cpp
|
||||||
|
${QET_DIR}/sources/colorbutton.h
|
||||||
|
${QET_DIR}/sources/colorcombobox.cpp
|
||||||
|
${QET_DIR}/sources/colorcombobox.h
|
||||||
|
${QET_DIR}/sources/colorcomboboxdelegate.cpp
|
||||||
|
${QET_DIR}/sources/colorcomboboxdelegate.h
|
||||||
${QET_DIR}/sources/conductorautonumerotation.cpp
|
${QET_DIR}/sources/conductorautonumerotation.cpp
|
||||||
${QET_DIR}/sources/conductorautonumerotation.h
|
${QET_DIR}/sources/conductorautonumerotation.h
|
||||||
${QET_DIR}/sources/conductornumexport.cpp
|
${QET_DIR}/sources/conductornumexport.cpp
|
||||||
@@ -710,7 +718,6 @@ set(QET_SRC_FILES
|
|||||||
|
|
||||||
set(TS_FILES
|
set(TS_FILES
|
||||||
${QET_DIR}/lang/qet_ar.ts
|
${QET_DIR}/lang/qet_ar.ts
|
||||||
${QET_DIR}/lang/qet_be.ts
|
|
||||||
${QET_DIR}/lang/qet_ca.ts
|
${QET_DIR}/lang/qet_ca.ts
|
||||||
${QET_DIR}/lang/qet_cs.ts
|
${QET_DIR}/lang/qet_cs.ts
|
||||||
${QET_DIR}/lang/qet_da.ts
|
${QET_DIR}/lang/qet_da.ts
|
||||||
@@ -727,6 +734,7 @@ set(TS_FILES
|
|||||||
${QET_DIR}/lang/qet_mn.ts
|
${QET_DIR}/lang/qet_mn.ts
|
||||||
${QET_DIR}/lang/qet_nb.ts
|
${QET_DIR}/lang/qet_nb.ts
|
||||||
${QET_DIR}/lang/qet_nl.ts
|
${QET_DIR}/lang/qet_nl.ts
|
||||||
|
${QET_DIR}/lang/qet_nl_BE.ts
|
||||||
${QET_DIR}/lang/qet_no.ts
|
${QET_DIR}/lang/qet_no.ts
|
||||||
${QET_DIR}/lang/qet_pl.ts
|
${QET_DIR}/lang/qet_pl.ts
|
||||||
${QET_DIR}/lang/qet_pt.ts
|
${QET_DIR}/lang/qet_pt.ts
|
||||||
@@ -736,6 +744,7 @@ set(TS_FILES
|
|||||||
${QET_DIR}/lang/qet_sk.ts
|
${QET_DIR}/lang/qet_sk.ts
|
||||||
${QET_DIR}/lang/qet_sl.ts
|
${QET_DIR}/lang/qet_sl.ts
|
||||||
${QET_DIR}/lang/qet_sr.ts
|
${QET_DIR}/lang/qet_sr.ts
|
||||||
|
${QET_DIR}/lang/qet_sv.ts
|
||||||
${QET_DIR}/lang/qet_tr.ts
|
${QET_DIR}/lang/qet_tr.ts
|
||||||
${QET_DIR}/lang/qet_zh.ts
|
${QET_DIR}/lang/qet_zh.ts
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -29,4 +29,4 @@ add_definitions(-DQET_ALLOW_OVERRIDE_CD_OPTION)
|
|||||||
add_definitions(-DQET_ALLOW_OVERRIDE_DD_OPTION)
|
add_definitions(-DQET_ALLOW_OVERRIDE_DD_OPTION)
|
||||||
|
|
||||||
#comment the line below to disable the project database export
|
#comment the line below to disable the project database export
|
||||||
#add_definitions(-DQET_EXPORT_PROJECT_DB) #error Todo
|
add_definitions(-DQET_EXPORT_PROJECT_DB)
|
||||||
|
|||||||
+1
-1
Submodule elements updated: 3373575a73...48eb7dcedf
Binary file not shown.
|
After Width: | Height: | Size: 295 B |
Binary file not shown.
|
After Width: | Height: | Size: 291 B |
@@ -0,0 +1,326 @@
|
|||||||
|
<!DOCTYPE QPH>
|
||||||
|
<QPH sourcelanguage="fr" language="sv">
|
||||||
|
<phrase>
|
||||||
|
<source>Texte composé</source>
|
||||||
|
<target>Sammansatt text</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Texte utilisateur</source>
|
||||||
|
<target>Egen text</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Gauche</source>
|
||||||
|
<target>Vänster</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Droite</source>
|
||||||
|
<target>Höger</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Centre</source>
|
||||||
|
<target>Centrum</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Élément</source>
|
||||||
|
<target>Objekt</target>
|
||||||
|
<definition>Vid referens av olika typer</definition>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Folio</source>
|
||||||
|
<target>Blad</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Conducteur</source>
|
||||||
|
<target>Förbindning</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Sans nom</source>
|
||||||
|
<target>Namnlös</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Recharger</source>
|
||||||
|
<target>Ladda om</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Projet sans titre</source>
|
||||||
|
<target>Namnlöst projekt</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Folio sans titre</source>
|
||||||
|
<target>Namnlöst blad</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Nom</source>
|
||||||
|
<target>Namn</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Sélection</source>
|
||||||
|
<target>Urval</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Désélectionner tout</source>
|
||||||
|
<target>Avmarkera allt</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Sélectionner tout</source>
|
||||||
|
<target>Välj allt</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Installation</source>
|
||||||
|
<target>Anläggning</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Localisation</source>
|
||||||
|
<target>Placering</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Reports de folio</source>
|
||||||
|
<target>Bladhänvisningar</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Report de folio</source>
|
||||||
|
<target>Bladhänvisning</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Centre</source>
|
||||||
|
<target>Mitten</target>
|
||||||
|
<definition>Vid textjustering</definition>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Collage multiple</source>
|
||||||
|
<target>Klistra in flera</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Remplacer</source>
|
||||||
|
<target>Ersätt</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Élément</source>
|
||||||
|
<target>Symbol</target>
|
||||||
|
<definition>Vid referens av symbol</definition>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>À</source>
|
||||||
|
<target>Till</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>De</source>
|
||||||
|
<target>Från</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Nomenclature</source>
|
||||||
|
<target>Förteckning</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Position du folio</source>
|
||||||
|
<target>Bladposition</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Polygone fermé</source>
|
||||||
|
<target>Sluten polygon</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Dossier</source>
|
||||||
|
<target>Mapp</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Que souhaitez-vous faire</source>
|
||||||
|
<target>Vad vill du göra</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Collection</source>
|
||||||
|
<target>Bibliotek</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Collection de cartouches</source>
|
||||||
|
<target>Titelblockbibliotek</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Collection company de cartouches</source>
|
||||||
|
<target>Organisationens titelblockbibliotek</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Champ texte</source>
|
||||||
|
<target>Textfält</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Longueur</source>
|
||||||
|
<target>Längd</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Suivant</source>
|
||||||
|
<target>Nästa</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Suivant</source>
|
||||||
|
<target>Följande</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Chiffre</source>
|
||||||
|
<target>Siffra</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Tout cocher</source>
|
||||||
|
<target>Markera allt</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Tout décocher</source>
|
||||||
|
<target>Avmarkera allt</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Titre</source>
|
||||||
|
<target>Titel</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Dimensions</source>
|
||||||
|
<target>Dimensioner</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Dimensions</source>
|
||||||
|
<target>Mått</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Aperçu</source>
|
||||||
|
<target>Översikt</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Générique</source>
|
||||||
|
<target>Generisk</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Sans</source>
|
||||||
|
<target>Utan</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Avec</source>
|
||||||
|
<target>Med</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Normal</source>
|
||||||
|
<target>Normal</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Tiret</source>
|
||||||
|
<target>Streckad</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Pointillé</source>
|
||||||
|
<target>Punktad</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Remplissage</source>
|
||||||
|
<target>Fyllning</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Apparence</source>
|
||||||
|
<target>Utseende</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Contour</source>
|
||||||
|
<target>Kontur</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Épaisseur</source>
|
||||||
|
<target>Tjocklek</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Géométrie</source>
|
||||||
|
<target>Geometri</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Par defaut</source>
|
||||||
|
<target>Förinställt</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Parcourir</source>
|
||||||
|
<target>Bläddra</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Général</source>
|
||||||
|
<target>Allmänt</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Borne</source>
|
||||||
|
<target>Plint</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Coller</source>
|
||||||
|
<target>Klistra in</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Ouvrir</source>
|
||||||
|
<target>Öppna</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Arc</source>
|
||||||
|
<target>Båge</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Ellipse</source>
|
||||||
|
<target>Ellips</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Ligne</source>
|
||||||
|
<target>Linje</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Rectangle</source>
|
||||||
|
<target>Rektangel</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Orientation</source>
|
||||||
|
<target>Orientering</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Nord</source>
|
||||||
|
<target>Nord</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Est</source>
|
||||||
|
<target>Öst</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Sud</source>
|
||||||
|
<target>Syd</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Ouest</source>
|
||||||
|
<target>Väst</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Police</source>
|
||||||
|
<target>Typsnitt</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Dimensions</source>
|
||||||
|
<target>Storlek</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Sans titre</source>
|
||||||
|
<target>Namnlös</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Borne</source>
|
||||||
|
<target>Anslutning</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Sans titre</source>
|
||||||
|
<target>Namnlöst</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Sans nom</source>
|
||||||
|
<target>Namnlöst</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Décalage</source>
|
||||||
|
<target>Förkjutning</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Afficher</source>
|
||||||
|
<target>Visa</target>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
<source>Affichage</source>
|
||||||
|
<target>Visning</target>
|
||||||
|
</phrase>
|
||||||
|
</QPH>
|
||||||
Binary file not shown.
+331
-532
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+331
-532
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+553
-586
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+332
-534
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+405
-603
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+332
-533
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+334
-535
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+331
-532
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+332
-533
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+331
-532
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+332
-534
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+332
-533
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+331
-532
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+331
-532
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+331
-532
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+332
-534
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+332
-534
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+404
-570
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+331
-532
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+332
-533
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+331
-532
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+332
-533
File diff suppressed because it is too large
Load Diff
+331
-532
File diff suppressed because it is too large
Load Diff
+331
-532
File diff suppressed because it is too large
Load Diff
+331
-532
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+14418
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+331
-532
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+332
-533
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+332
-533
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Version=1.0
|
Version=1.0
|
||||||
Name=QElectroTech
|
Name=QElectroTech
|
||||||
TryExec=qelectrotech
|
TryExec=qelectrotech
|
||||||
Exec=qelectrotech %F
|
Exec=qelectrotech %F
|
||||||
Icon=qelectrotech
|
Icon=qelectrotech
|
||||||
@@ -10,7 +10,7 @@ MimeType=application/x-qet-project;application/x-qet-element;application/x-qet-t
|
|||||||
Categories=Graphics;Qt;VectorGraphics;Science;Electricity;Engineering;
|
Categories=Graphics;Qt;VectorGraphics;Science;Electricity;Engineering;
|
||||||
Keywords=Graphics;Science;Electricity;Engineering;
|
Keywords=Graphics;Science;Electricity;Engineering;
|
||||||
Comment=Edit electrical diagrams.
|
Comment=Edit electrical diagrams.
|
||||||
Comment[de]=Schaltpläne erstellen und bearbeiten.
|
Comment[de]=Elektroschaltpläne erstellen und bearbeiten.
|
||||||
Comment[fr]=Éditer des schémas électriques.
|
Comment[fr]=Éditer des schémas électriques.
|
||||||
Comment[ar]=تحرير مخططات كهربائية
|
Comment[ar]=تحرير مخططات كهربائية
|
||||||
Comment[es]=Editar esquemas eléctricos
|
Comment[es]=Editar esquemas eléctricos
|
||||||
@@ -26,6 +26,7 @@ Comment[nl]=Bewerken bedradingsdiagrammen.
|
|||||||
Comment[be]=Bewerken elektrisch schema.
|
Comment[be]=Bewerken elektrisch schema.
|
||||||
Comment[da]=Rediger elektriske diagrammer.
|
Comment[da]=Rediger elektriske diagrammer.
|
||||||
Comment[ja]=電気回路図の編集。
|
Comment[ja]=電気回路図の編集。
|
||||||
|
Comment[sk]=Úprava elektrických schém.
|
||||||
GenericName=Electrical diagram editor
|
GenericName=Electrical diagram editor
|
||||||
GenericName[de]=Schaltplaneditor
|
GenericName[de]=Schaltplaneditor
|
||||||
GenericName[fr]=Éditeur de schémas électriques
|
GenericName[fr]=Éditeur de schémas électriques
|
||||||
@@ -42,3 +43,4 @@ GenericName[nl]=Elektrische schema editor
|
|||||||
GenericName[be]=Elektrische schema editor
|
GenericName[be]=Elektrische schema editor
|
||||||
GenericName[da]=Elektrisk diagram redigering
|
GenericName[da]=Elektrisk diagram redigering
|
||||||
GenericName[ja]=電気回路図エディタ
|
GenericName[ja]=電気回路図エディタ
|
||||||
|
GenericName[sk]=Editor elektrických schém
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
<file>ico/16x16/endline-none.png</file>
|
<file>ico/16x16/endline-none.png</file>
|
||||||
<file>ico/16x16/endline-simple.png</file>
|
<file>ico/16x16/endline-simple.png</file>
|
||||||
<file>ico/16x16/endline-triangle.png</file>
|
<file>ico/16x16/endline-triangle.png</file>
|
||||||
|
<file>ico/16x16/flip.png</file>
|
||||||
<file>ico/16x16/folder-new.png</file>
|
<file>ico/16x16/folder-new.png</file>
|
||||||
<file>ico/16x16/folder.png</file>
|
<file>ico/16x16/folder.png</file>
|
||||||
<file>ico/16x16/go-company.png</file>
|
<file>ico/16x16/go-company.png</file>
|
||||||
@@ -60,6 +61,7 @@
|
|||||||
<file>ico/16x16/list-add.png</file>
|
<file>ico/16x16/list-add.png</file>
|
||||||
<file>ico/16x16/list-remove.png</file>
|
<file>ico/16x16/list-remove.png</file>
|
||||||
<file>ico/16x16/masquer.png</file>
|
<file>ico/16x16/masquer.png</file>
|
||||||
|
<file>ico/16x16/mirror.png</file>
|
||||||
<file>ico/16x16/neutral.png</file>
|
<file>ico/16x16/neutral.png</file>
|
||||||
<file>ico/16x16/north.png</file>
|
<file>ico/16x16/north.png</file>
|
||||||
<file>ico/16x16/orientations.png</file>
|
<file>ico/16x16/orientations.png</file>
|
||||||
|
|||||||
@@ -26,7 +26,8 @@
|
|||||||
#include "xmlprojectelementcollectionitem.h"
|
#include "xmlprojectelementcollectionitem.h"
|
||||||
|
|
||||||
#include <QFutureWatcher>
|
#include <QFutureWatcher>
|
||||||
#include <QtConcurrent>
|
#include <QtConcurrentMap>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief ElementsCollectionModel::ElementsCollectionModel
|
@brief ElementsCollectionModel::ElementsCollectionModel
|
||||||
@@ -292,15 +293,9 @@ void ElementsCollectionModel::loadCollections(bool common_collection,
|
|||||||
&QFutureWatcher<void>::finished,
|
&QFutureWatcher<void>::finished,
|
||||||
watcher,
|
watcher,
|
||||||
&QFutureWatcher<void>::deleteLater);
|
&QFutureWatcher<void>::deleteLater);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
|
||||||
m_future = QtConcurrent::map(m_items_list_to_setUp, setUpData);
|
m_future = QtConcurrent::map(m_items_list_to_setUp, setUpData);
|
||||||
#else
|
|
||||||
# if TODO_LIST
|
|
||||||
# pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
# endif
|
|
||||||
qDebug() << "Help code for QT 6 or later"
|
|
||||||
<< "QtConcurrent::run its backwards now...function, object, args";
|
|
||||||
#endif
|
|
||||||
watcher->setFuture(m_future);
|
watcher->setFuture(m_future);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -765,7 +765,7 @@ void ElementsCollectionWidget::search()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//start the search when text have at least 3 letters.
|
//start the search when text have at least 3 letters.
|
||||||
if (text.count() < 3) {
|
if (text.length() < 3) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -805,15 +805,15 @@ bool ElementsLocation::setXml(const QDomDocument &xml_document) const
|
|||||||
qDebug() << "Help code for QT 6 or later";
|
qDebug() << "Help code for QT 6 or later";
|
||||||
|
|
||||||
QString path_ = collectionPath(false);
|
QString path_ = collectionPath(false);
|
||||||
QRegularExpression rx("^(.*)/(.*\\.elmt)$");
|
QRegularExpression rx(QRegularExpression::anchoredPattern("(.*)/(.*\\.elmt)"));
|
||||||
|
QRegularExpressionMatch match = rx.match(path_);
|
||||||
if (rx.exactMatch(path_))
|
if (match.hasMatch())
|
||||||
{
|
{
|
||||||
return project()
|
return project()
|
||||||
->embeddedElementCollection()
|
->embeddedElementCollection()
|
||||||
->addElementDefinition(
|
->addElementDefinition(
|
||||||
rx.cap(1),
|
match.captured(1),
|
||||||
rx.cap(2),
|
match.captured(2),
|
||||||
xml_document.documentElement());
|
xml_document.documentElement());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -870,7 +870,7 @@ QIcon ElementsLocation::icon() const
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
@brief ElementLocation::name
|
@brief ElementLocation::name
|
||||||
@return The name of the represented element in the current local
|
@return The name of the represented element in the current locale
|
||||||
*/
|
*/
|
||||||
QString ElementsLocation::name() const
|
QString ElementsLocation::name() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class XmlElementCollection;
|
|||||||
This class represents the location,
|
This class represents the location,
|
||||||
the location of an element or of a category,
|
the location of an element or of a category,
|
||||||
even of a collection ... in a collection.
|
even of a collection ... in a collection.
|
||||||
She encapsulates a virtual path.
|
It encapsulates a virtual path.
|
||||||
\~French
|
\~French
|
||||||
Cette classe represente la localisation, l'emplacement d'un element ou
|
Cette classe represente la localisation, l'emplacement d'un element ou
|
||||||
d'une categorie, voire d'une collection... dans une collection.
|
d'une categorie, voire d'une collection... dans une collection.
|
||||||
|
|||||||
@@ -117,46 +117,53 @@ XmlElementCollection::XmlElementCollection(QETProject *project) :
|
|||||||
0x8981,
|
0x8981,
|
||||||
0x7D20};
|
0x7D20};
|
||||||
|
|
||||||
names.addName("fr", "Éléments importés");
|
names.addName("ca", "Elements importats");
|
||||||
names.addName("en", "Imported elements");
|
names.addName("cs", "Zavedené prvky");
|
||||||
names.addName("nl_BE","Elementen geïmporteerd");
|
names.addName("da", "Importerede elementer");
|
||||||
names.addName("de", "Importierte elemente");
|
names.addName("de", "Importierte elemente");
|
||||||
names.addName("es", "Elementos importados");
|
names.addName("el", QString(greek_data, 18));
|
||||||
names.addName("ru", QString(russian_data, 24));
|
names.addName("en", "Imported elements");
|
||||||
names.addName("cs", "Zavedené prvky");
|
names.addName("es", "Elementos importados");
|
||||||
names.addName("pl", "Elementy importowane");
|
names.addName("fr", "Éléments importés");
|
||||||
names.addName("pt", "elementos importados");
|
names.addName("hr", "Uvezeni elementi");
|
||||||
names.addName("it", "Elementi importati");
|
names.addName("it", "Elementi importati");
|
||||||
names.addName("el", QString(greek_data, 18));
|
names.addName("ja", QString(japanese_data, 10));
|
||||||
names.addName("nl", "Elementen geïmporteerd");
|
names.addName("nl_BE", "Elementen geïmporteerd");
|
||||||
names.addName("hr", "Uvezeni elementi");
|
names.addName("nl", "Elementen geïmporteerd");
|
||||||
names.addName("ca", "Elements importats");
|
names.addName("pl", "Elementy importowane");
|
||||||
names.addName("ro", "Elemente importate");
|
names.addName("pt_BR", "elementos importados");
|
||||||
names.addName("tr", QString(turkish_data, 12));
|
names.addName("pt", "elementos importados");
|
||||||
names.addName("da", "Importerede elementer");
|
names.addName("ro", "Elemente importate");
|
||||||
names.addName("sl", "Uvoženi elementi");
|
names.addName("ru", QString(russian_data, 24));
|
||||||
names.addName("ja", QString(japanese_data, 10));
|
names.addName("sl", "Uvoženi elementi");
|
||||||
names.addName("uk", QString(ukrainian_data, 20));
|
names.addName("tr", QString(turkish_data, 12));
|
||||||
|
names.addName("uk", QString(ukrainian_data, 20));
|
||||||
#else
|
#else
|
||||||
# if TODO_LIST
|
# if TODO_LIST
|
||||||
# pragma message("@TODO remove code for QT 6 or later")
|
# pragma message("@TODO remove code for QT 6 or later")
|
||||||
# endif
|
# endif
|
||||||
qDebug() << "Help code for QT 6 or later";
|
qDebug() << "Help code for QT 6 or later";
|
||||||
names.addName("fr", "Éléments importés");
|
names.addName("ca", "Elements importats");
|
||||||
names.addName("en", "Imported elements");
|
names.addName("cs", "Zavedené prvky");
|
||||||
names.addName("de", "Importierte elemente");
|
names.addName("da", "Importerede elementer");
|
||||||
names.addName("es", "Elementos importados");
|
names.addName("de", "Importierte elemente");
|
||||||
names.addName("cs", "Zavedené prvky");
|
names.addName("el", "Εισηγμένα στοιχεία");
|
||||||
names.addName("pl", "Elementy importowane");
|
names.addName("en", "Imported elements");
|
||||||
names.addName("pt", "elementos importados");
|
names.addName("es", "Elementos importados");
|
||||||
names.addName("it", "Elementi importati");
|
names.addName("fr", "Éléments importés");
|
||||||
names.addName("nl", "Elementen geïmporteerd");
|
names.addName("hr", "Uvezeni elementi");
|
||||||
names.addName("hr", "Uvezeni elementi");
|
names.addName("it", "Elementi importati");
|
||||||
names.addName("ca", "Elements importats");
|
names.addName("ja", "インバートされた要素");
|
||||||
names.addName("ro", "Elemente importate");
|
names.addName("nl_BE", "Elementen geïmporteerd");
|
||||||
names.addName("da", "Importerede elementer");
|
names.addName("nl", "Elementen geïmporteerd");
|
||||||
names.addName("sl", "Uvoženi elementi");
|
names.addName("pl", "Elementy importowane");
|
||||||
names.addName("uk", "Імпортовані елементи");
|
names.addName("pt_BR", "elementos importados");
|
||||||
|
names.addName("pt", "elementos importados");
|
||||||
|
names.addName("ro", "Elemente importate");
|
||||||
|
names.addName("ru", "Импортированные элементы");
|
||||||
|
names.addName("sl", "Uvoženi elementi");
|
||||||
|
names.addName("tr", "İthal öğeler");
|
||||||
|
names.addName("uk", "Імпортовані елементи");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
import.appendChild(names.toXml(m_dom_document));
|
import.appendChild(names.toXml(m_dom_document));
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ NamesList::~NamesList()
|
|||||||
void NamesList::addName(const QString &lang, const QString &name) {
|
void NamesList::addName(const QString &lang, const QString &name) {
|
||||||
if ((lang.length() != 2) && (lang.length() != 5)) return;
|
if ((lang.length() != 2) && (lang.length() != 5)) return;
|
||||||
if ((lang.length() == 5) && (lang[2] != '_')) return;
|
if ((lang.length() == 5) && (lang[2] != '_')) return;
|
||||||
hash_names.insert(lang, name);
|
map_names.insert(lang, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,7 +54,7 @@ void NamesList::addName(const QString &lang, const QString &name) {
|
|||||||
@param lang la langue pour laquelle il faut supprimer le nom
|
@param lang la langue pour laquelle il faut supprimer le nom
|
||||||
*/
|
*/
|
||||||
void NamesList::removeName(const QString &lang) {
|
void NamesList::removeName(const QString &lang) {
|
||||||
hash_names.remove(lang);
|
map_names.remove(lang);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -62,7 +62,7 @@ void NamesList::removeName(const QString &lang) {
|
|||||||
*/
|
*/
|
||||||
void NamesList::clearNames()
|
void NamesList::clearNames()
|
||||||
{
|
{
|
||||||
hash_names.clear();
|
map_names.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -70,7 +70,7 @@ void NamesList::clearNames()
|
|||||||
*/
|
*/
|
||||||
QList<QString> NamesList::langs() const
|
QList<QString> NamesList::langs() const
|
||||||
{
|
{
|
||||||
return(hash_names.keys());
|
return(map_names.keys());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -78,7 +78,7 @@ QList<QString> NamesList::langs() const
|
|||||||
*/
|
*/
|
||||||
bool NamesList::isEmpty() const
|
bool NamesList::isEmpty() const
|
||||||
{
|
{
|
||||||
return(hash_names.isEmpty());
|
return(map_names.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,7 +86,7 @@ bool NamesList::isEmpty() const
|
|||||||
*/
|
*/
|
||||||
int NamesList::count() const
|
int NamesList::count() const
|
||||||
{
|
{
|
||||||
return(hash_names.count());
|
return(map_names.count());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -95,7 +95,7 @@ int NamesList::count() const
|
|||||||
defini
|
defini
|
||||||
*/
|
*/
|
||||||
QString &NamesList::operator[](const QString &lang) {
|
QString &NamesList::operator[](const QString &lang) {
|
||||||
return(hash_names[lang]);
|
return(map_names[lang]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -105,17 +105,21 @@ QString &NamesList::operator[](const QString &lang) {
|
|||||||
*/
|
*/
|
||||||
const QString NamesList::operator[](const QString &lang) const
|
const QString NamesList::operator[](const QString &lang) const
|
||||||
{
|
{
|
||||||
return(hash_names.value(lang));
|
return(map_names.value(lang));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loads the list of names from an XML element. This element is assumed to be
|
||||||
|
the parent of a ‘names’ element, which itself contains the ‘names’. The
|
||||||
|
names previously contained in the list are not deleted, but can be overwritten.
|
||||||
|
French:
|
||||||
Charge la liste de noms depuis un element XML. Cet element est sense etre
|
Charge la liste de noms depuis un element XML. Cet element est sense etre
|
||||||
le parent d'un element "names", qui contient lui meme les "name".
|
le parent d'un element "names", qui contient lui meme les "name".
|
||||||
Les noms precedemment contenus dans la liste ne sont pas effaces mais
|
Les noms precedemment contenus dans la liste ne sont pas effaces mais
|
||||||
peuvent etre ecrases.
|
peuvent etre ecrases.
|
||||||
@param xml_element L'element XML a analyser
|
@param xml_element L'element XML a analyser / The XML element to be parsed
|
||||||
@param xml_options A set of options related to XML parsing.
|
@param xml_options A set of options related to XML parsing.
|
||||||
@see getXmlOptions()
|
@see getXmlOptions()
|
||||||
*/
|
*/
|
||||||
@@ -168,8 +172,13 @@ void NamesList::fromXml(const pugi::xml_node &xml_element, const QHash<QString,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Exports the list of names to an XML element.
|
||||||
|
Make sure that the list of names is not empty before exporting.
|
||||||
|
If list is empty, set name to "en" / "NoName"
|
||||||
|
French:
|
||||||
Exporte la liste des noms vers un element XML. Veillez a verifier que la
|
Exporte la liste des noms vers un element XML. Veillez a verifier que la
|
||||||
liste de noms n'est pas vide avant de l'exporter.
|
liste de noms n'est pas vide avant de l'exporter.
|
||||||
|
Si la liste est vide, le nom sera "en" / "NoName".
|
||||||
@param xml_document Le document XML dans lequel l'element XML sera insere
|
@param xml_document Le document XML dans lequel l'element XML sera insere
|
||||||
@param xml_options A set of options related to XML parsing.
|
@param xml_options A set of options related to XML parsing.
|
||||||
@return L'element XML correspondant a la section "names"
|
@return L'element XML correspondant a la section "names"
|
||||||
@@ -179,13 +188,21 @@ QDomElement NamesList::toXml(QDomDocument &xml_document, const QHash<QString, QS
|
|||||||
{
|
{
|
||||||
QHash<QString, QString> xml_opt = getXmlOptions(xml_options);
|
QHash<QString, QString> xml_opt = getXmlOptions(xml_options);
|
||||||
QDomElement names_elmt = xml_document.createElement(xml_opt["ParentTagName"]);
|
QDomElement names_elmt = xml_document.createElement(xml_opt["ParentTagName"]);
|
||||||
QHashIterator<QString, QString> names_iterator(hash_names);
|
if (map_names.isEmpty()) {
|
||||||
while (names_iterator.hasNext()) {
|
qInfo() << " NamesList of element is empty - add default: [" << "en" << "] = " << "NoName" << "";
|
||||||
names_iterator.next();
|
|
||||||
QDomElement name_elmt = xml_document.createElement(xml_opt["TagName"]);
|
QDomElement name_elmt = xml_document.createElement(xml_opt["TagName"]);
|
||||||
name_elmt.setAttribute(xml_opt["LanguageAttribute"], names_iterator.key());
|
name_elmt.setAttribute(xml_opt["LanguageAttribute"], "en");
|
||||||
name_elmt.appendChild(xml_document.createTextNode(names_iterator.value()));
|
name_elmt.appendChild(xml_document.createTextNode("NoName"));
|
||||||
names_elmt.appendChild(name_elmt);
|
names_elmt.appendChild(name_elmt);
|
||||||
|
} else {
|
||||||
|
QMapIterator<QString, QString> names_iterator(map_names);
|
||||||
|
while (names_iterator.hasNext()) {
|
||||||
|
names_iterator.next();
|
||||||
|
QDomElement name_elmt = xml_document.createElement(xml_opt["TagName"]);
|
||||||
|
name_elmt.setAttribute(xml_opt["LanguageAttribute"], names_iterator.key());
|
||||||
|
name_elmt.appendChild(xml_document.createTextNode(names_iterator.value().trimmed()));
|
||||||
|
names_elmt.appendChild(name_elmt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return(names_elmt);
|
return(names_elmt);
|
||||||
}
|
}
|
||||||
@@ -218,7 +235,7 @@ QHash<QString, QString> NamesList::getXmlOptions(const QHash<QString, QString> &
|
|||||||
*/
|
*/
|
||||||
bool NamesList::operator!=(const NamesList &nl) const
|
bool NamesList::operator!=(const NamesList &nl) const
|
||||||
{
|
{
|
||||||
return(hash_names != nl.hash_names);
|
return(map_names != nl.map_names);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -227,7 +244,7 @@ bool NamesList::operator!=(const NamesList &nl) const
|
|||||||
*/
|
*/
|
||||||
bool NamesList::operator==(const NamesList &nl) const
|
bool NamesList::operator==(const NamesList &nl) const
|
||||||
{
|
{
|
||||||
return(hash_names == nl.hash_names);
|
return(map_names == nl.map_names);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -246,10 +263,10 @@ bool NamesList::operator==(const NamesList &nl) const
|
|||||||
QString NamesList::name(const QString &fallback_name) const
|
QString NamesList::name(const QString &fallback_name) const
|
||||||
{
|
{
|
||||||
QString system_language = QETApp::langFromSetting();
|
QString system_language = QETApp::langFromSetting();
|
||||||
if (! hash_names[system_language].isEmpty())
|
if (! map_names[system_language].isEmpty())
|
||||||
return (hash_names[system_language]);
|
return (map_names[system_language]);
|
||||||
if (! hash_names["en"].isEmpty()) return (hash_names["en"]);
|
if (! map_names["en"].isEmpty()) return (map_names["en"]);
|
||||||
if (! fallback_name.isEmpty()) return (fallback_name);
|
if (! fallback_name.isEmpty()) return (fallback_name);
|
||||||
if (hash_names.count()) return (hash_names.begin().value());
|
if (map_names.count()) return (map_names.begin().value());
|
||||||
return (QString(""));
|
return (QString(""));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,12 @@
|
|||||||
|
|
||||||
#include <QtXml>
|
#include <QtXml>
|
||||||
/**
|
/**
|
||||||
|
This class represents a list of names, used by elements and categories
|
||||||
|
to embed the same name in several languages.
|
||||||
|
Languages are represented by two or five letters (typically the first
|
||||||
|
two of the system locale); examples: en for English, fr for French,
|
||||||
|
pt_BR for Brazilian Portuguese.
|
||||||
|
French:
|
||||||
Cette classe represente une liste de noms, utilisee
|
Cette classe represente une liste de noms, utilisee
|
||||||
par les elements et categories pour embarquer un meme nom en plusieurs
|
par les elements et categories pour embarquer un meme nom en plusieurs
|
||||||
langues.
|
langues.
|
||||||
@@ -36,7 +42,7 @@ class NamesList {
|
|||||||
|
|
||||||
// attributes
|
// attributes
|
||||||
private:
|
private:
|
||||||
QHash<QString, QString> hash_names;
|
QMap<QString, QString> map_names;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static int MetaTypeId;
|
static int MetaTypeId;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "terminalstripdrawer.h"
|
#include "terminalstripdrawer.h"
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include <QHash>
|
||||||
|
|
||||||
namespace TerminalStripDrawer {
|
namespace TerminalStripDrawer {
|
||||||
|
|
||||||
@@ -202,7 +203,7 @@ void TerminalStripDrawer::paint(QPainter *painter)
|
|||||||
painter->restore();
|
painter->restore();
|
||||||
|
|
||||||
//Draw the bridges
|
//Draw the bridges
|
||||||
for (const auto &points_ : qAsConst(bridges_anchor_points))
|
for (const auto &points_ : std::as_const(bridges_anchor_points))
|
||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
auto pen_{painter->pen()};
|
auto pen_{painter->pen()};
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ void RemoveTerminalFromStripCommand::redo()
|
|||||||
if (m_strip)
|
if (m_strip)
|
||||||
{
|
{
|
||||||
QVector<QSharedPointer<RealTerminal>> real_t;
|
QVector<QSharedPointer<RealTerminal>> real_t;
|
||||||
for (const auto &real_t_vector : qAsConst(m_terminals)) {
|
for (const auto &real_t_vector : std::as_const(m_terminals)) {
|
||||||
real_t.append(real_t_vector);
|
real_t.append(real_t_vector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ void UnGroupTerminalsCommand::undo()
|
|||||||
m_terminal_strip->groupTerminals(key, m_physical_real_H.value(key));
|
m_terminal_strip->groupTerminals(key, m_physical_real_H.value(key));
|
||||||
}
|
}
|
||||||
//Second, set level.
|
//Second, set level.
|
||||||
for (const auto &pair : qAsConst(m_real_t_level)) {
|
for (const auto &pair : std::as_const(m_real_t_level)) {
|
||||||
m_terminal_strip->setLevel(pair.first, pair.second);
|
m_terminal_strip->setLevel(pair.first, pair.second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ void UnGroupTerminalsCommand::redo()
|
|||||||
{
|
{
|
||||||
if (m_terminal_strip)
|
if (m_terminal_strip)
|
||||||
{
|
{
|
||||||
for (const auto &value : qAsConst(m_physical_real_H)) {
|
for (const auto &value : std::as_const(m_physical_real_H)) {
|
||||||
m_terminal_strip->unGroupTerminals(value);
|
m_terminal_strip->unGroupTerminals(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ bool PhysicalTerminal::setLevelOf(const QSharedPointer<RealTerminal> &terminal,
|
|||||||
if (i >= 0)
|
if (i >= 0)
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
|
#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
|
||||||
m_real_terminal.swapItemsAt(i, std::min(level, m_real_terminal.size()-1));
|
m_real_terminal.swapItemsAt(i, std::min((qsizetype)level, m_real_terminal.size()-1));
|
||||||
#else
|
#else
|
||||||
auto j = std::min(level, m_real_terminal.size()-1);
|
auto j = std::min(level, m_real_terminal.size()-1);
|
||||||
std::swap(m_real_terminal.begin()[i], m_real_terminal.begin()[j]);
|
std::swap(m_real_terminal.begin()[i], m_real_terminal.begin()[j]);
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ bool TerminalStrip::addTerminal(Element *terminal)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (terminal->elementData().m_type != ElementData::Terminale) {
|
if (terminal->elementData().m_type != ElementData::Terminal) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -466,7 +466,7 @@ QSharedPointer<RealTerminal> TerminalStrip::realTerminalForUuid(const QUuid &uui
|
|||||||
QVector<QSharedPointer<RealTerminal>> TerminalStrip::realTerminals() const
|
QVector<QSharedPointer<RealTerminal>> TerminalStrip::realTerminals() const
|
||||||
{
|
{
|
||||||
QVector<QSharedPointer<RealTerminal>> vector_;
|
QVector<QSharedPointer<RealTerminal>> vector_;
|
||||||
for (const auto &phy : qAsConst(m_physical_terminals)) {
|
for (const auto &phy : std::as_const(m_physical_terminals)) {
|
||||||
vector_.append(phy->realTerminals());
|
vector_.append(phy->realTerminals());
|
||||||
}
|
}
|
||||||
return vector_;
|
return vector_;
|
||||||
@@ -639,7 +639,7 @@ bool TerminalStrip::isBridgeable(const QVector<QSharedPointer<RealTerminal>> &re
|
|||||||
// Get the physical terminal and pos
|
// Get the physical terminal and pos
|
||||||
auto first_physical_terminal = first_real_terminal->physicalTerminal();
|
auto first_physical_terminal = first_real_terminal->physicalTerminal();
|
||||||
QVector<shared_physical_terminal> physical_vector{first_physical_terminal};
|
QVector<shared_physical_terminal> physical_vector{first_physical_terminal};
|
||||||
QVector<int> pos_vector{m_physical_terminals.indexOf(first_physical_terminal)};
|
QVector<qsizetype> pos_vector{m_physical_terminals.indexOf(first_physical_terminal)};
|
||||||
|
|
||||||
auto bridge_ = isBridged(first_real_terminal);
|
auto bridge_ = isBridged(first_real_terminal);
|
||||||
//bool to know at the end of this function if at least one terminal is not bridged
|
//bool to know at the end of this function if at least one terminal is not bridged
|
||||||
@@ -856,7 +856,7 @@ QSharedPointer<TerminalStripBridge> TerminalStrip::isBridged(const QSharedPointe
|
|||||||
{
|
{
|
||||||
if (real_terminal)
|
if (real_terminal)
|
||||||
{
|
{
|
||||||
for (const auto &bridge_ : qAsConst(m_bridge)) {
|
for (const auto &bridge_ : std::as_const(m_bridge)) {
|
||||||
if (bridge_->realTerminals().contains(real_terminal))
|
if (bridge_->realTerminals().contains(real_terminal))
|
||||||
return bridge_;
|
return bridge_;
|
||||||
}
|
}
|
||||||
@@ -983,7 +983,7 @@ QDomElement TerminalStrip::toXml(QDomDocument &parent_document)
|
|||||||
}
|
}
|
||||||
root_elmt.appendChild(xml_layout);
|
root_elmt.appendChild(xml_layout);
|
||||||
|
|
||||||
for (const auto &bridge_ : qAsConst(m_bridge)) {
|
for (const auto &bridge_ : std::as_const(m_bridge)) {
|
||||||
root_elmt.appendChild(bridge_->toXml(parent_document));
|
root_elmt.appendChild(bridge_->toXml(parent_document));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1024,7 +1024,7 @@ bool TerminalStrip::fromXml(QDomElement &xml_element)
|
|||||||
for (auto &xml_real : QETXML::findInDomElement(xml_physical, RealTerminal::xmlTagName()))
|
for (auto &xml_real : QETXML::findInDomElement(xml_physical, RealTerminal::xmlTagName()))
|
||||||
{
|
{
|
||||||
const auto uuid_ = QUuid(xml_real.attribute(QStringLiteral("element_uuid")));
|
const auto uuid_ = QUuid(xml_real.attribute(QStringLiteral("element_uuid")));
|
||||||
for (auto terminal_elmt : qAsConst(free_terminals))
|
for (auto terminal_elmt : std::as_const(free_terminals))
|
||||||
{
|
{
|
||||||
if (terminal_elmt->uuid() == uuid_)
|
if (terminal_elmt->uuid() == uuid_)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ QDomElement TerminalStripBridge::toXml(QDomDocument &parent_document) const
|
|||||||
root_elmt.setAttribute(QStringLiteral("color"), m_color.name());
|
root_elmt.setAttribute(QStringLiteral("color"), m_color.name());
|
||||||
|
|
||||||
auto terminals_elmt = parent_document.createElement(QStringLiteral("real_terminals"));
|
auto terminals_elmt = parent_document.createElement(QStringLiteral("real_terminals"));
|
||||||
for (const auto &real_t : qAsConst(m_real_terminals))
|
for (const auto &real_t : std::as_const(m_real_terminals))
|
||||||
{
|
{
|
||||||
if (real_t)
|
if (real_t)
|
||||||
{
|
{
|
||||||
@@ -106,7 +106,7 @@ void TerminalStripBridge::fromXml(const QDomElement &dom_element)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_uuid = QUuid(dom_element.attribute(QStringLiteral("uuid"), m_uuid.toString()));
|
m_uuid = QUuid(dom_element.attribute(QStringLiteral("uuid"), m_uuid.toString()));
|
||||||
m_color.setNamedColor(dom_element.attribute(QStringLiteral("color")));
|
m_color = QColor::fromString(dom_element.attribute(QStringLiteral("color")));
|
||||||
|
|
||||||
const auto real_t_vector = QETXML::subChild(dom_element,
|
const auto real_t_vector = QETXML::subChild(dom_element,
|
||||||
QStringLiteral("real_terminals"),
|
QStringLiteral("real_terminals"),
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="12" column="1" colspan="2">
|
<item row="12" column="1" colspan="2">
|
||||||
<widget class="KColorCombo" name="m_bridge_color_cb"/>
|
<widget class="ColorComboBox" name="m_bridge_color_cb"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="label_6">
|
||||||
@@ -323,9 +323,9 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>KColorCombo</class>
|
<class>ColorComboBox</class>
|
||||||
<extends>QComboBox</extends>
|
<extends>QComboBox</extends>
|
||||||
<header>kcolorcombo.h</header>
|
<header>../../colorcombobox.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
|
|||||||
@@ -535,7 +535,7 @@ modelRealTerminalData TerminalStripModel::dataAtRow(int row) const
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto current_row = 0;
|
auto current_row = 0;
|
||||||
for (const auto &physical_data : qAsConst(m_physical_data))
|
for (const auto &physical_data : std::as_const(m_physical_data))
|
||||||
{
|
{
|
||||||
for (const auto &real_data : physical_data.real_data)
|
for (const auto &real_data : physical_data.real_data)
|
||||||
{
|
{
|
||||||
@@ -567,7 +567,7 @@ void TerminalStripModel::replaceDataAtRow(modelRealTerminalData data, int row)
|
|||||||
auto current_row = 0;
|
auto current_row = 0;
|
||||||
auto current_physical = 0;
|
auto current_physical = 0;
|
||||||
|
|
||||||
for (const auto &physical_data : qAsConst(m_physical_data))
|
for (const auto &physical_data : std::as_const(m_physical_data))
|
||||||
{
|
{
|
||||||
auto current_real = 0;
|
auto current_real = 0;
|
||||||
for (int i=0 ; i<physical_data.real_data.count() ; ++i)
|
for (int i=0 ; i<physical_data.real_data.count() ; ++i)
|
||||||
@@ -606,7 +606,7 @@ modelPhysicalTerminalData TerminalStripModel::physicalDataAtIndex(int index) con
|
|||||||
int current_phy = -1;
|
int current_phy = -1;
|
||||||
bool match_ = false;
|
bool match_ = false;
|
||||||
|
|
||||||
for (const auto &ptd_ : qAsConst(m_physical_data))
|
for (const auto &ptd_ : std::as_const(m_physical_data))
|
||||||
{
|
{
|
||||||
current_checked_index += ptd_.real_data.size();
|
current_checked_index += ptd_.real_data.size();
|
||||||
++current_phy;
|
++current_phy;
|
||||||
@@ -637,9 +637,9 @@ modelRealTerminalData TerminalStripModel::realDataAtIndex(int index) const
|
|||||||
|
|
||||||
int current_checked_index = -1;
|
int current_checked_index = -1;
|
||||||
|
|
||||||
for (const auto & ptd_ : qAsConst(m_physical_data))
|
for (const auto & ptd_ : std::as_const(m_physical_data))
|
||||||
{
|
{
|
||||||
for (const auto & rtd_ : qAsConst(ptd_.real_data)) {
|
for (const auto & rtd_ : std::as_const(ptd_.real_data)) {
|
||||||
++current_checked_index;
|
++current_checked_index;
|
||||||
if (current_checked_index == index) {
|
if (current_checked_index == index) {
|
||||||
return rtd_;
|
return rtd_;
|
||||||
|
|||||||
@@ -29,12 +29,12 @@
|
|||||||
#include "modelTerminalData.h"
|
#include "modelTerminalData.h"
|
||||||
|
|
||||||
//Code to use QColor as key for QHash
|
//Code to use QColor as key for QHash
|
||||||
inline uint qHash(const QColor &key, uint seed) {
|
inline size_t qHash(const QColor &key, size_t seed) {
|
||||||
return qHash(key.name(), seed);
|
return qHash(key.name(), seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
//needed to use QPointer<Element> as key of QHash
|
//needed to use QPointer<Element> as key of QHash
|
||||||
inline uint qHash(const QPointer<Element> &key, uint seed) {
|
inline size_t qHash(const QPointer<Element> &key, size_t seed) {
|
||||||
if (key)
|
if (key)
|
||||||
return qHash(key->uuid(), seed);
|
return qHash(key->uuid(), seed);
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ void TerminalStripTreeDockWidget::reload()
|
|||||||
m_uuid_terminal_H.clear();
|
m_uuid_terminal_H.clear();
|
||||||
m_uuid_strip_H.clear();
|
m_uuid_strip_H.clear();
|
||||||
|
|
||||||
for (const auto &connection_ : qAsConst(m_strip_changed_connection)) {
|
for (const auto &connection_ : std::as_const(m_strip_changed_connection)) {
|
||||||
disconnect(connection_);
|
disconnect(connection_);
|
||||||
}
|
}
|
||||||
m_strip_changed_connection.clear();
|
m_strip_changed_connection.clear();
|
||||||
@@ -222,7 +222,7 @@ void TerminalStripTreeDockWidget::buildTree()
|
|||||||
return a->name() < b->name();
|
return a->name() < b->name();
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const auto &ts : qAsConst(ts_vector)) {
|
for (const auto &ts : std::as_const(ts_vector)) {
|
||||||
addTerminalStrip(ts);
|
addTerminalStrip(ts);
|
||||||
}
|
}
|
||||||
addFreeTerminal();
|
addFreeTerminal();
|
||||||
@@ -324,7 +324,7 @@ void TerminalStripTreeDockWidget::addFreeTerminal()
|
|||||||
|
|
||||||
auto free_terminal_item = ui->m_tree_view->topLevelItem(1);
|
auto free_terminal_item = ui->m_tree_view->topLevelItem(1);
|
||||||
|
|
||||||
for (const auto terminal : qAsConst(vector_))
|
for (const auto terminal : std::as_const(vector_))
|
||||||
{
|
{
|
||||||
QUuid uuid_ = terminal->uuid();
|
QUuid uuid_ = terminal->uuid();
|
||||||
QStringList strl{terminal->actualLabel()};
|
QStringList strl{terminal->actualLabel()};
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include "../diagram.h"
|
#include "../diagram.h"
|
||||||
#include "../diagramposition.h"
|
#include "../diagramposition.h"
|
||||||
#include "../qetapp.h"
|
#include "../qetapp.h"
|
||||||
|
#include "../qetgraphicsitem/conductor.h"
|
||||||
#include "../qetgraphicsitem/element.h"
|
#include "../qetgraphicsitem/element.h"
|
||||||
#include "../qetxml.h"
|
#include "../qetxml.h"
|
||||||
|
|
||||||
@@ -189,12 +190,14 @@ namespace autonum
|
|||||||
QString AssignVariables::formulaToLabel(QString formula,
|
QString AssignVariables::formulaToLabel(QString formula,
|
||||||
sequentialNumbers &seqStruct,
|
sequentialNumbers &seqStruct,
|
||||||
Diagram *diagram,
|
Diagram *diagram,
|
||||||
const Element *elmt)
|
const Element *elmt,
|
||||||
|
const Conductor *cndr)
|
||||||
{
|
{
|
||||||
AssignVariables av(std::move(formula),
|
AssignVariables av(std::move(formula),
|
||||||
seqStruct,
|
seqStruct,
|
||||||
diagram,
|
diagram,
|
||||||
elmt);
|
elmt,
|
||||||
|
cndr);
|
||||||
seqStruct = av.m_seq_struct;
|
seqStruct = av.m_seq_struct;
|
||||||
return av.m_assigned_label;
|
return av.m_assigned_label;
|
||||||
}
|
}
|
||||||
@@ -301,13 +304,14 @@ namespace autonum
|
|||||||
AssignVariables::AssignVariables(const QString& formula,
|
AssignVariables::AssignVariables(const QString& formula,
|
||||||
const sequentialNumbers& seqStruct,
|
const sequentialNumbers& seqStruct,
|
||||||
Diagram *diagram,
|
Diagram *diagram,
|
||||||
const Element *elmt):
|
const Element *elmt,
|
||||||
|
const Conductor *cndr):
|
||||||
m_diagram(diagram),
|
m_diagram(diagram),
|
||||||
m_arg_formula(formula),
|
m_arg_formula(formula),
|
||||||
m_assigned_label(formula),
|
m_assigned_label(formula),
|
||||||
m_seq_struct(seqStruct),
|
m_seq_struct(seqStruct),
|
||||||
m_element(elmt)
|
m_element(elmt),
|
||||||
|
m_conductor(cndr)
|
||||||
{
|
{
|
||||||
if (m_diagram)
|
if (m_diagram)
|
||||||
{
|
{
|
||||||
@@ -349,6 +353,14 @@ namespace autonum
|
|||||||
m_assigned_label.replace("%prefix", m_element->getPrefix());
|
m_assigned_label.replace("%prefix", m_element->getPrefix());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_conductor)
|
||||||
|
{
|
||||||
|
m_assigned_label.replace("%wf", cndr->properties().m_function);
|
||||||
|
m_assigned_label.replace("%wv", cndr->properties().m_tension_protocol);
|
||||||
|
m_assigned_label.replace("%wc", cndr->properties().m_wire_color);
|
||||||
|
m_assigned_label.replace("%ws", cndr->properties().m_wire_section);
|
||||||
|
}
|
||||||
|
|
||||||
assignTitleBlockVar();
|
assignTitleBlockVar();
|
||||||
assignProjectVar();
|
assignProjectVar();
|
||||||
assignSequence();
|
assignSequence();
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
|
class Conductor;
|
||||||
class Diagram;
|
class Diagram;
|
||||||
class Element;
|
class Element;
|
||||||
class ElementsLocation;
|
class ElementsLocation;
|
||||||
@@ -61,12 +62,12 @@ namespace autonum
|
|||||||
class AssignVariables
|
class AssignVariables
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static QString formulaToLabel (QString formula, sequentialNumbers &seqStruct, Diagram *diagram, const Element *elmt = nullptr);
|
static QString formulaToLabel (QString formula, sequentialNumbers &seqStruct, Diagram *diagram, const Element *elmt = nullptr, const Conductor *cndr = nullptr);
|
||||||
static QString replaceVariable (const QString &formula, const DiagramContext &dc);
|
static QString replaceVariable (const QString &formula, const DiagramContext &dc);
|
||||||
static QString genericXref (const Element *element);
|
static QString genericXref (const Element *element);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AssignVariables(const QString& formula, const sequentialNumbers& seqStruct , Diagram *diagram, const Element *elmt = nullptr);
|
AssignVariables(const QString& formula, const sequentialNumbers& seqStruct , Diagram *diagram, const Element *elmt = nullptr, const Conductor *cndr = nullptr);
|
||||||
void assignTitleBlockVar();
|
void assignTitleBlockVar();
|
||||||
void assignProjectVar();
|
void assignProjectVar();
|
||||||
void assignSequence();
|
void assignSequence();
|
||||||
@@ -76,6 +77,7 @@ namespace autonum
|
|||||||
QString m_assigned_label;
|
QString m_assigned_label;
|
||||||
sequentialNumbers m_seq_struct;
|
sequentialNumbers m_seq_struct;
|
||||||
const Element *m_element = nullptr;
|
const Element *m_element = nullptr;
|
||||||
|
const Conductor *m_conductor = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
void setSequentialToList(QStringList &list, NumerotationContext &nc, const QString& type);
|
void setSequentialToList(QStringList &list, NumerotationContext &nc, const QString& type);
|
||||||
|
|||||||
@@ -57,9 +57,9 @@ bool NumerotationContext::addValue(const QString &type,
|
|||||||
const QVariant &value,
|
const QVariant &value,
|
||||||
const int increase,
|
const int increase,
|
||||||
const int initialvalue) {
|
const int initialvalue) {
|
||||||
if (!keyIsAcceptable(type) && !value.canConvert(QVariant::String))
|
if (!keyIsAcceptable(type) && !value.canConvert<QString>())
|
||||||
return false;
|
return false;
|
||||||
if (keyIsNumber(type) && !value.canConvert(QVariant::Int))
|
if (keyIsNumber(type) && !value.canConvert<int>())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QString valuestr = value.toString();
|
QString valuestr = value.toString();
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ void AutoNumberingDockWidget::setProject(QETProject *project,
|
|||||||
//Set Combobox Context
|
//Set Combobox Context
|
||||||
setContext();
|
setContext();
|
||||||
|
|
||||||
ui->m_configure_pb->setShortcut(QKeySequence( tr("Ctrl+Shift+P")));
|
ui->m_configure_pb->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_P);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -55,11 +55,8 @@ BorderTitleBlock::BorderTitleBlock(QObject *parent) :
|
|||||||
m_titleblock_template_renderer = new TitleBlockTemplateRenderer(this);
|
m_titleblock_template_renderer = new TitleBlockTemplateRenderer(this);
|
||||||
m_titleblock_template_renderer -> setTitleBlockTemplate(QETApp::defaultTitleBlockTemplate());
|
m_titleblock_template_renderer -> setTitleBlockTemplate(QETApp::defaultTitleBlockTemplate());
|
||||||
|
|
||||||
// disable the QPicture-based cache from Qt 4.8 to avoid rendering errors and crashes
|
// disable the QPicture-based cache to avoid rendering errors and crashes
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(4, 8, 0) // ### Qt 6: remove
|
|
||||||
#else
|
|
||||||
m_titleblock_template_renderer -> setUseCache(false);
|
m_titleblock_template_renderer -> setUseCache(false);
|
||||||
#endif
|
|
||||||
|
|
||||||
// dimensions par defaut du schema
|
// dimensions par defaut du schema
|
||||||
importBorder(BorderProperties());
|
importBorder(BorderProperties());
|
||||||
@@ -239,7 +236,8 @@ void BorderTitleBlock::borderToXml(QDomElement &xml_elmt) {
|
|||||||
xml_elmt.setAttribute("displayrows", rowsAreDisplayed() ? "true" : "false");
|
xml_elmt.setAttribute("displayrows", rowsAreDisplayed() ? "true" : "false");
|
||||||
|
|
||||||
// attribut datant de la version 0.1 - laisse pour retrocompatibilite
|
// attribut datant de la version 0.1 - laisse pour retrocompatibilite
|
||||||
xml_elmt.setAttribute("height", QString("%1").arg(diagramHeight()));
|
// attribute from version 0.1 - leave for backwards-compatibility
|
||||||
|
xml_elmt.setAttribute("height", QString("%1").arg(diagramHeight()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -941,22 +939,15 @@ QString BorderTitleBlock::incrementLetters(const QString &string) {
|
|||||||
} else {
|
} else {
|
||||||
// separate previous digits from last digit
|
// separate previous digits from last digit
|
||||||
// separe les digits precedents du dernier digit
|
// separe les digits precedents du dernier digit
|
||||||
QString first_digits(string.left(string.count() - 1));
|
QString first_digits(string.left(string.length() - 1));
|
||||||
QChar last_digit(string.at(string.count() - 1));
|
char last_digit(string.at(string.length() - 1).unicode());
|
||||||
if (last_digit != 'Z') {
|
if (last_digit != 'Z') {
|
||||||
// increments the last digit
|
// increments the last digit
|
||||||
// incremente le dernier digit
|
// incremente le dernier digit
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
last_digit = (char)(string[string.length()-1].unicode()) + 1;
|
||||||
last_digit = last_digit.toLatin1() + 1;
|
|
||||||
#else
|
|
||||||
# if TODO_LIST
|
|
||||||
# pragma message("@TODO remove code for QT 6 or later")
|
|
||||||
# endif
|
|
||||||
qDebug() << "Help code for QT 6 or later";
|
|
||||||
#endif
|
|
||||||
return(first_digits + QString(last_digit));
|
return(first_digits + QString(last_digit));
|
||||||
} else {
|
} else {
|
||||||
return(incrementLetters(first_digits) + "A");
|
return(incrementLetters(first_digits) % "A");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,90 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2006-2025 The QElectroTech Team
|
||||||
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include "colorbutton.h"
|
||||||
|
|
||||||
|
#include <QColorDialog>
|
||||||
|
#include <QPainter>
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief ColorButton::ColorButton
|
||||||
|
Simple constructor
|
||||||
|
@param parent QObject parent of the ColorButton
|
||||||
|
*/
|
||||||
|
ColorButton::ColorButton(QWidget *parent) : QPushButton(parent)
|
||||||
|
{
|
||||||
|
connect(this, &QPushButton::clicked, this, &ColorButton::clicked);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Getter for current color
|
||||||
|
@return The current selected color
|
||||||
|
*/
|
||||||
|
const QColor ColorButton::color()
|
||||||
|
{
|
||||||
|
return m_color;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Setter for current color
|
||||||
|
*/
|
||||||
|
void ColorButton::setColor(const QColor &color)
|
||||||
|
{
|
||||||
|
m_color = color;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief ColorButton::clicked
|
||||||
|
Opens a color selection dialog and lets the user select a color.
|
||||||
|
@param checked Not used
|
||||||
|
*/
|
||||||
|
void ColorButton::clicked(bool checked)
|
||||||
|
{
|
||||||
|
// Open color selection dialog
|
||||||
|
auto new_color = QColorDialog::getColor(m_color, this, tr("Select color"), QColorDialog::DontUseNativeDialog);
|
||||||
|
|
||||||
|
// Validate user input
|
||||||
|
if (new_color.isValid()) {
|
||||||
|
m_color = new_color;
|
||||||
|
emit changed(new_color);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief ColorButton::paintEvent
|
||||||
|
Paints a filled rectangle with the current selected color on the button surface.
|
||||||
|
@param e Paint event context
|
||||||
|
*/
|
||||||
|
void ColorButton::paintEvent(QPaintEvent *e) {
|
||||||
|
QPushButton::paintEvent(e);
|
||||||
|
|
||||||
|
// Padding for the color indicator
|
||||||
|
const int padding_x = 5;
|
||||||
|
const int padding_y = 5;
|
||||||
|
|
||||||
|
QPainter painter(this);
|
||||||
|
|
||||||
|
// Get dimensions of the button paint surface
|
||||||
|
auto r_width = painter.device()->width();
|
||||||
|
auto r_height = painter.device()->height();
|
||||||
|
|
||||||
|
// Paint a rectangle with a margin of 5
|
||||||
|
auto color_indicator = QRect(padding_x, padding_y, r_width - padding_x * 2, r_height - padding_y * 2);
|
||||||
|
painter.fillRect(color_indicator, m_color);
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2006-2025 The QElectroTech Team
|
||||||
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef COLORBUTTON_H
|
||||||
|
#define COLORBUTTON_H
|
||||||
|
|
||||||
|
#include <QColor>
|
||||||
|
#include <QObject>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <Qt>
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief The ColorButton class
|
||||||
|
*/
|
||||||
|
class ColorButton : public QPushButton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
ColorButton(QWidget * = nullptr);
|
||||||
|
|
||||||
|
const QColor color();
|
||||||
|
void setColor(const QColor &);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void clicked(bool = false);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void paintEvent(QPaintEvent *) override;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void changed(const QColor &);
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// @brief Current selected color
|
||||||
|
QColor m_color = Qt::black;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2006-2025 The QElectroTech Team
|
||||||
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include "colorcombobox.h"
|
||||||
|
|
||||||
|
#include "colorcomboboxdelegate.h"
|
||||||
|
|
||||||
|
#include <QColorDialog>
|
||||||
|
#include <QPainter>
|
||||||
|
#include <QStylePainter>
|
||||||
|
#include <Qt>
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief ColorComboBox::ColorComboBox
|
||||||
|
Simple constructor
|
||||||
|
@param parent QObject parent of the ColorComboBox
|
||||||
|
*/
|
||||||
|
ColorComboBox::ColorComboBox(QWidget *parent) : QComboBox(parent)
|
||||||
|
{
|
||||||
|
connect(this, &QComboBox::activated, this, &ColorComboBox::colorSelected);
|
||||||
|
setItemDelegate(new ColorComboBoxDelegate());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief ColorComboBox::setColors
|
||||||
|
Sets the colors of the combo box. An item at the top will be added to allow selection
|
||||||
|
of a custom color.
|
||||||
|
@param colors Vector of colors to add to the combo box
|
||||||
|
*/
|
||||||
|
void ColorComboBox::setColors(const QVector<QColor> &colors)
|
||||||
|
{
|
||||||
|
addItem(tr("[Custom color...]"), QColor(Qt::black));
|
||||||
|
for(auto &color : colors) {
|
||||||
|
addItem(color.name(), color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief ColorComboBox::colorSelected
|
||||||
|
Opens a color selection dialog and lets the user select a color.
|
||||||
|
@param checked Not used
|
||||||
|
*/
|
||||||
|
void ColorComboBox::colorSelected(int index)
|
||||||
|
{
|
||||||
|
if (index == 0) {
|
||||||
|
// Open color selection dialog if custom color is selected
|
||||||
|
auto new_color = QColorDialog::getColor(itemData(index).value<QColor>(), this, tr("Select color"), QColorDialog::DontUseNativeDialog);
|
||||||
|
|
||||||
|
// Validate and emit user input color
|
||||||
|
if (new_color.isValid()) {
|
||||||
|
setItemData(index, new_color);
|
||||||
|
emit activated(new_color);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Emit color from selected combo box row
|
||||||
|
emit activated(itemData(index).value<QColor>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief ColorComboBox::paintEvent
|
||||||
|
Paints a filled rectangle with the current selected color on the combo box surface.
|
||||||
|
@param e Paint event context
|
||||||
|
*/
|
||||||
|
void ColorComboBox::paintEvent(QPaintEvent *e) {
|
||||||
|
// Padding for the color indicator
|
||||||
|
const int padding_x = 5;
|
||||||
|
const int padding_y = 5;
|
||||||
|
|
||||||
|
// Create painter and draw a vanilla combobox
|
||||||
|
QStylePainter painter(this);
|
||||||
|
QStyleOptionComboBox opt;
|
||||||
|
initStyleOption(&opt);
|
||||||
|
painter.drawComplexControl(QStyle::CC_ComboBox, opt);
|
||||||
|
|
||||||
|
// Get dimensions of the combo box paint surface
|
||||||
|
auto r_width = painter.device()->width();
|
||||||
|
auto r_height = painter.device()->height();
|
||||||
|
|
||||||
|
// Paint a rectangle with a margin
|
||||||
|
auto color_indicator = QRect(padding_x, padding_y, r_width - padding_x * 2, r_height - padding_y * 2);
|
||||||
|
painter.fillRect(color_indicator, itemData(currentIndex()).value<QColor>());
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2006-2025 The QElectroTech Team
|
||||||
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef COLORCOMBOBOX_H
|
||||||
|
#define COLORCOMBOBOX_H
|
||||||
|
|
||||||
|
#include <QColor>
|
||||||
|
#include <QObject>
|
||||||
|
#include <QComboBox>
|
||||||
|
#include <QVector>
|
||||||
|
#include <Qt>
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief The ColorComboBox class
|
||||||
|
*/
|
||||||
|
class ColorComboBox : public QComboBox
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
ColorComboBox(QWidget * = nullptr);
|
||||||
|
|
||||||
|
void setColors(const QVector<QColor> &);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void colorSelected(int);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void paintEvent(QPaintEvent *) override;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void activated(const QColor &);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2006-2025 The QElectroTech Team
|
||||||
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include "colorcomboboxdelegate.h"
|
||||||
|
|
||||||
|
#include <QColor>
|
||||||
|
#include <QPainter>
|
||||||
|
#include <QPalette>
|
||||||
|
#include <QtDebug>
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief ColorComboBoxDelegate::paint
|
||||||
|
Paints a filled rectangle on the drop down item with the items color.
|
||||||
|
@param painter Painter context
|
||||||
|
@param option Style options
|
||||||
|
@param index Index of the item to paint
|
||||||
|
|
||||||
|
*/
|
||||||
|
void ColorComboBoxDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||||
|
{
|
||||||
|
// Padding for the color indicator
|
||||||
|
const int padding_x = 5;
|
||||||
|
const int padding_y = 2;
|
||||||
|
|
||||||
|
painter->save();
|
||||||
|
|
||||||
|
if (index.row() > 0)
|
||||||
|
{
|
||||||
|
auto rect = option.rect;
|
||||||
|
|
||||||
|
// Draw mouseover background
|
||||||
|
if (option.state & QStyle::State_MouseOver)
|
||||||
|
{
|
||||||
|
auto pal = option.widget->palette();
|
||||||
|
painter->fillRect(rect, pal.color(QPalette::Highlight));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw color indicator rectangle
|
||||||
|
auto color = qvariant_cast<QColor>(index.data());
|
||||||
|
rect.adjust(padding_x, padding_y, -padding_x, -padding_y);
|
||||||
|
painter->fillRect(rect, color);
|
||||||
|
} else {
|
||||||
|
// Draw a normal drop down item for custom color
|
||||||
|
QStyledItemDelegate::paint(painter, option, index);
|
||||||
|
}
|
||||||
|
|
||||||
|
painter->restore();
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2006-2025 The QElectroTech Team
|
||||||
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef COLORCOMBOBOXDELEGATE_H
|
||||||
|
#define COLORCOMBOBOXDELEGATE_H
|
||||||
|
|
||||||
|
#include <QStyledItemDelegate>
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief The ColorComboBoxDelegate class
|
||||||
|
Handles drawing of items in the drop down list of ColorComboBox.
|
||||||
|
*/
|
||||||
|
class ColorComboBoxDelegate : public QStyledItemDelegate
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -72,14 +72,7 @@ bool ConductorNumExport::toCsv()
|
|||||||
if (file.open(QIODevice::WriteOnly | QIODevice::Text))
|
if (file.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||||
{
|
{
|
||||||
QTextStream stream(&file);
|
QTextStream stream(&file);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove
|
|
||||||
stream << wiresNum() << endl;
|
|
||||||
#else
|
|
||||||
#if TODO_LIST
|
|
||||||
#pragma message("@TODO remove code for QT 5.15 or later")
|
|
||||||
#endif
|
|
||||||
stream << wiresNum() << &Qt::endl(stream);
|
stream << wiresNum() << &Qt::endl(stream);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user