Skip to content
Permalink
Browse files

Fix handling of link category boundaries with sorting of rows

  • Loading branch information
ccrook committed Sep 30, 2014
1 parent 1841225 commit 834c1d0db45133005bfe5714e6d11afd64399f95
Showing with 7 additions and 9 deletions.
  1. +7 −9 src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp
@@ -326,6 +326,7 @@ void QgsGraduatedSymbolRendererV2Model::sort( int column, Qt::SortOrder order )
{
mRenderer->sortByLabel( order );
}
emit rowsMoved();
emit dataChanged( createIndex( 0, 0, 0 ), createIndex( mRenderer->ranges().size(), 0 ) );
QgsDebugMsg( "Done" );
}
@@ -798,22 +799,19 @@ void QgsGraduatedSymbolRendererV2Widget::toggleBoundariesLink( bool linked )
//This is done by updating all lower ranges to the upper value of the range above
if ( linked )
{
// Cannot link ranges if they are not sorted - results will be crazy
// qSort( mRenderer->ranges() );
// Could not get qSort to work with copy/swap idiom on QgsVectorRange

if ( ! rowsOrdered() )
{
int result = QMessageBox::warning(
this,
tr( "Linked range warning" ),
tr( "Linking ranges that are not ordered may produced unexpected results. Proceed?" ),
tr( "Rows will be reordered before linking boundaries. Continue?" ),
QMessageBox::Ok | QMessageBox::Cancel );
if ( result != QMessageBox::Ok )
{
cbxLinkBoundaries->setChecked( false );
return;
}
mRenderer->sortByValue();
}

// Ok to proceed
@@ -920,16 +918,16 @@ void QgsGraduatedSymbolRendererV2Widget::showSymbolLevels()
void QgsGraduatedSymbolRendererV2Widget::rowsMoved()
{
viewGraduated->selectionModel()->clear();
}

void QgsGraduatedSymbolRendererV2Widget::modelDataChanged()
{
if ( ! rowsOrdered() )
{
cbxLinkBoundaries->setChecked( false );
}
}

void QgsGraduatedSymbolRendererV2Widget::modelDataChanged()
{
}

void QgsGraduatedSymbolRendererV2Widget::keyPressEvent( QKeyEvent* event )
{
if ( !event )

0 comments on commit 834c1d0

Please sign in to comment.
You can’t perform that action at this time.