#include <recipeListItem.hpp>
Public Types | |
| typedef QCheckListItem::Type | Type |
Public Member Functions | |
| RecipeListItem (QListView *parent, int _id, const QString &_title, bool _selected) | |
| virtual int | compare (QListViewItem *i, int col, bool ascending) const |
| void | setId (int _id) |
| void | setTitle (const QString &_title) |
| int | getId (void) const |
Protected Attributes | |
| int | id |
Definition at line 25 of file recipeListItem.hpp.
| typedef QCheckListItem::Type RecipeListItem::Type |
Definition at line 29 of file recipeListItem.hpp.
| RecipeListItem::RecipeListItem | ( | QListView * | parent, | |
| int | _id, | |||
| const QString & | _title, | |||
| bool | _selected | |||
| ) |
Definition at line 22 of file recipeListItem.cpp.
References setTitle().
00023 : 00024 QCheckListItem( parent, QString( "%1" ).arg( _id ), CheckBox ), id(_id) 00025 { 00026 setTitle( _title ); 00027 setOn( _selected ); 00028 }
| int RecipeListItem::compare | ( | QListViewItem * | i, | |
| int | col, | |||
| bool | ascending | |||
| ) | const [virtual] |
Definition at line 30 of file recipeListItem.cpp.
00031 { 00032 int retVal; 00033 if ( col != 1 ) { 00034 double 00035 a = atof( key( col, ascending ) ), 00036 b = atof( i->key( col, ascending ) ); 00037 if ( a < b ) 00038 retVal = -1; 00039 else 00040 if ( a > b ) 00041 retVal = 1; 00042 else 00043 retVal = 0; 00044 } else 00045 retVal = QCheckListItem::compare( i, col, ascending ); 00046 return retVal; 00047 }
| void RecipeListItem::setId | ( | int | _id | ) |
| void RecipeListItem::setTitle | ( | const QString & | _title | ) |
| int RecipeListItem::getId | ( | void | ) | const [inline] |
int RecipeListItem::id [protected] |