1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
3 | |
4 | #ifndef TOPICCHOOSER_H |
5 | #define TOPICCHOOSER_H |
6 | |
7 | #include "ui_topicchooser.h" |
8 | |
9 | #include <QtWidgets/QDialog> |
10 | |
11 | QT_BEGIN_NAMESPACE |
12 | |
13 | class QSortFilterProxyModel; |
14 | struct QHelpLink; |
15 | |
16 | class TopicChooser : public QDialog |
17 | { |
18 | Q_OBJECT |
19 | |
20 | public: |
21 | TopicChooser(QWidget *parent, const QString &keyword, const QList<QHelpLink> &docs); |
22 | ~TopicChooser() override; |
23 | |
24 | QUrl link() const; |
25 | |
26 | private slots: |
27 | void acceptDialog(); |
28 | void setFilter(const QString &pattern); |
29 | void activated(const QModelIndex &index); |
30 | |
31 | private: |
32 | bool eventFilter(QObject *object, QEvent *event) override; |
33 | |
34 | private: |
35 | Ui::TopicChooser ui; |
36 | QList<QUrl> m_links; |
37 | |
38 | QModelIndex m_activedIndex; |
39 | QSortFilterProxyModel *m_filterModel; |
40 | }; |
41 | |
42 | QT_END_NAMESPACE |
43 | |
44 | #endif // TOPICCHOOSER_H |
45 |