File indexing completed on 2024-12-15 03:45:01
0001 /* 0002 SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org> 0003 0004 SPDX-License-Identifier: MIT 0005 */ 0006 0007 #include "singlerowfilterproxymodel.h" 0008 0009 using namespace KUserFeedback::Console; 0010 0011 SingleRowFilterProxyModel::SingleRowFilterProxyModel(QObject* parent) : 0012 QSortFilterProxyModel(parent) 0013 { 0014 } 0015 0016 SingleRowFilterProxyModel::~SingleRowFilterProxyModel() = default; 0017 0018 void SingleRowFilterProxyModel::setRow(int row) 0019 { 0020 m_row = row; 0021 invalidateFilter(); 0022 } 0023 0024 bool SingleRowFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const 0025 { 0026 if (source_parent.isValid()) 0027 return false; 0028 return source_row == m_row; 0029 } 0030 0031 #include "moc_singlerowfilterproxymodel.cpp"