I use a QTableView and a model subclassed QAbstractTableModel to display the items which is increasing per second. And in order to display the items number which is selected by user, I use QItemSelectionModel.The attachment complete the task.But there is a strange bug.
The selction setting of tableview is
And the critical codes which bring bug areCode:
If I selected items in the tableview by push down left button of mouse,draw diagonal line of a rectangel,the release the button. The displayed number of selected items is totally wrong.Code:
VerHeaderView->swapSections(1,2); //this is critial for the behavior of m_selectionModel
If deleted the critical codes, repeat the selection in the same way. This time, the displayed number is right. I want to know, where is the mistake?