LeechCraft
0.6.70-18450-gabe19ee3b0
Modular cross-platform feature rich live environment.
Toggle main menu visibility
Loading...
Searching...
No Matches
flattenfiltermodel.h
Go to the documentation of this file.
1
/**********************************************************************
2
* LeechCraft - modular cross-platform feature rich internet client.
3
* Copyright (C) 2006-2014 Georg Rudoy
4
*
5
* Distributed under the Boost Software License, Version 1.0.
6
* (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7
**********************************************************************/
8
9
#pragma once
10
11
#include <QAbstractItemModel>
12
#include "
modelsconfig.h
"
13
14
namespace
LC::Util
15
{
27
class
UTIL_MODELS_API
FlattenFilterModel
:
public
QAbstractItemModel
28
{
29
protected
:
30
QAbstractItemModel *
Source_
=
nullptr
;
31
QList<QPersistentModelIndex>
SourceIndexes_
;
32
public
:
37
using
QAbstractItemModel::QAbstractItemModel;
38
41
QModelIndex
index
(
int
,
int
,
const
QModelIndex& = {})
const
override
;
42
45
QModelIndex parent (
const
QModelIndex&)
const override
;
46
49
int
rowCount (
const
QModelIndex& parent = {})
const
override
;
50
53
int
columnCount (
const
QModelIndex& parent = {})
const
override
;
54
57
QVariant data (
const
QModelIndex& index,
int
role = Qt::DisplayRole)
const override
;
58
66
void
SetSource (QAbstractItemModel *model);
67
protected
:
87
virtual
bool
IsIndexAccepted (
const
QModelIndex& index)
const
;
88
private
:
89
void
HandleDataChanged (
const
QModelIndex&,
const
QModelIndex&);
90
void
HandleRowsInserted (
const
QModelIndex&,
int
,
int
);
91
void
HandleRowsAboutRemoved (
const
QModelIndex&,
int
,
int
);
92
};
93
}
LC::Util::FlattenFilterModel
Proxy model flattening a hierarchical model.
Definition
flattenfiltermodel.h:28
LC::Util::FlattenFilterModel::index
QModelIndex index(int, int, const QModelIndex &={}) const override
Reimplemented from QAbstractItemModel.
Definition
flattenfiltermodel.cpp:13
LC::Util::FlattenFilterModel::SourceIndexes_
QList< QPersistentModelIndex > SourceIndexes_
Definition
flattenfiltermodel.h:31
LC::Util::FlattenFilterModel::Source_
QAbstractItemModel * Source_
Definition
flattenfiltermodel.h:30
QList
Definition
ianrulesstorage.h:14
modelsconfig.h
UTIL_MODELS_API
#define UTIL_MODELS_API
Definition
modelsconfig.h:16
LC::Util
Definition
icoreproxy.h:34
src
util
models
flattenfiltermodel.h
Generated by
1.17.0