Add compiler message @TODO

This commit is contained in:
Simon De Backer
2020-07-19 22:06:42 +02:00
parent d3b237d06c
commit fe4552200b
20 changed files with 43 additions and 5 deletions

View File

@@ -27,6 +27,7 @@
#include <QtCore/QSharedMemory>
#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 <QRandomGenerator>
#endif
#include "singleapplication.h"
@@ -106,6 +107,7 @@ SingleApplication::SingleApplication( int &argc, char *argv[], bool allowSeconda
qsrand( QDateTime::currentMSecsSinceEpoch() % std::numeric_limits<uint>::max() );
QThread::sleep( 8 + static_cast <unsigned long>( static_cast <float>( 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 <unsigned long>( static_cast <float>( value ) / RAND_MAX * 10 ) );
#endif

View File

@@ -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;

View File

@@ -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();

View File

@@ -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
}

View File

@@ -331,12 +331,23 @@ void ConductorProperties::fromXml(QDomElement &e)
horiz_rotate_text = e.attribute("horizrotatetext").toDouble();
QMetaEnum me = QMetaEnum::fromType<Qt::Alignment>();
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
#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

View File

@@ -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<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), [this](int id)
#else
#pragma message("@TODO remove code for QT 5.15 or later")
connect(&m_button_group, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::idClicked), [this](int id)
#endif
{

View File

@@ -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<IndependentTextItem *>(
added_texts.begin(),
added_texts.end());

View File

@@ -416,6 +416,7 @@ void ChangeZValueCommand::applyRaise(const QList<QGraphicsItem *> &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<QGraphicsItem *> &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
}

View File

@@ -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

View File

@@ -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*$");

View File

@@ -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"));

View File

@@ -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
}

View File

@@ -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

View File

@@ -333,6 +333,7 @@ void GraphicsTablePropertiesEditor::setUpEditConnection()
m_edit_connection << connect(m_table_button_group, QOverload<int>::of(&QButtonGroup::buttonClicked), this, &GraphicsTablePropertiesEditor::apply);
m_edit_connection << connect(m_header_button_group, QOverload<int>::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<int>::of(&QButtonGroup::idClicked), this, &GraphicsTablePropertiesEditor::apply);
m_edit_connection << connect(m_header_button_group, QOverload<int>::of(&QButtonGroup::idClicked), this, &GraphicsTablePropertiesEditor::apply);
#endif

View File

@@ -1675,6 +1675,7 @@ QSet<Conductor *> 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<Conductor*>(other_conductors_list_t.begin(),other_conductors_list_t.end());
#endif
}

View File

@@ -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

View File

@@ -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) {

View File

@@ -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<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), [this](int id)
#else
#pragma message("@TODO remove code for QT 5.15 or later")
connect(&m_button_group, static_cast<void (QButtonGroup::*)(int)>(&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
}

View File

@@ -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();

View File

@@ -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
}