From fe4552200b95ac9a2ce99b53d58d7a769277a9f4 Mon Sep 17 00:00:00 2001 From: Simon De Backer Date: Sun, 19 Jul 2020 22:06:42 +0200 Subject: [PATCH] Add compiler message @TODO --- SingleApplication/singleapplication.cpp | 2 ++ .../elementscollectionwidget.cpp | 1 + .../ElementsCollection/elementslocation.cpp | 1 + sources/conductornumexport.cpp | 1 + sources/conductorproperties.cpp | 22 ++++++++++++++----- sources/dataBase/ui/elementquerywidget.cpp | 1 + sources/diagram.cpp | 1 + sources/editor/editorcommands.cpp | 2 ++ .../graphicspart/customelementgraphicpart.cpp | 1 + sources/factory/elementpicturefactory.cpp | 1 + sources/main.cpp | 1 + sources/nomenclature.cpp | 1 + sources/qet.cpp | 2 ++ .../ui/graphicstablepropertieseditor.cpp | 1 + sources/qetgraphicsitem/conductor.cpp | 1 + sources/richtext/richtexteditor.cpp | 1 + sources/titleblocktemplate.cpp | 2 ++ sources/ui/bomexportdialog.cpp | 2 ++ sources/ui/compositetexteditdialog.cpp | 2 ++ sources/undocommand/rotatetextscommand.cpp | 2 ++ 20 files changed, 43 insertions(+), 5 deletions(-) diff --git a/SingleApplication/singleapplication.cpp b/SingleApplication/singleapplication.cpp index 1bbe930d9..ebf6f38b2 100644 --- a/SingleApplication/singleapplication.cpp +++ b/SingleApplication/singleapplication.cpp @@ -27,6 +27,7 @@ #include #if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) // ### Qt 6: remove #else +#pragma message("@TODO remove code for QT 5.10 or later") #include #endif #include "singleapplication.h" @@ -106,6 +107,7 @@ SingleApplication::SingleApplication( int &argc, char *argv[], bool allowSeconda qsrand( QDateTime::currentMSecsSinceEpoch() % std::numeric_limits::max() ); QThread::sleep( 8 + static_cast ( static_cast ( qrand() ) / RAND_MAX * 10 ) ); #else +#pragma message("@TODO remove code for QT 5.10 or later") quint32 value = QRandomGenerator::global()->generate(); QThread::sleep( 8 + static_cast ( static_cast ( value ) / RAND_MAX * 10 ) ); #endif diff --git a/sources/ElementsCollection/elementscollectionwidget.cpp b/sources/ElementsCollection/elementscollectionwidget.cpp index 084a57fa8..308150307 100644 --- a/sources/ElementsCollection/elementscollectionwidget.cpp +++ b/sources/ElementsCollection/elementscollectionwidget.cpp @@ -641,6 +641,7 @@ void ElementsCollectionWidget::search() #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove QStringList text_list = text.split("+", QString::SkipEmptyParts); #else +#pragma message("@TODO remove code for QT 5.14 or later") QStringList text_list = text.split("+", Qt::SkipEmptyParts); #endif QModelIndexList match_index; diff --git a/sources/ElementsCollection/elementslocation.cpp b/sources/ElementsCollection/elementslocation.cpp index 9f13df17a..c28f6d63c 100644 --- a/sources/ElementsCollection/elementslocation.cpp +++ b/sources/ElementsCollection/elementslocation.cpp @@ -754,6 +754,7 @@ QDebug operator<< (QDebug debug, const ElementsLocation &location) QDebugStateSaver saver(debug); #if QT_VERSION >= 0x050400 +#pragma message("@TODO remove code for QT 5.04 or later") debug.noquote(); #else debug.nospace(); diff --git a/sources/conductornumexport.cpp b/sources/conductornumexport.cpp index 1eab20d6d..d2f45a1af 100644 --- a/sources/conductornumexport.cpp +++ b/sources/conductornumexport.cpp @@ -70,6 +70,7 @@ bool ConductorNumExport::toCsv() #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove stream << wiresNum() << endl; #else +#pragma message("@TODO remove code for QT 5.15 or later") stream << wiresNum() << &Qt::endl(stream); #endif } diff --git a/sources/conductorproperties.cpp b/sources/conductorproperties.cpp index 1a5b05dab..40bcf4499 100644 --- a/sources/conductorproperties.cpp +++ b/sources/conductorproperties.cpp @@ -331,12 +331,23 @@ void ConductorProperties::fromXml(QDomElement &e) horiz_rotate_text = e.attribute("horizrotatetext").toDouble(); QMetaEnum me = QMetaEnum::fromType(); - m_horizontal_alignment = Qt::Alignment(me.keyToValue(e.attribute("horizontal-alignment", "AlignBottom").toStdString().data())); - m_vertical_alignment = Qt::Alignment(me.keyToValue(e.attribute("vertical-alignment", "AlignRight").toStdString().data())); + m_horizontal_alignment = Qt::Alignment( + me.keyToValue( + e.attribute( + "horizontal-alignment", + "AlignBottom" + ).toStdString().data())); + m_vertical_alignment = Qt::Alignment( + me.keyToValue( + e.attribute( + "vertical-alignment", + "AlignRight" + ).toStdString().data())); - //Keep retrocompatible with version older than 0,4 - //If the propertie @type is simple (removed since QET 0,4), we set text no visible. - //@TODO remove this code for qet 0.6 or later + //Keep retrocompatible with version older than 0,4 + //If the propertie @type is simple (removed since QET 0,4), we set text no visible. + //@TODO remove this code for qet 0.6 or later +#pragma message("@TODO remove this code for qet 0.6 or later") if (e.attribute("type") == "simple") m_show_text = false; } @@ -754,6 +765,7 @@ void ConductorProperties::readStyle(const QString &style_string) { #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove QStringList styles = style_string.split(";", QString::SkipEmptyParts); #else +#pragma message("@TODO remove code QString::SkipEmptyParts for QT 5.14 or later") QStringList styles = style_string.split(";", Qt::SkipEmptyParts); #endif diff --git a/sources/dataBase/ui/elementquerywidget.cpp b/sources/dataBase/ui/elementquerywidget.cpp index 382a5c4dc..c45efa1a2 100644 --- a/sources/dataBase/ui/elementquerywidget.cpp +++ b/sources/dataBase/ui/elementquerywidget.cpp @@ -46,6 +46,7 @@ ElementQueryWidget::ElementQueryWidget(QWidget *parent) : #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove connect(&m_button_group, static_cast(&QButtonGroup::buttonClicked), [this](int id) #else +#pragma message("@TODO remove code for QT 5.15 or later") connect(&m_button_group, static_cast(&QButtonGroup::idClicked), [this](int id) #endif { diff --git a/sources/diagram.cpp b/sources/diagram.cpp index 5222aa075..fd34414de 100644 --- a/sources/diagram.cpp +++ b/sources/diagram.cpp @@ -1141,6 +1141,7 @@ bool Diagram::fromXml(QDomElement &document, QPointF position, bool consider_inf content_ptr -> m_images = added_images.toSet(); content_ptr -> m_shapes = added_shapes.toSet(); #else +#pragma message("@TODO remove code for QT 5.14 or later") content_ptr -> m_text_fields = QSet( added_texts.begin(), added_texts.end()); diff --git a/sources/editor/editorcommands.cpp b/sources/editor/editorcommands.cpp index 85620ff97..1fb7966b9 100644 --- a/sources/editor/editorcommands.cpp +++ b/sources/editor/editorcommands.cpp @@ -416,6 +416,7 @@ void ChangeZValueCommand::applyRaise(const QList &items_list) { #if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) // ### Qt 6: remove my_items_list.swap(i, i + 1); #else +#pragma message("@TODO remove code for QT 5.13 or later") my_items_list.swapItemsAt(i, i + 1); #endif } @@ -438,6 +439,7 @@ void ChangeZValueCommand::applyLower(const QList &items_list) { #if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) // ### Qt 6: remove my_items_list.swap(i, i - 1); #else +#pragma message("@TODO remove code for QT 5.13 or later") my_items_list.swapItemsAt(i, i - 1); #endif } diff --git a/sources/editor/graphicspart/customelementgraphicpart.cpp b/sources/editor/graphicspart/customelementgraphicpart.cpp index e19280ecc..d01114d8c 100644 --- a/sources/editor/graphicspart/customelementgraphicpart.cpp +++ b/sources/editor/graphicspart/customelementgraphicpart.cpp @@ -498,6 +498,7 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde) #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove QStringList styles = qde.attribute("style").split(";", QString::SkipEmptyParts); #else +#pragma message("@TODO remove code for QT 5.14 or later") QStringList styles = qde.attribute("style").split(";", Qt::SkipEmptyParts); #endif diff --git a/sources/factory/elementpicturefactory.cpp b/sources/factory/elementpicturefactory.cpp index 4ac20c169..2cb0b11bc 100644 --- a/sources/factory/elementpicturefactory.cpp +++ b/sources/factory/elementpicturefactory.cpp @@ -559,6 +559,7 @@ void ElementPictureFactory::setPainterStyle(const QDomElement &dom, QPainter &pa #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove const QStringList styles = dom.attribute("style").split(";", QString::SkipEmptyParts); #else +#pragma message("@TODO remove code for QT 5.14 or later") const QStringList styles = dom.attribute("style").split(";", Qt::SkipEmptyParts); #endif QRegExp rx("^\\s*([a-z-]+)\\s*:\\s*([a-zA-Z-]+)\\s*$"); diff --git a/sources/main.cpp b/sources/main.cpp index 1f6dc349d..66a6fa6d8 100644 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -39,6 +39,7 @@ int main(int argc, char **argv) //Creation and execution of the application //HighDPI #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) +#pragma message("@TODO remove code for QT 5.6 or later") QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #else qputenv("QT_DEVICE_PIXEL_RATIO", QByteArray("auto")); diff --git a/sources/nomenclature.cpp b/sources/nomenclature.cpp index 7c9878334..97b315b17 100644 --- a/sources/nomenclature.cpp +++ b/sources/nomenclature.cpp @@ -69,6 +69,7 @@ bool nomenclature::saveToCSVFile() #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove stream << getNomenclature() << endl; #else +#pragma message("@TODO remove code for QT 5.15 or later") stream << getNomenclature() << &Qt::endl(stream); #endif } diff --git a/sources/qet.cpp b/sources/qet.cpp index 928ccda86..9a83f9e98 100644 --- a/sources/qet.cpp +++ b/sources/qet.cpp @@ -176,6 +176,7 @@ bool QET::orthogonalProjection(const QPointF &point, const QLineF &line, QPointF #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) QLineF::IntersectType it = line.intersect(perpendicular_line, &intersection_point); // ### Qt 6: remove #else +#pragma message("@TODO remove code for QT 5.14 or later") QLineF::IntersectType it = line.intersects(perpendicular_line, &intersection_point); #endif @@ -450,6 +451,7 @@ QStringList QET::splitWithSpaces(const QString &string) { #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove QStringList escaped_strings = string.split(QRegExp("[^\\]?(?:\\\\)* "), QString::SkipEmptyParts); #else +#pragma message("@TODO remove code for QT 5.14 or later") QStringList escaped_strings = string.split(QRegExp("[^\\]?(?:\\\\)* "), Qt::SkipEmptyParts); #endif diff --git a/sources/qetgraphicsitem/ViewItem/ui/graphicstablepropertieseditor.cpp b/sources/qetgraphicsitem/ViewItem/ui/graphicstablepropertieseditor.cpp index f821ad0d9..75ed5aa63 100644 --- a/sources/qetgraphicsitem/ViewItem/ui/graphicstablepropertieseditor.cpp +++ b/sources/qetgraphicsitem/ViewItem/ui/graphicstablepropertieseditor.cpp @@ -333,6 +333,7 @@ void GraphicsTablePropertiesEditor::setUpEditConnection() m_edit_connection << connect(m_table_button_group, QOverload::of(&QButtonGroup::buttonClicked), this, &GraphicsTablePropertiesEditor::apply); m_edit_connection << connect(m_header_button_group, QOverload::of(&QButtonGroup::buttonClicked), this, &GraphicsTablePropertiesEditor::apply); #else +#pragma message("@TODO remove code for QT 5.15 or later") m_edit_connection << connect(m_table_button_group, QOverload::of(&QButtonGroup::idClicked), this, &GraphicsTablePropertiesEditor::apply); m_edit_connection << connect(m_header_button_group, QOverload::of(&QButtonGroup::idClicked), this, &GraphicsTablePropertiesEditor::apply); #endif diff --git a/sources/qetgraphicsitem/conductor.cpp b/sources/qetgraphicsitem/conductor.cpp index 804b4aa24..9acdf6bd0 100644 --- a/sources/qetgraphicsitem/conductor.cpp +++ b/sources/qetgraphicsitem/conductor.cpp @@ -1675,6 +1675,7 @@ QSet Conductor::relatedPotentialConductors(const bool all_diagram, #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove other_conductors += other_conductors_list_t.toSet(); #else +#pragma message("@TODO remove code for QT 5.14 or later") other_conductors += QSet(other_conductors_list_t.begin(),other_conductors_list_t.end()); #endif } diff --git a/sources/richtext/richtexteditor.cpp b/sources/richtext/richtexteditor.cpp index ddd3ad7f1..df9cbda5a 100644 --- a/sources/richtext/richtexteditor.cpp +++ b/sources/richtext/richtexteditor.cpp @@ -739,6 +739,7 @@ QString RichTextEditor::text(Qt::TextFormat format) const break; #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) #else +#pragma message("@TODO remove code for QT 5.14 or later") case Qt::MarkdownText: //This enum value was added in Qt 5.14. break; #endif diff --git a/sources/titleblocktemplate.cpp b/sources/titleblocktemplate.cpp index 12c011872..83bbf4651 100644 --- a/sources/titleblocktemplate.cpp +++ b/sources/titleblocktemplate.cpp @@ -338,6 +338,7 @@ void TitleBlockTemplate::parseRows(const QString &rows_string) { #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove QStringList rows_descriptions = rows_string.split(QChar(';'), QString::SkipEmptyParts); #else +#pragma message("@TODO remove code for QT 5.14 or later") QStringList rows_descriptions = rows_string.split(QChar(';'), Qt::SkipEmptyParts); #endif foreach (QString rows_description, rows_descriptions) { @@ -365,6 +366,7 @@ void TitleBlockTemplate::parseColumns(const QString &cols_string) { #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove QStringList cols_descriptions = cols_string.split(QChar(';'), QString::SkipEmptyParts); #else +#pragma message("@TODO remove code for QT 5.14 or later") QStringList cols_descriptions = cols_string.split(QChar(';'), Qt::SkipEmptyParts); #endif foreach (QString cols_description, cols_descriptions) { diff --git a/sources/ui/bomexportdialog.cpp b/sources/ui/bomexportdialog.cpp index 3ce6242ef..87ddabe28 100644 --- a/sources/ui/bomexportdialog.cpp +++ b/sources/ui/bomexportdialog.cpp @@ -61,6 +61,7 @@ BOMExportDialog::BOMExportDialog(QETProject *project, QWidget *parent) : #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove connect(&m_button_group, static_cast(&QButtonGroup::buttonClicked), [this](int id) #else +#pragma message("@TODO remove code for QT 5.15 or later") connect(&m_button_group, static_cast(&QButtonGroup::idClicked), [this](int id) #endif { @@ -154,6 +155,7 @@ int BOMExportDialog::exec() #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove stream << getBom() << endl; #else +#pragma message("@TODO remove code for QT 5.15 or later") stream << getBom() << &Qt::endl(stream); #endif } diff --git a/sources/ui/compositetexteditdialog.cpp b/sources/ui/compositetexteditdialog.cpp index d45500310..1d9894f0e 100644 --- a/sources/ui/compositetexteditdialog.cpp +++ b/sources/ui/compositetexteditdialog.cpp @@ -16,6 +16,7 @@ CompositeTextEditDialog::CompositeTextEditDialog(DynamicElementTextItem *text, Q m_default_text = m_text->compositeText(); ui->m_plain_text_edit->setPlainText(m_default_text); #if QT_VERSION >= 0x050300 +#pragma message("@TODO remove code for QT 5.3 or later") ui->m_plain_text_edit->setPlaceholderText(tr("Entrée votre texte composé ici, en vous aidant des variables disponible")); #endif setUpComboBox(); @@ -29,6 +30,7 @@ CompositeTextEditDialog::CompositeTextEditDialog(QString text, QWidget *parent) m_default_text = std::move(text); ui->m_plain_text_edit->setPlainText(m_default_text); #if QT_VERSION >= 0x050300 +#pragma message("@TODO remove code for QT 5.3 or later") ui->m_plain_text_edit->setPlaceholderText(tr("Entrée votre texte composé ici, en vous aidant des variables disponible")); #endif setUpComboBox(); diff --git a/sources/undocommand/rotatetextscommand.cpp b/sources/undocommand/rotatetextscommand.cpp index 8e83dad7b..92e8da93c 100644 --- a/sources/undocommand/rotatetextscommand.cpp +++ b/sources/undocommand/rotatetextscommand.cpp @@ -77,6 +77,7 @@ m_diagram(diagram) #if QT_VERSION >= 0x050900 else setObsolete(true); +#pragma message("@TODO remove code for QT 5.9 or later") #endif } @@ -135,6 +136,7 @@ void RotateTextsCommand::openDialog() #if QT_VERSION >= 0x050900 else setObsolete(true); +#pragma message("@TODO remove code for QT 5.9 or later") #endif }