There is a dictionary taken from JSON file, that is represented by QTreeView
QStandardItemModel
.
A user can reorganize QTreeView
(add, delete, drag-n-drop) and rename items.
The goal is: call function that reads changed QTreeView
, makes the dictionary and writes it to initial JSON file.
I can do it by pressing a QPushButton
after changes occurred or by binding that function to every change e.g. call function when an item is deleted, call function when an item is added, call a function when an item is renamed and so on.
Is there any way to call a function if any of changes occur? Is there such a signal that corresponds to all of the mentioned changes?
The
rowsMoved
anditemChanged
signals do what you think they do. See http://doc.qt.io/qt-4.8/qstandarditemmodel.html