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 void doSetFocus();
50
51#if QT_CONFIG(printer)
52 void print(QPrinter *printer);
53#endif
54
55 QString selectedText() const;
56 bool isForwardAvailable() const;
57 bool isBackwardAvailable() const;
58
59 bool findText(const QString &text, FindFlags flags, bool incremental,
60 bool fromSearch);
61
62 static bool isLocalUrl(const QUrl &url);
63 static bool canOpenPage(const QString &url);
64 static QString mimeFromUrl(const QUrl &url);
65 static bool launchWithExternalApp(const QUrl &url);
66
67 // implementation detail, not a part of the interface
68 bool eventFilter(QObject *src, QEvent *event) override;
69
70public slots:
71#if QT_CONFIG(clipboard)
72 void copy();
73#endif
74 void home();
75 void forward();
76 void backward();
77
80 void copyAvailable(bool yes);
81 void sourceChanged(const QUrl &url);
82 void forwardAvailable(bool enabled);
83 void backwardAvailable(bool enabled);
84 void highlighted(const QUrl &link);
87private:
88 void doSetSource(const QUrl &url, bool reload);
89
91};
92
93QT_END_NAMESPACE
94
95#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)
void doSetFocus()
QObject * parent
Definition qobject.h:74
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