Akonadi

tageditwidget.h
1/*
2 This file is part of Akonadi
3
4 SPDX-FileCopyrightText: 2014 Christian Mollekopf <mollekopf@kolabsys.com>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#pragma once
10
11#include "akonadiwidgets_export.h"
12// AkonadiCore
13#include "akonadi/tag.h"
14
15#include <QWidget>
16
17#include <memory>
18
19namespace Akonadi
20{
21class TagModel;
22class TagEditWidgetPrivate;
23
24/**
25 * A widget that offers facilities to add/remove tags and optionally provides a way to select tags.
26 *
27 * @since 4.13
28 */
29class AKONADIWIDGETS_EXPORT TagEditWidget : public QWidget
30{
31 Q_OBJECT
32public:
33 explicit TagEditWidget(QWidget *parent = nullptr);
34 explicit TagEditWidget(Akonadi::TagModel *model, QWidget *parent = nullptr, bool enableSelection = false);
35 ~TagEditWidget() override;
36
37 void setModel(Akonadi::TagModel *model);
38 Akonadi::TagModel *model() const;
39
40 void setSelectionEnabled(bool enabled);
41 bool selectionEnabled() const;
42
43 void setSelection(const Akonadi::Tag::List &tags);
44 [[nodiscard]] Akonadi::Tag::List selection() const;
45
46protected:
47 bool eventFilter(QObject *watched, QEvent *event) override;
48
49private:
50 std::unique_ptr<TagEditWidgetPrivate> const d;
51};
52
53}
A widget that offers facilities to add/remove tags and optionally provides a way to select tags.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.