[Qt-interest] blockSignals doesn't work in QStyledItemDelegate

NoRulez norulez at me.com
Mon Oct 25 13:14:11 CEST 2010


Hello,

 

in the function “setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const”

I need to update 4 columns in the model, however the problem is that I get 4
update requests.

So, I tried to use blockSignals as followed to get only one update request,
but it doesn’t work, I still get 4 update requests:

 

blockSignals(true);

//model->blockSignals(true); // Does also not work

model->setData(model->index(index.row(), ...);

model->setData(model->index(index.row(), ...);

model->setData(model->index(index.row(), ...);

//model->blockSignals(false); // Does also not work

blockSignals(false);

model->setData(model->index(index.row(), ...);

 

The problem is that the first update request overwrites the data for the
others.

 

Is there an other way to doing so?

 

Thanks in advance

 

Best Regards

NoRulez

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101025/8c1cbe15/attachment.html 


More information about the Qt-interest-old mailing list