I know now to create a QML window in C++, but my qml code will frequently operate the window, so I wan’t to create the window using QML.
I wan’t to write code like this:
Window {
id: test_win
source: "Component/xxx.qml"
}
I wrote a class MyWindow derived from QDeclarativeView, and called qmlRegisterType.
the MyWindow always use a global QDeclarativeView as father.
but when I setSource to the global QDeclarativeView, error occurs:
ASSERT: “!d->isWidget” in file kernel\qobject.cpp, line 1894
Can anyone help?
Thank you!
I notice http://qt-project.org/doc/qt-5.0/qtquick/qmlmodule-qtquick-window2-qtquick-window-2.html in Qt5’s document, but I’m currently still using Qt4, and I didn’t found a QtQuick.Window 1.0 in Qt4..
↧