c++ - QtQuick: QQmlApplicationEngine failed to load component qrc:/main.qml:23 Invalid attached object assignment -
Looking at my thoughts below, am I barking the wrong tree? Or in the information given below, am I misusing the Qt API to get an error in the title?
I'm trying to modify the sample to work with the default coefficic project generated from Qt Creator 3.3.0 (OpenSource). Qt 5.4.0 (GCC 4.6.1, 64bit) Based on.
The first thing to look at after the code is that I stand by:
The sample uses the main.cpp:
qmlRegisterType & lt ; Squircle & gt; ("OpenGLUARMM", 1, 0, "Squircle"); QQuickView view; View.setResizeMode (QQuickView :: SizeRootObjectToView); View.setSource (QUrl ("QRC: ///scenegraph/openglunderqml/main.qml")); View.show ();
Some name changes in my name. CPP
qmlRegisterType & lt; Menuscreen & gt; ("OpenGLUnderQML", 1, 0, "Main Screen"); QQmlApplicationEngine engine; Engine.load (QUrl (QStringLiteral ("QRC: /main.qml")));
I'm not sure that the difference in using QQmlApplicationEngine on a QuickView can cause my error:
QQmlApplicationEngine component failed to load qrc Is: / main .qml: 23 - Invalid Attached Object Assignment
Where my main XML looks:
Import Cactiq 2.4 Import QtQuick.Window 2.2 Import OpenGLUnderQML 1.0 Import "qmlmodel" Window {ID: Width of Main Window: 800 Height: 600 Appearance: True Color : "Black" Title: "Army calculator" ObjectName: "Main window" list view {ID: Mainlist view anchor. Fill: Basic ObjectName: "Mainlist View"} Main Screen {Graduate animation on deltati {NumberAnimation {to: 1; Duration: 2500; Easing.type: Ease Inquisition} number animation {to: 0; Duration: 2500; Simplicity: typing: easy. Octquaed} loop: animation. The infinite is running: true}}} and the sample uses it: import cautious 2.0 imported OpenGLUARMML 1.0 item {width: 320 height : 480 Squircle {T {Number Animation {Sequential Animation {From: 1; Duration: 2500; Easing.type: Ease Inquisition} number animation {to: 0; Duration: 2500; Simplicity: Typing: Easy. Otkwad} loop: animation. Infinity is running: true}} rectangle {color: Q. RGBA (1, 1, 1, 0.7) radius: 10 limit. Width: 1 border Colal: "white" anchor .Fil: Label anchor. Margin: -10} text {id: label color: "black" RAM mode: text. Word Lesson: "Background Here is a squircle provided with raw OpenGL using the 'firsthander ()' signal in QuickWindows. This text label and its border QML" anchors.right: parent.right anchors.left: parent .left anchors.bottom: parent.bottom anchors.margins: 20}} is provided using
In the comment given below, according to the request is MainScreen.h
#ifndef MAINSCREEN_H #define MAINSCREEN_H #include & lt; QQuickItem & gt; Class main screen renderer; Class QQuickWindow; Classroom Homescreen: Public QQuickItem {Q_OBJECT Q_PROPERTY (qreal deltati READ getDeltaT WRITE set DELTAT NOTIFY deltaTChanged) Public: home screen (); ~ MainScreen (); Qreal getDeltaT () console; Zero set deltaT; Signal: Zero Delftify (); Public slots: zero sync (); Zero cleaning (); Private Slots: Wide Handwindows Change (Quwwwondo * Win); Private: qreal m_DeltaT; Main Spring Renderer * M_Renderer; }; #endif // MAINSCREEN_H
The property name should start with lowercase letters. You need to convert DeltaT to deltaT.
MainScreen.h
Q_PROPERTY (qreal deltaT READ getDeltaT WRITE set DeltaT NOTIFY deltaTChanged)
Main.qml
main screen (sequential animation at deltaT {}}
Comments
Post a Comment