[Interest] QQuickwidget with webview in iOS
Jian
xu at avasition.de
Tue Mar 1 20:18:59 CET 2016
Hi everyone,
I want to create a webview embedded in a widget under iOS. I have tried createwindowcontainer but I could not get the geometry right. With QQuickwidget I can set the Geometry as I want, but when I embed it in a QWidget, the web page will not be displayed/loaded.
Following is a minimal code reproducing the problem, there is only the red rectangle from QML displayed.
main.cpp:
QWidget *mainwindow = new QWidget();
QVBoxLayout *layout = new QVBoxLayout();
QQuickWidget *view = new QQuickWidget();
view->setResizeMode(QQuickWidget::SizeRootObjectToView);
view->setVisible(true);
view->setSource(QUrl("qrc:///webview.qml"));
layout->addWidget(view);
mainwindow->setLayout(layout);
mainwindow->show();
webview.qml:
import QtQuick 2.2
import QtWebView 1.1
Rectangle {
visible: true
color: "red"
WebView
{
anchors.fill: parent
url: "https://www.google.de”
}
}
Could anyone help me? Thanks
Regards,
Jian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160301/211f9205/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160301/211f9205/attachment.sig>
More information about the Interest
mailing list