LeechCraft 0.6.70-19424-g027e980fd1
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
categoryselector.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 <QStringList>
13#include <QWidget>
14#include "tagsconfig.h"
15
16class QTreeView;
17
18namespace LC::Util
19{
27 class UTIL_TAGS_API CategorySelector : public QWidget
28 {
29 Q_OBJECT
30
31 class CheckableModel;
32 CheckableModel& Model_;
33 QTreeView& View_;
34 public:
35 explicit CategorySelector (QWidget *parent = nullptr);
36
39 void SetModel (QAbstractItemModel& model);
40
43 void SetCaption (const QString& caption);
44
49 QStringList GetSelections () const;
50
55 QModelIndexList GetSelectedIndexes () const;
56
61 void SetSelections (const QStringList& names);
62
67 void SelectAll ();
68
73 void SelectNone ();
74 signals:
79 void selectionEdited (const QStringList& selected);
80 };
81}
void selectionEdited(const QStringList &selected)
Emitted after the user has changed the selection, with GetSelections().
QStringList GetSelections() const
Returns the selected names present in the model.
void SetModel(QAbstractItemModel &model)
Lists the names of model, which is not owned.
CategorySelector(QWidget *parent=nullptr)
void SelectNone()
Clears the selection.
void SetCaption(const QString &caption)
Sets the header above the list; there is none by default.
void SetSelections(const QStringList &names)
Replaces the selection.
void SelectAll()
Selects exactly the names in the model.
QModelIndexList GetSelectedIndexes() const
Returns the model's indexes of the selected names.
#define UTIL_TAGS_API
Definition tagsconfig.h:16