PDA

View Full Version : Program crash- unable to detect the issue



newtoQ_s
20th October 2015, 06:26
The following code is giving me an issue.


void MainWindow::onDelete()
{

if(ui->tableWidget->selectionModel()->hasSelection()){

QItemSelectionModel *selectionmodel =ui->tableWidget->selectionModel();
QModelIndexList selected_items= selectionmodel->selectedRows();
qSort(selected_items);
}


Whenever I run it, the program crashes giving me an error:
Invalid address specified to RtlValidateHeap( 006A0000, 00F4DB90 )

It appears to be trying to delete a node from the code in qlist. I am unable to figure out the error. Any advice would be great.

anda_skoa
21st October 2015, 18:46
What do you want to achieve by sorting model indexes?
You are aware that this is only for usage with QMap, right?

Cheers,
_