[Interest] Annoying ApplicationWindow Error

Jason H scorp1us at yahoo.com
Fri May 16 15:09:49 CEST 2014


I picked a Qt Quick 2 project.




----- Original Message -----
From: Nurmi J-P <jpnurmi at digia.com>
To: Interests Qt <interest at qt-project.org>
Cc: 
Sent: Tuesday, May 13, 2014 3:12 AM
Subject: Re: [Interest] Annoying ApplicationWindow Error

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

_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list