forward urlchaged signal

back forward reload slots
to make it more usable from javascript and to have the api simiar to qgraphicswebview

svn path=/trunk/KDE/kdelibs/; revision=1166067
This commit is contained in:
Marco Martin 2010-08-20 18:19:11 +00:00
parent 4b8bffc1f8
commit 44d2c0b531
2 changed files with 53 additions and 0 deletions

View File

@ -79,6 +79,8 @@ WebView::WebView(QGraphicsItem *parent)
this, SIGNAL(loadProgress(int)));
connect(d->webView, SIGNAL(loadFinished(bool)),
this, SLOT(loadingFinished(bool)));
connect(d->webView, SIGNAL(urlChanged(const QUrl &)),
this, SLOT(urlChanged(const QUrl &)));
}
WebView::~WebView()
@ -179,6 +181,26 @@ bool WebView::dragToScroll()
return d->webView->dragToScroll();
}
void WebView::back()
{
d->webView->back();
}
void WebView::forward()
{
d->webView->forward();
}
void WebView::reload()
{
d->webView->reload();
}
void WebView::stop()
{
d->webView->stop();
}
void WebView::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
QGraphicsWidget::paint(painter, option, widget);

View File

@ -174,6 +174,31 @@ class PLASMA_EXPORT WebView : public QGraphicsWidget
*/
void setGeometry(const QRectF &geometry);
public Q_SLOTS:
/**
* Loads the previous document in the list of documents built by navigating links.
* @since 4.6
*/
void back();
/**
* Loads the next document in the list of documents built by navigating links.
* @since 4.6
*/
void forward();
/**
* Reloads the current document.
* @since 4.6
*/
void reload();
/**
* Stops loading the document.
* @since 4.6
*/
void stop();
Q_SIGNALS:
/**
* During loading progress, this signal is emitted. The values
@ -191,6 +216,12 @@ class PLASMA_EXPORT WebView : public QGraphicsWidget
*/
void loadFinished(bool success);
/**
* url displayed by the web page changed
* @since 4.6
*/
void urlChanged(const QUrl &url);
protected:
/**
* Reimplementation