we also want the qbytearray version; use it with QWebFrame::setContent is all. this prevents unecessary QString/QByteArray conversions.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=821515
This commit is contained in:
Aaron J. Seigo 2008-06-17 17:01:08 +00:00
parent 289941dece
commit 28a27433a4
2 changed files with 18 additions and 1 deletions

View File

@ -62,6 +62,14 @@ void WebContent::setUrl(const QUrl &url)
}
}
void WebContent::setHtml(const QByteArray &html, const QUrl &baseUrl)
{
d->loaded = false;
if (d->page) {
d->page->mainFrame()->setContent(html, QString(), baseUrl);
}
}
void WebContent::setHtml(const QString &html, const QUrl &baseUrl)
{
d->loaded = false;

View File

@ -52,7 +52,16 @@ class PLASMA_EXPORT WebContent : public QGraphicsWidget
* Sets the html to be shown along with a base URL to be used
* to resolve relative references.
*
* @param html the html to display in the content area
* @param html the html (in utf8) to display in the content area
* @param baseUrl the base url for relative references
*/
void setHtml(const QByteArray &html, const QUrl &baseUrl = QUrl());
/**
* Sets the html to be shown along with a base URL to be used
* to resolve relative references.
*
* @param html the html (in utf8) to display in the content area
* @param baseUrl the base url for relative references
*/
void setHtml(const QString &html, const QUrl &baseUrl = QUrl());