LeechCraft 0.6.70-17609-g3dde4097dd
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 <memory>
12#include <QDialog>
13#include <QStringList>
14#include <util/sll/util.h>
15#include "tagsconfig.h"
16
17class QStringListModel;
18
19namespace Ui
20{
21 class CategorySelector;
22}
23
24namespace LC::Util
25{
46 class UTIL_TAGS_API CategorySelector : public QDialog
47 {
48 Q_OBJECT
49
51
52 std::shared_ptr<Ui::CategorySelector> Ui_;
53 SelectorTagsModel& Model_;
54
55 QString Separator_;
56 bool NotificationsEnabled_ = true;
57 public:
64
73 explicit CategorySelector (QWidget *parent = nullptr);
74
81 void SetCaption (const QString& caption);
82
93 QStringList GetSelections () const;
94
104 QList<int> GetSelectedIndexes () const;
105
115 void SetSelections (const QStringList& subset);
116
122 QString GetSeparator () const;
123
130 void SetSeparator (const QString&);
131
134 void SetButtonsMode (ButtonsMode);
135
154 virtual void SetPossibleSelections (QStringList selections, bool sort = true);
155
156 QStringList GetPossibleSelections () const;
157
160 void SelectAll ();
161
164 void SelectNone ();
165
174 void SetSelectionsFromString (const QString& newText);
175 protected:
179 void moveEvent (QMoveEvent*) override;
180 private:
183 void NotifyTagsSelection ();
184
185 [[nodiscard]] Util::DefaultScopeGuard DisableNotifications (bool reemit = true);
186 signals:
191 void tagsSelectionChanged (const QStringList& newSelections);
192 };
193}
The CategorySelector widget provides a way to select amongst a group of items.
CategorySelector(QWidget *parent=nullptr)
Constructor.
void tagsSelectionChanged(const QStringList &newSelections)
Indicates that selections have changed.
detail::ScopeGuard< detail::DefaultScopeGuardDeleter > DefaultScopeGuard
Definition util.h:132
#define UTIL_TAGS_API
Definition tagsconfig.h:16