Commit 73834e78 authored by Davide Gianforte's avatar Davide Gianforte

replace deprecated QComboBox::activated

parent e2e33862
......@@ -36,6 +36,7 @@
#include <KI18n/KLocalizedString>
#include "../GUI/krlistwidget.h"
#include "../compat.h"
/**
* Constructs a KrMaskChoice which is a child of 'parent', with the
......@@ -110,7 +111,7 @@ KrMaskChoice::KrMaskChoice(QWidget* parent)
connect(PushButton7, &QPushButton::clicked, this, &KrMaskChoice::addSelection);
connect(PushButton7_2, &QPushButton::clicked, this, &KrMaskChoice::deleteSelection);
connect(PushButton7_3, &QPushButton::clicked, this, &KrMaskChoice::clearSelections);
connect(selection, QOverload<const QString &>::of(&KComboBox::activated), selection, &KComboBox::setEditText);
connect(selection, QOverload<const QString &>::of(&KComboBox::QCOMBOBOX_ACTIVATED), selection, &KComboBox::setEditText);
connect(selection->lineEdit(), &QLineEdit::returnPressed, this, &KrMaskChoice::accept);
connect(preSelections, &KrListWidget::currentItemChanged, this, &KrMaskChoice::currentItemChanged);
connect(preSelections, &KrListWidget::itemActivated, this, &KrMaskChoice::acceptFromList);
......
......@@ -41,6 +41,7 @@
#include "../krglobal.h"
#include "../icon.h"
#include "../compat.h"
#define SIZE_MINIMUM QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)
......@@ -152,8 +153,8 @@ newFTPGUI::newFTPGUI(QWidget* parent) : QDialog(parent)
connect(buttonBox, &QDialogButtonBox::accepted, this, &newFTPGUI::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &newFTPGUI::reject);
connect(prefix, QOverload<const QString &>::of(&KComboBox::activated), this, &newFTPGUI::slotTextChanged);
connect(url, QOverload<const QString &>::of(&KrHistoryComboBox::activated), url, &KrHistoryComboBox::addToHistory);
connect(prefix, QOverload<const QString &>::of(&KComboBox::QCOMBOBOX_ACTIVATED), this, &newFTPGUI::slotTextChanged);
connect(url, QOverload<const QString &>::of(&KrHistoryComboBox::QCOMBOBOX_ACTIVATED), url, &KrHistoryComboBox::addToHistory);
if(!lastUsedProtocol.isEmpty()) {
// update the port field
......
......@@ -53,6 +53,7 @@
#include "../defaults.h"
#include "../krglobal.h"
#include "../icon.h"
#include "../compat.h"
#include "../GUI/krhistorycombobox.h"
/*
......@@ -87,7 +88,7 @@ PackGUIBase::PackGUIBase(QWidget* parent)
typeData = new QComboBox(this);
typeData->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed));
connect(typeData, QOverload<const QString &>::of(&QComboBox::activated), this, &PackGUIBase::checkConsistency);
connect(typeData, QOverload<const QString &>::of(&QComboBox::QCOMBOBOX_ACTIVATED), this, &PackGUIBase::checkConsistency);
connect(typeData, QOverload<const QString &>::of(&QComboBox::highlighted), this, &PackGUIBase::checkConsistency);
hbox->addWidget(typeData);
......
......@@ -25,6 +25,7 @@
#include "../krglobal.h"
#include "../krservices.h"
#include "../FileSystem/filesystem.h"
#include "../compat.h"
// QtWidgets
#include <QPushButton>
......@@ -390,8 +391,8 @@ GeneralFilter::GeneralFilter(FilterTabs *tabs, int properties, QWidget *parent,
connect(profileManager, &ProfileManager::saveToProfile, fltTabs, &FilterTabs::saveToProfile);
}
connect(searchFor, QOverload<const QString &>::of(&KrHistoryComboBox::activated), searchFor, &KrHistoryComboBox::addToHistory);
connect(containsText, QOverload<const QString &>::of(&KrHistoryComboBox::activated), containsText, &KrHistoryComboBox::addToHistory);
connect(searchFor, QOverload<const QString &>::of(&KrHistoryComboBox::QCOMBOBOX_ACTIVATED), searchFor, &KrHistoryComboBox::addToHistory);
connect(containsText, QOverload<const QString &>::of(&KrHistoryComboBox::QCOMBOBOX_ACTIVATED), containsText, &KrHistoryComboBox::addToHistory);
// load the completion and history lists
// ==> search for
......
......@@ -82,7 +82,7 @@
#include "../Dialogs/checksumdlg.h"
#include "../KViewer/krviewer.h"
#include "../MountMan/kmountman.h"
#include "../compat.h"
QPointer<ListPanelFunc> ListPanelFunc::copyToClipboardOrigin;
......@@ -714,7 +714,7 @@ void ListPanelFunc::mkdir()
connect(&buttonBox, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
connect(&buttonBox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
connect(&comboBox, QOverload<const QString &>::of(&KrHistoryComboBox::activated),
connect(&comboBox, QOverload<const QString &>::of(&KrHistoryComboBox::QCOMBOBOX_ACTIVATED),
&comboBox, &KrHistoryComboBox::addToHistory);
// ------------------------------------------------------------------------
......
......@@ -28,6 +28,20 @@
#define UDS_ENTRY_INSERT(A, B) UDSEntry::insert((A), (B));
#endif
/**
* QComboBox::activated(const QString &text) was made obsoleted in QT 5.15 in
* favor of QComboBox::textActivated(const QString &text)
*
* https://doc.qt.io/qt-5.15/qcombobox-obsolete.html#activated-1
*
* This can be removed when the qt minimum version required will be >= 5.14
*/
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
#define QCOMBOBOX_ACTIVATED textActivated
#else
#define QCOMBOBOX_ACTIVATED activated
#endif
/**
* QFontMetrics::width(const QString&, int) was made obsoleted in QT 5.11 in
* favor of QFontMetrics::horizontalAdvance(const QString &, int)
......
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