From 3fe0adc66e70553928599cd83b860dc5d13cf377 Mon Sep 17 00:00:00 2001 From: Simon De Backer Date: Thu, 10 Dec 2020 16:01:10 +0100 Subject: [PATCH] QT6 QChar and int build error remove code for QT 6 or later! this will have to be restored later. --- .../xmlelementcollection.cpp | 71 +++++++++++++++---- sources/bordertitleblock.cpp | 7 ++ sources/qetproject.cpp | 64 +++++++++++++++-- 3 files changed, 122 insertions(+), 20 deletions(-) diff --git a/sources/ElementsCollection/xmlelementcollection.cpp b/sources/ElementsCollection/xmlelementcollection.cpp index d0e8d2c60..bfaee99e6 100644 --- a/sources/ElementsCollection/xmlelementcollection.cpp +++ b/sources/ElementsCollection/xmlelementcollection.cpp @@ -46,19 +46,44 @@ XmlElementCollection::XmlElementCollection(QETProject *project) : collection.appendChild(import); NamesList names; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove - const QChar russian_data[24] = { 0x0418, 0x043C, 0x043F, 0x043E, 0x0440, - 0x0442, 0x0438, 0x0440, 0x043E, 0x0432, - 0x0430, 0x043D, 0x043D, 0x044B, 0x0435, - 0x0020, 0x044D, 0x043B, 0x0435, 0x043C, - 0x0435, 0x043D, 0x0442, 0x044B }; - const QChar greek_data[18] = { 0x0395, 0x03b9, 0x03c3, 0x03b7, 0x03b3, - 0x03bc, 0x03ad, 0x03bd, 0x03b1, 0x0020, - 0x03c3, 0x03c4, 0x03bf, 0x03b9, 0x03c7, - 0x03b5, 0x03af, 0x03b1 }; - const QChar turkish_data[12] ={ 0x0130, 0x0074, 0x0068, 0x0061, 0x006C, - 0x0020, 0x00F6, 0x011F, 0x0065, 0x006C, - 0x0065, 0x0072 }; + const QChar russian_data[24] = { + 0x0418, 0x043C, 0x043F, 0x043E, 0x0440, 0x0442, 0x0438, 0x0440, + 0x043E, 0x0432, 0x0430, 0x043D, 0x043D, 0x044B, 0x0435, 0x0020, + 0x044D, 0x043B, 0x0435, 0x043C, 0x0435, 0x043D, 0x0442, 0x044B}; + const QChar greek_data[18] = { + 0x0395, + 0x03b9, + 0x03c3, + 0x03b7, + 0x03b3, + 0x03bc, + 0x03ad, + 0x03bd, + 0x03b1, + 0x0020, + 0x03c3, + 0x03c4, + 0x03bf, + 0x03b9, + 0x03c7, + 0x03b5, + 0x03af, + 0x03b1}; + const QChar turkish_data[12] = { + 0x0130, + 0x0074, + 0x0068, + 0x0061, + 0x006C, + 0x0020, + 0x00F6, + 0x011F, + 0x0065, + 0x006C, + 0x0065, + 0x0072}; names.addName("fr", "Éléments importés"); names.addName("en", "Imported elements"); names.addName("de", "Importierte elemente"); @@ -77,7 +102,27 @@ XmlElementCollection::XmlElementCollection(QETProject *project) : names.addName("da", "Importerede elementer"); names.addName("hr", "Uvezeni elementi"); names.addName("sl", "Uvoženi elementi"); - +#else +# if TODO_LIST +# pragma message("@TODO remove code for QT 6 or later") +# endif + qDebug() << "Help code for QT 6 or later"; + names.addName("fr", "Éléments importés"); + names.addName("en", "Imported elements"); + names.addName("de", "Importierte elemente"); + names.addName("es", "Elementos importados"); + names.addName("cs", "Zavedené prvky"); + names.addName("pl", "Elementy importowane"); + names.addName("pt", "elementos importados"); + names.addName("it", "Elementi importati"); + names.addName("nl", "Elementen geïmporteerd"); + names.addName("hr", "Uvezeni elementi"); + names.addName("ca", "Elements importats"); + names.addName("ro", "Elemente importate"); + names.addName("da", "Importerede elementer"); + names.addName("hr", "Uvezeni elementi"); + names.addName("sl", "Uvoženi elementi"); +#endif import.appendChild(names.toXml(m_dom_document)); } diff --git a/sources/bordertitleblock.cpp b/sources/bordertitleblock.cpp index 63ed0a4d9..08c73543f 100644 --- a/sources/bordertitleblock.cpp +++ b/sources/bordertitleblock.cpp @@ -979,7 +979,14 @@ QString BorderTitleBlock::incrementLetters(const QString &string) { 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 return(first_digits + QString(last_digit)); } else { return(incrementLetters(first_digits) + "A"); diff --git a/sources/qetproject.cpp b/sources/qetproject.cpp index a22a57b9c..17db03714 100644 --- a/sources/qetproject.cpp +++ b/sources/qetproject.cpp @@ -1661,11 +1661,42 @@ void QETProject::addDiagram(Diagram *diagram, int pos) */ NamesList QETProject::namesListForIntegrationCategory() { - NamesList names; - - const QChar russian_data[24] = { 0x0418, 0x043C, 0x043F, 0x043E, 0x0440, 0x0442, 0x0438, 0x0440, 0x043E, 0x0432, 0x0430, 0x043D, 0x043D, 0x044B, 0x0435, 0x0020, 0x044D, 0x043B, 0x0435, 0x043C, 0x0435, 0x043D, 0x0442, 0x044B }; - const QChar greek_data[18] = { 0x0395, 0x03b9, 0x03c3, 0x03b7, 0x03b3, 0x03bc, 0x03ad, 0x03bd, 0x03b1, 0x0020, 0x03c3, 0x03c4, 0x03bf, 0x03b9, 0x03c7, 0x03b5, 0x03af, 0x03b1 }; - const QChar japanese_data[10] = { 0x30A4, 0x30F3, 0x30D0, 0x30FC, 0x30C8, 0x3055, 0x308C, 0x305F, 0x8981, 0x7D20 }; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove + NamesList names; + const QChar russian_data[24] = { + 0x0418, 0x043C, 0x043F, 0x043E, 0x0440, 0x0442, 0x0438, 0x0440, + 0x043E, 0x0432, 0x0430, 0x043D, 0x043D, 0x044B, 0x0435, 0x0020, + 0x044D, 0x043B, 0x0435, 0x043C, 0x0435, 0x043D, 0x0442, 0x044B}; + const QChar greek_data[18] = { + 0x0395, + 0x03b9, + 0x03c3, + 0x03b7, + 0x03b3, + 0x03bc, + 0x03ad, + 0x03bd, + 0x03b1, + 0x0020, + 0x03c3, + 0x03c4, + 0x03bf, + 0x03b9, + 0x03c7, + 0x03b5, + 0x03af, + 0x03b1}; + const QChar japanese_data[10] = { + 0x30A4, + 0x30F3, + 0x30D0, + 0x30FC, + 0x30C8, + 0x3055, + 0x308C, + 0x305F, + 0x8981, + 0x7D20}; names.addName("fr", "Éléments importés"); names.addName("en", "Imported elements"); @@ -1682,8 +1713,27 @@ NamesList QETProject::namesListForIntegrationCategory() names.addName("ca", "Elements importats"); names.addName("ro", "Elemente importate"); names.addName("ja", QString(japanese_data, 10)); - - return(names); + return (names); +#else +# if TODO_LIST +# pragma message("@TODO remove code for QT 6 or later") +# endif + qDebug() << "Help code for QT 6 or later"; + NamesList names; + names.addName("fr", "Éléments importés"); + names.addName("en", "Imported elements"); + names.addName("de", "Importierte elemente"); + names.addName("es", "Elementos importados"); + names.addName("cs", "Zavedené prvky"); + names.addName("pl", "Elementy importowane"); + names.addName("pt", "elementos importados"); + names.addName("it", "Elementi importati"); + names.addName("nl", "Elementen geïmporteerd"); + names.addName("hr", "Uvezeni elementi"); + names.addName("ca", "Elements importats"); + names.addName("ro", "Elemente importate"); + return (names); +#endif } /**