Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
openpageswidget.h
Go to the documentation of this file.
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 OPENPAGESWIDGET_H
5#define OPENPAGESWIDGET_H
6
7#include <QtWidgets/QStyledItemDelegate>
8#include <QtWidgets/QTreeView>
9
11
12class OpenPagesModel;
13
15{
17public:
18 explicit OpenPagesDelegate(QObject *parent = nullptr);
19 void paint(QPainter *painter, const QStyleOptionViewItem &option,
20 const QModelIndex &index) const override;
21
23};
24
26{
28public:
31
32 void selectCurrentPage();
33 void allowContextMenu(bool ok);
34
37 void closePage(const QModelIndex &index);
38 void closePagesExcept(const QModelIndex &index);
39
40private slots:
42 void handlePressed(const QModelIndex &index);
43 void handleClicked(const QModelIndex &index);
44
45private:
46 bool eventFilter(QObject *obj, QEvent *event) override;
47
48 bool m_allowContextMenu;
49 OpenPagesDelegate *m_delegate;
50};
51
52QT_END_NAMESPACE
53
54#endif // OPENPAGESWIDGET_H
int currentIndex() const
static CentralWidget * instance()
static HelpEngineWrapper & instance()
void reload()
QUrl source() const
QModelIndex pressedIndex
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
This pure abstract function must be reimplemented if you want to provide custom rendering.
QAbstractItemView * openPagesWidget() const
void setCurrentPage(HelpViewer *page)
bool pagesOpenForNamespace(const QString &nameSpace) const
HelpViewer * createNewPageFromSearch(const QUrl &url)
void closePage(HelpViewer *page)
void reloadPages(const QString &nameSpace)
HelpViewer * createBlankPage()
static OpenPagesManager * instance()
void setCurrentPage(int index)
void closePages(const QString &nameSpace)
HelpViewer * addPage(const QUrl &url, qreal zoom=0)
void removePage(int index)
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns for the children of the given parent.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows under the given parent.
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Returns the data stored under the given role for the item referred to by the index.
HelpViewer * pageAt(int index) const
void focusInEvent(QFocusEvent *event) override
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus receive...
void setVisible(bool visible) override
bool eventFilter(QObject *object, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
void setCurrentPage(const QModelIndex &index)
void allowContextMenu(bool ok)
void closePage(const QModelIndex &index)
bool eventFilter(QObject *obj, QEvent *event) override
void closePagesExcept(const QModelIndex &index)
~OpenPagesWidget() override
\inmodule QtCore
@ ShowLastPages
@ ShowHomePage
Combined button and popup list for selecting options.
#define TRACE_OBJ
Definition tracer.h:34