Commit 907b1dc9 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add custom ListWidgetItem

parent 42a922ac
......@@ -35,7 +35,6 @@ void ConfigureFiltersWidget::init()
for (const auto &filter : lstFilters) {
mListFiltersWidget->addItem(filter.filterName);
}
// TODO load filter
}
void ConfigureFiltersWidget::slotCustomContextMenuRequested(const QPoint &pos)
......@@ -57,3 +56,22 @@ void ConfigureFiltersWidget::removeFilterInfo(const QString &identifier)
FilterSavedManager::self()->removeFilter(identifier);
}
}
FilterListWidgetItem::FilterListWidgetItem(QListWidget *parent)
: QListWidgetItem(parent)
{
}
FilterListWidgetItem::~FilterListWidgetItem()
{
}
const QString &FilterListWidgetItem::identifier() const
{
return mIdentifier;
}
void FilterListWidgetItem::setIdentifier(const QString &newIdentifier)
{
mIdentifier = newIdentifier;
}
......@@ -7,12 +7,26 @@
#pragma once
#include "messagelist_private_export.h"
#include <QListWidget>
#include <QWidget>
class QListWidget;
namespace MessageList
{
namespace Core
{
class FilterListWidgetItem : public QListWidgetItem
{
public:
explicit FilterListWidgetItem(QListWidget *parent = nullptr);
~FilterListWidgetItem() override;
const QString &identifier() const;
void setIdentifier(const QString &newIdentifier);
private:
QString mIdentifier;
};
class MESSAGELIST_TESTS_EXPORT ConfigureFiltersWidget : public QWidget
{
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