Country Class Reference

an example DataObject More...

#include <country.h>

Inheritance diagram for Country:

Inheritance graph
[legend]
Collaboration diagram for Country:

Collaboration graph
[legend]
List of all members.

Public Types

enum  CountryType
 For Q_ENUMS macro to work, we must have the enum type definition in the same class as the Q_ENUMS.

Public Member Functions

 Country (CountryType val=USA)
 Country (const QString &str)
Countryoperator= (const Country &newCountry)
 Since country is derived from QObject, which has a private assignment operator, the compiler-supplied assignment operator will not work, so we must define our own.
CountryType getVal () const
void setVal (CountryType nc)
QString toString () const

Static Public Member Functions

static QStringList getCountryNames ()
 
Returns:
a list all the Country names supported


Properties

CountryType val []

Detailed Description

an example DataObject

This is a very simple object with a single enum property, Country. It is an example of how one can convert from QStrings to enum values and back. It does no string hardcoding anywhere.

Since Country is derived (indirectly) from QObject, which has a private copy constructor, the compiler-supplied copy constructor will not work here. In fact, care should be taken to make sure that only Country references are passed to or returned from functions.

Definition at line 18 of file country.h.


The documentation for this class was generated from the following files:
Generated on Wed Sep 30 01:15:43 2009 for oopapidocs by  doxygen 1.5.1