Get data in Textfield from ListView delegate
-
I'm a newbie developer so my question might be a bit stupid here :(
I using ListView with TextField in delegate. So when the user edit the textfield how can I get this value for each delegate instance? I want this value of each instance to sync with a QML element properties
-
Hi,
In ListView's delegate you can access ListModel and use "ListModel::set":http://doc.qt.nokia.com/4.7-snapshot/qml-listmodel.html#set-method or "ListModel::setProperty":http://doc.qt.nokia.com/4.7-snapshot/qml-listmodel.html#setProperty-method
-
[quote author="task_struct" date="1326874475"]Hi,
In ListView's delegate you can access ListModel and use "ListModel::set":http://doc.qt.nokia.com/4.7-snapshot/qml-listmodel.html#set-method or "ListModel::setProperty":http://doc.qt.nokia.com/4.7-snapshot/qml-listmodel.html#setProperty-method[/quote]
Thanks! Never thought it was just easy :P
-
@eswar This is a very old post. There is very little chance if OP would read it and revert back. In such case, always create a new post just giving some reference. The links are dead because that domain doesn't exist. The Qt documentation is moved to new site: http://doc.qt.io
Anyway here are all those methods:
http://doc.qt.io/qt-5/qml-qtqml-models-listmodel.html#methods