Re: [Interest] Problems when updating view/delegate

2012-02-08 Thread Timo Falk
On Fri Feb 03 2012 11:47:20 GMT+0100, noru...@me.com wrote: > Hello @all, > > lets say I have a model with 5 columns and 3 rows. > > The delegate should set the background color for the individual rows > depending on which value is in column 2. Is the delegate set as column-delegate for all colum

Re: [Interest] Problems when updating view/delegate

2012-02-03 Thread norulez
Hi, I tried to overload the setData() function as followed, but the behavior is the same which means that the view/delegate doesn't get updated: bool ret = QStandardItemModel::setData(index, value, role); emit dataChanged(this->index(0, 0), this->index(rowCount(), columnCount())); return ret; I

Re: [Interest] Problems when updating view/delegate

2012-02-03 Thread Bo Thorsen
The way I would do this is to make a custom role for the background and use that to paint the background in the delegate. You have to emit dataChanged() for the cells where the background should be updated as well as the column2 cells for the delegates to be notified about the change. Bo. Den

[Interest] Problems when updating view/delegate

2012-02-03 Thread norulez
Hello @all, lets say I have a model with 5 columns and 3 rows. The delegate should set the background color for the individual rows depending on which value is in column 2. Now my main problem is that when I change the value of column 2, then only the background of column 2 is changed. How c