void ModelGrouper::groupByColumn( int column ) { // Single level grouping for now if( mIsGrouped ) ungroup(); mGroupColumn = column; int count = model()->rowCount(); if( count > 0 ) groupRows( 0, count - 1 ); mIsGrouped = true; emit grouped(); emit groupingChanged( true ); }
/** Used by the view to tell the presenter something has changed */ void ReflMainViewPresenter::notify(int flag) { switch(flag) { case ReflMainView::SaveAsFlag: saveAs(); break; case ReflMainView::SaveFlag: save(); break; case ReflMainView::AddRowFlag: addRow(); break; case ReflMainView::DeleteRowFlag: deleteRow(); break; case ReflMainView::ProcessFlag: process(); break; case ReflMainView::GroupRowsFlag: groupRows(); break; case ReflMainView::NoFlags: return; } //Not having a 'default' case is deliberate. gcc issues a warning if there's a flag we aren't handling. }