سؤال

I have a QTreeWidget with some items in it. However, due to my data structure, I need to have the QTreeWidget (or the QTreeWidgetItem) tell me when someone finishes editing it.

I already have a subclass of both QTreeWidget and QTreeWidgetItem, if that makes it any easier to solve.

هل كانت مفيدة؟

المحلول

the QTreeWidget emits the signal QTreeWidget::itemChanged ( QTreeWidgetItem * item, int column ). this should do the job.

the thing is, it will also be called when you fill or change the tree from your code. therefor use the QObject::blockSignals(bool) to solve that.

soo long zai

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top