QortalOS Brooklyn for Raspberry Pi 4
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
715 B

/*
SPDX-FileCopyrightText: 2019 Kai Uwe Broulik <[email protected]>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#pragma once
#include <QSortFilterProxyModel>
class LimitedRowCountProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
explicit LimitedRowCountProxyModel(QObject *parent = nullptr);
~LimitedRowCountProxyModel() override;
void setSourceModel(QAbstractItemModel *sourceModel) override;
int limit() const;
void setLimit(int limit);
Q_SIGNALS:
void limitChanged();
protected:
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
private:
int m_limit = 0;
};