Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e6d29cf345 | |||
| f16cf7dac8 | |||
| 2d4f968348 | |||
| 6f669e1074 | |||
| 0b91318749 | |||
| 1ba97c7e92 | |||
| cd09fc0d32 | |||
| 924fe082fb | |||
| ad37b0f9a5 | |||
| fedc1cb092 | |||
| 5f318e09c8 | |||
| 27afeaefe2 | |||
| ab2f933fdf | |||
| 7f718f672f | |||
| 9ec02bc088 |
@@ -11,6 +11,7 @@ jobs:
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: ubuntu-latest
|
||||
if: github.ref == 'refs/heads/master'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
|
||||
@@ -2,7 +2,7 @@ name: Windows Build
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 2 1 * *' #
|
||||
- cron: '0 2 * * 1' # Every Monday at 2:00 UTC
|
||||
workflow_dispatch: # Manual trigger available at any time
|
||||
|
||||
concurrency:
|
||||
@@ -113,7 +113,7 @@ jobs:
|
||||
-DQt5_DIR=/ucrt64/lib/cmake/Qt5 \
|
||||
-DQT_VERSION_MAJOR=5 \
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_Qt6=ON \
|
||||
-DPACKAGE_TESTS=OFF \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0077=NEW \
|
||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
||||
-DCMAKE_CXX_FLAGS="-DQET_EXPORT_PROJECT_DB" \
|
||||
@@ -343,21 +343,21 @@ jobs:
|
||||
with:
|
||||
name: qelectrotech-${{ steps.qet_version.outputs.base_version }}+git${{ steps.qet_version.outputs.head }}-x86-win64-readytouse
|
||||
path: dist/${{ steps.zip_portable.outputs.zip_name }}
|
||||
retention-days: 40
|
||||
retention-days: 14
|
||||
|
||||
- name: Upload NSIS installer
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: qelectrotech-windows-installer
|
||||
path: dist/Installer_*.exe
|
||||
retention-days: 40
|
||||
retention-days: 14
|
||||
|
||||
- name: Upload portable (nom fixe pour le workflow MSI)
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: qelectrotech-windows-portable
|
||||
path: nsis_root/files/
|
||||
retention-days: 40
|
||||
retention-days: 14
|
||||
|
||||
# =============================================================================
|
||||
# Job 2: Qt6 build (EXPERIMENTAL track)
|
||||
@@ -397,9 +397,6 @@ jobs:
|
||||
mingw-w64-ucrt-x86_64-qt6-pdf
|
||||
mingw-w64-ucrt-x86_64-sqlite3
|
||||
mingw-w64-ucrt-x86_64-pkg-config
|
||||
mingw-w64-ucrt-x86_64-kwidgetsaddons
|
||||
mingw-w64-ucrt-x86_64-kcoreaddons
|
||||
mingw-w64-ucrt-x86_64-extra-cmake-modules
|
||||
mingw-w64-ucrt-x86_64-nsis
|
||||
mingw-w64-ucrt-x86_64-angleproject
|
||||
|
||||
@@ -459,8 +456,7 @@ jobs:
|
||||
-DCMAKE_PREFIX_PATH=/ucrt64 \
|
||||
-DQt6_DIR=/ucrt64/lib/cmake/Qt6 \
|
||||
-DQT_VERSION_MAJOR=6 \
|
||||
-DBUILD_WITH_KF=ON \
|
||||
-DBUILD_KF=OFF \
|
||||
-DBUILD_WITH_KF5=OFF \
|
||||
-DPACKAGE_TESTS=OFF \
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0077=NEW \
|
||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
||||
@@ -691,21 +687,21 @@ jobs:
|
||||
with:
|
||||
name: qelectrotech-${{ steps.qet_version.outputs.base_version }}+git${{ steps.qet_version.outputs.head }}-x86-win64-readytouse
|
||||
path: dist/${{ steps.zip_portable.outputs.zip_name }}
|
||||
retention-days: 40
|
||||
retention-days: 14
|
||||
|
||||
- name: Upload NSIS installer
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: qelectrotech-windows-installer-qt6
|
||||
path: dist/Installer_*.exe
|
||||
retention-days: 40
|
||||
retention-days: 14
|
||||
|
||||
- name: Upload portable (nom fixe pour le workflow MSI)
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: qelectrotech-windows-portable-qt6
|
||||
path: nsis_root/files/
|
||||
retention-days: 40
|
||||
retention-days: 14
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Job 3 : Publie les assets nightly (exe + zip, Qt5 et Qt6) sur la release
|
||||
|
||||
@@ -311,7 +311,7 @@ jobs:
|
||||
with:
|
||||
name: qelectrotech-windows-msi-${{ matrix.flavor }}
|
||||
path: dist\*.msi
|
||||
retention-days: 40
|
||||
retention-days: 14
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Delete old nightly .msi asset for this flavor
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
[submodule "pugixml"]
|
||||
path = pugixml
|
||||
url = https://github.com/zeux/pugixml.git
|
||||
[submodule "SingleApplication"]
|
||||
path = SingleApplication
|
||||
url = https://github.com/itay-grudev/SingleApplication.git
|
||||
[submodule "elements"]
|
||||
path = elements
|
||||
url = https://github.com/qelectrotech/qelectrotech-elements.git
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
include(cmake/hoto_update_cmake_message.cmake)
|
||||
|
||||
cmake_minimum_required(VERSION 3.5...4.2)
|
||||
|
||||
project(qelectrotech
|
||||
@@ -27,6 +25,13 @@ project(qelectrotech
|
||||
include(cmake/copyright_message.cmake)
|
||||
|
||||
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()
|
||||
|
||||
# QT_VERSION_MAJOR is chosen explicitly by whoever configures the build,
|
||||
# via -DQT_VERSION_MAJOR=5 or -DQT_VERSION_MAJOR=6.
|
||||
@@ -36,7 +41,7 @@ set(QET_DIR ${PROJECT_SOURCE_DIR})
|
||||
# includes below, so every subdirectory and every FetchContent dependency
|
||||
# sees a consistent, already-defined value.
|
||||
if(NOT DEFINED QT_VERSION_MAJOR)
|
||||
set(QT_VERSION_MAJOR 5)
|
||||
set(QT_VERSION_MAJOR 6)
|
||||
endif()
|
||||
|
||||
# Some third-party CMake projects we pull in via FetchContent (e.g.
|
||||
@@ -48,17 +53,24 @@ endif()
|
||||
# INTERFACE_QT_MAJOR_VERSION mismatch at generate time.
|
||||
set(QT_DEFAULT_MAJOR_VERSION ${QT_VERSION_MAJOR} CACHE STRING "Qt version to use (5 or 6)" FORCE)
|
||||
|
||||
# Add sub directories
|
||||
option(PACKAGE_TESTS "Build the tests" NO)
|
||||
if(PACKAGE_TESTS)
|
||||
message("Add sub directory tests")
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
include(cmake/paths_compilation_installation.cmake)
|
||||
include(cmake/start_options.cmake)
|
||||
include(cmake/developer_options.cmake)
|
||||
include(cmake/git_update_submodules.cmake)
|
||||
include(cmake/git_last_commit_sha.cmake)
|
||||
include(cmake/fetch_kdeaddons.cmake)
|
||||
include(cmake/fetch_singleapplication.cmake)
|
||||
include(cmake/fetch_pugixml.cmake)
|
||||
include(cmake/qet_compilation_vars.cmake)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
SET(CMAKE_CXX_STANDARD 17)
|
||||
@@ -70,23 +82,12 @@ find_package(
|
||||
${QET_COMPONENTS}
|
||||
REQUIRED)
|
||||
|
||||
# <private/qpdf_p.h> (QPdfEngine::drawHyperlink) needs Qt's private GUI module.
|
||||
# Qt >= 6.7 ships it as a proper find_package component, but some distro
|
||||
# packages (e.g. Ubuntu's qt6-base-private-dev) omit Qt6GuiPrivateConfig.cmake
|
||||
# and only provide the implicit Qt6::GuiPrivate target created alongside
|
||||
# Qt6::Gui. Try the component quietly, then verify the target below so a
|
||||
# missing private-headers package fails here instead of at compile time.
|
||||
# Qt5 has no such component as its GuiPrivate target always exists once Gui is found.
|
||||
if(QT_VERSION_MAJOR GREATER_EQUAL 6)
|
||||
find_package(Qt6 QUIET COMPONENTS GuiPrivate)
|
||||
endif()
|
||||
|
||||
if(QT_VERSION_MAJOR GREATER_EQUAL 6 AND NOT TARGET Qt6::GuiPrivate)
|
||||
message(FATAL_ERROR
|
||||
"Qt6::GuiPrivate was not found. It is required for PDF hyperlink "
|
||||
"support (<private/qpdf_p.h>). Install the Qt6 private headers "
|
||||
"(e.g. 'qt6-base-private-dev' on Debian/Ubuntu) or use a Qt build "
|
||||
"that provides the GuiPrivate component.")
|
||||
# Qt6 only creates the Qt::GuiPrivate target (used for QPdfEngine::drawHyperlink)
|
||||
# when the GuiPrivate component is explicitly requested. Qt5 has no such
|
||||
# component package and creates the target implicitly with Gui, so only
|
||||
# request it on Qt6 - requesting it on Qt5 fails the whole configure.
|
||||
if(QT_VERSION_MAJOR GREATER_EQUAL 5)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS GuiPrivate)
|
||||
endif()
|
||||
|
||||
find_package(SQLite3 REQUIRED)
|
||||
@@ -103,215 +104,94 @@ endif()
|
||||
|
||||
set(CMAKE_AUTOUIC_SEARCH_PATHS ${QET_DIR}/sources/ui)
|
||||
|
||||
if(QT_VERSION_MAJOR EQUAL 6)
|
||||
set(KF_MAJOR_VERSION 6)
|
||||
else()
|
||||
set(KF_MAJOR_VERSION 5)
|
||||
endif()
|
||||
include(cmake/fetch_kdeaddons.cmake)
|
||||
|
||||
# Add sub directories
|
||||
option(PACKAGE_TESTS "Build the tests" ON)
|
||||
if(PACKAGE_TESTS)
|
||||
message("Add sub directory tests")
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
# als laatse
|
||||
include(cmake/define_definitions.cmake)
|
||||
|
||||
# On Windows, WIN32 sets /SUBSYSTEM:WINDOWS to suppress the console window.
|
||||
# Qt automatically links qtmain.lib which provides the WinMain entry point,
|
||||
# so no source code change is needed.
|
||||
if(WIN32)
|
||||
add_executable(
|
||||
${PROJECT_NAME}
|
||||
WIN32
|
||||
${QET_RES_FILES}
|
||||
${QET_SRC_FILES}
|
||||
${QM_FILES}
|
||||
${QET_DIR}/qelectrotech.qrc
|
||||
)
|
||||
else()
|
||||
add_executable(
|
||||
${PROJECT_NAME}
|
||||
${QET_RES_FILES}
|
||||
${QET_SRC_FILES}
|
||||
${QM_FILES}
|
||||
${QET_DIR}/qelectrotech.qrc
|
||||
)
|
||||
endif()
|
||||
|
||||
# The default build only compiles the tracked .ts files to .qm (lrelease).
|
||||
# Refreshing the .ts from the sources (lupdate) is a developer action behind
|
||||
# the explicit "update_translations" target below: running lupdate on every
|
||||
# build rewrote tracked files as a side effect, and under high parallelism
|
||||
# lupdate rewriting a .ts while lrelease read the same file made the build
|
||||
# fail with "Premature end of document".
|
||||
set_source_files_properties(
|
||||
${TS_FILES}
|
||||
PROPERTIES OUTPUT_LOCATION "${QET_DIR}/lang"
|
||||
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${QET_DIR}/lang")
|
||||
#if(QT_VERSION_MAJOR EQUAL 6)
|
||||
# qt6_add_translation(QM_FILES ${TS_FILES})
|
||||
#else()
|
||||
# qt5_add_translation(QM_FILES ${TS_FILES})
|
||||
#endif()
|
||||
|
||||
add_custom_target(update_translations
|
||||
COMMAND $<TARGET_FILE:Qt${QT_VERSION_MAJOR}::lupdate> ${CMAKE_SOURCE_DIR}/sources -ts ${TS_FILES}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMENT "Updating .ts files from sources/ (lupdate) - developer target, run explicitly"
|
||||
VERBATIM
|
||||
)
|
||||
if(QT_VERSION_MAJOR EQUAL 6)
|
||||
if(Qt6_VERSION VERSION_LESS "6.2")
|
||||
# Qt 6.0–6.1
|
||||
qt6_add_translation(QM_FILES ${TS_FILES})
|
||||
|
||||
# qt6_add_translation() only creates custom commands. Something must
|
||||
# depend on their outputs for them to run during the default build.
|
||||
add_custom_target(${PROJECT_NAME}_lrelease ALL
|
||||
DEPENDS ${QM_FILES}
|
||||
)
|
||||
include(cmake/define_definitions.cmake)
|
||||
|
||||
add_custom_target(update_translations
|
||||
COMMAND
|
||||
$<TARGET_FILE:Qt6::lupdate>
|
||||
"${CMAKE_SOURCE_DIR}/sources"
|
||||
-ts ${TS_FILES}
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
COMMENT
|
||||
"Updating .ts files from sources/ (lupdate) - developer target"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
elseif(Qt6_VERSION VERSION_LESS "6.7")
|
||||
# Qt 6.2–6.6: old target-based signature
|
||||
qt_add_lrelease(
|
||||
${PROJECT_NAME}
|
||||
TS_FILES ${TS_FILES}
|
||||
QM_FILES_OUTPUT_VARIABLE QM_FILES
|
||||
)
|
||||
|
||||
# Automatically creates the update_translations umbrella target.
|
||||
qt_add_lupdate(
|
||||
${PROJECT_NAME}
|
||||
TS_FILES ${TS_FILES}
|
||||
)
|
||||
|
||||
else()
|
||||
# Qt 6.7+: new signature
|
||||
qt_add_lrelease(
|
||||
TS_FILES ${TS_FILES}
|
||||
LRELEASE_TARGET ${PROJECT_NAME}_lrelease
|
||||
QM_FILES_OUTPUT_VARIABLE QM_FILES
|
||||
)
|
||||
|
||||
qt_add_lupdate(
|
||||
SOURCE_TARGETS ${PROJECT_NAME}
|
||||
TS_FILES ${TS_FILES}
|
||||
LUPDATE_TARGET update_translations
|
||||
NO_GLOBAL_TARGET
|
||||
)
|
||||
endif()
|
||||
qt_add_executable(
|
||||
${PROJECT_NAME}
|
||||
${QET_RES_FILES}
|
||||
${QET_SRC_FILES}
|
||||
${QM_FILES}
|
||||
${QET_DIR}/qelectrotech.qrc
|
||||
)
|
||||
|
||||
if(QMFILES_AS_RESOURCE)
|
||||
qt_add_translations(${PROJECT_NAME} TS_FILES ${TS_FILES} RESOURCE_PREFIX "/lang")
|
||||
else()
|
||||
# Qt 5
|
||||
qt5_add_translation(QM_FILES ${TS_FILES})
|
||||
|
||||
# Likewise, qt5_add_translation() needs a target depending on its outputs,
|
||||
# unless QM_FILES are already consumed elsewhere.
|
||||
add_custom_target(${PROJECT_NAME}_lrelease ALL
|
||||
DEPENDS ${QM_FILES}
|
||||
)
|
||||
|
||||
add_custom_target(update_translations
|
||||
COMMAND
|
||||
$<TARGET_FILE:Qt5::lupdate>
|
||||
"${CMAKE_SOURCE_DIR}/sources"
|
||||
-ts ${TS_FILES}
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
COMMENT
|
||||
"Updating .ts files from sources/ (lupdate) - developer target"
|
||||
VERBATIM
|
||||
)
|
||||
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()
|
||||
|
||||
# Optional precompiled headers -- see QET_ENABLE_PCH in
|
||||
# cmake/developer_options.cmake for what this trades away.
|
||||
#
|
||||
# target_precompile_headers() needs CMake 3.16; the project still declares a
|
||||
# 3.5 minimum, so guard rather than raise it for an opt-in developer feature.
|
||||
#
|
||||
# The generator expressions are load-bearing, not decoration: this target also
|
||||
# compiles the 18 C files of the bundled LZMA decoder
|
||||
# (sources/import/edz/lzma/*.c), and an unguarded list applies to every
|
||||
# language in the target, so the Qt headers would reach the C compiler and fail
|
||||
# with "unknown type name 'namespace'". $<ANGLE-R> is required because a
|
||||
# literal '>' would terminate the generator expression.
|
||||
if(QET_ENABLE_PCH)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.16)
|
||||
message(WARNING
|
||||
"QET_ENABLE_PCH needs CMake 3.16 or newer (found ${CMAKE_VERSION}); "
|
||||
"building without precompiled headers.")
|
||||
else()
|
||||
target_precompile_headers(${PROJECT_NAME} PRIVATE
|
||||
"$<$<COMPILE_LANGUAGE:CXX>:<QtCore/QtCore$<ANGLE-R>>"
|
||||
"$<$<COMPILE_LANGUAGE:CXX>:<QtGui/QtGui$<ANGLE-R>>"
|
||||
"$<$<COMPILE_LANGUAGE:CXX>:<QtWidgets/QtWidgets$<ANGLE-R>>"
|
||||
"$<$<COMPILE_LANGUAGE:CXX>:<QtXml/QtXml$<ANGLE-R>>"
|
||||
)
|
||||
message(STATUS "QET_ENABLE_PCH: precompiled headers enabled")
|
||||
endif()
|
||||
endif()
|
||||
find_package(SQLite3 REQUIRED)
|
||||
|
||||
target_link_libraries(
|
||||
${PROJECT_NAME}
|
||||
PUBLIC
|
||||
PRIVATE
|
||||
pugixml::pugixml
|
||||
SingleApplication::SingleApplication
|
||||
SQLite3::SQLite3
|
||||
${KF_PRIVATE_LIBRARIES}
|
||||
${QET_PRIVATE_LIBRARIES}
|
||||
)
|
||||
${PROJECT_NAME}
|
||||
PUBLIC
|
||||
PRIVATE
|
||||
pugixml::pugixml
|
||||
SingleApplication::SingleApplication
|
||||
SQLite::SQLite3
|
||||
${KF6_PRIVATE_LIBRARIES}
|
||||
${QET_PRIVATE_LIBRARIES}
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
${PROJECT_NAME}
|
||||
PRIVATE
|
||||
${QET_DIR}/sources/titleblock
|
||||
${QET_DIR}/sources/ui
|
||||
${QET_DIR}/sources/qetgraphicsitem
|
||||
${QET_DIR}/sources/qetgraphicsitem/ViewItem
|
||||
${QET_DIR}/sources/qetgraphicsitem/ViewItem/ui
|
||||
${QET_DIR}/sources/richtext
|
||||
${QET_DIR}/sources/factory
|
||||
${QET_DIR}/sources/properties
|
||||
${QET_DIR}/sources/dvevent
|
||||
${QET_DIR}/sources/editor
|
||||
${QET_DIR}/sources/editor/esevent
|
||||
${QET_DIR}/sources/editor/graphicspart
|
||||
${QET_DIR}/sources/editor/ui
|
||||
${QET_DIR}/sources/editor/UndoCommand
|
||||
${QET_DIR}/sources/undocommand
|
||||
${QET_DIR}/sources/diagramevent
|
||||
${QET_DIR}/sources/ElementsCollection
|
||||
${QET_DIR}/sources/ElementsCollection/ui
|
||||
${QET_DIR}/sources/autoNum
|
||||
${QET_DIR}/sources/autoNum/ui
|
||||
${QET_DIR}/sources/ui/configpage
|
||||
${QET_DIR}/sources/SearchAndReplace
|
||||
${QET_DIR}/sources/SearchAndReplace/ui
|
||||
${QET_DIR}/sources/NameList
|
||||
${QET_DIR}/sources/NameList/ui
|
||||
${QET_DIR}/sources/utils
|
||||
${QET_DIR}/pugixml/src
|
||||
${QET_DIR}/sources/dataBase
|
||||
${QET_DIR}/sources/dataBase/ui
|
||||
${QET_DIR}/sources/factory/ui
|
||||
${QET_DIR}/sources/print
|
||||
${QET_DIR}/sources/svg
|
||||
)
|
||||
|
||||
if(NOT BUILD_WITH_KF)
|
||||
target_include_directories(
|
||||
${PROJECT_NAME}
|
||||
PRIVATE
|
||||
${QET_DIR}/sources/ui/nokde
|
||||
)
|
||||
endif()
|
||||
${PROJECT_NAME}
|
||||
PRIVATE
|
||||
${QET_DIR}/sources/titleblock
|
||||
${QET_DIR}/sources/ui
|
||||
${QET_DIR}/sources/qetgraphicsitem
|
||||
${QET_DIR}/sources/qetgraphicsitem/ViewItem
|
||||
${QET_DIR}/sources/qetgraphicsitem/ViewItem/ui
|
||||
${QET_DIR}/sources/richtext
|
||||
${QET_DIR}/sources/factory
|
||||
${QET_DIR}/sources/properties
|
||||
${QET_DIR}/sources/dvevent
|
||||
${QET_DIR}/sources/editor
|
||||
${QET_DIR}/sources/editor/esevent
|
||||
${QET_DIR}/sources/editor/graphicspart
|
||||
${QET_DIR}/sources/editor/ui
|
||||
${QET_DIR}/sources/editor/UndoCommand
|
||||
${QET_DIR}/sources/undocommand
|
||||
${QET_DIR}/sources/diagramevent
|
||||
${QET_DIR}/sources/ElementsCollection
|
||||
${QET_DIR}/sources/ElementsCollection/ui
|
||||
${QET_DIR}/sources/autoNum
|
||||
${QET_DIR}/sources/autoNum/ui
|
||||
${QET_DIR}/sources/ui/configpage
|
||||
${QET_DIR}/sources/SearchAndReplace
|
||||
${QET_DIR}/sources/SearchAndReplace/ui
|
||||
${QET_DIR}/sources/NameList
|
||||
${QET_DIR}/sources/NameList/ui
|
||||
${QET_DIR}/sources/utils
|
||||
${QET_DIR}/sources/dataBase
|
||||
${QET_DIR}/sources/dataBase/ui
|
||||
${QET_DIR}/sources/factory/ui
|
||||
${QET_DIR}/sources/print
|
||||
${QET_DIR}/sources/svg
|
||||
)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME})
|
||||
|
||||
if (NOT MINGW)
|
||||
install(DIRECTORY ico/breeze-icons/16x16 DESTINATION ${QET_ICONS_PATH})
|
||||
install(DIRECTORY ico/breeze-icons/22x22 DESTINATION ${QET_ICONS_PATH})
|
||||
|
||||
@@ -59,6 +59,9 @@ Here are the technical choices made for the software development:
|
||||
|
||||
If you wish to be informed of the latest developments, browse the [archive](https://listengine.tuxfamily.org/lists.tuxfamily.org/qet/) of the project mailing list where all commits (changes) are registered. This archive is publicly available, you don't need any account to access it.
|
||||
|
||||
### Build QElectroTech under Windows
|
||||
To build QElectroTech under microsoft Windows, please follow [these instructions (french)](md/fr/fr_window_build_summary.md)
|
||||
|
||||
|
||||
# Features
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@ git clone --recursive https://github.com/qelectrotech/qelectrotech-source-mirror
|
||||
Here are the technical choices made for the software development:
|
||||
|
||||
* Integrated development environment: [Qt Framework](https://www.qt.io/ide/)
|
||||
* Libraries: Qt 5.x / Qt 6.x
|
||||
* [KF5/6 Framework](https://github.com/KDE)
|
||||
* Libraries: Qt 5.x
|
||||
* [KF5 Framework](https://github.com/KDE)
|
||||
[Cmake](https://cmake.org/install/)
|
||||
[kcoreaddons](https://github.com/KDE/kcoreaddons/tree/kf5)
|
||||
[kwidgetsaddons](https://github.com/KDE/kwidgetsaddons/tree/kf5).
|
||||
|
||||
@@ -62,10 +62,15 @@ message("PROJECT_SOURCE_DIR :" ${PROJECT_SOURCE_DIR})
|
||||
message("QET_DIR :" ${QET_DIR})
|
||||
message("GIT_COMMIT_SHA :" ${GIT_COMMIT_SHA})
|
||||
|
||||
if(BUILD_WITH_KF)
|
||||
message("KF_GIT_TAG :" ${KF_GIT_TAG})
|
||||
else()
|
||||
add_definitions(-DBUILD_WITHOUT_KF)
|
||||
if(BUILD_WITH_KF6 AND BUILD_KF6)
|
||||
message("KF6_GIT_TAG :" ${KF6_GIT_TAG})
|
||||
endif()
|
||||
if(NOT BUILD_WITH_KF6)
|
||||
add_definitions(-DBUILD_WITHOUT_KF6)
|
||||
endif()
|
||||
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,22 +31,8 @@ add_definitions(-DQT_MESSAGELOGCONTEXT)
|
||||
# In order to do so, uncomment the following line.
|
||||
#add_definitions(-DTODO_LIST)
|
||||
|
||||
# Build with KDE Frameworks. The major version (KF5/KF6) is derived
|
||||
# automatically from QT_VERSION_MAJOR -- KDE Frameworks deliberately
|
||||
# mirrors Qt's own major version numbering, so there is no independent
|
||||
# choice to make here. See cmake/fetch_kdeaddons.cmake.
|
||||
option(BUILD_WITH_KF "Build with KDE Frameworks" ON)
|
||||
# Build with KF6
|
||||
option(BUILD_WITH_KF6 "Build with KF6" ON)
|
||||
|
||||
# Precompiled headers for the Qt umbrella headers.
|
||||
#
|
||||
# Off by default and intended for local development only. Building QET is
|
||||
# dominated by re-parsing Qt's headers: a 214-line .cpp expands to ~198,000
|
||||
# preprocessed lines, and compiling one translation unit costs ~4.1 s of which
|
||||
# only ~0.35 s is optimisation (-O0 instead of -O3 saves 8%). A PCH caches the
|
||||
# parsed header state and takes that ~4.1 s down to ~1.2 s.
|
||||
#
|
||||
# It is deliberately NOT on by default: a PCH satisfies includes that a source
|
||||
# file forgot to make itself, so code written with it enabled can fail to
|
||||
# compile for everyone else. Leaving it off keeps CI and contributors on the
|
||||
# strict behaviour, and only developers who opt in trade that for the speed.
|
||||
option(QET_ENABLE_PCH "Use precompiled headers (developer build speed; may mask missing #includes)" OFF)
|
||||
# Use translations as a Qt resource
|
||||
option(QMFILES_AS_RESOURCE "Use .qm files as Qt resource" ON)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2006 The QElectroTech Team
|
||||
# Copyright 2006-2026 The QElectroTech Team
|
||||
# This file is part of QElectroTech.
|
||||
#
|
||||
# QElectroTech is free software: you can redistribute it and/or modify
|
||||
@@ -14,76 +14,42 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
message(" - fetch_kdeaddons")
|
||||
option(BUILD_KF6 "Build KF6 libraries, use system ones otherwise" OFF)
|
||||
if(BUILD_KF6)
|
||||
block(PROPAGATE KF6_GIT_TAG)
|
||||
message(STATUS " - fetch_kdeaddons")
|
||||
set(KDE_SKIP_TEST_SETTINGS ON)
|
||||
set(KCOREADDONS_USE_QML OFF)
|
||||
set(KWIDGETSADDONS_USE_QML OFF)
|
||||
set(BUILD_TESTING OFF)
|
||||
set(BUILD_DESIGNERPLUGIN OFF)
|
||||
set(BUILD_QCH OFF)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
|
||||
# TODO remove path as soon as Qt5 gets retired
|
||||
if(BUILD_WITH_KF)
|
||||
Include(FetchContent)
|
||||
Include(FetchContent)
|
||||
|
||||
option(BUILD_KF "Build KF libraries, use system ones otherwise" YES)
|
||||
|
||||
if(BUILD_KF)
|
||||
|
||||
if(KF_MAJOR_VERSION EQUAL 5)
|
||||
if(NOT DEFINED KF_GIT_TAG)
|
||||
#https://qelectrotech.org/forum/viewtopic.php?pid=13924#p13924
|
||||
set(KF_GIT_TAG v5.77.0)
|
||||
endif()
|
||||
else()
|
||||
if(NOT DEFINED KF_GIT_TAG)
|
||||
# this is a more or less random version, taken as an conservative approach
|
||||
set(KF_GIT_TAG v6.10.0)
|
||||
endif()
|
||||
if(NOT DEFINED KF6_GIT_TAG)
|
||||
set(KF6_GIT_TAG v6.22.0)
|
||||
endif()
|
||||
# using a function in order to limit the scope of the variables
|
||||
# with CMake >=3.25 we could use a block()
|
||||
function(qet_make_kf_available)
|
||||
# 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 ON)
|
||||
set(BUILD_TESTING OFF)
|
||||
|
||||
# QElectroTech is a plain QtWidgets application with no QML anywhere in
|
||||
# it; these disable optional features of the fetched KF modules that
|
||||
# would otherwise pull in extra Qt6 components (e.g. Qt6Qml) we don't
|
||||
# have and don't need.
|
||||
set(BUILD_DESIGNERPLUGIN OFF)
|
||||
set(KCOREADDONS_USE_QML OFF)
|
||||
set(BUILD_QCH OFF)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
|
||||
FetchContent_Declare(
|
||||
ecm
|
||||
GIT_REPOSITORY https://invent.kde.org/frameworks/extra-cmake-modules.git
|
||||
GIT_TAG ${KF_GIT_TAG})
|
||||
FetchContent_MakeAvailable(ecm)
|
||||
FetchContent_Declare(
|
||||
kcoreaddons
|
||||
GIT_REPOSITORY https://invent.kde.org/frameworks/kcoreaddons.git
|
||||
GIT_TAG ${KF6_GIT_TAG})
|
||||
FetchContent_MakeAvailable(kcoreaddons)
|
||||
|
||||
FetchContent_Declare(
|
||||
kcoreaddons
|
||||
GIT_REPOSITORY https://invent.kde.org/frameworks/kcoreaddons.git
|
||||
GIT_TAG ${KF_GIT_TAG})
|
||||
FetchContent_MakeAvailable(kcoreaddons)
|
||||
|
||||
FetchContent_Declare(
|
||||
kwidgetsaddons
|
||||
GIT_REPOSITORY https://invent.kde.org/frameworks/kwidgetsaddons.git
|
||||
GIT_TAG ${KF_GIT_TAG})
|
||||
FetchContent_MakeAvailable(kwidgetsaddons)
|
||||
endfunction()
|
||||
qet_make_kf_available()
|
||||
else()
|
||||
find_package(KF${KF_MAJOR_VERSION}CoreAddons REQUIRED)
|
||||
find_package(KF${KF_MAJOR_VERSION}WidgetsAddons REQUIRED)
|
||||
endif()
|
||||
|
||||
set(KF_PRIVATE_LIBRARIES
|
||||
KF${KF_MAJOR_VERSION}::WidgetsAddons
|
||||
KF${KF_MAJOR_VERSION}::CoreAddons
|
||||
)
|
||||
FetchContent_Declare(
|
||||
kwidgetsaddons
|
||||
GIT_REPOSITORY https://invent.kde.org/frameworks/kwidgetsaddons.git
|
||||
GIT_TAG ${KF6_GIT_TAG})
|
||||
FetchContent_MakeAvailable(kwidgetsaddons)
|
||||
endblock()
|
||||
else()
|
||||
find_package(KF6CoreAddons REQUIRED)
|
||||
find_package(KF6WidgetsAddons REQUIRED)
|
||||
endif()
|
||||
|
||||
set(KF6_PRIVATE_LIBRARIES
|
||||
KF6::CoreAddons
|
||||
KF6::WidgetsAddons
|
||||
)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2006 The QElectroTech Team
|
||||
# Copyright 2006-2026 The QElectroTech Team
|
||||
# This file is part of QElectroTech.
|
||||
#
|
||||
# QElectroTech is free software: you can redistribute it and/or modify
|
||||
@@ -14,14 +14,10 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
message(" - fetch_pugixml")
|
||||
|
||||
Include(FetchContent)
|
||||
|
||||
option(BUILD_PUGIXML "Build pugixml library, use system one otherwise" YES)
|
||||
|
||||
option(BUILD_PUGIXML "Build pugixml library, use system one otherwise" OFF)
|
||||
if(BUILD_PUGIXML)
|
||||
|
||||
Include(FetchContent)
|
||||
message(" - fetch pugixml")
|
||||
FetchContent_Declare(
|
||||
pugixml
|
||||
GIT_REPOSITORY https://github.com/zeux/pugixml.git
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2006 The QElectroTech Team
|
||||
# Copyright 2006-2026 The QElectroTech Team
|
||||
# This file is part of QElectroTech.
|
||||
#
|
||||
# QElectroTech is free software: you can redistribute it and/or modify
|
||||
@@ -16,9 +16,6 @@
|
||||
|
||||
message(" - fetch_singleapplication")
|
||||
|
||||
# https://github.com/itay-grudev/SingleApplication/issues/18
|
||||
#qmake
|
||||
#DEFINES += QAPPLICATION_CLASS=QGuiApplication
|
||||
set(QAPPLICATION_CLASS QApplication)
|
||||
|
||||
Include(FetchContent)
|
||||
@@ -26,6 +23,6 @@ Include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
SingleApplication
|
||||
GIT_REPOSITORY https://github.com/itay-grudev/SingleApplication.git
|
||||
GIT_TAG v3.2.0)
|
||||
GIT_TAG v3.5.4)
|
||||
|
||||
FetchContent_MakeAvailable(SingleApplication)
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
# Copyright 2006 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/>.
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.14)
|
||||
message(
|
||||
"_____________________________________________________________________")
|
||||
message("to update Cmake on linux:")
|
||||
message("https://github.com/Kitware/CMake/")
|
||||
message("linux => cmake-3.19.1-Linux-x86_64.sh")
|
||||
message(" sudo ./cmake.sh --prefix=/usr/local/ --exclude-subdir")
|
||||
message("windows good luck :)")
|
||||
endif()
|
||||
@@ -24,6 +24,8 @@ message(" - qet_compilation_vars")
|
||||
# QT_VERSION_MAJOR, after the main find_package.
|
||||
# (Needed for QPdfEngine::drawHyperlink, the PDF internal links.)
|
||||
set(QET_COMPONENTS
|
||||
Core
|
||||
Gui
|
||||
LinguistTools
|
||||
PrintSupport
|
||||
Xml
|
||||
@@ -116,16 +118,6 @@ set(QET_RES_FILES
|
||||
set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/cli_export.cpp
|
||||
${QET_DIR}/sources/cli_export.h
|
||||
${QET_DIR}/sources/logging/crashhandler.cpp
|
||||
${QET_DIR}/sources/logging/crashhandler.h
|
||||
${QET_DIR}/sources/logging/eventloopwatchdog.cpp
|
||||
${QET_DIR}/sources/logging/eventloopwatchdog.h
|
||||
${QET_DIR}/sources/logging/logring.cpp
|
||||
${QET_DIR}/sources/logging/logring.h
|
||||
${QET_DIR}/sources/logging/qetlogger.cpp
|
||||
${QET_DIR}/sources/logging/qetlogger.h
|
||||
${QET_DIR}/sources/logging/ui/diagnosticsreportdialog.cpp
|
||||
${QET_DIR}/sources/logging/ui/diagnosticsreportdialog.h
|
||||
${QET_DIR}/sources/pdf_links.cpp
|
||||
${QET_DIR}/sources/pdf_links.h
|
||||
${QET_DIR}/sources/import/edz/edzarchive.cpp
|
||||
@@ -160,6 +152,12 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/borderproperties.h
|
||||
${QET_DIR}/sources/bordertitleblock.cpp
|
||||
${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.h
|
||||
${QET_DIR}/sources/conductornumexport.cpp
|
||||
@@ -177,8 +175,6 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/configdialog.h
|
||||
${QET_DIR}/sources/createdxf.cpp
|
||||
${QET_DIR}/sources/createdxf.h
|
||||
${QET_DIR}/sources/dxfpaintdevice.cpp
|
||||
${QET_DIR}/sources/dxfpaintdevice.h
|
||||
${QET_DIR}/sources/diagramcommands.cpp
|
||||
${QET_DIR}/sources/diagramcommands.h
|
||||
${QET_DIR}/sources/diagramcontent.cpp
|
||||
@@ -217,8 +213,6 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/exportpropertieswidget.h
|
||||
${QET_DIR}/sources/genericpanel.cpp
|
||||
${QET_DIR}/sources/genericpanel.h
|
||||
${QET_DIR}/sources/lastusedstyle.cpp
|
||||
${QET_DIR}/sources/lastusedstyle.h
|
||||
${QET_DIR}/sources/machine_info.cpp
|
||||
${QET_DIR}/sources/machine_info.h
|
||||
${QET_DIR}/sources/main.cpp
|
||||
@@ -262,8 +256,6 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/qtextorientationwidget.h
|
||||
${QET_DIR}/sources/recentfiles.cpp
|
||||
${QET_DIR}/sources/recentfiles.h
|
||||
${QET_DIR}/sources/shortcutmanager.cpp
|
||||
${QET_DIR}/sources/shortcutmanager.h
|
||||
${QET_DIR}/sources/titleblockcell.cpp
|
||||
${QET_DIR}/sources/titleblockcell.h
|
||||
${QET_DIR}/sources/titleblockproperties.cpp
|
||||
@@ -300,9 +292,6 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/dataBase/ui/summaryquerywidget.cpp
|
||||
${QET_DIR}/sources/dataBase/ui/summaryquerywidget.h
|
||||
|
||||
${QET_DIR}/sources/autobreakconductor.cpp
|
||||
${QET_DIR}/sources/autobreakconductor.h
|
||||
|
||||
${QET_DIR}/sources/diagramevent/diagrameventaddelement.cpp
|
||||
${QET_DIR}/sources/diagramevent/diagrameventaddelement.h
|
||||
${QET_DIR}/sources/diagramevent/diagrameventaddimage.cpp
|
||||
@@ -481,10 +470,6 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/PropertiesEditor/propertieseditorwidget.cpp
|
||||
${QET_DIR}/sources/PropertiesEditor/propertieseditorwidget.h
|
||||
|
||||
${QET_DIR}/pugixml/src/pugiconfig.hpp
|
||||
${QET_DIR}/pugixml/src/pugixml.cpp
|
||||
${QET_DIR}/pugixml/src/pugixml.hpp
|
||||
|
||||
${QET_DIR}/sources/qetgraphicsitem/conductor.cpp
|
||||
${QET_DIR}/sources/qetgraphicsitem/conductor.h
|
||||
${QET_DIR}/sources/qetgraphicsitem/conductortextitem.cpp
|
||||
@@ -547,6 +532,7 @@ set(QET_SRC_FILES
|
||||
|
||||
${QET_DIR}/sources/richtext/richtexteditor.cpp
|
||||
${QET_DIR}/sources/richtext/richtexteditor_p.h
|
||||
${QET_DIR}/sources/richtext/ui_addlinkdialog.h
|
||||
|
||||
${QET_DIR}/sources/SearchAndReplace/searchandreplaceworker.cpp
|
||||
${QET_DIR}/sources/SearchAndReplace/searchandreplaceworker.h
|
||||
@@ -564,6 +550,9 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/svg/qetsvg.cpp
|
||||
${QET_DIR}/sources/svg/qetsvg.h
|
||||
|
||||
${QET_DIR}/sources/svg/qetsvg.cpp
|
||||
${QET_DIR}/sources/svg/qetsvg.h
|
||||
|
||||
${QET_DIR}/sources/titleblock/dimension.cpp
|
||||
${QET_DIR}/sources/titleblock/dimension.h
|
||||
${QET_DIR}/sources/titleblock/dimensionwidget.cpp
|
||||
@@ -699,8 +688,6 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/ui/dynamicelementtextitemeditor.h
|
||||
${QET_DIR}/sources/ui/dynamicelementtextmodel.cpp
|
||||
${QET_DIR}/sources/ui/dynamicelementtextmodel.h
|
||||
${QET_DIR}/sources/ui/customelementinfopartwidget.cpp
|
||||
${QET_DIR}/sources/ui/customelementinfopartwidget.h
|
||||
${QET_DIR}/sources/ui/elementinfopartwidget.cpp
|
||||
${QET_DIR}/sources/ui/elementinfopartwidget.h
|
||||
${QET_DIR}/sources/ui/elementinfowidget.cpp
|
||||
@@ -717,8 +704,6 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/ui/importelementdialog.h
|
||||
${QET_DIR}/sources/ui/importelementtextpatterndialog.cpp
|
||||
${QET_DIR}/sources/ui/importelementtextpatterndialog.h
|
||||
${QET_DIR}/sources/ui/jumptoelementdialog.cpp
|
||||
${QET_DIR}/sources/ui/jumptoelementdialog.h
|
||||
${QET_DIR}/sources/ui/inditextpropertieswidget.cpp
|
||||
${QET_DIR}/sources/ui/inditextpropertieswidget.h
|
||||
${QET_DIR}/sources/ui/linksingleelementwidget.cpp
|
||||
@@ -754,13 +739,9 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/ui/configpage/projectconfigpages.h
|
||||
${QET_DIR}/sources/ui/configpage/guidespropertieswidget.cpp
|
||||
${QET_DIR}/sources/ui/configpage/guidespropertieswidget.h
|
||||
${QET_DIR}/sources/ui/configpage/shortcutsconfigpage.cpp
|
||||
${QET_DIR}/sources/ui/configpage/shortcutsconfigpage.h
|
||||
|
||||
${QET_DIR}/sources/undocommand/addelementtextcommand.cpp
|
||||
${QET_DIR}/sources/undocommand/addelementtextcommand.h
|
||||
${QET_DIR}/sources/undocommand/adddiagramcommand.cpp
|
||||
${QET_DIR}/sources/undocommand/adddiagramcommand.h
|
||||
${QET_DIR}/sources/undocommand/addgraphicsobjectcommand.cpp
|
||||
${QET_DIR}/sources/undocommand/addgraphicsobjectcommand.h
|
||||
${QET_DIR}/sources/undocommand/changeelementdatacommand.cpp
|
||||
@@ -775,12 +756,6 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/undocommand/itemmodelcommand.h
|
||||
${QET_DIR}/sources/undocommand/linkelementcommand.cpp
|
||||
${QET_DIR}/sources/undocommand/linkelementcommand.h
|
||||
${QET_DIR}/sources/undocommand/movediagramcommand.cpp
|
||||
${QET_DIR}/sources/undocommand/movediagramcommand.h
|
||||
${QET_DIR}/sources/undocommand/removediagramcommand.cpp
|
||||
${QET_DIR}/sources/undocommand/removediagramcommand.h
|
||||
${QET_DIR}/sources/undocommand/setautonumcontextcommand.cpp
|
||||
${QET_DIR}/sources/undocommand/setautonumcontextcommand.h
|
||||
${QET_DIR}/sources/undocommand/rotateselectioncommand.cpp
|
||||
${QET_DIR}/sources/undocommand/rotateselectioncommand.h
|
||||
${QET_DIR}/sources/undocommand/rotatetextscommand.cpp
|
||||
@@ -803,17 +778,6 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/xml/terminalstriplayoutpatternxml.h
|
||||
)
|
||||
|
||||
if(NOT BUILD_WITH_KF)
|
||||
list(APPEND QET_SRC_FILES
|
||||
${QET_DIR}/sources/ui/nokde/kautosavefile.cpp
|
||||
${QET_DIR}/sources/ui/nokde/kautosavefile.h
|
||||
${QET_DIR}/sources/ui/nokde/kcolorbutton.cpp
|
||||
${QET_DIR}/sources/ui/nokde/kcolorbutton.h
|
||||
${QET_DIR}/sources/ui/nokde/kcolorcombo.cpp
|
||||
${QET_DIR}/sources/ui/nokde/kcolorcombo.h
|
||||
)
|
||||
endif()
|
||||
|
||||
set(TS_FILES
|
||||
${QET_DIR}/lang/qet_ar.ts
|
||||
${QET_DIR}/lang/qet_ca.ts
|
||||
@@ -832,19 +796,17 @@ set(TS_FILES
|
||||
${QET_DIR}/lang/qet_mn.ts
|
||||
${QET_DIR}/lang/qet_nb.ts
|
||||
${QET_DIR}/lang/qet_nl.ts
|
||||
${QET_DIR}/lang/qet_nl_BE.ts
|
||||
${QET_DIR}/lang/qet_nl_BE.ts
|
||||
${QET_DIR}/lang/qet_no.ts
|
||||
${QET_DIR}/lang/qet_pl.ts
|
||||
${QET_DIR}/lang/qet_pt.ts
|
||||
${QET_DIR}/lang/qet_pt_BR.ts
|
||||
${QET_DIR}/lang/qet_ro.ts
|
||||
${QET_DIR}/lang/qet_rs.ts
|
||||
${QET_DIR}/lang/qet_ru.ts
|
||||
${QET_DIR}/lang/qet_sk.ts
|
||||
${QET_DIR}/lang/qet_sl.ts
|
||||
${QET_DIR}/lang/qet_sr.ts
|
||||
${QET_DIR}/lang/qet_sv.ts
|
||||
${QET_DIR}/lang/qet_tr.ts
|
||||
${QET_DIR}/lang/qet_uk.ts
|
||||
${QET_DIR}/lang/qet_zh.ts
|
||||
)
|
||||
|
||||
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 51 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 49 KiB |
@@ -0,0 +1,101 @@
|
||||
Compiler QElectroTech sous microsoft Windows 10 et 11 avec MSYS2
|
||||
================================
|
||||
Ce document décrit les étapes nécessaire afin de compilé QElectroTech sous Windows avec Qt6 et cmake en utilisant MSYS2.
|
||||
|
||||
# MSYS2
|
||||
L'ensemble des outils nécessaire au développement et à la compilation de QElectroTech sous Windows sera installé par l’intermédiaire de [MSYS2](https://www.msys2.org/). Cela comprend entre autre le framework [Qt6](https://www.qt.io/development/qt-framework/qt6), les outils cmake, les dépendances ([kde framework](https://develop.kde.org/docs/), [sqlite](https://sqlite.org/), [pugixml](https://pugixml.org/)), les outils de compilation [minGW](https://www.mingw-w64.org/)...
|
||||
|
||||
>Il sera nécessaire d'utiliser [winget](https://learn.microsoft.com/fr-fr/windows/package-manager/winget/), celui-ci est présent par défaut sous Windows 11, dans le cas de Windows 10, winget peut necessité d'être activé manuellement
|
||||
|
||||
# Installer GIT et MSYS2 avec winget
|
||||
Avec power shell.
|
||||
```
|
||||
winget install Git.Git
|
||||
```
|
||||
puis
|
||||
```
|
||||
winget install MSYS2.MSYS2
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Mise à jour de MSYS2
|
||||
Lors de la première utilisation de MSYS2 il est nécessaire de mettre celui-ci à jour.
|
||||
|
||||
Lancer "MSYS2 MSYS" depuis le menu démarré de Windows.
|
||||
Une fenêtre avec un shell s'ouvre, dans celui-ci lancer la commande :
|
||||
```
|
||||
pacman -Syu
|
||||
```
|
||||
A la fin de la mise à jour MSYS2 MSYS se fermera automatiquement. Ouvrez le à nouveau et relancé la commande
|
||||
```
|
||||
pacman -Syu
|
||||
```
|
||||
|
||||
## Installation des outils de devellopement
|
||||
Toujours dans le shell MSYS2 MSYS lancer la commande suivante.
|
||||
```
|
||||
pacman -S mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-qt6-svg mingw-w64-ucrt-x86_64-qt6-base mingw-w64-ucrt-x86_64-sqlite3 mingw-w64-ucrt-x86_64-pugixml mingw-w64-ucrt-x86_64-kcoreaddons mingw-w64-ucrt-x86_64-kwidgetsaddons mingw-w64-ucrt-x86_64-extra-cmake-modules mingw-w64-ucrt-x86_64-gdb mingw-w64-ucrt-x86_64-qt6-translations mingw-w64-ucrt-x86_64-qt6-tools
|
||||
```
|
||||
> La quantité de paquets à installer est conséquent, en fonction de votre connexion internet cela peut prendre plusieurs dizaine de minute
|
||||
|
||||
L'ensemble des outils est mantenant installé 😀
|
||||
|
||||
# Installer Qt creator
|
||||
Télécharger [l'installateur online de Qt](https://www.qt.io/development/download-qt-installer-oss) et lancer l'installation en suivant les indications de ce dernier.
|
||||
|
||||
>Dans le cas où vous comptez utilisé Qt Creator uniquement pour développez QElectroTech, lors de l'installation choisissez l'option "installation personnalisée" puis dans la page suivante sélectionné uniquement Qt Creator.
|
||||
|
||||
## Configurer Qt creator
|
||||
Ouvrir Qt creator puis rendez vous dans "édition -> préférence -> kit"
|
||||
|
||||
### Versions de Qt
|
||||
|
||||
- Cliquer sur _ajouter_
|
||||
- Renseigner _Chemin de qmake_ (exemple C:\\msys64\\ucrt64\\bin\\qmake.exe).
|
||||
- Dans le champ _Nom :_ ajouter (msys2).
|
||||
|
||||

|
||||
|
||||
### Compilateurs
|
||||
- Cliquer sur _ajouter_ puis choisir _MinGW_.
|
||||
- Renseigner _Emplacement du compilateur C_ (exemple C:\\msys64\\ucrt64\\bin\\g++.exe).
|
||||
- Dans le champ _Nom :_ ajouter (msys2).
|
||||
|
||||

|
||||
|
||||
### Débogueurs
|
||||
- Cliquer sur _ajouter_
|
||||
- Renseigner _Chemin :_ (exemple C:\\msys64\\ucrt64\\bin\\gdb.exe).
|
||||
- Dans le champ _Nom :_ ajouter (msys2).
|
||||
|
||||

|
||||
|
||||
### cmake
|
||||
- Outils -> _Ajouter_
|
||||
- Renseigner _Chemin :_ (exemple C:\\msys64\\ucrt64\\bin\\cmake.exe).
|
||||
- Dans le champ _Nom :_ ajouter (msys2).
|
||||
|
||||

|
||||
|
||||
### KIT
|
||||
Maintenant que tous les prérequis sont fait nous allons crée un kit utilisant les outils fournis par MSYS2. Cliquer sur _Ajouter_, un nouveau kit _manuel_ apparaît, nommer celui-ci par exemple _Qt6 msys2_ puis renseigner le compilateur, le débogueur, la version de Qt et Outils CMake en choisissant à chaque fois ceux que nous venons de créer.
|
||||
puis cliquer sur _appliquer_.
|
||||
|
||||

|
||||
|
||||
Bravo 🥳🥳 vous avez terminé l'installation de la totalité des outils de développement.
|
||||
|
||||
# Clonez le dépôts de QElectrotech
|
||||
Clonez le dépôt de QElectroTech comme vous le faite habituellement, sinon utilisez les commandes suivante dans power shell.
|
||||
|
||||
Crée et/ou se rendre dans le dossier dans lequel vous voulez clonez le dépôt (dans l'exemple nous allons crée un dossier QElectroTech dans C:)
|
||||
|
||||
```
|
||||
mkdir C:\QElectroTech
|
||||
cd C:\QElectroTech
|
||||
|
||||
git clone --recursive https://github.com/qelectrotech/qelectrotech-source-mirror.git
|
||||
```
|
||||
|
||||
Une fois le dépôt cloné lancer Qt creator puis choisir d'ouvrir un projet existant, en choisissant le _CMakeLists.txt_ se trouvant à la racine du projet QElectroTech, enfin dans l'assistant de création de projet choisir comme kit le kit que nous avons créer précédemment.
|
||||
@@ -0,0 +1,13 @@
|
||||
Compiler QElectroTech sous microsoft Windows 10 et 11
|
||||
================================
|
||||
Compiler QElectroTech pour et/ou sous Windows peut être effectué avec plusieurs méthode différente.
|
||||
Ce document énumère uniquement les différentes méthode possible
|
||||
|
||||
N'est mentionné que les étapes nécessaire afin de compilé QElectroTech sous Windows avec Qt6 et cmake. Ce document ne traite pas la compilation avec Qt5 et qmake.
|
||||
|
||||
>QElectroTech 0.100 est la dernière version à utiliser Qt5. Les version suivante sont développé avec Qt6 et utilise cmake au lieu de qmake.
|
||||
|
||||
Il existe deux méthodes pour cela :
|
||||
|
||||
1. [Utiliser msys2 (méthode recommandé)](fr_window_build_msys2.md)
|
||||
2. Télécharger et compiler l'ensemble des dépendances (non rédigé)
|
||||
@@ -173,9 +173,7 @@ HEADERS += $$files(sources/*.h) \
|
||||
$$files(sources/qet_elementscaler/*.h) \
|
||||
$$files(sources/svg/*.h) \
|
||||
$$files(sources/import/edz/*.h) \
|
||||
$$files(sources/import/edz/lzma/*.h) \
|
||||
$$files(sources/logging/*.h) \
|
||||
$$files(sources/logging/ui/*.h)
|
||||
$$files(sources/import/edz/lzma/*.h)
|
||||
|
||||
SOURCES += $$files(sources/*.cpp) \
|
||||
$$files(sources/editor/*.cpp) \
|
||||
@@ -221,10 +219,7 @@ SOURCES += $$files(sources/*.cpp) \
|
||||
$$files(sources/qet_elementscaler/*.cpp) \
|
||||
$$files(sources/svg/*.cpp) \
|
||||
$$files(sources/import/edz/*.cpp) \
|
||||
$$files(sources/import/edz/lzma/*.c) \
|
||||
$$files(sources/logging/*.cpp) \
|
||||
$$files(sources/logging/ui/*.cpp)
|
||||
|
||||
$$files(sources/import/edz/lzma/*.c)
|
||||
|
||||
# Needed for use promote QTreeWidget in terminalstripeditor.ui
|
||||
INCLUDEPATH += sources/TerminalStrip/ui
|
||||
|
||||
@@ -25,9 +25,8 @@
|
||||
#include "xmlelementcollection.h"
|
||||
#include "xmlprojectelementcollectionitem.h"
|
||||
|
||||
|
||||
#include <QFutureWatcher>
|
||||
#include <QtConcurrentMap>
|
||||
|
||||
/**
|
||||
@brief ElementsCollectionModel::ElementsCollectionModel
|
||||
Constructor
|
||||
@@ -38,20 +37,6 @@ ElementsCollectionModel::ElementsCollectionModel(QObject *parent) :
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@brief ElementsCollectionModel::~ElementsCollectionModel
|
||||
Destructor. loadCollections() may still have background threads
|
||||
(via QtConcurrent::map()) running setUpData() on this model's items
|
||||
when the model is destroyed (e.g. the user cancels the dialog before
|
||||
loading finishes). Wait for them here so QStandardItemModel's
|
||||
destructor doesn't free items out from under them, which used to
|
||||
crash the whole application (bugtracker #291).
|
||||
*/
|
||||
ElementsCollectionModel::~ElementsCollectionModel()
|
||||
{
|
||||
m_future.waitForFinished();
|
||||
}
|
||||
|
||||
/**
|
||||
@brief ElementsCollectionModel::data
|
||||
Reimplemented from QStandardItemModel
|
||||
@@ -304,9 +289,12 @@ void ElementsCollectionModel::loadCollections(bool common_collection,
|
||||
connect(watcher, &QFutureWatcher<void>::progressRangeChanged,
|
||||
this, &ElementsCollectionModel::loadingProgressRangeChanged);
|
||||
connect(watcher, &QFutureWatcher<void>::finished,
|
||||
this, &ElementsCollectionModel::loadingFinished);
|
||||
connect(watcher, &QFutureWatcher<void>::finished, watcher, &QFutureWatcher<void>::deleteLater);
|
||||
|
||||
this, &ElementsCollectionModel::loadingFinished);
|
||||
connect(
|
||||
watcher,
|
||||
&QFutureWatcher<void>::finished,
|
||||
watcher,
|
||||
&QFutureWatcher<void>::deleteLater);
|
||||
|
||||
m_future = QtConcurrent::map(m_items_list_to_setUp, setUpData);
|
||||
watcher->setFuture(m_future);
|
||||
|
||||
@@ -35,7 +35,6 @@ class ElementsCollectionModel : public QStandardItemModel
|
||||
|
||||
public:
|
||||
ElementsCollectionModel(QObject *parent = Q_NULLPTR);
|
||||
~ElementsCollectionModel() override;
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
QMimeData *mimeData(const QModelIndexList &indexes) const override;
|
||||
|
||||
@@ -949,6 +949,7 @@ void ElementsCollectionWidget::search()
|
||||
}
|
||||
|
||||
hideCollection(true);
|
||||
|
||||
const QStringList text_list = text.split("+", Qt::SkipEmptyParts);
|
||||
QModelIndexList match_index;
|
||||
for (QString txt : text_list) {
|
||||
|
||||
@@ -806,13 +806,13 @@ bool ElementsLocation::setXml(const QDomDocument &xml_document) const
|
||||
QRegularExpression rx("^(.*)/(.*\\.elmt)$");
|
||||
QRegularExpressionMatch match = rx.match(path_);
|
||||
|
||||
if (match.hasMatch())
|
||||
if (auto regex_match = rx.match(path_); regex_match.hasMatch())
|
||||
{
|
||||
return project()
|
||||
->embeddedElementCollection()
|
||||
->addElementDefinition(
|
||||
match.captured(1),
|
||||
match.captured(2),
|
||||
regex_match.captured(1),
|
||||
regex_match.captured(2),
|
||||
xml_document.documentElement());
|
||||
}
|
||||
else
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "../NameList/nameslist.h"
|
||||
#include "../diagramcontext.h"
|
||||
#include "pugixml/src/pugixml.hpp"
|
||||
#include "pugixml.hpp"
|
||||
|
||||
#include <QIcon>
|
||||
#include <QString>
|
||||
|
||||
@@ -43,14 +43,6 @@ ElementsTreeView::ElementsTreeView(QWidget *parent) :
|
||||
{
|
||||
// force du noir sur une alternance de blanc (comme le schema) et de gris
|
||||
// clair, avec du blanc sur bleu pas trop fonce pour la selection
|
||||
//
|
||||
// Element icons are rendered with colors read directly from each .elmt
|
||||
// file (almost always black linework, matching printed-schematic
|
||||
// convention) onto a transparent background -- so this view must keep
|
||||
// a light background regardless of the OS/desktop theme, or the icons
|
||||
// become invisible on dark themes. QAbstractItemView paints its rows
|
||||
// using the viewport's palette, not the view's own, so the palette
|
||||
// must be applied to both to actually take effect under every style.
|
||||
QPalette qp = palette();
|
||||
qp.setColor(QPalette::Text, Qt::black);
|
||||
qp.setColor(QPalette::Base, Qt::white);
|
||||
@@ -58,7 +50,6 @@ ElementsTreeView::ElementsTreeView(QWidget *parent) :
|
||||
qp.setColor(QPalette::Highlight, QColor("#678db2"));
|
||||
qp.setColor(QPalette::HighlightedText, Qt::black);
|
||||
setPalette(qp);
|
||||
viewport()->setPalette(qp);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,11 +87,7 @@ void ElementsTreeView::startElementDrag(const ElementsLocation &location)
|
||||
{
|
||||
if (! location.exist()) return;
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
|
||||
QDrag* drag = new QDrag(this);
|
||||
#else
|
||||
QScopedPointer<QDrag> drag(new QDrag(this));
|
||||
#endif
|
||||
auto drag = new QDrag{this};
|
||||
|
||||
QString location_str = location.toString();
|
||||
QMimeData *mime_data = new QMimeData();
|
||||
@@ -143,7 +130,11 @@ void ElementsTreeView::startElementDrag(const ElementsLocation &location)
|
||||
QString file_name = (last_slash != -1) ? path.mid(last_slash + 1) : path;
|
||||
|
||||
if (!dir_path.isEmpty()) {
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||
QStringList parts = dir_path.split('/', QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList parts = dir_path.split('/', Qt::SkipEmptyParts);
|
||||
#endif
|
||||
QString current_path = "";
|
||||
for (const QString &part : parts) {
|
||||
QString parent_path = current_path;
|
||||
|
||||
@@ -22,39 +22,7 @@
|
||||
#include "../qeticons.h"
|
||||
#include "elementslocation.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDir>
|
||||
#include <QPainter>
|
||||
#include <QPixmap>
|
||||
#include <QStyle>
|
||||
|
||||
namespace {
|
||||
/**
|
||||
@return the folder icon overlaid with a small warning badge in the
|
||||
bottom-right corner. Used for a directory whose qet_directory could
|
||||
not be read (@see FileElementCollectionItem::m_qet_directory_unreadable),
|
||||
so the problem is visible in the tree itself and not only on hover
|
||||
via the tooltip. Built once: same folder icon, same badge, every time.
|
||||
*/
|
||||
const QIcon &unreadableFolderIcon()
|
||||
{
|
||||
static const QIcon icon = []() {
|
||||
QPixmap pixmap = QET::Icons::Folder.pixmap(16, 16);
|
||||
const QPixmap badge = QApplication::style()
|
||||
->standardIcon(QStyle::SP_MessageBoxWarning)
|
||||
.pixmap(9, 9);
|
||||
|
||||
QPainter painter(&pixmap);
|
||||
painter.drawPixmap(pixmap.width() - badge.width(),
|
||||
pixmap.height() - badge.height(),
|
||||
badge);
|
||||
painter.end();
|
||||
|
||||
return QIcon(pixmap);
|
||||
}();
|
||||
return icon;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@brief FileElementCollectionItem::FileElementCollectionItem
|
||||
@@ -168,41 +136,18 @@ QString FileElementCollectionItem::localName()
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fall back to the raw directory name (m_path) whenever the
|
||||
// translated name can't be obtained -- qet_directory missing,
|
||||
// unreadable (e.g. a Windows path-encoding issue with special
|
||||
// characters, see bugtracker #332), malformed, or present but
|
||||
// without a usable name entry -- rather than leaving the item
|
||||
// blank.
|
||||
QString display_name;
|
||||
bool readable = false;
|
||||
QString str(fileSystemPath() % "/qet_directory");
|
||||
pugi::xml_document docu;
|
||||
if (docu.load_file(str.toStdWString().c_str()))
|
||||
if(docu.load_file(str.toStdWString().c_str()))
|
||||
{
|
||||
if (QString(docu.document_element().name())
|
||||
== "qet-directory")
|
||||
{
|
||||
readable = true;
|
||||
NamesList nl;
|
||||
nl.fromXml(docu.document_element());
|
||||
// Deliberately no fallback argument: a non-empty one
|
||||
// is returned *before* NamesList::name() reaches its
|
||||
// "first available translation" step, so passing
|
||||
// m_path here would replace a perfectly good name in
|
||||
// some other language with the raw directory name.
|
||||
// The fallback belongs after the chain, not inside it.
|
||||
display_name = nl.name();
|
||||
setText(nl.name());
|
||||
}
|
||||
}
|
||||
setText(display_name.isEmpty() ? m_path : display_name);
|
||||
|
||||
// Only a file-level failure counts: a readable qet-directory
|
||||
// with no entry for the current language is not an error,
|
||||
// NamesList::name() resolves that on its own. Recorded here
|
||||
// and reported by setUpData(), which sets the tooltip after
|
||||
// this runs.
|
||||
m_qet_directory_unreadable = !readable;
|
||||
}
|
||||
}
|
||||
else if (isElement()) {
|
||||
@@ -405,21 +350,7 @@ void FileElementCollectionItem::setUpData()
|
||||
}
|
||||
}
|
||||
|
||||
// Falling back to the raw directory name keeps the folder usable, but
|
||||
// on its own it hides the fact that a file is broken: the user sees a
|
||||
// plausible name and never learns there is anything to repair. Say so
|
||||
// above the collection path, which stays as the last line the way the
|
||||
// element tooltip above builds it.
|
||||
QStringList tip;
|
||||
if (isDir() && m_qet_directory_unreadable)
|
||||
{
|
||||
tip << QObject::tr("Le fichier « %1 » est absent ou illisible : "
|
||||
"le nom traduit de ce dossier n'a pas pu être lu, "
|
||||
"son nom de dossier est affiché à la place.")
|
||||
.arg(fileSystemPath() % "/qet_directory");
|
||||
}
|
||||
tip << collectionPath();
|
||||
setToolTip(tip.join(QLatin1Char('\n')));
|
||||
setToolTip(collectionPath());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -430,19 +361,6 @@ void FileElementCollectionItem::setUpData()
|
||||
*/
|
||||
void FileElementCollectionItem::setUpIcon()
|
||||
{
|
||||
// Must return unconditionally once an icon is set: setIcon() calls
|
||||
// setData(), which emits dataChanged() regardless of whether the new
|
||||
// icon differs from the old one (QIcon has no meaningful equality).
|
||||
// QTreeView responds to dataChanged() by recomputing the row's size
|
||||
// hint, which re-enters data() for this same index -- so without this
|
||||
// guard, any repeated setIcon() here recurses until the stack
|
||||
// overflows. Confirmed by crash report on PR #633.
|
||||
//
|
||||
// This item's m_qet_directory_unreadable is already final by the time
|
||||
// this can run at all: ElementsCollectionModel only attaches itself
|
||||
// to the tree view (making data() reachable) from loadingFinished(),
|
||||
// which fires after the QtConcurrent::map over every item -- this one
|
||||
// included -- has completed. So there is no race to work around here.
|
||||
if (!icon().isNull())
|
||||
return;
|
||||
|
||||
@@ -462,11 +380,10 @@ void FileElementCollectionItem::setUpIcon()
|
||||
else
|
||||
{
|
||||
if (isDir()) {
|
||||
setIcon(m_qet_directory_unreadable ? unreadableFolderIcon()
|
||||
: QET::Icons::Folder);
|
||||
setIcon(QET::Icons::Folder);
|
||||
} else {
|
||||
if (m_path.endsWith(".qetmak")) {
|
||||
setIcon(QIcon());
|
||||
setIcon(QET::Icons::PartRectangle);
|
||||
} else {
|
||||
ElementsLocation loc(collectionPath());
|
||||
setIcon(loc.icon());
|
||||
|
||||
@@ -64,11 +64,6 @@ class FileElementCollectionItem : public ElementCollectionItem
|
||||
|
||||
private:
|
||||
QString m_path;
|
||||
/// True when this directory's qet_directory file is missing or
|
||||
/// unreadable, so setUpData() can say so in the tooltip. Recorded
|
||||
/// rather than acted on in localName(), because setUpData() resets
|
||||
/// the tooltip afterwards and would otherwise discard it.
|
||||
bool m_qet_directory_unreadable = false;
|
||||
};
|
||||
|
||||
#endif // FILEELEMENTCOLLECTIONITEM2_H
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
#ifndef NAMES_LIST_H
|
||||
#define NAMES_LIST_H
|
||||
#include "pugixml/src/pugixml.hpp"
|
||||
#include "pugixml.hpp"
|
||||
|
||||
#include <QtXml>
|
||||
/**
|
||||
|
||||
@@ -46,18 +46,6 @@ class PropertiesEditorDialog : public QDialog
|
||||
PropertiesEditorDialog(T editor, QWidget *parent = nullptr) :
|
||||
QDialog (parent)
|
||||
{
|
||||
// Without this, a QWidget-modal QDialog with a parent falls
|
||||
// back to macOS's automatic sheet presentation, which some
|
||||
// Qt/Cocoa versions render stuck centered on screen and
|
||||
// non-draggable rather than as a proper attached sheet
|
||||
// (bugtracker #275). Other dialogs in this codebase already
|
||||
// opt in explicitly (see ElementDialog, DiagramPropertiesDialog)
|
||||
// -- this one was missing it.
|
||||
setWindowModality(Qt::WindowModal);
|
||||
#ifdef Q_OS_MACOS
|
||||
setWindowFlags(Qt::Sheet);
|
||||
#endif
|
||||
|
||||
//Set dialog title
|
||||
setWindowTitle(editor->title());
|
||||
// Reparent the editor,
|
||||
|
||||
@@ -1020,7 +1020,6 @@ void SearchAndReplaceWidget::on_m_tree_widget_currentItemChanged(
|
||||
{
|
||||
m_highlighted_element = elmt;
|
||||
elmt.data()->setHighlighted(true);
|
||||
elmt.data()->ensureVisible();
|
||||
}
|
||||
}
|
||||
else if (m_text_hash.contains(current))
|
||||
@@ -1030,7 +1029,6 @@ void SearchAndReplaceWidget::on_m_tree_widget_currentItemChanged(
|
||||
{
|
||||
text.data()->setSelected(true);
|
||||
m_last_selected = text;
|
||||
text.data()->ensureVisible();
|
||||
}
|
||||
}
|
||||
else if (m_conductor_hash.contains(current))
|
||||
@@ -1040,7 +1038,6 @@ void SearchAndReplaceWidget::on_m_tree_widget_currentItemChanged(
|
||||
{
|
||||
cond.data()->setSelected(true);
|
||||
m_last_selected = cond;
|
||||
cond.data()->ensureVisible();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
#include <QPainter>
|
||||
#include <QHash>
|
||||
#include <QUuid>
|
||||
|
||||
namespace TerminalStripDrawer {
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#define TERMINALSTRIPDRAWER_H
|
||||
|
||||
#include <QPointer>
|
||||
#include <QUuid>
|
||||
|
||||
#include "properties/terminalstriplayoutpattern.h"
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ bool PhysicalTerminal::setLevelOf(const QSharedPointer<RealTerminal> &terminal,
|
||||
const int i = m_real_terminal.indexOf(terminal);
|
||||
if (i >= 0)
|
||||
{
|
||||
m_real_terminal.swapItemsAt(i, std::min<int>(level, static_cast<int>(m_real_terminal.size())-1));
|
||||
m_real_terminal.swapItemsAt(i, std::min(static_cast<qsizetype>(level), m_real_terminal.size()-1));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -28,8 +28,6 @@
|
||||
#include "../terminalstrip.h"
|
||||
#include "../../qetinformation.h"
|
||||
|
||||
#include <QUuid>
|
||||
|
||||
TerminalStripTreeDockWidget::TerminalStripTreeDockWidget(QETProject *project, QWidget *parent) :
|
||||
QDockWidget(parent),
|
||||
ui(new Ui::TerminalStripTreeDockWidget)
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include <QDockWidget>
|
||||
#include <QPointer>
|
||||
#include <QHash>
|
||||
|
||||
class QETProject;
|
||||
class QTreeWidgetItem;
|
||||
|
||||
@@ -39,13 +39,11 @@ namespace autonum
|
||||
sequentialNumbers::sequentialNumbers(const sequentialNumbers &other)
|
||||
{
|
||||
unit = other.unit;
|
||||
wrap = other.wrap;
|
||||
unit_folio = other.unit_folio;
|
||||
ten = other.ten;
|
||||
ten_folio = other.ten_folio;
|
||||
hundred = other.hundred;
|
||||
hundred_folio = other.hundred_folio;
|
||||
alpha = other.alpha;
|
||||
}
|
||||
|
||||
sequentialNumbers::~sequentialNumbers()
|
||||
@@ -58,13 +56,11 @@ namespace autonum
|
||||
return (*this);
|
||||
|
||||
unit = other.unit;
|
||||
wrap = other.wrap;
|
||||
unit_folio = other.unit_folio;
|
||||
ten = other.ten;
|
||||
ten_folio = other.ten_folio;
|
||||
hundred = other.hundred;
|
||||
hundred_folio = other.hundred_folio;
|
||||
alpha = other.alpha;
|
||||
|
||||
return (*this);
|
||||
}
|
||||
@@ -72,13 +68,11 @@ namespace autonum
|
||||
bool sequentialNumbers::operator==(const sequentialNumbers &other) const
|
||||
{
|
||||
if (unit == other.unit && \
|
||||
wrap == other.wrap && \
|
||||
unit_folio == other.unit_folio && \
|
||||
ten == other.ten && \
|
||||
ten_folio == other.ten_folio && \
|
||||
hundred == other.hundred && \
|
||||
hundred_folio == other.hundred_folio && \
|
||||
alpha == other.alpha)
|
||||
hundred_folio == other.hundred_folio)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
@@ -110,11 +104,6 @@ namespace autonum
|
||||
document,
|
||||
"unit",
|
||||
unit.join(";")));
|
||||
if (!wrap.isEmpty())
|
||||
element.appendChild(QETXML::textToDomElement(
|
||||
document,
|
||||
"wrap",
|
||||
wrap.join(";")));
|
||||
if (!unit_folio.isEmpty())
|
||||
element.appendChild(QETXML::textToDomElement(
|
||||
document,
|
||||
@@ -140,11 +129,6 @@ namespace autonum
|
||||
document,
|
||||
"hundredFolio",
|
||||
hundred_folio.join(";")));
|
||||
if(!alpha.isEmpty())
|
||||
element.appendChild(QETXML::textToDomElement(
|
||||
document,
|
||||
"alpha",
|
||||
alpha.join(";")));
|
||||
|
||||
return element;
|
||||
}
|
||||
@@ -164,11 +148,6 @@ namespace autonum
|
||||
from = element.firstChildElement("unit");
|
||||
unit = from.text().split(";");
|
||||
|
||||
//Absent from files written before cyclic parts could be
|
||||
//rendered; an empty list is the correct reading of that.
|
||||
from = element.firstChildElement("wrap");
|
||||
wrap = from.text().split(";");
|
||||
|
||||
from = element.firstChildElement("unitFolio");
|
||||
unit_folio = from.text().split(";");
|
||||
|
||||
@@ -183,22 +162,17 @@ namespace autonum
|
||||
|
||||
from = element.firstChildElement("hundredFolio");
|
||||
hundred_folio = from.text().split(";");
|
||||
|
||||
from = element.firstChildElement("alpha");
|
||||
alpha = from.text().split(";");
|
||||
}
|
||||
|
||||
//Clear this sequence
|
||||
void sequentialNumbers::clear()
|
||||
{
|
||||
unit.clear();
|
||||
wrap.clear();
|
||||
unit_folio.clear();
|
||||
ten.clear();
|
||||
ten_folio.clear();
|
||||
hundred.clear();
|
||||
hundred_folio.clear();
|
||||
alpha.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -306,11 +280,6 @@ namespace autonum
|
||||
str.replace("%{plc_function}", dc.value("plc_function").toString());
|
||||
str.replace("%{plc_comment}", dc.value("plc_comment").toString());
|
||||
str.replace("%{plc_crossref}", dc.value("plc_crossref").toString());
|
||||
str.replace("%{plc_tc}", dc.value("plc_tc").toString());
|
||||
str.replace("%{plc_t1}", dc.value("plc_t1").toString());
|
||||
str.replace("%{plc_t2}", dc.value("plc_t2").toString());
|
||||
str.replace("%{plc_t3}", dc.value("plc_t3").toString());
|
||||
str.replace("%{plc_t4}", dc.value("plc_t4").toString());
|
||||
|
||||
return str;
|
||||
}
|
||||
@@ -445,11 +414,8 @@ namespace autonum
|
||||
m_seq_struct.ten_folio.size()),
|
||||
qMax(m_seq_struct.hundred_folio.size(),
|
||||
m_seq_struct.unit.size())),
|
||||
qMax(
|
||||
qMax(m_seq_struct.hundred.size(),
|
||||
m_seq_struct.ten.size()),
|
||||
qMax(m_seq_struct.alpha.size(),
|
||||
m_seq_struct.wrap.size()))
|
||||
qMax(m_seq_struct.hundred.size(),
|
||||
m_seq_struct.ten.size())
|
||||
);
|
||||
|
||||
for (int i=1; i<=max ; i++)
|
||||
@@ -457,9 +423,6 @@ namespace autonum
|
||||
if (m_assigned_label.contains("%sequ_" + QString::number(i)) && m_seq_struct.unit.size() >= i) {
|
||||
m_assigned_label.replace("%sequ_" + QString::number(i),m_seq_struct.unit.at(i-1));
|
||||
}
|
||||
if (m_assigned_label.contains("%seqw_" + QString::number(i)) && m_seq_struct.wrap.size() >= i) {
|
||||
m_assigned_label.replace("%seqw_" + QString::number(i),m_seq_struct.wrap.at(i-1));
|
||||
}
|
||||
if (m_assigned_label.contains("%seqt_" + QString::number(i)) && m_seq_struct.ten.size() >= i) {
|
||||
m_assigned_label.replace("%seqt_" + QString::number(i),m_seq_struct.ten.at(i-1));
|
||||
}
|
||||
@@ -475,9 +438,6 @@ namespace autonum
|
||||
if (m_assigned_label.contains("%seqhf_" + QString::number(i)) && m_seq_struct.hundred_folio.size() >= i) {
|
||||
m_assigned_label.replace("%seqhf_" + QString::number(i),m_seq_struct.hundred_folio.at(i-1));
|
||||
}
|
||||
if (m_assigned_label.contains("%seqa_" + QString::number(i)) && m_seq_struct.alpha.size() >= i) {
|
||||
m_assigned_label.replace("%seqa_" + QString::number(i),m_seq_struct.alpha.at(i-1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -497,26 +457,12 @@ namespace autonum
|
||||
{
|
||||
if (context.itemAt(i).at(0) == type)
|
||||
{
|
||||
const QStringList item = context.itemAt(i);
|
||||
//A zero-padding mask, spreadsheet style: its length is the
|
||||
//minimum number of digits. It overrides the width implied
|
||||
//by the part type, so "Chiffre 01" with a mask of "0000"
|
||||
//pads to four. An absent mask -- which is every context
|
||||
//written before the field existed -- falls through to the
|
||||
//type's own width, so nothing about existing projects
|
||||
//changes.
|
||||
const QString mask = NumerotationContext::formatOf(item);
|
||||
QString number;
|
||||
if (type == "alpha")
|
||||
//Alphabetic value, not an integer -- used as-is.
|
||||
number = item.at(1);
|
||||
else if (!mask.isEmpty())
|
||||
number = QString("%1").arg(item.at(1).toInt(), mask.length(), 10, QChar('0'));
|
||||
else if (type == "ten" || type == "tenfolio")
|
||||
number = QString("%1").arg(item.at(1).toInt(), 2, 10, QChar('0'));
|
||||
if (type == "ten" || type == "tenfolio")
|
||||
number = QString("%1").arg(context.itemAt(i).at(1).toInt(), 2, 10, QChar('0'));
|
||||
else if (type == "hundred" || type == "hundredfolio")
|
||||
number = QString("%1").arg(item.at(1).toInt(), 3, 10, QChar('0'));
|
||||
else number = QString::number(item.at(1).toInt());
|
||||
number = QString("%1").arg(context.itemAt(i).at(1).toInt(), 3, 10, QChar('0'));
|
||||
else number = QString::number(context.itemAt(i).at(1).toInt());
|
||||
list.append(number);
|
||||
}
|
||||
}
|
||||
@@ -582,10 +528,6 @@ namespace autonum
|
||||
{
|
||||
autonum::setSequentialToList(seqStruct.unit, context,"unit");
|
||||
}
|
||||
if (label.contains("%seqw_"))
|
||||
{
|
||||
autonum::setSequentialToList(seqStruct.wrap, context,"wrap");
|
||||
}
|
||||
if (label.contains("%sequf_"))
|
||||
{
|
||||
autonum::setSequentialToList(seqStruct.unit_folio, context,"unitfolio");
|
||||
@@ -609,10 +551,6 @@ namespace autonum
|
||||
autonum::setSequentialToList(seqStruct.hundred_folio, context,"hundredfolio");
|
||||
autonum::setFolioSequentialToHash(seqStruct.hundred_folio, diagram->m_elmt_hundredfolio_max, hashKey);
|
||||
}
|
||||
if (label.contains("%seqa_"))
|
||||
{
|
||||
autonum::setSequentialToList(seqStruct.alpha, context,"alpha");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -627,13 +565,11 @@ namespace autonum
|
||||
QString value;
|
||||
QString formula;
|
||||
int count_unit = 0;
|
||||
int count_wrap = 0;
|
||||
int count_unitf = 0;
|
||||
int count_ten = 0;
|
||||
int count_tenf = 0;
|
||||
int count_hundred = 0;
|
||||
int count_hundredf = 0;
|
||||
int count_alpha = 0;
|
||||
|
||||
for(int i=0 ; i<nc.size() ; i++)
|
||||
{
|
||||
@@ -670,10 +606,6 @@ namespace autonum
|
||||
count_unit++;
|
||||
formula.append("%sequ_" + QString::number(count_unit));
|
||||
}
|
||||
else if (type == "wrap") {
|
||||
count_wrap++;
|
||||
formula.append("%seqw_" + QString::number(count_wrap));
|
||||
}
|
||||
else if (type == "unitfolio") {
|
||||
count_unitf++;
|
||||
formula.append("%sequf_" + QString::number(count_unitf));
|
||||
@@ -694,10 +626,6 @@ namespace autonum
|
||||
count_hundredf++;
|
||||
formula.append("%seqhf_" + QString::number(count_hundredf));
|
||||
}
|
||||
else if (type == "alpha") {
|
||||
count_alpha++;
|
||||
formula.append("%seqa_" + QString::number(count_alpha));
|
||||
}
|
||||
}
|
||||
|
||||
return formula;
|
||||
|
||||