oopapidocs  2.0
Country Class Reference

an example DataObject More...

#include <country.h>

Inheritance diagram for Country:
Collaboration diagram for Country:

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

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.
QString toString () const

Static Public Member Functions

static QStringList getCountryNames ()

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.


Member Function Documentation

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

Definition at line 9 of file country.cpp.

QString Country::toString ( ) const [virtual]
Returns:
human and machine readable representation of this object (XML format)

Reimplemented from DataObject.

Definition at line 21 of file country.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Enumerations