Alecs
Alecs

Reputation: 2316

Distinguish Qt itemChange signal on item when move and edit

I have QTreeView and QStandatdItemModel. I have slot that connected to itemChanged signal, where I work up with new item data. Then I activated drag and drop possibility and find out that on mowing item I also receive itemChanged signal. But signature is only QStandardItem*, so I can't say what have happened - was item data changed or was it just moved, but I need to know that. How can distinguish was item changed or moved?

Upvotes: 0

Views: 598

Answers (2)

Marek R
Marek R

Reputation: 37717

Copy of comment:
check other signals (documented in parent class) there is lots of possibilities (data change, move row/column).

Upvotes: 1

pnezis
pnezis

Reputation: 12321

Use the dataChanged signal instead.

This signal is emitted whenever the data in an existing item changes.

Upvotes: 1

Related Questions