"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/gui/attributetable/qgsfeaturelistview.cpp" between
QGIS-final-3_14_15.tar.gz and QGIS-final-3_14_16.tar.gz

About: QGIS (Quantum GIS) is a Geographic Information System that supports vector, raster, and database formats. Latest release (3.14.x series).

qgsfeaturelistview.cpp  (QGIS-final-3_14_15):qgsfeaturelistview.cpp  (QGIS-final-3_14_16)
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 );
// cppcheck-suppress assertWithSideEffect // cppcheck-suppress assertWithSideEffect
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 );
} }
} }
void QgsFeatureListView::repaintRequested() void QgsFeatureListView::repaintRequested()
{ {
setDirtyRegion( viewport()->rect() ); setDirtyRegion( viewport()->rect() );
} }
void QgsFeatureListView::mouseMoveEvent( QMouseEvent *event ) void QgsFeatureListView::mouseMoveEvent( QMouseEvent *event )
{ {
QPoint pos = event->pos(); if ( mModel )
{
QPoint pos = event->pos();
QModelIndex index = indexAt( pos ); QModelIndex index = indexAt( pos );
if ( mEditSelectionDrag ) if ( mEditSelectionDrag )
{ {
if ( index.isValid() ) if ( index.isValid() )
setEditSelection( mModel->mapToMaster( index ), QItemSelectionModel::Clear setEditSelection( mModel->mapToMaster( index ), QItemSelectionModel::Cle
AndSelect ); arAndSelect );
}
else
{
selectRow( index, false );
}
} }
else else
{ {
selectRow( index, false ); QgsDebugMsg( QStringLiteral( "No model assigned to this view" ) );
} }
} }
void QgsFeatureListView::mouseReleaseEvent( QMouseEvent *event ) void QgsFeatureListView::mouseReleaseEvent( QMouseEvent *event )
{ {
Q_UNUSED( event ) Q_UNUSED( event )
if ( mEditSelectionDrag ) if ( mEditSelectionDrag )
{ {
mEditSelectionDrag = false; mEditSelectionDrag = false;
 End of changes. 10 change blocks. 
10 lines changed or deleted 28 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)