Hello,

I'm trying to do something that seems very simple, but I can't find a
solution anywhere. If I have two QML items that I've created from
components in C++, how do I bind a property on one to follow a property on
the other one? Here's a simple example:

// Simple.qml
Rectangle
{
   property bool myBool : false
}

// C++ code
QQmlComponent simpleFactory;
simpleFactory.loadUrl(QUrl("qrc:///Qml/Simple.qml"));
QQuickItem* item1 = qobject_cast<QQuickItem*>(m_simpleFactory.create());
QQuickItem* item2 = qobject_cast<QQuickItem*>(m_simpleFactory.create());

// how do I bind item2's myBool to the value of item1's myBool?

This is very simply done within QML, but I don't see how to do that glue in
C++.

Any help would be appreciated,
Alex
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to