qt5 - Cannot create certain QML types in a singleton -


A QML Singleton to use the style defined as I have defined:

  Pragma Singleton import QtQuick 2.2 Import QtQuick.Controls 1.1 Import QtQuick.Controls.Styles 1.1 QtObject {property ProgressBarStyle progressBarErrorStyle: ProgressBarStyle {background: Rectangle {radius: 2 color: "lightgray" border.color: "gray" border.width: 1 implicitWidth: 200 implicitHeight: 20} progress: Rectangle {color: "orange" range: color: "red"}}}   

I can import the object and am using it , Though progressBarErrorStyle is always given the code ProgressbarStyle_clataipe 7 / <>. If I change it to rectangle , then it is typed correctly as QQuickRectangle .

QtQuick.Controls.Styles defines import ProgressBarStyle , and QtCreator is I can not find any syntax errors ... so my object runtime But why is the wrong type given?

After the text itemprop = "text">

you should use as the property type:

  import QtQuick 2.2 Import QtQuick.Controls 1.2 Import QtQuick.Controls.Styles 1.2 Rectangle {property component progressBarErrorStyle: ProgressBarStyle {background: Rectangle {radius: 2 color: "lightgray" border.color: "gray" border.width: 1 implicitWidth: 200 implicitHeight : 20} progress: Rectangle {color: "Orangered" Borderkcolor: "red"}} {progressBar ID: progressbar NumberAnimation {target: progressbar property: to have a "value": 1 running true period: 2000} Style: progressBarErrorStyle}}   

styles for components Is used in loader EMS internally, which make examples of components when they like representatives of QT Quick, for example.

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -