Skip to content

Commit

Permalink
ENH: add setHtml to qSlicerWebWidget
Browse files Browse the repository at this point in the history
Allows you to easily display content in the widget.

svn-url: http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=28586
git-svn-id: http://svn.slicer.org/Slicer4/trunk@28586 3bd1e089-480b-0410-8dfb-8563597acbee
  • Loading branch information
pieper committed Nov 2, 2019
1 parent 704478f commit b146779
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Base/QTGUI/qSlicerWebWidget.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,14 @@ QString qSlicerWebWidget::evalJS(const QString &js)

}

//-----------------------------------------------------------------------------
void qSlicerWebWidget::setHtml(const QString &html, const QUrl &baseUrl)
{
Q_D(qSlicerWebWidget);

d->WebView->setHtml(html, baseUrl);
}

//-----------------------------------------------------------------------------
void qSlicerWebWidget::setUrl(const QString &url)
{
Expand Down
3 changes: 3 additions & 0 deletions Base/QTGUI/qSlicerWebWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ class Q_SLICER_BASE_QTGUI_EXPORT qSlicerWebWidget
/// Convenience for setting the internal webView QUrl from a QString
Q_INVOKABLE QString url();

/// Convenience for setting the internal webView html from a QString
Q_INVOKABLE void setHtml(const QString &html, const QUrl &baseUrl = QUrl());

public slots:

/// Convenience for setting the internal webView QUrl from a QString
Expand Down

0 comments on commit b146779

Please sign in to comment.