Hello
I have been writing in qt for 2 months, so I am green and I have one problem. I want to save every cell of table ms sql in QString. I use driver QODBC. This is what I've already written:
QModelIndexList selectionL = selectionM->selectedIndexes();
selectionL.takeFirst();
for (int h=0; h<20; h++){
copy[h] = model->data(selectionL.takeFirst()).toString();
}
QString *copy;
copy=new QString[20];
QItemSelectionModel *selectionM = ui->tableView->selectionModel();
QModelIndexList selectionL = selectionM->selectedIndexes();
selectionL.takeFirst();
for (int h=0; h<20; h++){
copy[h] = model->data(selectionL.takeFirst()).toString();
}
QMessageBox::information(this, "Kopiowanie", copy[1]);
To copy to clipboard, switch view to plain text mode
When I want to open this function in the program which I have written there appears a notification about the error : ,,This application has requested the Runtime to terminate it in an unusual way." Thanks in advance and I count for a simple explanation
Bookmarks