#include <country.h>
Inheritance diagram for Country:


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) | |
| Country & | operator= (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 () |
| |
Properties | |
| CountryType | val [] |
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.
1.5.1