Well, according to the ASSERT, I know that a QWidget cannot be directly put into QML code, but QDeclarativeView is inherited from QWidget, and MyWindow is inherited from QDeclarativeView, so the ASSERT failed.
Another way is make MyWindow inherited from QObject and make a QDeclarativeView as a member of MyWindow, but this also lead to many code(rewritten of many properties, such as size, pos)
So I finally give up this try. Thank you:)
↧