00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include <cassert>
00017 #include <stdlib.h>
00018 #include "categoryListItem.hpp"
00019
00020 using namespace std;
00021
00022 CategoryListItem::CategoryListItem( QListView *parent, const QString &text ):
00023 QCheckListItem( parent, text, CheckBox )
00024 {
00025 }
00026
00027 int CategoryListItem::compare( QListViewItem *i, int col, bool ascending ) const
00028 {
00029 int retVal;
00030 if ( col != 1 ) {
00031 double
00032 a = atof( key( col, ascending ) ),
00033 b = atof( i->key( col, ascending ) );
00034 if ( a < b )
00035 retVal = -1;
00036 else
00037 if ( a > b )
00038 retVal = 1;
00039 else
00040 retVal = 0;
00041 } else
00042 retVal = QCheckListItem::compare( i, col, ascending );
00043 return retVal;
00044 }