mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-30 07:09:59 +01:00
Build with qt6 and cmake
First build with qt6 and cmake. QET compil, but a lot of things don't work. Build tested on debian sid and ubuntu 25.04. Dependency needed under debian and ubuntu : qtcreator cmake qt6-tools-dev qt6-svg-dev libsqlite3-dev libkf6coreaddons-dev extra-cmake-modules libkf6widgetsaddons-dev
This commit is contained in:
@@ -16,10 +16,10 @@
|
|||||||
|
|
||||||
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.100.0
|
||||||
DESCRIPTION "QET is a CAD/CAE editor focusing on schematics drawing features."
|
DESCRIPTION "QET is a CAD/CAE editor focusing on schematics drawing features."
|
||||||
HOMEPAGE_URL "https://qelectrotech.org/"
|
HOMEPAGE_URL "https://qelectrotech.org/"
|
||||||
LANGUAGES CXX)
|
LANGUAGES CXX)
|
||||||
@@ -27,9 +27,16 @@ 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" NO)
|
||||||
if(PACKAGE_TESTS)
|
if(PACKAGE_TESTS)
|
||||||
message("Add sub directory tests")
|
message("Add sub directory tests")
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
@@ -43,42 +50,19 @@ 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(
|
find_package(KF6WidgetsAddons REQUIRED)
|
||||||
|
|
||||||
|
qt_add_executable(
|
||||||
${PROJECT_NAME}
|
${PROJECT_NAME}
|
||||||
${QET_RES_FILES}
|
${QET_RES_FILES}
|
||||||
${QET_SRC_FILES}
|
${QET_SRC_FILES}
|
||||||
@@ -86,14 +70,26 @@ 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}
|
||||||
|
KF6::WidgetsAddons
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
@@ -149,6 +145,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()
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -726,19 +734,17 @@ 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_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
|
||||||
${QET_DIR}/lang/qet_pt_BR.ts
|
${QET_DIR}/lang/qet_pt_BR.ts
|
||||||
${QET_DIR}/lang/qet_ro.ts
|
${QET_DIR}/lang/qet_ro.ts
|
||||||
${QET_DIR}/lang/qet_rs.ts
|
|
||||||
${QET_DIR}/lang/qet_ru.ts
|
${QET_DIR}/lang/qet_ru.ts
|
||||||
${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_sv.ts
|
||||||
${QET_DIR}/lang/qet_tr.ts
|
${QET_DIR}/lang/qet_tr.ts
|
||||||
${QET_DIR}/lang/qet_uk.ts
|
|
||||||
${QET_DIR}/lang/qet_zh.ts
|
${QET_DIR}/lang/qet_zh.ts
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -807,13 +807,13 @@ bool ElementsLocation::setXml(const QDomDocument &xml_document) const
|
|||||||
QString path_ = collectionPath(false);
|
QString path_ = collectionPath(false);
|
||||||
QRegularExpression rx("^(.*)/(.*\\.elmt)$");
|
QRegularExpression rx("^(.*)/(.*\\.elmt)$");
|
||||||
|
|
||||||
if (rx.exactMatch(path_))
|
if (auto regex_match = rx.match(path_); regex_match.hasMatch())
|
||||||
{
|
{
|
||||||
return project()
|
return project()
|
||||||
->embeddedElementCollection()
|
->embeddedElementCollection()
|
||||||
->addElementDefinition(
|
->addElementDefinition(
|
||||||
rx.cap(1),
|
regex_match.captured(1),
|
||||||
rx.cap(2),
|
regex_match.captured(2),
|
||||||
xml_document.documentElement());
|
xml_document.documentElement());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "terminalstripdrawer.h"
|
#include "terminalstripdrawer.h"
|
||||||
|
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include <QHash>
|
||||||
|
|
||||||
namespace TerminalStripDrawer {
|
namespace TerminalStripDrawer {
|
||||||
|
|
||||||
|
|||||||
@@ -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(static_cast<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]);
|
||||||
|
|||||||
@@ -188,10 +188,8 @@ void MachineInfo::send_info_to_debug()
|
|||||||
QDirIterator it1(QETApp::commonElementsDir().toLatin1(),nameFilters, QDir::Files, QDirIterator::Subdirectories);
|
QDirIterator it1(QETApp::commonElementsDir().toLatin1(),nameFilters, QDir::Files, QDirIterator::Subdirectories);
|
||||||
while (it1.hasNext())
|
while (it1.hasNext())
|
||||||
{
|
{
|
||||||
if(it1.next() > 0 )
|
it1.next();
|
||||||
{
|
|
||||||
commomElementsDir ++;
|
commomElementsDir ++;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
qInfo()<< " Common Elements count:"<< commomElementsDir << "Elements";
|
qInfo()<< " Common Elements count:"<< commomElementsDir << "Elements";
|
||||||
|
|
||||||
@@ -200,10 +198,8 @@ void MachineInfo::send_info_to_debug()
|
|||||||
QDirIterator it2(QETApp::customElementsDir().toLatin1(), nameFilters, QDir::Files, QDirIterator::Subdirectories);
|
QDirIterator it2(QETApp::customElementsDir().toLatin1(), nameFilters, QDir::Files, QDirIterator::Subdirectories);
|
||||||
while (it2.hasNext())
|
while (it2.hasNext())
|
||||||
{
|
{
|
||||||
if(it2.next() > 0 )
|
it2.next();
|
||||||
{
|
|
||||||
customElementsDir ++;
|
customElementsDir ++;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
qInfo()<< " Custom Elements count:"<< customElementsDir << "Elements";
|
qInfo()<< " Custom Elements count:"<< customElementsDir << "Elements";
|
||||||
|
|
||||||
@@ -211,10 +207,8 @@ void MachineInfo::send_info_to_debug()
|
|||||||
QDirIterator it3(QETApp::companyElementsDir().toLatin1(), nameFilters, QDir::Files, QDirIterator::Subdirectories);
|
QDirIterator it3(QETApp::companyElementsDir().toLatin1(), nameFilters, QDir::Files, QDirIterator::Subdirectories);
|
||||||
while (it3.hasNext())
|
while (it3.hasNext())
|
||||||
{
|
{
|
||||||
if(it3.next() > 0 )
|
it3.next();
|
||||||
{
|
|
||||||
companyElementsDir ++;
|
companyElementsDir ++;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
qInfo()<< " Company Elements count:"<< companyElementsDir << "Elements";
|
qInfo()<< " Company Elements count:"<< companyElementsDir << "Elements";
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include <QDomElement>
|
#include <QDomElement>
|
||||||
#include <QPen>
|
#include <QPen>
|
||||||
|
#include <QUuid>
|
||||||
|
|
||||||
class QDomDocument;
|
class QDomDocument;
|
||||||
class QDir;
|
class QDir;
|
||||||
|
|||||||
@@ -70,25 +70,6 @@ void QGIManager::release(QGraphicsItem *qgi) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
Demande au QGIManager de gerer plusieurs QGI
|
|
||||||
@param qgis QGraphicsItems a gerer
|
|
||||||
*/
|
|
||||||
void QGIManager::manage(const QList<QGraphicsItem *> &qgis) {
|
|
||||||
foreach(QGraphicsItem *qgi, qgis) manage(qgi);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Indique au QGIManager que pour chaque QGI fourni, une reference vers celui-ci
|
|
||||||
a ete detruite.
|
|
||||||
S'il n'y a plus de references vers un QGI et que celui-ci n'est pas present
|
|
||||||
sur la scene de ce QGIManager, alors il sera detruit.
|
|
||||||
@param qgis QGraphicsItems a ne plus gerer
|
|
||||||
*/
|
|
||||||
void QGIManager::release(const QList<QGraphicsItem *> &qgis) {
|
|
||||||
foreach(QGraphicsItem *qgi, qgis) release(qgi);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QGIManager::manage(const QVector<QGraphicsItem *> &items) {
|
void QGIManager::manage(const QVector<QGraphicsItem *> &items) {
|
||||||
for (const auto &qgi : items) {
|
for (const auto &qgi : items) {
|
||||||
manage(qgi);
|
manage(qgi);
|
||||||
|
|||||||
@@ -45,10 +45,6 @@ class QGIManager {
|
|||||||
public:
|
public:
|
||||||
void manage(QGraphicsItem *);
|
void manage(QGraphicsItem *);
|
||||||
void release(QGraphicsItem *);
|
void release(QGraphicsItem *);
|
||||||
QT_DEPRECATED_X("Use QGIManager::manage(const QVector<QGraphicsItem *> &) instead")
|
|
||||||
void manage(const QList<QGraphicsItem *> &);
|
|
||||||
QT_DEPRECATED_X("Use QGIManager::release(const QVector<QGraphicsItem *> &) instead")
|
|
||||||
void release(const QList<QGraphicsItem *> &);
|
|
||||||
void manage(const QVector<QGraphicsItem *> &items);
|
void manage(const QVector<QGraphicsItem *> &items);
|
||||||
void release(const QVector<QGraphicsItem *> &items);
|
void release(const QVector<QGraphicsItem *> &items);
|
||||||
void setDestroyQGIOnDelete(bool);
|
void setDestroyQGIOnDelete(bool);
|
||||||
|
|||||||
@@ -454,7 +454,7 @@ QDomElement TitleBlockTemplatesFilesCollection::getTemplateXmlDescription(const
|
|||||||
}
|
}
|
||||||
|
|
||||||
QDomDocument *xml_document = new QDomDocument();
|
QDomDocument *xml_document = new QDomDocument();
|
||||||
bool xml_parsing = xml_document -> setContent(&xml_file);
|
const auto xml_parsing = xml_document -> setContent(&xml_file);
|
||||||
if (!xml_parsing) {
|
if (!xml_parsing) {
|
||||||
delete xml_document;
|
delete xml_document;
|
||||||
return(QDomElement());
|
return(QDomElement());
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ class HelperCell;
|
|||||||
class SplittedHelperCell;
|
class SplittedHelperCell;
|
||||||
class TitleBlockTemplateCommand;
|
class TitleBlockTemplateCommand;
|
||||||
class TitleBlockTemplateCellsSet;
|
class TitleBlockTemplateCellsSet;
|
||||||
|
class QGraphicsLayoutItem;
|
||||||
|
class QGraphicsGridLayout;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This QGraphicsView subclass is used in the title block template editor to
|
This QGraphicsView subclass is used in the title block template editor to
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ bool TitleBlockTemplate::loadFromXmlFile(const QString &filepath) {
|
|||||||
|
|
||||||
// parse its content as XML
|
// parse its content as XML
|
||||||
QDomDocument xml_doc;
|
QDomDocument xml_doc;
|
||||||
bool xml_parsing = xml_doc.setContent(&template_file);
|
const auto xml_parsing = xml_doc.setContent(&template_file);
|
||||||
if (!xml_parsing) {
|
if (!xml_parsing) {
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user