Important: Please read the Qt Code of Conduct -

QUndoView, how to know if the user clicked? it seems QAbstractItemView::clicked is not emitted :'(

  • Hello,
    I'm having an issue to know when the user of my app is clicking on the UndoView.
    I would like to refresh my HMI when he does it.

    The only place I've found so far would be to connect to QUndoStack::indexChanged but this doesn't go with what I want.

    My app has a QGraphicsScene. When some stuff happens I fill the UndoStack BUT I don't want to refresh the scene.

    I want to refresh it only on Undo/Redo and on a click on the UndoView.

    It's easy to refresh when the user click on some Undo/Redo buttons but I don't find a way to intercept a click on the QUndoView.

    Any ideas?

  • on Linux 64bits, Qt.5.11.3, it seems that we need to click twice to have the signal QAbstractItemView::clicked.
    First the new index is selected, then we have to click again to send the signal... Same with QAbstractItemView::activated

    QAbstractItemView::pressed makes the job! Problem solved

Log in to reply