Skip to content
Permalink
Browse files
Abort classification upon high number of classes
  • Loading branch information
simon04 committed Nov 25, 2012
1 parent 349229f commit 755707de89b0c2464070d21c4ce71b96f59c713e
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.cpp
@@ -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 755707d

Please sign in to comment.