-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathflowwidget.hpp
48 lines (36 loc) · 847 Bytes
/
flowwidget.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef FLOWWIDGET_HPP
#define FLOWWIDGET_HPP
#include <QtCore/qglobal.h>
#if QT_VERSION >= 0x050000
#include <QtWidgets/QWidget>
#else
#include <QtGui/QWidget>
#endif
class QLabel;
class LabelWidget : public QWidget
{
Q_OBJECT
public:
explicit LabelWidget(const QString &text, QWidget *parent);
[[nodiscard]] auto text() const -> QString;
signals:
void removed();
private:
QLabel *m_label;
};
class FlowWidget : public QWidget
{
Q_OBJECT
public:
explicit FlowWidget(QWidget *parent = nullptr);
~FlowWidget() override;
void setItems(const QStringList &list);
void addItem(const QString &text);
[[nodiscard]] auto items() const -> QStringList;
private slots:
void onRemoved();
private:
class FlowWidgetPrivate;
QScopedPointer<FlowWidgetPrivate> d_ptr;
};
#endif // FLOWWIDGET_HPP