From a53a799da58be03319297211d33a861c28591f6a Mon Sep 17 00:00:00 2001 From: Laurent Trinques Date: Sat, 1 Mar 2025 15:48:42 +0100 Subject: [PATCH 1/2] Fix crossXref with Qt6 thanks plc-user, see:https://qelectrotech.org/forum/viewtopic.php?pid=21168#p21168 --- sources/qetgraphicsitem/element.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sources/qetgraphicsitem/element.cpp b/sources/qetgraphicsitem/element.cpp index 1e8d010de..02fa4fc61 100644 --- a/sources/qetgraphicsitem/element.cpp +++ b/sources/qetgraphicsitem/element.cpp @@ -765,14 +765,14 @@ bool Element::fromXml(QDomElement &e, QList uuid_list = QET::findInDomElement(e, QStringLiteral("links_uuids"), QStringLiteral("link_uuid")); - foreach (QDomElement qdo, uuid_list) #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove + foreach (QDomElement qdo, uuid_list) tmp_uuids_link << qdo.attribute(QStringLiteral("uuid")); #else -#if TODO_LIST -#pragma message("@TODO remove code for QT 6 or later") -#endif - qDebug()<<"Help code for QT 6 or later"; + foreach (QDomElement qdo, uuid_list) { + tmp_uuids_link << QUuid(qdo.attribute(QStringLiteral("uuid"))); + } + qInfo() << "tmp_uuids_link: " << tmp_uuids_link; #endif //uuid of this element m_uuid = QUuid(e.attribute(QStringLiteral("uuid"), QUuid::createUuid().toString())); From d7a15d6cb65fee21886673097189a2f1a0017f25 Mon Sep 17 00:00:00 2001 From: Laurent Trinques Date: Sun, 2 Mar 2025 10:35:16 +0100 Subject: [PATCH 2/2] bordertitleblock: use same code for Qt5 & Qt6 for "numbering" rows --- sources/bordertitleblock.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sources/bordertitleblock.cpp b/sources/bordertitleblock.cpp index c3cfcc3d6..17378b89b 100644 --- a/sources/bordertitleblock.cpp +++ b/sources/bordertitleblock.cpp @@ -942,18 +942,11 @@ QString BorderTitleBlock::incrementLetters(const QString &string) { // separate previous digits from last digit // separe les digits precedents du dernier digit QString first_digits(string.left(string.length() - 1)); - QChar last_digit(string.at(string.length() - 1)); + char last_digit(string.at(string.length() - 1).unicode()); if (last_digit != 'Z') { // increments the last digit // incremente le dernier digit -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove - last_digit = last_digit.toLatin1() + 1; -#else -# if TODO_LIST -# pragma message("@TODO remove code for QT 6 or later") -# endif - qDebug() << "Help code for QT 6 or later"; -#endif + last_digit = (char)(string[string.length()-1].unicode()) + 1; return(first_digits + QString(last_digit)); } else { return(incrementLetters(first_digits) + "A");