if (aModel) {
QList<int> aRows;
- QModelIndexList aSelectedIndexes = myTable->selectionModel()->selectedRows();
+ QModelIndexList aSelectedIndexes = myTable->selectionModel()->selectedIndexes();
foreach ( const QModelIndex& anIndex, aSelectedIndexes ) {
- aRows << anIndex.row();
+ int aRowIndex = anIndex.row();
+ if ( !aRows.contains( aRowIndex ) )
+ aRows << aRowIndex;
}
if ( aModel->removeRows( aRows ) ) {
*/
void HYDROGUI_PriorityWidget::onSelectionChanged()
{
- QModelIndexList aSelectedIndexes = myTable->selectionModel()->selectedRows();
+ QModelIndexList aSelectedIndexes = myTable->selectionModel()->selectedIndexes();
myRemove->setEnabled( aSelectedIndexes.count() > 0 );
}
void HYDROGUI_StricklerTableDlg::onRemoveCoefficient()
{
QList<int> aRows;
- QModelIndexList aSelectedIndexes = myTable->selectionModel()->selectedRows();
+ QModelIndexList aSelectedIndexes = myTable->selectionModel()->selectedIndexes();
foreach ( const QModelIndex& anIndex, aSelectedIndexes ) {
- aRows << anIndex.row();
+ int aRowIndex = anIndex.row();
+ if ( !aRows.contains( aRowIndex ) )
+ aRows << aRowIndex;
}
removeRows( aRows );
*/
void HYDROGUI_StricklerTableDlg::onSelectionChanged()
{
- QModelIndexList aSelectedIndexes = myTable->selectionModel()->selectedRows();
+ QModelIndexList aSelectedIndexes = myTable->selectionModel()->selectedIndexes();
myRemoveBtn->setEnabled( aSelectedIndexes.count() > 0 );
}