summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@nokia.com>2009-11-09 18:38:17 +0100
committerJocelyn Turcotte <jocelyn.turcotte@nokia.com>2009-11-10 10:30:24 +0100
commitd15d7385cb6cfb453ab08d6d7154b66c3fb087ee (patch)
tree14bc24f2fde81d5d93958be7662d4cdc0a527529 /src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
parent7bfdec392df263b15fb5661ab7d4f66f1cd8fbae (diff)
Updated WebKit from /home/jturcott/dev/webkit/ to qtwebkit/qtwebkit-4.6 ( 363898ca378e2198b855ca2f8921c5e4f898c5e2 )
Changes in WebKit/qt since the last update: ++ b/WebKit/qt/ChangeLog 2009-11-09 Benjamin Poulain <benjamin.poulain@nokia.com> Reviewed by Kenneth Rohde Christiansen. https://bugs.webkit.org/show_bug.cgi?id=30772 Add a non-const iterator to QWebElementCollection. Move the two attributes of the iterator to private. * Api/qwebelement.h: (const_iterator::begin): (const_iterator::end): (const_iterator::constBegin): (const_iterator::constEnd): (const_iterator::iterator::iterator): (const_iterator::iterator::operator*): (const_iterator::iterator::operator==): (const_iterator::iterator::operator!=): (const_iterator::iterator::operator<): (const_iterator::iterator::operator<=): (const_iterator::iterator::operator>): (const_iterator::iterator::operator>=): (const_iterator::iterator::operator++): (const_iterator::iterator::operator--): (const_iterator::iterator::operator+=): (const_iterator::iterator::operator-=): (const_iterator::iterator::operator+): (const_iterator::iterator::operator-): * tests/qwebelement/tst_qwebelement.cpp: (tst_QWebElement::nonConstIterator): (tst_QWebElement::constIterator): 2009-11-09 Laszlo Gombos <laszlo.1.gombos@nokia.com> Reviewed by Kenneth Christiansen. [Qt] Remove the sessionStorage setting (per Page) https://bugs.webkit.org/show_bug.cgi?id=31249 This setting allows to run sessionStorage on/off on a per page basis. Remove this prematurely exposed API. * Api/qwebsettings.cpp: (QWebSettingsPrivate::apply): (QWebSettings::QWebSettings): * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::database): (tst_QWebPage::testOptionalJSObjects): 2009-11-09 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> Reviewed by Simon Hausmann. [Qt] Remove the QWebPage:webInspectorTriggered signal. User customization of the communication between QWebPage and QWebInspector will be properly designed in the next version. https://bugs.webkit.org/show_bug.cgi?id=30773 * Api/qwebinspector.cpp: * Api/qwebpage.cpp: (QWebPagePrivate::getOrCreateInspector): (QWebPage::triggerAction): * Api/qwebpage.h: * QtLauncher/main.cpp: (MainWindow::MainWindow): 2009-11-05 Simon Hausmann <hausmann@webkit.org> Reviewed by Tor Arne Vestbø. Added a missing re-implementation of QGraphicsItem::inputMethodQuery(). * Api/qgraphicswebview.cpp: (QGraphicsWebView::inputMethodQuery): * Api/qgraphicswebview.h: 2009-11-04 Simon Hausmann <hausmann@webkit.org> Reviewed by Tor Arne Vestbø. Provide a dummy re-implementation of QGraphicsLayoutItem::sizeHint(), similar to QWebView. * Api/qgraphicswebview.cpp: (QGraphicsWebView::sizeHint): * Api/qgraphicswebview.h: 2009-11-04 Simon Hausmann <hausmann@webkit.org> Reviewed by Tor Arne Vestbø. Removed zoomFactoryChanged() signal and added linkClicked() to QGraphicsWebView, for consistency with QWebView. * Api/qgraphicswebview.cpp: (QGraphicsWebView::setPage): (QGraphicsWebView::setZoomFactor): * Api/qgraphicswebview.h: 2009-11-04 Simon Hausmann <hausmann@webkit.org> Reviewed by Tor Arne Vestbø. Added QGraphicsWebView::findText() for convenience and consistency with QWebView. * Api/qgraphicswebview.cpp: (QGraphicsWebView::findText): * Api/qgraphicswebview.h: 2009-11-04 Simon Hausmann <hausmann@webkit.org> Reviewed by Tor Arne Vestbø. Added QGraphicsWebView::pageAction() and triggerPageAction(), for consistency with QWebView. * Api/qgraphicswebview.cpp: (QGraphicsWebView::pageAction): (QGraphicsWebView::triggerPageAction): * Api/qgraphicswebview.h: 2009-11-04 Simon Hausmann <hausmann@webkit.org> Reviewed by Tor Arne Vestbø. Removed QGraphicsWebView::toHtml() after API review. That's consistent with QWebView and also based on the assumption that toHtml() is called less frequently than setHtml(). * Api/qgraphicswebview.cpp: * Api/qgraphicswebview.h: * tests/qgraphicswebview/tst_qgraphicswebview.cpp: (tst_QGraphicsWebView::qgraphicswebview): 2009-11-04 Simon Hausmann <hausmann@webkit.org> Reviewed by Tor Arne Vestbø. Removed the interactive property of QGraphicsWebView. There are clearly use-cases for this feature, but it will require more work to make this fully work with an enum to have fine-grained control over the interactivity levels. For now it is easy to achieve in user-code what the boolean property did. * Api/qgraphicswebview.cpp: (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): (QGraphicsWebView::hoverMoveEvent): (QGraphicsWebView::mouseMoveEvent): (QGraphicsWebView::mousePressEvent): (QGraphicsWebView::mouseReleaseEvent): (QGraphicsWebView::mouseDoubleClickEvent): (QGraphicsWebView::keyPressEvent): (QGraphicsWebView::keyReleaseEvent): (QGraphicsWebView::dragLeaveEvent): (QGraphicsWebView::dragMoveEvent): (QGraphicsWebView::dropEvent): (QGraphicsWebView::wheelEvent): (QGraphicsWebView::inputMethodEvent): * Api/qgraphicswebview.h: * tests/qgraphicswebview/tst_qgraphicswebview.cpp: (tst_QGraphicsWebView::qgraphicswebview): 2009-11-04 Simon Hausmann <hausmann@webkit.org> Reviewed by Tor Arne Vestbø. Make the QGraphicsWebView constructor explicit. * Api/qgraphicswebview.h: 2009-11-05 Simon Hausmann <hausmann@webkit.org> Last Qt 4.5 build fix (*sigh*) * tests/qwebpage/tst_qwebpage.cpp: (inputMethodHints): inputMethodHints() is only used for Qt 4.6, so guard the whole function. 2009-11-05 Simon Hausmann <hausmann@webkit.org> Another prospective build fix against Qt 4.5 (build bot) Don't compile & run the QGraphicsWebView portion of the input methods auto test with Qt 4.5. * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::inputMethods_data): (inputMethodHints): (inputMethodEnabled): (tst_QWebPage::inputMethods): 2009-11-05 Simon Hausmann <hausmann@webkit.org> Prospective build fix against Qt 4.5 (build bot) * Api/qgraphicswebview.cpp: (QGraphicsWebViewPrivate::setInputMethodEnabled): Guard the use of Qt 4.6 specific API with #ifdefs. 2009-11-01 Simon Hausmann <hausmann@webkit.org> Reviewed by Kenneth Christiansen. [Qt] Fix enabling of input method support on QGraphicsWebView. https://bugs.webkit.org/show_bug.cgi?id=30605 Instead of setting the unsupported widget attribute on the QGraphicsWidget in setInputMethodEnabled() set the ItemAcceptsInputMethod GraphicsItem flag directly. Changed the existing input method auto test to run once on a QWebView and once on a QGraphicsWebView. * Api/qgraphicswebview.cpp: (QGraphicsWebViewPrivate::setInputMethodEnabled): * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::inputMethods_data): (inputMethodHints): (inputMethodEnabled): (tst_QWebPage::inputMethods): 2009-11-04 Simon Hausmann <hausmann@webkit.org> Reviewed by Kenneth Christiansen. Added QGraphicsWebView::modified property, for consistency with QWebView. * Api/qgraphicswebview.cpp: (QGraphicsWebView::isModified): * Api/qgraphicswebview.h: * tests/qgraphicswebview/tst_qgraphicswebview.cpp: (tst_QGraphicsWebView::qgraphicswebview): 2009-11-04 Simon Hausmann <hausmann@webkit.org> Reviewed by Kenneth Christiansen. Removed status and progress properties of QGraphicsWebView. Added loadProgress and statusBarMessage signals instead, after API review. * Api/qgraphicswebview.cpp: (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): (QGraphicsWebView::setPage): * Api/qgraphicswebview.h: * tests/qgraphicswebview/tst_qgraphicswebview.cpp: (tst_QGraphicsWebView::qgraphicswebview):
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp')
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp286
1 files changed, 109 insertions, 177 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
index b22109bcdb..0365181391 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
@@ -39,8 +39,6 @@ public:
QGraphicsWebViewPrivate(QGraphicsWebView* parent)
: q(parent)
, page(0)
- , interactive(true)
- , progress(1.0)
{}
virtual void scroll(int dx, int dy, const QRect&);
@@ -61,28 +59,12 @@ public:
virtual QObject* pluginParent() const;
- void _q_doLoadProgress(int progress);
void _q_doLoadFinished(bool success);
- void _q_setStatusBarMessage(const QString& message);
QGraphicsWebView* q;
QWebPage* page;
-
- QString statusBarMessage;
- bool interactive;
- qreal progress;
};
-void QGraphicsWebViewPrivate::_q_doLoadProgress(int progress)
-{
- if (qFuzzyCompare(this->progress, qreal(progress / 100.)))
- return;
-
- this->progress = progress / 100.;
-
- emit q->progressChanged(this->progress);
-}
-
void QGraphicsWebViewPrivate::_q_doLoadFinished(bool success)
{
// If the page had no title, still make sure it gets the signal
@@ -105,8 +87,11 @@ void QGraphicsWebViewPrivate::update(const QRect & dirtyRect)
void QGraphicsWebViewPrivate::setInputMethodEnabled(bool enable)
{
- q->setAttribute(Qt::WA_InputMethodEnabled, enable);
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ q->setFlag(QGraphicsItem::ItemAcceptsInputMethod, enable);
+#endif
}
+
#if QT_VERSION >= 0x040600
void QGraphicsWebViewPrivate::setInputMethodHint(Qt::InputMethodHint hint, bool enable)
{
@@ -156,109 +141,19 @@ QObject* QGraphicsWebViewPrivate::pluginParent() const
return q;
}
-void QGraphicsWebViewPrivate::_q_setStatusBarMessage(const QString& s)
-{
- statusBarMessage = s;
- emit q->statusChanged();
-}
-
/*!
\class QGraphicsWebView
- \brief The QGraphicsWebView class allows Web content to be added to a GraphicsView.
+ \brief The QGraphicsWebView class allows web content to be added to a GraphicsView.
\since 4.6
- An instance of this class renders Web content from a URL or supplied as data, using
- features of the QtWebKit module.
-
- If the width and height of the item is not set, they will dynamically adjust to
- a size appropriate for the content. This width may be large (e.g., 980 pixels or
- more) for typical online Web pages.
-
- \section1 Browser Features
-
- Many of the functions, signals and properties provided by QWebView are also available
- for this item, making it simple to adapt existing code to use QGraphicsWebView instead
- of QWebView.
-
- The item uses a QWebPage object to perform the rendering of Web content, and this can
- be obtained with the page() function, enabling the document itself to be accessed and
- modified.
-
- As with QWebView, the item records the browsing history using a QWebHistory object,
- accessible using the history() function. The QWebSettings object that defines the
- configuration of the browser can be obtained with the settings() function, enabling
- features like plugin support to be customized for each item.
+ A WebGraphicsItem renders web content based on a URL or set data.
- \sa QWebView, QGraphicsTextItem
+ If the width and height of the item is not set, they will
+ dynamically adjust to a size appropriate for the content.
+ This width may be large (eg. 980) for typical online web pages.
*/
/*!
- \fn void QGraphicsWebView::titleChanged(const QString &title)
-
- This signal is emitted whenever the \a title of the main frame changes.
-
- \sa title()
-*/
-
-/*!
- \fn void QGraphicsWebView::urlChanged(const QUrl &url)
-
- This signal is emitted when the \a url of the view changes.
-
- \sa url(), load()
-*/
-
-/*!
- \fn void QGraphicsWebView::statusChanged()
-
- This signal is emitted when the status bar text is changed by the page.
-*/
-
-/*!
- \fn void QGraphicsWebView::iconChanged()
-
- This signal is emitted whenever the icon of the page is loaded or changes.
-
- In order for icons to be loaded, you will need to set an icon database path
- using QWebSettings::setIconDatabasePath().
-
- \sa icon(), QWebSettings::setIconDatabasePath()
-*/
-
-/*!
- \fn void QGraphicsWebView::loadStarted()
-
- This signal is emitted when a new load of the page is started.
-
- \sa progressChanged(), loadFinished()
-*/
-
-/*!
- \fn void QGraphicsWebView::loadFinished(bool ok)
-
- This signal is emitted when a load of the page is finished.
- \a ok will indicate whether the load was successful or any error occurred.
-
- \sa loadStarted()
-*/
-
-/*!
- \fn void QGraphicsWebView::progressChanged(qreal progress)
-
- This signal is emitted every time an element in the web page
- completes loading and the overall loading progress advances.
-
- This signal tracks the progress of all child frames.
-
- The current value is provided by \a progress and scales from 0.0 to 1.0,
- which is the default range of QProgressBar.
-
- \sa loadStarted(), loadFinished()
-*/
-
-
-
-/*!
Constructs an empty QGraphicsWebView with parent \a parent.
\sa load()
@@ -275,7 +170,7 @@ QGraphicsWebView::QGraphicsWebView(QGraphicsItem* parent)
}
/*!
- Destroys the item.
+ Destroys the web graphicsitem.
*/
QGraphicsWebView::~QGraphicsWebView()
{
@@ -356,6 +251,24 @@ QVariant QGraphicsWebView::itemChange(GraphicsItemChange change, const QVariant&
/*! \reimp
*/
+QSizeF QGraphicsWebView::sizeHint(Qt::SizeHint which, const QSizeF& constraint) const
+{
+ if (which == Qt::PreferredSize)
+ return QSizeF(800, 600); // ###
+ return QGraphicsWidget::sizeHint(which, constraint);
+}
+
+/*! \reimp
+*/
+QVariant QGraphicsWebView::inputMethodQuery(Qt::InputMethodQuery query) const
+{
+ if (d->page)
+ return d->page->inputMethodQuery(query);
+ return QVariant();
+}
+
+/*! \reimp
+*/
bool QGraphicsWebView::event(QEvent* event)
{
// Re-implemented in order to allows fixing event-related bugs in patch releases.
@@ -438,11 +351,13 @@ void QGraphicsWebView::setPage(QWebPage* page)
connect(d->page, SIGNAL(loadStarted()),
this, SIGNAL(loadStarted()));
connect(d->page, SIGNAL(loadProgress(int)),
- this, SLOT(_q_doLoadProgress(int)));
+ this, SIGNAL(loadProgress(int)));
connect(d->page, SIGNAL(loadFinished(bool)),
this, SLOT(_q_doLoadFinished(bool)));
connect(d->page, SIGNAL(statusBarMessage(const QString&)),
- this, SLOT(_q_setStatusBarMessage(const QString&)));
+ this, SIGNAL(statusBarMessage(const QString&)));
+ connect(d->page, SIGNAL(linkClicked(const QUrl &)),
+ this, SIGNAL(linkClicked(const QUrl &)));
}
/*!
@@ -513,7 +428,6 @@ void QGraphicsWebView::setZoomFactor(qreal factor)
return;
page()->mainFrame()->setZoomFactor(factor);
- emit zoomFactorChanged();
}
qreal QGraphicsWebView::zoomFactor() const
@@ -550,21 +464,6 @@ void QGraphicsWebView::setGeometry(const QRectF& rect)
}
/*!
- \property QGraphicsWebView::status
- \brief the load status message.
-
- Provides the latest status message set during the load of a URL.
- Commonly shown by Status Bar widgets.
-
- \sa statusChanged()
-*/
-
-QString QGraphicsWebView::status() const
-{
- return d->statusBarMessage;
-}
-
-/*!
Convenience slot that stops loading the document.
\sa reload(), loadFinished()
@@ -611,15 +510,6 @@ void QGraphicsWebView::reload()
}
/*!
- \property QGraphicsWebView::progress
- \brief the progress of loading the current URL, from 0 to 1.
-*/
-qreal QGraphicsWebView::progress() const
-{
- return d->progress;
-}
-
-/*!
Loads the specified \a url and displays it.
\note The view remains the same until enough data has arrived to display the new \a url.
@@ -651,15 +541,14 @@ void QGraphicsWebView::load(const QNetworkRequest& request,
}
/*!
- \property QGraphicsWebView::html
- This property provides an HTML interface to the text in the webview.
+ Sets the content of the web view to the specified \a html.
- When setting this property, external objects such as stylesheets or images
- referenced in the HTML document are located relative to \a baseUrl.
+ External objects such as stylesheets or images referenced in the HTML
+ document are located relative to \a baseUrl.
The \a html is loaded immediately; external objects are loaded asynchronously.
- When using these methods, WebKit assumes that external resources such as
+ When using this method, WebKit assumes that external resources such as
JavaScript programs or style sheets are encoded in UTF-8 unless otherwise
specified. For example, the encoding of an external script can be specified
through the charset attribute of the HTML script tag. Alternatively, the
@@ -672,11 +561,6 @@ void QGraphicsWebView::setHtml(const QString& html, const QUrl& baseUrl)
page()->mainFrame()->setHtml(html, baseUrl);
}
-QString QGraphicsWebView::toHtml() const
-{
- return page()->mainFrame()->toHtml();
-}
-
/*!
Sets the content of the web graphicsitem to the specified content \a data. If the \a mimeType argument
is empty it is currently assumed that the content is HTML but in future versions we may introduce
@@ -706,22 +590,19 @@ QWebHistory* QGraphicsWebView::history() const
}
/*!
- \property QGraphicsWebView::interactive
- \brief controls whether the item responds to mouse and key events.
-*/
+ \property QGraphicsWebView::modified
+ \brief whether the document was modified by the user
-bool QGraphicsWebView::isInteractive() const
-{
- return d->interactive;
-}
+ Parts of HTML documents can be editable for example through the
+ \c{contenteditable} attribute on HTML elements.
-void QGraphicsWebView::setInteractive(bool allowed)
+ By default, this property is false.
+*/
+bool QGraphicsWebView::isModified() const
{
- if (d->interactive == allowed)
- return;
-
- d->interactive = allowed;
- emit interactivityChanged();
+ if (d->page)
+ return d->page->isModified();
+ return false;
}
/*!
@@ -738,11 +619,53 @@ QWebSettings* QGraphicsWebView::settings() const
return page()->settings();
}
+/*!
+ Returns a pointer to a QAction that encapsulates the specified web action \a action.
+*/
+QAction *QGraphicsWebView::pageAction(QWebPage::WebAction action) const
+{
+ return page()->action(action);
+}
+
+/*!
+ Triggers the specified \a action. If it is a checkable action the specified
+ \a checked state is assumed.
+
+ \sa pageAction()
+*/
+void QGraphicsWebView::triggerPageAction(QWebPage::WebAction action, bool checked)
+{
+ page()->triggerAction(action, checked);
+}
+
+/*!
+ Finds the specified string, \a subString, in the page, using the given \a options.
+
+ If the HighlightAllOccurrences flag is passed, the function will highlight all occurrences
+ that exist in the page. All subsequent calls will extend the highlight, rather than
+ replace it, with occurrences of the new string.
+
+ If the HighlightAllOccurrences flag is not passed, the function will select an occurrence
+ and all subsequent calls will replace the current occurrence with the next one.
+
+ To clear the selection, just pass an empty string.
+
+ Returns true if \a subString was found; otherwise returns false.
+
+ \sa selectedText(), selectionChanged()
+*/
+bool QGraphicsWebView::findText(const QString &subString, QWebPage::FindFlags options)
+{
+ if (d->page)
+ return d->page->findText(subString, options);
+ return false;
+}
+
/*! \reimp
*/
void QGraphicsWebView::hoverMoveEvent(QGraphicsSceneHoverEvent* ev)
{
- if (d->interactive && d->page) {
+ if (d->page) {
const bool accepted = ev->isAccepted();
QMouseEvent me = QMouseEvent(QEvent::MouseMove,
ev->pos().toPoint(), Qt::NoButton,
@@ -766,7 +689,7 @@ void QGraphicsWebView::hoverLeaveEvent(QGraphicsSceneHoverEvent* ev)
*/
void QGraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* ev)
{
- if (d->interactive && d->page) {
+ if (d->page) {
const bool accepted = ev->isAccepted();
d->page->event(ev);
ev->setAccepted(accepted);
@@ -780,7 +703,7 @@ void QGraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* ev)
*/
void QGraphicsWebView::mousePressEvent(QGraphicsSceneMouseEvent* ev)
{
- if (d->interactive && d->page) {
+ if (d->page) {
const bool accepted = ev->isAccepted();
d->page->event(ev);
ev->setAccepted(accepted);
@@ -794,7 +717,7 @@ void QGraphicsWebView::mousePressEvent(QGraphicsSceneMouseEvent* ev)
*/
void QGraphicsWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev)
{
- if (d->interactive && d->page) {
+ if (d->page) {
const bool accepted = ev->isAccepted();
d->page->event(ev);
ev->setAccepted(accepted);
@@ -808,7 +731,7 @@ void QGraphicsWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev)
*/
void QGraphicsWebView::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* ev)
{
- if (d->interactive && d->page) {
+ if (d->page) {
const bool accepted = ev->isAccepted();
d->page->event(ev);
ev->setAccepted(accepted);
@@ -822,7 +745,7 @@ void QGraphicsWebView::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* ev)
*/
void QGraphicsWebView::keyPressEvent(QKeyEvent* ev)
{
- if (d->interactive && d->page)
+ if (d->page)
d->page->event(ev);
if (!ev->isAccepted())
@@ -833,7 +756,7 @@ void QGraphicsWebView::keyPressEvent(QKeyEvent* ev)
*/
void QGraphicsWebView::keyReleaseEvent(QKeyEvent* ev)
{
- if (d->interactive && d->page)
+ if (d->page)
d->page->event(ev);
if (!ev->isAccepted())
@@ -889,7 +812,7 @@ void QGraphicsWebView::dragEnterEvent(QGraphicsSceneDragDropEvent* ev)
void QGraphicsWebView::dragLeaveEvent(QGraphicsSceneDragDropEvent* ev)
{
#ifndef QT_NO_DRAGANDDROP
- if (d->interactive && d->page) {
+ if (d->page) {
const bool accepted = ev->isAccepted();
d->page->event(ev);
ev->setAccepted(accepted);
@@ -907,7 +830,7 @@ void QGraphicsWebView::dragLeaveEvent(QGraphicsSceneDragDropEvent* ev)
void QGraphicsWebView::dragMoveEvent(QGraphicsSceneDragDropEvent* ev)
{
#ifndef QT_NO_DRAGANDDROP
- if (d->interactive && d->page) {
+ if (d->page) {
const bool accepted = ev->isAccepted();
d->page->event(ev);
ev->setAccepted(accepted);
@@ -925,7 +848,7 @@ void QGraphicsWebView::dragMoveEvent(QGraphicsSceneDragDropEvent* ev)
void QGraphicsWebView::dropEvent(QGraphicsSceneDragDropEvent* ev)
{
#ifndef QT_NO_DRAGANDDROP
- if (d->interactive && d->page) {
+ if (d->page) {
const bool accepted = ev->isAccepted();
d->page->event(ev);
ev->setAccepted(accepted);
@@ -956,7 +879,7 @@ void QGraphicsWebView::contextMenuEvent(QGraphicsSceneContextMenuEvent* ev)
*/
void QGraphicsWebView::wheelEvent(QGraphicsSceneWheelEvent* ev)
{
- if (d->interactive && d->page) {
+ if (d->page) {
const bool accepted = ev->isAccepted();
d->page->event(ev);
ev->setAccepted(accepted);
@@ -971,11 +894,20 @@ void QGraphicsWebView::wheelEvent(QGraphicsSceneWheelEvent* ev)
*/
void QGraphicsWebView::inputMethodEvent(QInputMethodEvent* ev)
{
- if (d->interactive && d->page)
+ if (d->page)
d->page->event(ev);
if (!ev->isAccepted())
QGraphicsItem::inputMethodEvent(ev);
}
+/*!
+ \fn void QGraphicsWebView::linkClicked(const QUrl &url)
+
+ This signal is emitted whenever the user clicks on a link and the page's linkDelegationPolicy
+ property is set to delegate the link handling for the specified \a url.
+
+ \sa QWebPage::linkDelegationPolicy()
+*/
+
#include "moc_qgraphicswebview.cpp"