LeechCraft 0.6.70-18808-g3467692359
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
tagsfiltermodel.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
12#include "tagsconfig.h"
13
14namespace LC::Util
15{
30 {
31 QString Separator_;
32 QList<QString> FilterTags_;
33 int TagsRole_ = -1;
34 bool NormalMode_ = true;
35 public:
41 {
47 Any,
48
54 All
55 };
56 private:
57 TagsInclusionMode TagsMode_ = TagsInclusionMode::All;
58 public:
63 explicit TagsFilterModel (QObject *parent = nullptr);
64
65 void SetTagsRole (int role);
66
80 void SetSeparator (const QString& separator);
81
89 void SetTagsInclusionMode (TagsInclusionMode mode);
90
97 void SetTagsMode (bool enabled);
98 protected:
99 void UpdateDerivedFilter (const QString&) override;
100
101 bool filterAcceptsRow (int, const QModelIndex&) const override;
102
112 virtual QStringList GetTagsForIndex (int row) const;
113 private:
114 bool FilterTagsMode (int, const QModelIndex&) const;
115 };
116}
Provides filter model with additional tags filter mode.
TagsInclusionMode
Describes the modes of matching two sets of tags.
TagsFilterModel(QObject *parent=nullptr)
Creates the model with the given parent.
#define UTIL_TAGS_API
Definition tagsconfig.h:16