diff options
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp index c634a7f6a..e1a0c98cb 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp @@ -30,8 +30,7 @@ #include "qdir.h" #include "qfile.h" -class QWebViewPrivate -{ +class QWebViewPrivate { public: QWebViewPrivate(QWebView *view) : view(view) @@ -87,7 +86,7 @@ public: \image qwebview-url.png A web site can be loaded onto QWebView with the load() function. Like all - Qt Widgets, the show() function must be invoked in order to display + Qt widgets, the show() function must be invoked in order to display QWebView. The snippet below illustrates this: \snippet webkitsnippets/simple/main.cpp Using QWebView @@ -147,7 +146,8 @@ public: if you do not require QWidget attributes. Nevertheless, QtWebKit depends on QtGui, so you should use a QApplication instead of QCoreApplication. - \sa {Previewer Example}, {Browser} + \sa {Previewer Example}, {Web Browser}, {Form Extractor Example}, + {Google Chat Example}, {Fancy Browser Example} */ /*! @@ -206,16 +206,15 @@ QWebPage *QWebView::page() const \sa page() */ -void QWebView::setPage(QWebPage *page) +void QWebView::setPage(QWebPage* page) { if (d->page == page) return; if (d->page) { - if (d->page->parent() == this) { + if (d->page->parent() == this) delete d->page; - } else { + else d->page->disconnect(this); - } } d->page = page; if (d->page) { @@ -270,19 +269,24 @@ void QWebView::setPage(QWebPage *page) 'ftp'. The result is then passed through QUrl's tolerant parser, and in the case or success, a valid QUrl is returned, or else a QUrl(). - Examples - - webkit.org becomes http://webkit.org - - ftp.webkit.org becomes ftp://ftp.webkit.org - - localhost becomes http://localhost - - /home/user/test.html becomes file:///home/user/test.html (if exists) + \section1 Examples: - Tips when dealing with URLs and strings - - When creating a QString from a QByteArray or a char*, always use - QString::fromUtf8(). - - Do not use QUrl(string), nor QUrl::toString() anywhere where the URL might - be used, such as in the location bar, as those functions loose data. - Instead use QUrl::fromEncoded() and QUrl::toEncoded(), respectively. + \list + \o webkit.org becomes http://webkit.org + \o ftp.webkit.org becomes ftp://ftp.webkit.org + \o localhost becomes http://localhost + \o /home/user/test.html becomes file:///home/user/test.html (if exists) + \endlist + + \section2 Tips when dealing with URLs and strings: + \list + \o When creating a QString from a QByteArray or a char*, always use + QString::fromUtf8(). + \o Do not use QUrl(string), nor QUrl::toString() anywhere where the URL might + be used, such as in the location bar, as those functions loose data. + Instead use QUrl::fromEncoded() and QUrl::toEncoded(), respectively. + \endlist */ QUrl QWebView::guessUrlFromString(const QString &string) { @@ -612,6 +616,8 @@ qreal QWebView::textSizeMultiplier() const These hints are used to initialize QPainter before painting the web page. QPainter::TextAntialiasing is enabled by default. + + \sa QPainter::renderHints() */ QPainter::RenderHints QWebView::renderHints() const { @@ -703,9 +709,8 @@ bool QWebView::event(QEvent *e) } #endif #endif - } else if (e->type() == QEvent::Leave) { + } else if (e->type() == QEvent::Leave) d->page->event(e); - } } return QWidget::event(e); @@ -808,7 +813,7 @@ void QWebView::paintEvent(QPaintEvent *ev) #ifdef QWEBKIT_TIME_RENDERING int elapsed = time.elapsed(); - qDebug()<<"paint event on "<<ev->region()<<", took to render = "<<elapsed; + qDebug() << "paint event on " << ev->region() << ", took to render = " << elapsed; #endif } @@ -1004,9 +1009,8 @@ void QWebView::inputMethodEvent(QInputMethodEvent *e) */ void QWebView::changeEvent(QEvent *e) { - if (d->page && e->type() == QEvent::PaletteChange) { + if (d->page && e->type() == QEvent::PaletteChange) d->page->setPalette(palette()); - } QWidget::changeEvent(e); } |