Commit 04051f6a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port some deprecated methods

parent 094af7af
...@@ -568,7 +568,11 @@ Kleo::CryptoConfigEntryDebugLevel::CryptoConfigEntryDebugLevel(CryptoConfigModul ...@@ -568,7 +568,11 @@ Kleo::CryptoConfigEntryDebugLevel::CryptoConfigEntryDebugLevel(CryptoConfigModul
label->setEnabled(false); label->setEnabled(false);
mComboBox->setEnabled(false); mComboBox->setEnabled(false);
} else { } else {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(mComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(mComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
#else
connect(mComboBox, QOverload<int, const QString &>::of(&QComboBox::currentIndexChanged),
#endif
this, &CryptoConfigEntryDebugLevel::slotChanged); this, &CryptoConfigEntryDebugLevel::slotChanged);
} }
......
...@@ -376,7 +376,11 @@ KeySelectionCombo::KeySelectionCombo(bool secretOnly, QWidget* parent) ...@@ -376,7 +376,11 @@ KeySelectionCombo::KeySelectionCombo(bool secretOnly, QWidget* parent)
d->proxyModel->setSourceModel(d->sortFilterProxy); d->proxyModel->setSourceModel(d->sortFilterProxy);
setModel(d->proxyModel); setModel(d->proxyModel);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(this, static_cast<void(KeySelectionCombo::*)(int)>(&KeySelectionCombo::currentIndexChanged), connect(this, static_cast<void(KeySelectionCombo::*)(int)>(&KeySelectionCombo::currentIndexChanged),
#else
connect(this, static_cast<void(KeySelectionCombo::*)(int, const QString &)>(&KeySelectionCombo::currentIndexChanged),
#endif
this, [this](int row) { this, [this](int row) {
if (row >= 0 && row < d->proxyModel->rowCount()) { if (row >= 0 && row < d->proxyModel->rowCount()) {
if (d->proxyModel->isCustomItem(row)) { if (d->proxyModel->isCustomItem(row)) {
...@@ -432,7 +436,11 @@ void KeySelectionCombo::init() ...@@ -432,7 +436,11 @@ void KeySelectionCombo::init()
Q_EMIT keyListingFinished(); Q_EMIT keyListingFinished();
} }
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(this, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this] () { connect(this, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this] () {
#else
connect(this, QOverload<int, const QString &>::of(&QComboBox::currentIndexChanged), this, [this] () {
#endif
setToolTip(currentData(Qt::ToolTipRole).toString()); setToolTip(currentData(Qt::ToolTipRole).toString());
}); });
} }
......
...@@ -300,8 +300,8 @@ public: ...@@ -300,8 +300,8 @@ public:
updateFilter(); updateFilter();
QObject::connect (mFormatBtns, static_cast<void (QButtonGroup::*)(int, bool)> (&QButtonGroup::buttonToggled), QObject::connect (mFormatBtns, static_cast<void (QButtonGroup::*)(QAbstractButton *, bool)> (&QButtonGroup::buttonToggled),
q, [this](int, bool) { q, [this](QAbstractButton *, bool) {
updateFilter(); updateFilter();
}); });
...@@ -490,7 +490,11 @@ public: ...@@ -490,7 +490,11 @@ public:
connect(combo, &KeySelectionCombo::currentKeyChanged, q, [this] () { connect(combo, &KeySelectionCombo::currentKeyChanged, q, [this] () {
updateOkButton(); updateOkButton();
}); });
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(combo, QOverload<int>::of(&QComboBox::currentIndexChanged), q, [this] () { connect(combo, QOverload<int>::of(&QComboBox::currentIndexChanged), q, [this] () {
#else
connect(combo, QOverload<int, const QString &>::of(&QComboBox::currentIndexChanged), q, [this] () {
#endif
updateOkButton(); updateOkButton();
}); });
...@@ -571,7 +575,11 @@ public: ...@@ -571,7 +575,11 @@ public:
connect(combo, &KeySelectionCombo::currentKeyChanged, q, [this] () { connect(combo, &KeySelectionCombo::currentKeyChanged, q, [this] () {
updateOkButton(); updateOkButton();
}); });
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(combo, QOverload<int>::of(&QComboBox::currentIndexChanged), q, [this] () { connect(combo, QOverload<int>::of(&QComboBox::currentIndexChanged), q, [this] () {
#else
connect(combo, QOverload<int, const QString &>::of(&QComboBox::currentIndexChanged), q, [this] () {
#endif
updateOkButton(); updateOkButton();
}); });
......
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