main.qml:
import QtQuick 2.0
Rectangle {
height: 300
width: 300
color: "black"
Zero {
m_ref.m_url: "something"
}
}
import QtQuick 2.0
Rectangle {
height: 300
width: 300
color: "black"
Zero {
m_ref.m_url: "something"
}
}
To copy to clipboard, switch view to plain text mode
Zero.qml
import QtQuick 2.0
Item {
property alias m_ref: objZero
Rectangle {
id: objZero
property url m_url
}
}
import QtQuick 2.0
Item {
property alias m_ref: objZero
Rectangle {
id: objZero
property url m_url
}
}
To copy to clipboard, switch view to plain text mode
This gives an error:
"m_url" Cannot assign to non-existent property
m_ref.m_url: "something"
^
"m_url" Cannot assign to non-existent property
m_ref.m_url: "something"
^
To copy to clipboard, switch view to plain text mode
However i can use m_url inside Zero.qml anywhere (by qualifying with the correct id ofcourse) or alias it with the topmost Item of Zero.qml and use the alias in main.qml.
Why using it the way shown above gives an error while the other methods (in the previous sentence) don't?
{using Qt 5.1.0 beta and Rc both, Windows 7, QtQuick 2.0}
Bookmarks