Main | License | Installation | FAQ | Screenshots | Contact | Links | Sf.net | Freshmeat.net | KDE-Apps.org
Requirements | Design | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

RecipeListItem Class Reference

#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


Detailed Description

Item for displaying a recipe.
Date:
Wed Mar 09 2005
Author:
Jan Wedekind (wedesoft@users.sourceforge.net)

Definition at line 25 of file recipeListItem.hpp.


Member Typedef Documentation

typedef QCheckListItem::Type RecipeListItem::Type

Definition at line 29 of file recipeListItem.hpp.


Constructor & Destructor Documentation

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 }


Member Function Documentation

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  ) 

Definition at line 49 of file recipeListItem.cpp.

00050 {
00051   setText( 0, QString( "%1" ).arg( _id ) );
00052   id = _id;
00053 }

void RecipeListItem::setTitle ( const QString &  _title  ) 

Definition at line 55 of file recipeListItem.cpp.

Referenced by RecipeListItem().

00056 {
00057   setText( 1, _title );
00058 }

int RecipeListItem::getId ( void   )  const [inline]

Definition at line 40 of file recipeListItem.hpp.

References id.

00040 { return id; }


Field Documentation

int RecipeListItem::id [protected]

Definition at line 43 of file recipeListItem.hpp.

Referenced by getId().


The documentation for this class was generated from the following files:

anymeal 0.30 - recipe management software - Make the most of your food! - © Jan Wedekind Sun Sep 14 16:01:29 2008 - GNU Free Documentation License