[Interest] Dumb idea of the day: QML auto-resolving properties?

Jason H jhihn at gmx.com
Fri Nov 4 18:54:05 CET 2016


99% of the time, I write code like:

Rectangle {
  width: parent.width   // In the form of P: O.P
}

I'm wondering if QML parser could be enhanced to look for and use the parent's width property automatically.

Rectangle {
  width: parent // Expands to width: parent.width  - Assignment of Item to double is not valid, so find same property name in parent and use that
}

Similarly:
Rectangle {
  width: parent / 2 // Expands to width: parent.width / 2
}

Is this possible?



More information about the Interest mailing list