Commit a7dfef33 authored by David Faure's avatar David Faure
Browse files

Port KCheckComboBox from KComboBox to QComboBox

Summary: We don't need any of the KComboBox/KLineEdit features here.

Test Plan: Used the gui test program

Reviewers: kfunk, mlaurent

Reviewed By: mlaurent

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D28912
parent ad04c019
......@@ -25,7 +25,6 @@
#include "kcheckcombobox.h"
#include <KLineEdit>
#include "libkdepim_debug.h"
#include <QAbstractItemView>
......@@ -135,10 +134,10 @@ void KCheckComboBox::Private::toggleCheckState()
/// Class KCheckComboBox
KCheckComboBox::KCheckComboBox(QWidget *parent)
: KComboBox(parent)
: QComboBox(parent)
, d(new KCheckComboBox::Private(this))
{
connect(this, qOverload<int>(&KComboBox::activated), this, [this]() {
connect(this, qOverload<int>(&QComboBox::activated), this, [this]() {
d->toggleCheckState();
});
connect(model(), &QAbstractItemModel::rowsInserted, this,
......@@ -159,7 +158,6 @@ KCheckComboBox::KCheckComboBox(QWidget *parent)
setCheckedItems(QStringList());
}
});
setInsertPolicy(KComboBox::NoInsert);
view()->installEventFilter(this);
view()->viewport()->installEventFilter(this);
......@@ -177,7 +175,7 @@ KCheckComboBox::~KCheckComboBox()
void KCheckComboBox::hidePopup()
{
if (!d->mIgnoreHide) {
KComboBox::hidePopup();
QComboBox::hidePopup();
}
d->mIgnoreHide = false;
}
......@@ -310,7 +308,7 @@ void KCheckComboBox::wheelEvent(QWheelEvent *event)
void KCheckComboBox::resizeEvent(QResizeEvent *event)
{
KComboBox::resizeEvent(event);
QComboBox::resizeEvent(event);
if (d->mSqueezeText) {
d->updateCheckedItems();
}
......@@ -351,7 +349,7 @@ bool KCheckComboBox::eventFilter(QObject *receiver, QEvent *event)
default:
break;
}
return KComboBox::eventFilter(receiver, event);
return QComboBox::eventFilter(receiver, event);
}
bool KCheckComboBox::alwaysShowDefaultText() const
......
......@@ -28,7 +28,7 @@
#include "kdepim_export.h"
#include <KComboBox>
#include <QComboBox>
#include <QModelIndex>
namespace KPIM {
......@@ -38,7 +38,7 @@ namespace KPIM {
* and the separator that is used to show the items that are selected in the line
* edit.
*/
class KDEPIM_EXPORT KCheckComboBox : public KComboBox
class KDEPIM_EXPORT KCheckComboBox : public QComboBox
{
Q_OBJECT
......
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