Hello,
i’ve created a brand new qtquick2applicationviewer application, but i also tested it with a QQuickView. I’ve got a QML-file loaded including this code:
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
ApplicationWindow {
width: 200
height: 200
title: qsTr("Sample");
color: "black"
}
This message displays in my console:
QQuickView only supports loading of root objects that derive from QQuickItem.
If your example is using QML 2, (such as qmlscene) and the .qml file you
loaded has ‘import QtQuick 1.0’ or ‘import Qt 4.7’, this error will occur.
To load files with ‘import QtQuick 1.0’ or ‘import Qt 4.7’, use the
QDeclarativeView class in the Qt Quick 1 module.
It does not occur when i am using a Rectangle as my top-level component.
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
Rectangle {
width: 200
height: 200
color: "black"
}
All the other files in my project are unchanged.
Am i using ApplicationWindow wrong or is this maybe a bug?
↧