From c25c400c93ce2cca99e225a4ad3584cf3b020f52 Mon Sep 17 00:00:00 2001 From: Andre Rummler Date: Mon, 10 Aug 2026 09:08:57 +0200 Subject: [PATCH 1/3] Some of the newly guarded (Qt5 path) signal/slot connects could be still converted to method pointers. Mostly for completeness as they will go away anyhow soon. Remaining: richtext editor. --- sources/exportdialog.cpp | 12 ++++++------ sources/qetapp.cpp | 2 +- sources/qetdiagrameditor.cpp | 2 +- sources/titleblock/templatelogomanager.cpp | 3 +-- sources/ui/configpage/projectconfigpages.cpp | 6 +++--- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/sources/exportdialog.cpp b/sources/exportdialog.cpp index 7e2b9f7ac..3507b6309 100644 --- a/sources/exportdialog.cpp +++ b/sources/exportdialog.cpp @@ -141,12 +141,12 @@ QWidget *ExportDialog::initDiagramsListPart() clipboard_mapper_ = new QSignalMapper(this); #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // TODO Qt6 only: remove, mappedInt() always available - connect(preview_mapper_, SIGNAL(mapped(int)), this, SLOT(slot_previewDiagram(int))); - connect(width_mapper_, SIGNAL(mapped(int)), this, SLOT(slot_correctHeight(int))); - connect(height_mapper_, SIGNAL(mapped(int)), this, SLOT(slot_correctWidth(int))); - connect(ratio_mapper_, SIGNAL(mapped(int)), this, SLOT(slot_keepRatioChanged(int))); - connect(reset_mapper_, SIGNAL(mapped(int)), this, SLOT(slot_resetSize(int))); - connect(clipboard_mapper_, SIGNAL(mapped(int)), this, SLOT(slot_exportToClipBoard(int))); + connect(preview_mapper_, qOverload(&QSignalMapper::mapped), this, &ExportDialog::slot_previewDiagram); + connect(width_mapper_, qOverload(&QSignalMapper::mapped), this, &ExportDialog::slot_correctHeight); + connect(height_mapper_, qOverload(&QSignalMapper::mapped), this, &ExportDialog::slot_correctWidth); + connect(ratio_mapper_, qOverload(&QSignalMapper::mapped), this, &ExportDialog::slot_keepRatioChanged); + connect(reset_mapper_, qOverload(&QSignalMapper::mapped), this, &ExportDialog::slot_resetSize); + connect(clipboard_mapper_, qOverload(&QSignalMapper::mapped), this, &ExportDialog::slot_exportToClipBoard); #else connect(preview_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_previewDiagram); connect(width_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_correctHeight); diff --git a/sources/qetapp.cpp b/sources/qetapp.cpp index 95d84a4d0..5b7003c57 100644 --- a/sources/qetapp.cpp +++ b/sources/qetapp.cpp @@ -125,7 +125,7 @@ QETApp::QETApp() : initSystemTray(); #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // TODO Qt6 only: remove, mappedObject() always available - connect(&signal_map, SIGNAL(mapped(QWidget *)), this, SLOT(invertMainWindowVisibility(QWidget *))); + connect(&signal_map, qOverload(&QSignalMapper::mapped), this, [this](QObject *object) { invertMainWindowVisibility(qobject_cast(object)); }); #else connect(&signal_map, &QSignalMapper::mappedObject, this, [this](QObject *object) { invertMainWindowVisibility(qobject_cast(object)); }); #endif diff --git a/sources/qetdiagrameditor.cpp b/sources/qetdiagrameditor.cpp index 44353b655..97c062490 100644 --- a/sources/qetdiagrameditor.cpp +++ b/sources/qetdiagrameditor.cpp @@ -108,7 +108,7 @@ QETDiagramEditor::QETDiagramEditor(const QStringList &files, QWidget *parent) : //Set the signal mapper #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // TODO Qt6 only: remove, mappedObject() always available - connect(&windowMapper, SIGNAL(mapped(QWidget *)), this, SLOT(activateWidget(QWidget *))); + connect(&windowMapper, qOverload(&QSignalMapper::mapped), this, [this](QObject *object) { activateWidget(qobject_cast(object)); }); #else connect(&windowMapper, &QSignalMapper::mappedObject, this, [this](QObject *object) { activateWidget(qobject_cast(object)); }); #endif diff --git a/sources/titleblock/templatelogomanager.cpp b/sources/titleblock/templatelogomanager.cpp index 8a0df8e4f..a8e925f4f 100644 --- a/sources/titleblock/templatelogomanager.cpp +++ b/sources/titleblock/templatelogomanager.cpp @@ -217,8 +217,7 @@ QString TitleBlockTemplateLogoManager::confirmLogoName(const QString &initial_na connect(rename_button, &QPushButton::clicked, signal_mapper, qOverload<>(&QSignalMapper::map)); connect(cancel_button, &QPushButton::clicked, signal_mapper, qOverload<>(&QSignalMapper::map)); #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // TODO Qt6 only: remove, mappedInt() always available - connect(signal_mapper, SIGNAL(mapped(int)), rename_dialog, SLOT(done(int))); - + connect(signal_mapper, qOverload(&QSignalMapper::mapped), rename_dialog, &QDialog::done); #else connect(signal_mapper, &QSignalMapper::mappedInt, rename_dialog, &QDialog::done); #endif diff --git a/sources/ui/configpage/projectconfigpages.cpp b/sources/ui/configpage/projectconfigpages.cpp index 0a95c3c10..183b16f38 100644 --- a/sources/ui/configpage/projectconfigpages.cpp +++ b/sources/ui/configpage/projectconfigpages.cpp @@ -397,7 +397,7 @@ void ProjectAutoNumConfigPage::buildConnections() connect(m_saw_conductor, &SelectAutonumW::applyPressed, this, &ProjectAutoNumConfigPage::saveContextConductor); connect(m_saw_conductor, &SelectAutonumW::removeClicked, this, &ProjectAutoNumConfigPage::removeContextConductor); #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // TODO Qt6 only: remove, textActivated() always available - connect(m_saw_conductor->contextComboBox(), SIGNAL(activated(QString)), this, SLOT(updateContextConductor(QString))); + connect(m_saw_conductor->contextComboBox(), &QComboBox::activated, this, &ProjectAutoNumConfigPage::updateContextConductor); #else connect(m_saw_conductor->contextComboBox(), &QComboBox::textActivated, this, &ProjectAutoNumConfigPage::updateContextConductor); #endif @@ -406,7 +406,7 @@ void ProjectAutoNumConfigPage::buildConnections() connect(m_saw_element, &SelectAutonumW::applyPressed, this, &ProjectAutoNumConfigPage::saveContextElement); connect(m_saw_element, &SelectAutonumW::removeClicked, this, &ProjectAutoNumConfigPage::removeContextElement); #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // TODO Qt6 only: remove, textActivated() always available - connect(m_saw_element->contextComboBox(), SIGNAL(activated(QString)), this, SLOT(updateContextElement(QString))); + connect(m_saw_element->contextComboBox(), &QComboBox::activated, this, &ProjectAutoNumConfigPage::updateContextElement); #else connect(m_saw_element->contextComboBox(), &QComboBox::textActivated, this, &ProjectAutoNumConfigPage::updateContextElement); #endif @@ -415,7 +415,7 @@ void ProjectAutoNumConfigPage::buildConnections() connect(m_saw_folio, &SelectAutonumW::applyPressed, this, &ProjectAutoNumConfigPage::saveContextFolio); connect(m_saw_folio, &SelectAutonumW::removeClicked, this, &ProjectAutoNumConfigPage::removeContextFolio); #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // TODO Qt6 only: remove, textActivated() always available - connect(m_saw_folio->contextComboBox(), SIGNAL(activated(QString)), this, SLOT(updateContextFolio(QString))); + connect(m_saw_folio->contextComboBox(), &QComboBox::activated, this, &ProjectAutoNumConfigPage::updateContextFolio); #else connect(m_saw_folio->contextComboBox(), &QComboBox::textActivated, this, &ProjectAutoNumConfigPage::updateContextFolio); #endif From 7ba295a339cfb03661fbc0a5af5178cff67c127f Mon Sep 17 00:00:00 2001 From: Andre Rummler Date: Thu, 13 Aug 2026 15:45:15 +0200 Subject: [PATCH 2/3] Remove all Qt version checks and branches for <5.14.0 as such versions are no longer supported. --- .../elementscollectionwidget.cpp | 7 ------ .../ElementsCollection/elementstreeview.cpp | 4 ---- sources/conductorproperties.cpp | 7 ------ sources/diagram.cpp | 9 ------- sources/diagramevent/diagrameventaddmacro.cpp | 8 ------- .../graphicspart/customelementgraphicpart.cpp | 7 ------ sources/factory/elementpicturefactory.cpp | 7 ------ sources/main.cpp | 11 +-------- sources/qet.cpp | 24 ++++--------------- sources/qetgraphicsitem/conductor.cpp | 8 +------ sources/richtext/richtexteditor.cpp | 12 +--------- sources/titleblocktemplate.cpp | 16 ------------- .../configpage/generalconfigurationpage.cpp | 7 +----- sources/ui/configpage/projectconfigpages.cpp | 12 ---------- sources/utils/qetsettings.cpp | 2 -- sources/utils/qetsettings.h | 2 -- 16 files changed, 8 insertions(+), 135 deletions(-) diff --git a/sources/ElementsCollection/elementscollectionwidget.cpp b/sources/ElementsCollection/elementscollectionwidget.cpp index 2d0cf1693..605489430 100644 --- a/sources/ElementsCollection/elementscollectionwidget.cpp +++ b/sources/ElementsCollection/elementscollectionwidget.cpp @@ -949,14 +949,7 @@ void ElementsCollectionWidget::search() } hideCollection(true); -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove - const QStringList text_list = text.split("+", QString::SkipEmptyParts); -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 5.14 or later") -#endif const QStringList text_list = text.split("+", Qt::SkipEmptyParts); -#endif QModelIndexList match_index; for (QString txt : text_list) { match_index << m_model->match(m_showed_index.isValid() diff --git a/sources/ElementsCollection/elementstreeview.cpp b/sources/ElementsCollection/elementstreeview.cpp index eb62e2d1f..39fe4a70b 100644 --- a/sources/ElementsCollection/elementstreeview.cpp +++ b/sources/ElementsCollection/elementstreeview.cpp @@ -143,11 +143,7 @@ void ElementsTreeView::startElementDrag(const ElementsLocation &location) QString file_name = (last_slash != -1) ? path.mid(last_slash + 1) : path; if (!dir_path.isEmpty()) { - #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) - QStringList parts = dir_path.split('/', QString::SkipEmptyParts); - #else QStringList parts = dir_path.split('/', Qt::SkipEmptyParts); - #endif QString current_path = ""; for (const QString &part : parts) { QString parent_path = current_path; diff --git a/sources/conductorproperties.cpp b/sources/conductorproperties.cpp index 71e552ea4..da3f849d5 100644 --- a/sources/conductorproperties.cpp +++ b/sources/conductorproperties.cpp @@ -811,14 +811,7 @@ void ConductorProperties::readStyle(const QString &style_string) { if (style_string.isEmpty()) return; // recupere la liste des couples style / valeur -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove - QStringList styles = style_string.split(";", QString::SkipEmptyParts); -#else -#if TODO_LIST -#pragma message("@TODO remove code QString::SkipEmptyParts for QT 5.14 or later") -#endif QStringList styles = style_string.split(";", Qt::SkipEmptyParts); -#endif QRegularExpression Rx("^(?[a-z-]+): (?[a-z-]+)$"); if (!Rx.isValid()) diff --git a/sources/diagram.cpp b/sources/diagram.cpp index d0e3127fb..fa707e4a5 100644 --- a/sources/diagram.cpp +++ b/sources/diagram.cpp @@ -1556,14 +1556,6 @@ bool Diagram::fromXml(QDomElement &document, if (content_ptr) { content_ptr -> m_elements = added_elements; content_ptr -> m_conductors_to_move = added_conductors; -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove - content_ptr -> m_text_fields = added_texts.toSet(); - content_ptr -> m_images = added_images.toSet(); - content_ptr -> m_shapes = added_shapes.toSet(); -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 5.14 or later") -#endif content_ptr -> m_text_fields = QSet( added_texts.begin(), added_texts.end()); @@ -1574,7 +1566,6 @@ bool Diagram::fromXml(QDomElement &document, added_shapes.begin(), added_shapes.end()); content_ptr->m_terminal_strip.swap(added_strips); -#endif content_ptr->m_tables.swap(added_tables); } diff --git a/sources/diagramevent/diagrameventaddmacro.cpp b/sources/diagramevent/diagrameventaddmacro.cpp index 556a5e42d..81a0387e0 100644 --- a/sources/diagramevent/diagrameventaddmacro.cpp +++ b/sources/diagramevent/diagrameventaddmacro.cpp @@ -43,11 +43,7 @@ m_preview_item(nullptr) QString file_name = (last_slash != -1) ? path.mid(last_slash + 1) : path; if (!dir_path.isEmpty()) { - #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) - QStringList parts = dir_path.split('/', QString::SkipEmptyParts); - #else QStringList parts = dir_path.split('/', Qt::SkipEmptyParts); - #endif QString current_path = ""; for (const QString &part : parts) { QString parent_path = current_path; @@ -202,11 +198,7 @@ bool DiagramEventAddMacro::loadMacro() QString file_name = (last_slash != -1) ? path.mid(last_slash + 1) : path; if (!dir_path.isEmpty()) { - #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) - QStringList parts = dir_path.split('/', QString::SkipEmptyParts); - #else QStringList parts = dir_path.split('/', Qt::SkipEmptyParts); - #endif QString current_path = ""; for (const QString &part : parts) { QString parent_path = current_path; diff --git a/sources/editor/graphicspart/customelementgraphicpart.cpp b/sources/editor/graphicspart/customelementgraphicpart.cpp index 4c4200dac..f19717eae 100644 --- a/sources/editor/graphicspart/customelementgraphicpart.cpp +++ b/sources/editor/graphicspart/customelementgraphicpart.cpp @@ -521,14 +521,7 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde) resetStyles(); //Get the list of pair style/value -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove - QStringList styles = qde.attribute("style").split(";", QString::SkipEmptyParts); -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 5.14 or later") -#endif QStringList styles = qde.attribute("style").split(";", Qt::SkipEmptyParts); -#endif //Check each pair of style QRegularExpression rx("^\\s*([a-z-]+)\\s*:\\s*([a-zA-Z-]+)\\s*$"); diff --git a/sources/factory/elementpicturefactory.cpp b/sources/factory/elementpicturefactory.cpp index 99d21ca10..a5f0f2d51 100644 --- a/sources/factory/elementpicturefactory.cpp +++ b/sources/factory/elementpicturefactory.cpp @@ -612,14 +612,7 @@ void ElementPictureFactory::setPainterStyle(const QDomElement &dom, QPainter &pa pen.setCapStyle(Qt::SquareCap); //Get the couples style/value -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove - const QStringList styles = dom.attribute("style").split(";", QString::SkipEmptyParts); -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 5.14 or later") -#endif const QStringList styles = dom.attribute("style").split(";", Qt::SkipEmptyParts); -#endif QRegularExpression rx("^(?[a-z-]+):(?[a-zA-Z-]+)$"); if (!rx.isValid()) diff --git a/sources/main.cpp b/sources/main.cpp index 4932b17b9..b0f32a237 100644 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -103,24 +103,15 @@ int main(int argc, char **argv) QDomImplementation::ReturnNullNode); //Creation and execution of the application //HighDPI -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 6 or later") -#endif -#endif -#if QT_VERSION > QT_VERSION_CHECK(5, 7, 0) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); #endif -#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) qputenv("QT_ENABLE_HIGHDPI_SCALING", "1"); QGuiApplication::setHighDpiScaleFactorRoundingPolicy(QetSettings::hdpiScaleFactorRoundingPolicy()); -#endif // Headless command-line export: render a project to PDF/PNG/SVG without diff --git a/sources/qet.cpp b/sources/qet.cpp index 7d57f2999..0f0a5a8ee 100644 --- a/sources/qet.cpp +++ b/sources/qet.cpp @@ -184,16 +184,8 @@ bool QET::orthogonalProjection( // determine le point d'intersection des deux droites = le projete orthogonal QPointF intersection_point; -#if TODO_LIST -#pragma message("@TODO remove code for QT 5.14 or later") -#endif - QLineF::IntersectType it = line. -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) - intersect // ### Qt 6: remove -#else - intersects -#endif - (perpendicular_line, &intersection_point); + + QLineF::IntersectType it = line.intersects(perpendicular_line, &intersection_point); // ne devrait pas arriver (mais bon...) if (it == QLineF::NoIntersection) return(false); @@ -546,16 +538,8 @@ QString QET::joinWithSpaces(const QStringList &string_list) { QStringList QET::splitWithSpaces(const QString &string) { // les chaines sont separees par des espaces non echappes // = avec un nombre nul ou pair de backslashes devant -#if TODO_LIST -#pragma message("@TODO remove code for QT 5.14 or later") -#endif - QStringList escaped_strings = string.split(QRegularExpression("[^\\]?(?:\\\\)* "), -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove - QString -#else - Qt -#endif - ::SkipEmptyParts); + + QStringList escaped_strings = string.split(QRegularExpression("[^\\]?(?:\\\\)* "),Qt::SkipEmptyParts); QStringList returned_list; foreach(QString escaped_string, escaped_strings) { diff --git a/sources/qetgraphicsitem/conductor.cpp b/sources/qetgraphicsitem/conductor.cpp index 291608620..0b105a9c0 100644 --- a/sources/qetgraphicsitem/conductor.cpp +++ b/sources/qetgraphicsitem/conductor.cpp @@ -1725,14 +1725,8 @@ QSet Conductor::relatedPotentialConductors(const bool all_diagram, for (Conductor *c : other_conductors_list_t) { other_conductors += c->relatedPotentialConductors(all_diagram, t_list); } -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove - other_conductors += other_conductors_list_t.toSet(); -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 5.14 or later") -#endif + 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 41515d02b..e8055fc08 100644 --- a/sources/richtext/richtexteditor.cpp +++ b/sources/richtext/richtexteditor.cpp @@ -78,11 +78,7 @@ #include #include -#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) #include -#else -#define QStringView QStringRef -#endif QT_BEGIN_NAMESPACE @@ -744,14 +740,8 @@ QString RichTextEditor::text(Qt::TextFormat format) const return m_simplifyRichText ? simplifyRichTextFilter(toHtml()) : toHtml(); case Qt::AutoText: break; -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 5.14 or later") -#endif - case Qt::MarkdownText: //This enum value was added in Qt 5.14. + case Qt::MarkdownText: break; -#endif default: qInfo("(RichTextEditor::text) no valid switch: %d",format); break; diff --git a/sources/titleblocktemplate.cpp b/sources/titleblocktemplate.cpp index 4379605c1..b42806408 100644 --- a/sources/titleblocktemplate.cpp +++ b/sources/titleblocktemplate.cpp @@ -396,16 +396,8 @@ void TitleBlockTemplate::parseRows(const QString &rows_string) { QRegularExpression::CaseInsensitiveOption); bool conv_ok; -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove - QStringList rows_descriptions = - rows_string.split(QChar(';'), QString::SkipEmptyParts); -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 5.14 or later") -#endif QStringList rows_descriptions = rows_string.split(QChar(';'), Qt::SkipEmptyParts); -#endif foreach (QString rows_description, rows_descriptions) { QRegularExpressionMatch match; match = row_size_format.match(rows_description); @@ -438,16 +430,8 @@ void TitleBlockTemplate::parseColumns(const QString &cols_string) { bool conv_ok; qDebug() <<"is QRegularExpression ok?"; -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove - QStringList cols_descriptions = - cols_string.split(QChar(';'), QString::SkipEmptyParts); -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 5.14 or later") -#endif QStringList cols_descriptions = cols_string.split(QChar(';'), Qt::SkipEmptyParts); -#endif foreach (QString cols_description, cols_descriptions) { QRegularExpressionMatch match_abc,match_rel; match_abc = abs_col_size_format.match(cols_description); diff --git a/sources/ui/configpage/generalconfigurationpage.cpp b/sources/ui/configpage/generalconfigurationpage.cpp index 2a7b48ae1..70ad81599 100644 --- a/sources/ui/configpage/generalconfigurationpage.cpp +++ b/sources/ui/configpage/generalconfigurationpage.cpp @@ -40,9 +40,6 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) : QSettings settings; //Appearance tab -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ###Qt 6:remove - ui->m_hdpi_round_policy_widget->setDisabled(true); -#else ui->m_hdpi_round_policy_cb->addItem(tr("Arrondi supérieur pour 0.5 et plus"), QLatin1String("Round")); ui->m_hdpi_round_policy_cb->addItem(tr("Toujours arrondi supérieur"), QLatin1String("Ceil")); ui->m_hdpi_round_policy_cb->addItem(tr("Toujours arrondi inférieur"), QLatin1String("Floor")); @@ -65,7 +62,7 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) : ui->m_hdpi_round_policy_cb->setCurrentIndex(4); break; } -#endif + ui->grid_startup_cb->setChecked(settings.value("diagrameditor/grid_display_startup", true).toBool()); ui->guides_startup_cb->setChecked(settings.value("diagrameditor/guides_display_startup", false).toBool()); ui->DiagramEditor_xGrid_sb->setValue(settings.value("diagrameditor/Xgrid", 10).toInt()); @@ -215,10 +212,8 @@ void GeneralConfigurationPage::applyConf() settings.setValue("lang", ui->m_lang_cb->itemData(ui->m_lang_cb->currentIndex()).toString()); //hdpi -#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) QetSettings::setHdpiScaleFactorRoundingPolicy(ui->m_hdpi_round_policy_cb->currentData().toString()); QGuiApplication::setHighDpiScaleFactorRoundingPolicy(QetSettings::hdpiScaleFactorRoundingPolicy()); -#endif //ELEMENT EDITOR settings.setValue("elementeditor/default-informations", ui->m_default_elements_info->toPlainText()); diff --git a/sources/ui/configpage/projectconfigpages.cpp b/sources/ui/configpage/projectconfigpages.cpp index 183b16f38..e1e404bb1 100644 --- a/sources/ui/configpage/projectconfigpages.cpp +++ b/sources/ui/configpage/projectconfigpages.cpp @@ -396,29 +396,17 @@ void ProjectAutoNumConfigPage::buildConnections() //Conductor Tab connect(m_saw_conductor, &SelectAutonumW::applyPressed, this, &ProjectAutoNumConfigPage::saveContextConductor); connect(m_saw_conductor, &SelectAutonumW::removeClicked, this, &ProjectAutoNumConfigPage::removeContextConductor); -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // TODO Qt6 only: remove, textActivated() always available - connect(m_saw_conductor->contextComboBox(), &QComboBox::activated, this, &ProjectAutoNumConfigPage::updateContextConductor); -#else connect(m_saw_conductor->contextComboBox(), &QComboBox::textActivated, this, &ProjectAutoNumConfigPage::updateContextConductor); -#endif //Element Tab connect(m_saw_element, &SelectAutonumW::applyPressed, this, &ProjectAutoNumConfigPage::saveContextElement); connect(m_saw_element, &SelectAutonumW::removeClicked, this, &ProjectAutoNumConfigPage::removeContextElement); -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // TODO Qt6 only: remove, textActivated() always available - connect(m_saw_element->contextComboBox(), &QComboBox::activated, this, &ProjectAutoNumConfigPage::updateContextElement); -#else connect(m_saw_element->contextComboBox(), &QComboBox::textActivated, this, &ProjectAutoNumConfigPage::updateContextElement); -#endif //Folio Tab connect(m_saw_folio, &SelectAutonumW::applyPressed, this, &ProjectAutoNumConfigPage::saveContextFolio); connect(m_saw_folio, &SelectAutonumW::removeClicked, this, &ProjectAutoNumConfigPage::removeContextFolio); -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // TODO Qt6 only: remove, textActivated() always available - connect(m_saw_folio->contextComboBox(), &QComboBox::activated, this, &ProjectAutoNumConfigPage::updateContextFolio); -#else connect(m_saw_folio->contextComboBox(), &QComboBox::textActivated, this, &ProjectAutoNumConfigPage::updateContextFolio); -#endif // Auto Folio Numbering connect(m_faw, &FolioAutonumberingW::applyPressed, this, &ProjectAutoNumConfigPage::applyAutoNum); diff --git a/sources/utils/qetsettings.cpp b/sources/utils/qetsettings.cpp index 7d5fb43b3..3b2e7a5ac 100644 --- a/sources/utils/qetsettings.cpp +++ b/sources/utils/qetsettings.cpp @@ -22,7 +22,6 @@ namespace QetSettings { -#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) /** * @brief setHdpiScaleFactorRoundingPolicy * Write the value of HdpiScaleFactorRoundingPolicy in @@ -106,5 +105,4 @@ namespace QetSettings return default_policy; } } -#endif } diff --git a/sources/utils/qetsettings.h b/sources/utils/qetsettings.h index b145df15d..857c37796 100644 --- a/sources/utils/qetsettings.h +++ b/sources/utils/qetsettings.h @@ -28,12 +28,10 @@ */ namespace QetSettings { -#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) void setHdpiScaleFactorRoundingPolicy(const QString &policy_str); void setHdpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy); Qt::HighDpiScaleFactorRoundingPolicy hdpiScaleFactorRoundingPolicy( Qt::HighDpiScaleFactorRoundingPolicy default_policy = Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); -#endif } #endif // QETSETTINGS_H From 6d05bc2f219d85258cd80c5e0de070a50e57f1dc Mon Sep 17 00:00:00 2001 From: Andre Rummler Date: Thu, 13 Aug 2026 16:20:30 +0200 Subject: [PATCH 3/3] Remove all Qt version checks and branches for <5.15.12 as such versions are no longer supported. --- sources/TerminalStrip/physicalterminal.cpp | 5 - sources/TerminalStrip/terminalstripdata.cpp | 5 +- .../ui/terminalstriptreedockwidget.cpp | 8 -- sources/conductornumexport.cpp | 8 +- sources/dataBase/ui/elementquerywidget.cpp | 8 +- sources/diagramview.cpp | 21 ---- sources/editor/editorcommands.cpp | 14 --- sources/editor/elementview.cpp | 21 ---- .../ui/elementpropertieseditorwidget.cpp | 2 - sources/exportdialog.cpp | 9 -- sources/print/projectprintwindow.cpp | 105 ++---------------- sources/qetapp.cpp | 5 +- sources/qetdiagrameditor.cpp | 4 - .../ui/graphicstablepropertieseditor.cpp | 8 -- sources/titleblock/templatelogomanager.cpp | 4 - sources/ui/bomexportdialog.cpp | 7 -- 16 files changed, 11 insertions(+), 223 deletions(-) diff --git a/sources/TerminalStrip/physicalterminal.cpp b/sources/TerminalStrip/physicalterminal.cpp index 6af90d55f..75c714bdf 100644 --- a/sources/TerminalStrip/physicalterminal.cpp +++ b/sources/TerminalStrip/physicalterminal.cpp @@ -130,12 +130,7 @@ bool PhysicalTerminal::setLevelOf(const QSharedPointer &terminal, const int i = m_real_terminal.indexOf(terminal); if (i >= 0) { -#if QT_VERSION >= QT_VERSION_CHECK(5,14,0) m_real_terminal.swapItemsAt(i, std::min(level, static_cast(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]); -#endif return true; } return false; diff --git a/sources/TerminalStrip/terminalstripdata.cpp b/sources/TerminalStrip/terminalstripdata.cpp index bee4efbe6..04318f0a1 100644 --- a/sources/TerminalStrip/terminalstripdata.cpp +++ b/sources/TerminalStrip/terminalstripdata.cpp @@ -64,11 +64,8 @@ bool TerminalStripData::fromXml(const QDomElement &xml_element) "due to wrong tag name. Expected " << this->xmlTagName() << " used " << xml_element.tagName(); return false; } -#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) + m_uuid = QUuid::fromString(xml_element.attribute(QStringLiteral("uuid"))); -#else - m_uuid = QUuid(xml_element.attribute(QStringLiteral("uuid"))); -#endif for (auto &xml_info : QETXML::findInDomElement(xml_element.firstChildElement(QStringLiteral("informations")), diff --git a/sources/TerminalStrip/ui/terminalstriptreedockwidget.cpp b/sources/TerminalStrip/ui/terminalstriptreedockwidget.cpp index 5ab386c57..b2e2aa1db 100644 --- a/sources/TerminalStrip/ui/terminalstriptreedockwidget.cpp +++ b/sources/TerminalStrip/ui/terminalstriptreedockwidget.cpp @@ -37,11 +37,7 @@ TerminalStripTreeDockWidget::TerminalStripTreeDockWidget(QETProject *project, QW ui->setupUi(this); setProject(project); -#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0) ui->m_tree_view->expandRecursively(ui->m_tree_view->rootIndex()); -#else - ui->m_tree_view->expandAll(); -#endif } TerminalStripTreeDockWidget::~TerminalStripTreeDockWidget() @@ -95,11 +91,7 @@ void TerminalStripTreeDockWidget::reload() buildTree(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0) ui->m_tree_view->expandRecursively(ui->m_tree_view->rootIndex()); -#else - ui->m_tree_view->expandAll(); -#endif //Reselect the tree widget item of the current edited strip auto item = m_item_strip_H.key(current_); diff --git a/sources/conductornumexport.cpp b/sources/conductornumexport.cpp index 23adb23ed..ba17514ec 100644 --- a/sources/conductornumexport.cpp +++ b/sources/conductornumexport.cpp @@ -72,14 +72,8 @@ bool ConductorNumExport::toCsv() if (file.open(QIODevice::WriteOnly | QIODevice::Text)) { QTextStream stream(&file); -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove - stream << wiresNum() << endl; -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 5.15 or later") -#endif + stream << wiresNum() << &Qt::endl(stream); -#endif } else { return false; diff --git a/sources/dataBase/ui/elementquerywidget.cpp b/sources/dataBase/ui/elementquerywidget.cpp index 606cddd4e..b68036028 100644 --- a/sources/dataBase/ui/elementquerywidget.cpp +++ b/sources/dataBase/ui/elementquerywidget.cpp @@ -48,14 +48,8 @@ ElementQueryWidget::ElementQueryWidget(QWidget *parent) : m_button_group.addButton(ui->m_protection_cb, 5); m_button_group.addButton(ui->m_thumbnail_cb, 6); m_button_group.addButton(ui->m_plc_cb, 7); -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove - connect(&m_button_group, static_cast(&QButtonGroup::buttonClicked), [this](int id) -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 5.15 or later") -#endif connect(&m_button_group, static_cast(&QButtonGroup::idClicked), [this](int id) -#endif + { auto check_box = static_cast(m_button_group.button(0)); if (id == 0) diff --git a/sources/diagramview.cpp b/sources/diagramview.cpp index c2eb0ff9d..5bef9e088 100644 --- a/sources/diagramview.cpp +++ b/sources/diagramview.cpp @@ -458,14 +458,7 @@ void DiagramView::mousePressEvent(QMouseEvent *e) if (m_event_interface && m_event_interface->mousePressEvent(e)) return; //Start drag view when hold the middle button -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 1) // ### Qt 6: remove - if (e->button() == Qt::MidButton) -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 6 or later") -#endif if (e->button() == Qt::MiddleButton) -#endif { m_drag_last_pos = e->pos(); viewport()->setCursor(Qt::ClosedHandCursor); @@ -515,14 +508,7 @@ void DiagramView::mouseMoveEvent(QMouseEvent *e) if (m_event_interface && m_event_interface->mouseMoveEvent(e)) return; // Drag the view -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 1) // ### Qt 6: remove - if (e->buttons() == Qt::MidButton) -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 6 or later") -#endif if (e->buttons() == Qt::MiddleButton) -#endif { QScrollBar *h = horizontalScrollBar(); QScrollBar *v = verticalScrollBar(); @@ -583,14 +569,7 @@ void DiagramView::mouseReleaseEvent(QMouseEvent *e) if (m_event_interface && m_event_interface->mouseReleaseEvent(e)) return; // Stop drag view -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 1) // ### Qt 6: remove - if (e->button() == Qt::MidButton) -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 6 or later") -#endif if (e->button() == Qt::MiddleButton) -#endif { viewport()->setCursor(Qt::ArrowCursor); } diff --git a/sources/editor/editorcommands.cpp b/sources/editor/editorcommands.cpp index dafe10661..7646ab88d 100644 --- a/sources/editor/editorcommands.cpp +++ b/sources/editor/editorcommands.cpp @@ -276,14 +276,7 @@ void ChangeZValueCommand::applyRaise(const QList &items_list) { for (int i = my_items_list.count() - 2 ; i >= 0 ; -- i) { if (my_items_list[i] -> isSelected()) { if (!my_items_list[i +1] -> isSelected()) { -#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) // ### Qt 6: remove - my_items_list.swap(i, i + 1); -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 5.13 or later") -#endif my_items_list.swapItemsAt(i, i + 1); -#endif } } } @@ -301,14 +294,7 @@ void ChangeZValueCommand::applyLower(const QList &items_list) { for (int i = 1 ; i < my_items_list.count() ; ++ i) { if (my_items_list[i] -> isSelected()) { if (!my_items_list[i - 1] -> isSelected()) { -#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) // ### Qt 6: remove - my_items_list.swap(i, i - 1); -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 5.13 or later") -#endif my_items_list.swapItemsAt(i, i - 1); -#endif } } } diff --git a/sources/editor/elementview.cpp b/sources/editor/elementview.cpp index fe7d515b0..62226f748 100644 --- a/sources/editor/elementview.cpp +++ b/sources/editor/elementview.cpp @@ -372,14 +372,7 @@ ElementContent ElementView::pasteWithOffset(const QDomDocument &xml_document) { */ void ElementView::mousePressEvent(QMouseEvent* e) { -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 1) // ### Qt 6: remove - if (e->button() == Qt::MidButton) -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 6 or later") -#endif if (e->button() == Qt::MiddleButton) -#endif { setCursor( (Qt::ClosedHandCursor)); reference_view_ = e->pos(); @@ -394,14 +387,7 @@ void ElementView::mousePressEvent(QMouseEvent* e) */ void ElementView::mouseMoveEvent(QMouseEvent* e) { -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 1) // ### Qt 6: remove - if (e->buttons() == Qt::MidButton) -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 6 or later") -#endif if (e->buttons() == Qt::MiddleButton) -#endif { QScrollBar *h = horizontalScrollBar(); QScrollBar *v = verticalScrollBar(); @@ -420,14 +406,7 @@ void ElementView::mouseMoveEvent(QMouseEvent* e) */ void ElementView::mouseReleaseEvent(QMouseEvent* e) { -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 1) // ### Qt 6: remove - if (e->button() == Qt::MidButton) -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 6 or later") -#endif if (e->button() == Qt::MiddleButton) -#endif { setCursor(Qt::ArrowCursor); adjustSceneRect(); diff --git a/sources/editor/ui/elementpropertieseditorwidget.cpp b/sources/editor/ui/elementpropertieseditorwidget.cpp index 6a09de091..dd8273e7a 100644 --- a/sources/editor/ui/elementpropertieseditorwidget.cpp +++ b/sources/editor/ui/elementpropertieseditorwidget.cpp @@ -423,11 +423,9 @@ void ElementPropertiesEditorWidget::on_m_base_type_cb_currentIndexChanged(int in ui->m_master_gb->setVisible(master); ui->m_terminal_gb->setVisible(terminal); -#if QT_VERSION >= QT_VERSION_CHECK(5,15,0) ui->tabWidget->setTabVisible(1, (type_ == ElementData::Simple || type_ == ElementData::Master)); -#endif updateTree(); } diff --git a/sources/exportdialog.cpp b/sources/exportdialog.cpp index 3507b6309..4f666fef1 100644 --- a/sources/exportdialog.cpp +++ b/sources/exportdialog.cpp @@ -140,21 +140,12 @@ QWidget *ExportDialog::initDiagramsListPart() reset_mapper_ = new QSignalMapper(this); clipboard_mapper_ = new QSignalMapper(this); -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // TODO Qt6 only: remove, mappedInt() always available - connect(preview_mapper_, qOverload(&QSignalMapper::mapped), this, &ExportDialog::slot_previewDiagram); - connect(width_mapper_, qOverload(&QSignalMapper::mapped), this, &ExportDialog::slot_correctHeight); - connect(height_mapper_, qOverload(&QSignalMapper::mapped), this, &ExportDialog::slot_correctWidth); - connect(ratio_mapper_, qOverload(&QSignalMapper::mapped), this, &ExportDialog::slot_keepRatioChanged); - connect(reset_mapper_, qOverload(&QSignalMapper::mapped), this, &ExportDialog::slot_resetSize); - connect(clipboard_mapper_, qOverload(&QSignalMapper::mapped), this, &ExportDialog::slot_exportToClipBoard); -#else connect(preview_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_previewDiagram); connect(width_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_correctHeight); connect(height_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_correctWidth); connect(ratio_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_keepRatioChanged); connect(reset_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_resetSize); connect(clipboard_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_exportToClipBoard); -#endif diagrams_list_layout_ = new QGridLayout(); diff --git a/sources/print/projectprintwindow.cpp b/sources/print/projectprintwindow.cpp index d064ba574..9cba458cd 100644 --- a/sources/print/projectprintwindow.cpp +++ b/sources/print/projectprintwindow.cpp @@ -63,14 +63,7 @@ void ProjectPrintWindow::launchDialog(QETProject *project, QPrinter::OutputForma auto printer_ = new QPrinter(); QPrinter printer(QPrinter::HighResolution); printer_->setDocName(ProjectPrintWindow::docName(project)); -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 1) // ### Qt 6: remove - printer_->setOrientation(QPrinter::Landscape); -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 6 or later") -# endif printer_->setPageOrientation(QPageLayout::Landscape); -#endif if (format == QPrinter::NativeFormat) //To physical printer { @@ -204,7 +197,6 @@ ProjectPrintWindow::~ProjectPrintWindow() */ void ProjectPrintWindow::requestPaint() { - #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) #ifdef Q_OS_WIN #ifdef QT_DEBUG qDebug() << "--"; @@ -229,7 +221,6 @@ void ProjectPrintWindow::requestPaint() qDebug() << "--"; #endif #endif - #endif if (!m_project->diagrams().count()) { return; @@ -317,16 +308,10 @@ void ProjectPrintWindow::printDiagram(Diagram *diagram, bool fit_page, QPainter diagram->render(painter, QRectF(), diagram_rect, Qt::KeepAspectRatio); } else { // Print on one or several pages -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 1) // ### Qt 6: remove - auto printed_rect = full_page ? printer->paperRect() : printer->pageRect(); -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 6 or later") -#endif - qDebug()<<"Help code for QT 6 or later"; + auto printed_rect = full_page ? printer->paperRect(QPrinter::Millimeter) : printer->pageRect(QPrinter::Millimeter); -#endif + auto used_width = printed_rect.width(); auto used_height = printed_rect.height(); auto h_pages_count = horizontalPagesCount(diagram, option, full_page); @@ -476,17 +461,12 @@ int ProjectPrintWindow::horizontalPagesCount( Diagram *diagram, const ExportProperties &option, bool full_page) const { QRect printable_area; -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 1) // ### Qt 6: remove - printable_area = full_page ? m_printer->paperRect() : m_printer->pageRect(); -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 6 or later") -# endif + printable_area = full_page ? m_printer->pageLayout().fullRectPixels(m_printer->resolution()) : m_printer->pageLayout().paintRectPixels(m_printer->resolution()); -#endif + QRect diagram_rect = diagramRect(diagram, option); int h_pages_count = int(ceil(qreal(diagram_rect.width()) / qreal(printable_area.width()))); @@ -505,17 +485,12 @@ int ProjectPrintWindow::verticalPagesCount( Diagram *diagram, const ExportProperties &option, bool full_page) const { QRect printable_area; -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 1) // ### Qt 6: remove - printable_area = full_page ? m_printer->paperRect() : m_printer->pageRect(); -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 6 or later") -# endif + printable_area = full_page ? m_printer->pageLayout().fullRectPixels(m_printer->resolution()) : m_printer->pageLayout().paintRectPixels(m_printer->resolution()); -#endif + QRect diagram_rect = diagramRect(diagram, option); int v_pages_count = int(ceil(qreal(diagram_rect.height()) / qreal(printable_area.height()))); @@ -588,43 +563,7 @@ void ProjectPrintWindow::loadPageSetupForCurrentPrinter() } settings.beginGroup(printer_section); -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 1) // ### Qt 6: remove - if (settings.contains("orientation")) { - QString value = settings.value("orientation", "landscape").toString(); - m_printer -> setOrientation(value == "landscape" ? QPrinter::Landscape : QPrinter::Portrait); - } - if (settings.contains("papersize")) { - int value = settings.value("papersize", QPrinter::A4).toInt(); - if (value == QPrinter::Custom) { - bool w_ok, h_ok; - int w = settings.value("customwidthmm", -1).toInt(&w_ok); - int h = settings.value("customheightmm", -1).toInt(&h_ok); - if (w_ok && h_ok && w != -1 && h != -1) { - m_printer -> setPaperSize(QSizeF(w, h), QPrinter::Millimeter); - } - } else if (value < QPrinter::Custom) { - m_printer -> setPaperSize(static_cast(value)); - } - } - qreal margins[4]; - m_printer -> getPageMargins(&margins[0], &margins[1], &margins[2], &margins[3], QPrinter::Millimeter); - QStringList margins_names(QStringList() << "left" << "top" << "right" << "bottom"); - for (int i = 0 ; i < 4 ; ++ i) { - bool conv_ok; - qreal value = settings.value("margin" + margins_names.at(i), -1.0).toReal(&conv_ok); - if (conv_ok && value != -1.0) margins[i] = value; - } - m_printer->setPageMargins( - margins[0], - margins[1], - margins[2], - margins[3], - QPrinter::Millimeter); -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 6 or later") -# endif if (settings.contains("orientation")) { QString value = settings.value("orientation", "landscape").toString(); @@ -677,7 +616,7 @@ void ProjectPrintWindow::loadPageSetupForCurrentPrinter() m_printer->setPageMargins( QMarginsF(margins[0], margins[1], margins[2], margins[3]), QPageLayout::Millimeter); -#endif + m_printer->setFullPage( settings.value("fullpage", "false").toString() == "true"); @@ -694,35 +633,6 @@ void ProjectPrintWindow::savePageSetupForCurrentPrinter() settings.beginGroup("printers"); settings.beginGroup(printer_section); -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 1) // ### Qt 6: remove - settings.setValue("orientation", m_printer -> orientation() == QPrinter::Portrait ? "portrait" : "landscape"); - settings.setValue("papersize", int(m_printer -> paperSize())); - if (m_printer -> paperSize() == QPrinter::Custom) { - QSizeF size = m_printer -> paperSize(QPrinter::Millimeter); - settings.setValue("customwidthmm", size.width()); - settings.setValue("customheightmm", size.height()); - } else { - settings.remove("customwidthmm"); - settings.remove("customheightmm"); - } - qreal left, top, right, bottom; - m_printer - ->getPageMargins(&left, &top, &right, &bottom, QPrinter::Millimeter); - settings.setValue("marginleft", left); - settings.setValue("margintop", top); - settings.setValue("marginright", right); - settings.setValue("marginbottom", bottom); - settings.setValue("fullpage", m_printer->fullPage() ? "true" : "false"); - settings.endGroup(); - settings.endGroup(); - settings.sync(); - -#else -# if TODO_LIST -# pragma message("@TODO remove code for QT 6 or later") -# endif - qDebug() << "Help code for QT 6 or later"; - settings.setValue( "orientation", m_printer->pageLayout().orientation() == QPageLayout::Portrait ? @@ -753,7 +663,6 @@ void ProjectPrintWindow::savePageSetupForCurrentPrinter() settings.endGroup(); settings.endGroup(); settings.sync(); -#endif } /** diff --git a/sources/qetapp.cpp b/sources/qetapp.cpp index 3baf3c73e..d8afcc34b 100644 --- a/sources/qetapp.cpp +++ b/sources/qetapp.cpp @@ -124,11 +124,8 @@ QETApp::QETApp() : initSplashScreen(); initSystemTray(); -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // TODO Qt6 only: remove, mappedObject() always available - connect(&signal_map, qOverload(&QSignalMapper::mapped), this, [this](QObject *object) { invertMainWindowVisibility(qobject_cast(object)); }); -#else connect(&signal_map, &QSignalMapper::mappedObject, this, [this](QObject *object) { invertMainWindowVisibility(qobject_cast(object)); }); -#endif + qApp->setQuitOnLastWindowClosed(false); connect(qApp, &QApplication::lastWindowClosed, this, &QETApp::checkRemainingWindows); diff --git a/sources/qetdiagrameditor.cpp b/sources/qetdiagrameditor.cpp index b0008f9f8..407f717d9 100644 --- a/sources/qetdiagrameditor.cpp +++ b/sources/qetdiagrameditor.cpp @@ -107,11 +107,7 @@ QETDiagramEditor::QETDiagramEditor(const QStringList &files, QWidget *parent) : m_workspace.setTabsClosable(true); //Set the signal mapper -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // TODO Qt6 only: remove, mappedObject() always available - connect(&windowMapper, qOverload(&QSignalMapper::mapped), this, [this](QObject *object) { activateWidget(qobject_cast(object)); }); -#else connect(&windowMapper, &QSignalMapper::mappedObject, this, [this](QObject *object) { activateWidget(qobject_cast(object)); }); -#endif setWindowTitle(tr("QElectroTech", "window title")); setWindowIcon(QET::Icons::QETLogo); diff --git a/sources/qetgraphicsitem/ViewItem/ui/graphicstablepropertieseditor.cpp b/sources/qetgraphicsitem/ViewItem/ui/graphicstablepropertieseditor.cpp index d0bb1a929..3d1e4e75a 100644 --- a/sources/qetgraphicsitem/ViewItem/ui/graphicstablepropertieseditor.cpp +++ b/sources/qetgraphicsitem/ViewItem/ui/graphicstablepropertieseditor.cpp @@ -451,16 +451,8 @@ void GraphicsTablePropertiesEditor::setUpEditConnection() m_edit_connection << connect(ui->m_table_left_margin, QOverload::of(&QSpinBox::valueChanged), this, &GraphicsTablePropertiesEditor::apply); m_edit_connection << connect(ui->m_table_right_margin, QOverload::of(&QSpinBox::valueChanged), this, &GraphicsTablePropertiesEditor::apply); m_edit_connection << connect(ui->m_table_bottom_margin, QOverload::of(&QSpinBox::valueChanged), this, &GraphicsTablePropertiesEditor::apply); -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove - 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 -#if TODO_LIST -#pragma message("@TODO remove code for QT 5.15 or later") -#endif 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 m_edit_connection << connect(ui->m_display_n_row_sb, QOverload::of(&QSpinBox::valueChanged), this, &GraphicsTablePropertiesEditor::apply); m_edit_connection << connect(ui->m_display_n_row_sb, QOverload::of(&QSpinBox::valueChanged), this, &GraphicsTablePropertiesEditor::updateInfoLabel); } diff --git a/sources/titleblock/templatelogomanager.cpp b/sources/titleblock/templatelogomanager.cpp index a8e925f4f..b850a5d00 100644 --- a/sources/titleblock/templatelogomanager.cpp +++ b/sources/titleblock/templatelogomanager.cpp @@ -216,11 +216,7 @@ QString TitleBlockTemplateLogoManager::confirmLogoName(const QString &initial_na connect(replace_button, &QPushButton::clicked, signal_mapper, qOverload<>(&QSignalMapper::map)); connect(rename_button, &QPushButton::clicked, signal_mapper, qOverload<>(&QSignalMapper::map)); connect(cancel_button, &QPushButton::clicked, signal_mapper, qOverload<>(&QSignalMapper::map)); -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // TODO Qt6 only: remove, mappedInt() always available - connect(signal_mapper, qOverload(&QSignalMapper::mapped), rename_dialog, &QDialog::done); -#else connect(signal_mapper, &QSignalMapper::mappedInt, rename_dialog, &QDialog::done); -#endif } rd_label -> setText( QString(tr( diff --git a/sources/ui/bomexportdialog.cpp b/sources/ui/bomexportdialog.cpp index 81a78615b..63429ede7 100644 --- a/sources/ui/bomexportdialog.cpp +++ b/sources/ui/bomexportdialog.cpp @@ -83,14 +83,7 @@ int BOMExportDialog::exec() if (file.open(QIODevice::WriteOnly | QIODevice::Text)) { QTextStream stream(&file); -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove - stream << getBom() << endl; -#else -#if TODO_LIST -#pragma message("@TODO remove code for QT 5.15 or later") -#endif stream << getBom() << &Qt::endl(stream); -#endif } } }