I have a very weird issue. Could anyone please help me out of this? Thanks in advance.

I have a QTreeview which shows data from a socket and it uses a custom QAbstractItemModel; When data arrives, dataChanged is emitted. And in the data method of my item model, I qDebug log information. The socket runs in a separate thread.

The weird thing is that if I set a breakpoint in the model's data method, then the method is hit and a cell of QTreeView is updated. But if there are no breakpoints in the data method, the method seems not to be called (no logging from qDebug) and the cell is not updated.

I guess it's related to thread stuff but I don't know what it is exactly. Any help will be greatly appreciated.