[Interest] Annoying ApplicationWindow Error
Nurmi J-P
jpnurmi at digia.com
Tue May 13 09:12:55 CEST 2014
On 13 May 2014, at 05:50, Jason H <scorp1us at yahoo.com> wrote:
> QtQuick 2.x project.... I'm getting this error:
>
> """
> 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.
> """
>
> using this source file:
>
> """
> import QtQuick.Controls1.1
>
> ApplicationWindow{
> width:640
> height:1080
> }
>
> """
>
> However I am given this example from "Qt Quick Controls Overview"
> """
> import QtQuick.Controls 1.1
>
> ApplicationWindow {
> title: "My Application"
>
> Button {
> text: "Push Me"
> anchors.centerIn: parent
> }
> }
> """
>
>
> Why am I getting an error that I should not be getting by reason and according to the example?
>
When you create a new "Qt Quick Application" in Qt Creator, the wizard asks you which component set you want to use. Apparently the template is a bit different whether you use plain Qt Quick or Qt Quick Controls. All Qt Quick Controls examples, the ones shipped with the module, are using QQmlApplicationEngine instead.
--
J-P Nurmi
More information about the Interest
mailing list