main.qml:
ApplicationWindow {
visible: true
visibility: "Maximized"
title: "My title"
WebView {
id: webView
objectName: "webView"
anchors.fill: parent
url: initialUrl
}
}main.cpp:
QQmlApplicationEngine engine;
QQmlContext *context = engine.rootContext();
context->setContextProperty(QString("initialUrl"), "http://google.com/");
QQmlComponent component(&engine, QUrl("qrc:/qml/main.qml"));
qDebug() << component.status();
component.create();它是在Linux和Android上工作的,但是在Windows上我有这样的错误:
warning: QQmlComponent::Status(Ready) // This "qDebug() << component.status();" from my code
warning: QQmlComponent: Component is not ready
warning: QObject::connect: invalid null parameter
warning: QObject::connect: invalid null parameter
warning: QObject::connect: invalid null parameter
warning: QObject::connect: invalid null parameter
Program received signal SIGSEGV, Segmentation fault.
0x6e9cd3dd in Qt5Quick!?setParentItem@QQuickItem@@QAEXPAV1@@Z () from C:\myprog-dist\Qt5Quick.dll怎么修呢?QT5.7.0 (msvc 2015编译器)
发布于 2016-11-15 02:30:07
解决方案:
不要使用windeployqt。
安装QT5.7 for Windows。使用Process和手动复制依赖项。
https://stackoverflow.com/questions/40584219
复制相似问题