QCoreApplication app(argc, argv);
QQmlEngine engine;
MessageBoard msgBoard;
engine.rootContext()->setContextProperty("msgBoard",&msgBoard);
// QQmlComponent component (&engine,QUrl::fromLocalFile("Item.qml"));
const QUrl url(QStringLiteral("qrc:/item.qml"));
QQmlComponent component (&engine,url);
component.create();
return app.exec();
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/274250.html
標籤:Qt
上一篇:請推薦好用的記憶體泄露檢測工具
下一篇:qml 如何讓輸入框失去焦點?
