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

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to