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
helpviewer.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 HELPVIEWER_H
5#define HELPVIEWER_H
6
7#include <QtCore/qglobal.h>
8#include <QtCore/QUrl>
9
10#include <QtGui/QFont>
11#include <QtGui/QTextDocument>
12
13#include <QtPrintSupport/QPrinter>
14
15#include <QtWidgets/QWidget>
16
18
20
21class HelpViewer : public QWidget
22{
24public:
25 enum FindFlag {
28 };
29 Q_DECLARE_FLAGS(FindFlags, FindFlag)
30
31 HelpViewer(qreal zoom, QWidget *parent = nullptr);
33
34 QFont viewerFont() const;
35 void setViewerFont(const QFont &font);
36
37 void scaleUp();
38 void scaleDown();
39
40 void resetScale();
41 qreal scale() const;
42
43 QString title() const;
44
45 QUrl source() const;
46 void reload();
47 void setSource(const QUrl &url);
48
49#if QT_CONFIG(printer)
50 void print(QPrinter *printer);
51#endif
52
53 QString selectedText() const;
54 bool isForwardAvailable() const;
55 bool isBackwardAvailable() const;
56
57 bool findText(const QString &text, FindFlags flags, bool incremental,
58 bool fromSearch);
59
60 static bool isLocalUrl(const QUrl &url);
61 static bool canOpenPage(const QString &url);
62 static QString mimeFromUrl(const QUrl &url);
63 static bool launchWithExternalApp(const QUrl &url);
64
65 // implementation detail, not a part of the interface
66 bool eventFilter(QObject *src, QEvent *event) override;
67
68public slots:
69#if QT_CONFIG(clipboard)
70 void copy();
71#endif
72 void home();
73 void forward();
74 void backward();
75
78 void copyAvailable(bool yes);
79 void sourceChanged(const QUrl &url);
80 void forwardAvailable(bool enabled);
81 void backwardAvailable(bool enabled);
82 void highlighted(const QUrl &link);
85private:
86 void doSetSource(const QUrl &url, bool reload);
87
89};
90
91QT_END_NAMESPACE
92
93#endif // HELPVIEWER_H
QString documentTitle() const
void setText(const QString &text, const QByteArray &resources)
void setPixmap(const QPixmap &pixmap)
QSize minimumSizeHint() const override
QVariant loadResource(int type, const QUrl &name) override
This function is called when the document is loaded and for each image in the document.
void doSetSource(const QUrl &name, QTextDocument::ResourceType type) override
Attempts to load the document at the given url with the specified type.
void setText(const QString &text, const QByteArray &resources)
void setViewerFont(const QFont &font)
static QString mimeFromUrl(const QUrl &url)
void scaleUp()
void forwardAvailable(bool enabled)
QString title() const
void copyAvailable(bool yes)
void setSource(const QUrl &url)
void resetScale()
static bool launchWithExternalApp(const QUrl &url)
void loadFinished()
QString selectedText() const
void sourceChanged(const QUrl &url)
void forward()
void scaleDown()
void printRequested()
static bool isLocalUrl(const QUrl &url)
void reload()
bool isForwardAvailable() const
void backward()
QFont viewerFont() const
~HelpViewer() override
QUrl source() const
void backwardAvailable(bool enabled)
bool findText(const QString &text, FindFlags flags, bool incremental, bool fromSearch)
qreal scale() const
bool isBackwardAvailable() const
bool eventFilter(QObject *src, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
void highlighted(const QUrl &link)
static bool canOpenPage(const QString &url)
QObject * parent
Definition qobject.h:73
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
Combined button and popup list for selecting options.
#define TRACE_OBJ
Definition tracer.h:34