Skip to content
Permalink
Browse files
Merge pull request #338 from simon04/too_many_classes
Abort classification upon high number of classes
  • Loading branch information
mach0 committed Nov 25, 2012
2 parents a0c8b5c + 755707d commit 9f71d9f
Showing 1 changed file with 13 additions and 0 deletions.
@@ -596,6 +596,19 @@ void QgsCategorizedSymbolRendererV2Widget::addCategories()
QList<QVariant> unique_vals;
mLayer->uniqueValues( idx, unique_vals );

// ask to abort if too many classes
if ( unique_vals.size() >= 1000 )
{
int res = QMessageBox::warning( 0, tr( "High number of classes!" ),
tr( "Classification would yield %1 entries which might not be expected. Continue?" ).arg( unique_vals.size() ),
QMessageBox::Ok | QMessageBox::Cancel,
QMessageBox::Cancel );
if ( res == QMessageBox::Cancel )
{
return;
}
}

//DlgAddCategories dlg(mStyle, createDefaultSymbol(), unique_vals, this);
//if (!dlg.exec())
// return;

0 comments on commit 9f71d9f

Please sign in to comment.