forked from mirror/nheko
parent
005ed00d67
commit
cb8441b169
@ -0,0 +1,37 @@ |
|||||||
|
/*
|
||||||
|
* <one line to give the program's name and a brief idea of what it does.> |
||||||
|
* Copyright (C) 2020 thurloat <thurloat@protonmail.ch> |
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU General Public License as published by |
||||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||||
|
* (at your option) any later version. |
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU General Public License for more details. |
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/ |
||||||
|
|
||||||
|
#include "TimelineModelFilterProxy.h" |
||||||
|
|
||||||
|
bool |
||||||
|
TimelineModelFilterProxy::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const |
||||||
|
{ |
||||||
|
bool ret(true); |
||||||
|
|
||||||
|
if (this->sourceModel() != nullptr) { |
||||||
|
auto index = this->sourceModel()->index(source_row, 0, source_parent); |
||||||
|
if (index.isValid()) { |
||||||
|
auto value = index.data(); |
||||||
|
if (value.isValid()) { |
||||||
|
ret = true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return ret; |
||||||
|
} |
@ -0,0 +1,48 @@ |
|||||||
|
/*
|
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU General Public License as published by |
||||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||||
|
* (at your option) any later version. |
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU General Public License for more details. |
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/ |
||||||
|
|
||||||
|
#ifndef TIMELINEMODELFILTERPROXY_H |
||||||
|
#define TIMELINEMODELFILTERPROXY_H |
||||||
|
|
||||||
|
#include <qsortfilterproxymodel.h> |
||||||
|
|
||||||
|
#define UNUSED(...) (void)(__VA_ARGS__) |
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo write docs |
||||||
|
*/ |
||||||
|
class TimelineModelFilterProxy : public QSortFilterProxyModel |
||||||
|
{ |
||||||
|
Q_OBJECT |
||||||
|
|
||||||
|
public: |
||||||
|
/**
|
||||||
|
* @todo write docs |
||||||
|
*/ |
||||||
|
TimelineModelFilterProxy(){}; |
||||||
|
virtual ~TimelineModelFilterProxy(){}; |
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo write docs |
||||||
|
* |
||||||
|
* @param source_row TODO |
||||||
|
* @param source_parent TODO |
||||||
|
* @return TODO |
||||||
|
*/ |
||||||
|
bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override; |
||||||
|
|
||||||
|
}; |
||||||
|
|
||||||
|
#endif // TIMELINEMODELFILTERPROXY_H
|
Loading…
Reference in new issue