Jack Wootton
2010-07-27 09:14:31 UTC
Hello,
The Qt 4.7 QML documentation for WebView (
http://doc.qt.nokia.com/4.7-snapshot/qml-webview.html) explains the import
statement for WebView should be "import QtWebKit 1.0". I am using Qt 4.7,
however looking at the source code for QML WebView:
class WebKitQmlPlugin : public QDeclarativeExtensionPlugin
{
Q_OBJECT
public:
virtual void registerTypes(const char *uri)
{
*Q_ASSERT(QLatin1String(uri) == QLatin1String("org.webkit"));*
qmlRegisterType<QDeclarativeWebSettings>();
qmlRegisterType<QDeclarativeWebView>(uri,1,0,"WebView");
}
};
The import statement is "org.webkit". How should I resolve this?
1. Does a newer Qt 4.7 binary have the corrected WebKitQmlPlugin which
registers the new syntax (QqtWebKit)?
2. Modify the existing WebKitQmlPlugin to use the new syntax?
3. Continue using the old syntax and don't modify anything?
The problem arose because QtCreator displays a runtime error of "module
org.webkit is not installed". I assumed this was caused by my QML document
using the old-style syntax for WebView - however using the new syntax does
not reflect the source code I have for WebKitQmlPlugin.
--
Regards
Jack
The Qt 4.7 QML documentation for WebView (
http://doc.qt.nokia.com/4.7-snapshot/qml-webview.html) explains the import
statement for WebView should be "import QtWebKit 1.0". I am using Qt 4.7,
however looking at the source code for QML WebView:
class WebKitQmlPlugin : public QDeclarativeExtensionPlugin
{
Q_OBJECT
public:
virtual void registerTypes(const char *uri)
{
*Q_ASSERT(QLatin1String(uri) == QLatin1String("org.webkit"));*
qmlRegisterType<QDeclarativeWebSettings>();
qmlRegisterType<QDeclarativeWebView>(uri,1,0,"WebView");
}
};
The import statement is "org.webkit". How should I resolve this?
1. Does a newer Qt 4.7 binary have the corrected WebKitQmlPlugin which
registers the new syntax (QqtWebKit)?
2. Modify the existing WebKitQmlPlugin to use the new syntax?
3. Continue using the old syntax and don't modify anything?
The problem arose because QtCreator displays a runtime error of "module
org.webkit is not installed". I assumed this was caused by my QML document
using the old-style syntax for WebView - however using the new syntax does
not reflect the source code I have for WebKitQmlPlugin.
--
Regards
Jack