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