Important: Please read the Qt Code of Conduct -

[SOLVED]QStandardItemModel::itemChanged(QStandardItem*) signal and QAbstractScrollArea::paintEvent ( QPaintEvent * event ) function

  • Hello,

    I have a problem !
    I'm working on a QTableView, so I connected
    @void QStandardItemModel::itemChanged ( QStandardItem * item ) [signal]@

    to my own slot. But I set items in the paintEvent() method of my view, so the itemChanged() signal is emitted. That's the problem !

    So i would like to disconnect temporarly the signal and reconnect it later after the paintEvent processing.
    I know how to disconnect, I use a disconnect(model(), itemChanged(QStandardItem*), 0, 0).

    But how can I reconnect all slot to the signal after the treatment?

  • Moderators

    You could look at "QObject::blockSignals.":/doc/qt-4.8/qobject.html#blockSignals

  • Thanks you very much, it's exactly what I need !

  • Moderators

    Great! Be sure and edit the thread title to add [Solved]. Thanks!

Log in to reply