forked from qt-creator/qt-creator
litehtml: Add method for retrieving current html content
For squish testing. Fixes: QTCREATORBUG-24903 Change-Id: Id9b21c6be306db9b3ed0e70c23923f39fae2d210 Reviewed-by: Robert Loehning <robert.loehning@qt.io>
This commit is contained in:
@@ -368,6 +368,7 @@ display: block;
|
||||
class QLiteHtmlWidgetPrivate
|
||||
{
|
||||
public:
|
||||
QString html;
|
||||
DocumentContainerContext context;
|
||||
QUrl url;
|
||||
DocumentContainer documentContainer;
|
||||
@@ -421,6 +422,7 @@ QUrl QLiteHtmlWidget::url() const
|
||||
|
||||
void QLiteHtmlWidget::setHtml(const QString &content)
|
||||
{
|
||||
d->html = content;
|
||||
d->documentContainer.setPaintDevice(viewport());
|
||||
d->documentContainer.setDocument(content.toUtf8(), &d->context);
|
||||
verticalScrollBar()->setValue(0);
|
||||
@@ -428,6 +430,11 @@ void QLiteHtmlWidget::setHtml(const QString &content)
|
||||
render();
|
||||
}
|
||||
|
||||
QString QLiteHtmlWidget::html() const
|
||||
{
|
||||
return d->html;
|
||||
}
|
||||
|
||||
QString QLiteHtmlWidget::title() const
|
||||
{
|
||||
return d->documentContainer.caption();
|
||||
|
||||
@@ -45,6 +45,7 @@ public:
|
||||
void setUrl(const QUrl &url);
|
||||
Q_INVOKABLE QUrl url() const;
|
||||
void setHtml(const QString &content);
|
||||
Q_INVOKABLE QString html() const;
|
||||
Q_INVOKABLE QString title() const;
|
||||
|
||||
void setZoomFactor(qreal scale);
|
||||
|
||||
Reference in New Issue
Block a user