mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-31 08:19:58 +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:
@@ -807,13 +807,13 @@ bool ElementsLocation::setXml(const QDomDocument &xml_document) const
|
||||
QString path_ = collectionPath(false);
|
||||
QRegularExpression rx("^(.*)/(.*\\.elmt)$");
|
||||
|
||||
if (rx.exactMatch(path_))
|
||||
if (auto regex_match = rx.match(path_); regex_match.hasMatch())
|
||||
{
|
||||
return project()
|
||||
->embeddedElementCollection()
|
||||
->addElementDefinition(
|
||||
rx.cap(1),
|
||||
rx.cap(2),
|
||||
regex_match.captured(1),
|
||||
regex_match.captured(2),
|
||||
xml_document.documentElement());
|
||||
}
|
||||
else
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "terminalstripdrawer.h"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QHash>
|
||||
|
||||
namespace TerminalStripDrawer {
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ bool PhysicalTerminal::setLevelOf(const QSharedPointer<RealTerminal> &terminal,
|
||||
if (i >= 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
|
||||
auto j = std::min(level, m_real_terminal.size()-1);
|
||||
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);
|
||||
while (it1.hasNext())
|
||||
{
|
||||
if(it1.next() > 0 )
|
||||
{
|
||||
it1.next();
|
||||
commomElementsDir ++;
|
||||
}
|
||||
}
|
||||
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);
|
||||
while (it2.hasNext())
|
||||
{
|
||||
if(it2.next() > 0 )
|
||||
{
|
||||
it2.next();
|
||||
customElementsDir ++;
|
||||
}
|
||||
}
|
||||
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);
|
||||
while (it3.hasNext())
|
||||
{
|
||||
if(it3.next() > 0 )
|
||||
{
|
||||
it3.next();
|
||||
companyElementsDir ++;
|
||||
}
|
||||
}
|
||||
qInfo()<< " Company Elements count:"<< companyElementsDir << "Elements";
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <QDomElement>
|
||||
#include <QPen>
|
||||
#include <QUuid>
|
||||
|
||||
class QDomDocument;
|
||||
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) {
|
||||
for (const auto &qgi : items) {
|
||||
manage(qgi);
|
||||
|
||||
@@ -45,10 +45,6 @@ class QGIManager {
|
||||
public:
|
||||
void manage(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 release(const QVector<QGraphicsItem *> &items);
|
||||
void setDestroyQGIOnDelete(bool);
|
||||
|
||||
@@ -454,7 +454,7 @@ QDomElement TitleBlockTemplatesFilesCollection::getTemplateXmlDescription(const
|
||||
}
|
||||
|
||||
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) {
|
||||
delete xml_document;
|
||||
return(QDomElement());
|
||||
|
||||
@@ -24,6 +24,8 @@ class HelperCell;
|
||||
class SplittedHelperCell;
|
||||
class TitleBlockTemplateCommand;
|
||||
class TitleBlockTemplateCellsSet;
|
||||
class QGraphicsLayoutItem;
|
||||
class QGraphicsGridLayout;
|
||||
|
||||
/**
|
||||
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
|
||||
QDomDocument xml_doc;
|
||||
bool xml_parsing = xml_doc.setContent(&template_file);
|
||||
const auto xml_parsing = xml_doc.setContent(&template_file);
|
||||
if (!xml_parsing) {
|
||||
return(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user