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#if defined(QT_PRINTSUPPORT_LIB) && !defined(QT_NO_PRINTER)
14#include <QtPrintSupport/QPrinter>
15#endif
16
17#include <QtWidgets/QWidget>
18
20
22
23class HelpViewer : public QWidget
24{
26public:
27 enum FindFlag {
30 };
31 Q_DECLARE_FLAGS(FindFlags, FindFlag)
32
33 HelpViewer(qreal zoom, QWidget *parent = nullptr);
35
36 QFont viewerFont() const;
37 void setViewerFont(const QFont &font);
38
39 void scaleUp();
40 void scaleDown();
41
42 void resetScale();
43 qreal scale() const;
44
45 QString title() const;
46
47 QUrl source() const;
48 void reload();
49 void setSource(const QUrl &url);
50
51 void doSetFocus();
52
53#if defined(QT_PRINTSUPPORT_LIB) && !defined(QT_NO_PRINTER)
54 void print(QPrinter *printer);
55#endif
56
57 QString selectedText() const;
58 bool isForwardAvailable() const;
59 bool isBackwardAvailable() const;
60
61 bool findText(const QString &text, FindFlags flags, bool incremental,
62 bool fromSearch);
63
64 static bool isLocalUrl(const QUrl &url);
65 static bool canOpenPage(const QString &url);
66 static QString mimeFromUrl(const QUrl &url);
67 static bool launchWithExternalApp(const QUrl &url);
68
69 // implementation detail, not a part of the interface
70 bool eventFilter(QObject *src, QEvent *event) override;
71
72public slots:
73#if QT_CONFIG(clipboard)
74 void copy();
75#endif
76 void home();
77 void forward();
78 void backward();
79
82 void copyAvailable(bool yes);
83 void sourceChanged(const QUrl &url);
84 void forwardAvailable(bool enabled);
85 void backwardAvailable(bool enabled);
86 void highlighted(const QUrl &link);
89private:
90 void doSetSource(const QUrl &url, bool reload);
91
93};
94
95QT_END_NAMESPACE
96
97#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