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 OPENPAGESMODEL_H
5#define OPENPAGESMODEL_H
6
7#include "openpagesmanager.h"
8
9#include <QtCore/QAbstractTableModel>
10#include <QtCore/QList>
11
12QT_BEGIN_NAMESPACE
13
14class HelpViewer;
15class QUrl;
16
17class OpenPagesModel : public QAbstractTableModel
18{
19 Q_OBJECT
20 friend class OpenPagesManager;
21public:
22 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
23 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
24 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
25
26 HelpViewer *addPage(const QUrl &url, qreal zoom = 0);
27 void removePage(int index);
28 HelpViewer *pageAt(int index) const;
29
30private slots:
31 void handleTitleChanged();
32
33private:
34 OpenPagesModel(QObject *parent);
35
36private:
37 QList<HelpViewer *> m_pages;
38};
39
40QT_END_NAMESPACE
41
42#endif // OPENPAGESMODEL_H
43

source code of qttools/src/assistant/assistant/openpagesmodel.h