Commit cd9a35ae authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile against last qt5.15 without deprecated method

parent d7bd1985
......@@ -309,13 +309,25 @@ void TranslatorWidget::init()
slotFromLanguageChanged(0, true);
slotTextChanged();
readConfig();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(d->from, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this](int val) {
slotFromLanguageChanged(val, false);
slotConfigChanged();
});
connect(d->from, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &TranslatorWidget::slotConfigChanged);
connect(d->to, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &TranslatorWidget::slotConfigChanged);
connect(d->to, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &TranslatorWidget::slotTranslate);
connect(d->to, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this]() {
slotConfigChanged();
slotTranslate();
});
#else
connect(d->from, QOverload<int, const QString &>::of(&QComboBox::currentIndexChanged), this, [this](int val) {
slotFromLanguageChanged(val, false);
slotConfigChanged();
});
connect(d->to, QOverload<int, const QString &>::of(&QComboBox::currentIndexChanged), this, [this]() {
slotConfigChanged();
slotTranslate();
});
#endif
hide();
setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed));
......
......@@ -69,7 +69,11 @@ IncidencesForWidget::IncidencesForWidget(QWidget *parent)
d->mIncidencesForComboBox->setObjectName(QStringLiteral("contentstypecombobox"));
d->mIncidencesForComboBox->setWhatsThis(whatsThisForMyOwnFolders);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(d->mIncidencesForComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &IncidencesForWidget::currentIndexChanged);
#else
connect(d->mIncidencesForComboBox, QOverload<int, const QString &>::of(&QComboBox::currentIndexChanged), this, &IncidencesForWidget::currentIndexChanged);
#endif
}
IncidencesForWidget::~IncidencesForWidget()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment