[Interest] ItemModels, setData, and booleans

Jean-Michaël Celerier jeanmichael.celerier at gmail.com
Mon Dec 7 22:28:14 CET 2015


Hello!

When a QAbstractItemModel is used, how can I make it so that values are
sent
when the user chooses a value in a boolean combobox and not when the
combobox looses focus ?
My model has two columns, one "name" with a string and one "value" with
booleans.


​
It is very simple and derived from QAbstractItemModel. The view is a
QTreeView.

When I want to change a value, I double-clic on a value and then the Qt
selector with "True; False" as choices appears. However, in the model,
setData() is only called once the focus has been lost. I would like it to
be called as soon as a value is chosen. How could I do this ?

Thanks,

Jean-Michaël
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151207/8ed122c9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tree1.png
Type: image/png
Size: 359 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151207/8ed122c9/attachment.png>


More information about the Interest mailing list