summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfxwebview.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-04-27 05:56:06 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-04-27 05:56:06 (GMT)
commit7e94543a9b013b6b1140137ba64406b74a363afc (patch)
tree565db03ed0c733d8b6472a8b8bdb7f2cdba3b17e /src/declarative/fx/qfxwebview.cpp
parentcd8542ca836b175377f3b3471725b86f8739e91a (diff)
downloadQt-7e94543a9b013b6b1140137ba64406b74a363afc.zip
Qt-7e94543a9b013b6b1140137ba64406b74a363afc.tar.gz
Qt-7e94543a9b013b6b1140137ba64406b74a363afc.tar.bz2
Remove QFxItem::itemContext() method.
Use qmlContext(object) instead. This makes everything consistent.
Diffstat (limited to 'src/declarative/fx/qfxwebview.cpp')
-rw-r--r--src/declarative/fx/qfxwebview.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/declarative/fx/qfxwebview.cpp b/src/declarative/fx/qfxwebview.cpp
index 05e2f65..147415d 100644
--- a/src/declarative/fx/qfxwebview.cpp
+++ b/src/declarative/fx/qfxwebview.cpp
@@ -211,7 +211,8 @@ void QFxWebView::init()
pal.setBrush(QPalette::Base, QColor::fromRgbF(0, 0, 0, 0));
wp->setPalette(pal);
- wp->setNetworkAccessManager(itemContext()->engine()->networkAccessManager());
+ // ### Need to delay this as qmlEngine() is not set yet
+ wp->setNetworkAccessManager(qmlEngine(this)->networkAccessManager());
setPage(wp);
// XXX settable from QML?
@@ -313,7 +314,7 @@ void QFxWebView::setUrl(const QString &n)
QUrl url(n);
if (url.isRelative())
- url = itemContext()->resolvedUrl(n);
+ url = qmlContext(this)->resolvedUrl(n);
if (isComponentComplete())
d->page->mainFrame()->load(url);
@@ -1030,7 +1031,7 @@ public:
propertyValues(paramValues),
webview(view)
{
- QmlEngine *engine = webview->itemContext()->engine();
+ QmlEngine *engine = qmlEngine(webview);
component = new QmlComponent(engine, url, this);
item = 0;
connect(engine, SIGNAL(statusChanged(Status)), this, SLOT(qmlLoaded()));
@@ -1039,7 +1040,7 @@ public:
public Q_SLOTS:
void qmlLoaded()
{
- item = qobject_cast<QFxItem*>(component->create(webview->itemContext()));
+ item = qobject_cast<QFxItem*>(component->create(qmlContext(webview)));
item->setParent(webview);
for (int i=0; i<propertyNames.count(); ++i) {
if (propertyNames[i] != QLatin1String("type") && propertyNames[i] != QLatin1String("data")) {
@@ -1074,7 +1075,7 @@ QFxWebView *QFxWebPage::view()
QObject *QFxWebPage::createPlugin(const QString &, const QUrl &url, const QStringList &paramNames, const QStringList &paramValues)
{
- QUrl comp = view()->itemContext()->resolvedUri(url.toString());
+ QUrl comp = qmlContext(view())->resolvedUri(url.toString());
return new QWidget_Dummy_Plugin(comp,view(),paramNames,paramValues);
}