19 explicit QLiteHtmlWidget(QWidget *parent =
nullptr);
20 ~QLiteHtmlWidget() override;
23 void setUrl(
const QUrl &url);
24 Q_INVOKABLE QUrl url()
const;
25 void setHtml(
const QString &content);
26 Q_INVOKABLE QString html()
const;
27 Q_INVOKABLE QString title()
const;
29 void setZoomFactor(qreal scale);
30 qreal zoomFactor()
const;
32 bool findText(
const QString &text,
33 QTextDocument::FindFlags flags,
35 bool *wrapped =
nullptr);
37 void setDefaultFont(
const QFont &font);
38 QFont defaultFont()
const;
39 void setAntialias(
bool on);
41 void scrollToAnchor(
const QString &name);
43 using ResourceHandler = std::function<QByteArray(QUrl)>;
44 void setResourceHandler(
const ResourceHandler &handler);
47 Q_INVOKABLE QString selectedText()
const;
50 void linkClicked(
const QUrl &url);
51 void linkHighlighted(
const QUrl &url);
52 void copyAvailable(
bool available);
53 void contextMenuRequested(
const QPoint &pos,
const QUrl &url);
56 void paintEvent(QPaintEvent *event) override;
57 void resizeEvent(QResizeEvent *event) override;
58 void mouseMoveEvent(QMouseEvent *event) override;
59 void mousePressEvent(QMouseEvent *event) override;
60 void mouseReleaseEvent(QMouseEvent *event) override;
61 void mouseDoubleClickEvent(QMouseEvent *event) override;
62 void leaveEvent(QEvent *event) override;
63 void contextMenuEvent(QContextMenuEvent *event) override;
64 void keyPressEvent(QKeyEvent *event) override;
67 void updateHightlightedLink();
68 void setHightlightedLink(
const QUrl &url);
69 void withFixedTextPosition(
const std::function<
void()> &action);
71 QPoint scrollPosition()
const;
72 void htmlPos(
const QPoint &pos, QPoint *viewportPos, QPoint *htmlPos)
const;
73 QPoint toVirtual(
const QPoint &p)
const;
74 QSize toVirtual(
const QSize &s)
const;
75 QRect toVirtual(
const QRect &r)
const;
76 QRect fromVirtual(
const QRect &r)
const;
78 QLiteHtmlWidgetPrivate *d;