qgsfeaturelistview.cpp (QGIS-final-3_10_11) | : | qgsfeaturelistview.cpp (QGIS-final-3_10_12) | ||
---|---|---|---|---|
skipping to change at line 192 | skipping to change at line 192 | |||
{ | { | |||
QItemSelection selection; | QItemSelection selection; | |||
selection.append( QItemSelectionRange( mModel->index( 0, 0 ), mModel->index( m Model->rowCount() - 1, 0 ) ) ); | selection.append( QItemSelectionRange( mModel->index( 0, 0 ), mModel->index( m Model->rowCount() - 1, 0 ) ) ); | |||
mFeatureSelectionModel->selectFeatures( selection, QItemSelectionModel::ClearA ndSelect | QItemSelectionModel::Rows ); | mFeatureSelectionModel->selectFeatures( selection, QItemSelectionModel::ClearA ndSelect | QItemSelectionModel::Rows ); | |||
} | } | |||
void QgsFeatureListView::setEditSelection( const QgsFeatureIds &fids ) | void QgsFeatureListView::setEditSelection( const QgsFeatureIds &fids ) | |||
{ | { | |||
QItemSelection selection; | QItemSelection selection; | |||
QModelIndex firstModelIdx; | ||||
const auto constFids = fids; | const auto constFids = fids; | |||
for ( QgsFeatureId fid : constFids ) | for ( QgsFeatureId fid : constFids ) | |||
{ | { | |||
selection.append( QItemSelectionRange( mModel->mapToMaster( mModel->fidToIdx | QModelIndex modelIdx = mModel->fidToIdx( fid ); | |||
( fid ) ) ) ); | ||||
if ( ! firstModelIdx.isValid() ) | ||||
firstModelIdx = modelIdx; | ||||
selection.append( QItemSelectionRange( mModel->mapToMaster( modelIdx ) ) ); | ||||
} | } | |||
bool ok = true; | bool ok = true; | |||
emit aboutToChangeEditSelection( ok ); | emit aboutToChangeEditSelection( ok ); | |||
if ( ok ) | if ( ok ) | |||
{ | ||||
mCurrentEditSelectionModel->select( selection, QItemSelectionModel::ClearAnd Select ); | mCurrentEditSelectionModel->select( selection, QItemSelectionModel::ClearAnd Select ); | |||
scrollTo( firstModelIdx ); | ||||
} | ||||
} | } | |||
void QgsFeatureListView::setEditSelection( const QModelIndex &index, QItemSelect ionModel::SelectionFlags command ) | void QgsFeatureListView::setEditSelection( const QModelIndex &index, QItemSelect ionModel::SelectionFlags command ) | |||
{ | { | |||
bool ok = true; | bool ok = true; | |||
emit aboutToChangeEditSelection( ok ); | emit aboutToChangeEditSelection( ok ); | |||
Q_ASSERT( index.model() == mModel->masterModel() || !index.isValid() ); | Q_ASSERT( index.model() == mModel->masterModel() || !index.isValid() ); | |||
if ( ok ) | if ( ok ) | |||
{ | ||||
mCurrentEditSelectionModel->select( index, command ); | mCurrentEditSelectionModel->select( index, command ); | |||
scrollTo( index ); | ||||
} | ||||
} | } | |||
void QgsFeatureListView::repaintRequested( const QModelIndexList &indexes ) | void QgsFeatureListView::repaintRequested( const QModelIndexList &indexes ) | |||
{ | { | |||
const auto constIndexes = indexes; | const auto constIndexes = indexes; | |||
for ( const QModelIndex &index : constIndexes ) | for ( const QModelIndex &index : constIndexes ) | |||
{ | { | |||
update( index ); | update( index ); | |||
} | } | |||
} | } | |||
End of changes. 6 change blocks. | ||||
2 lines changed or deleted | 13 lines changed or added |