Represents a field to be used by a TaskType. More...
#include <tasktype.h>
Public Types | |
enum | Nature { Numerical, Textual } |
Public Member Functions | |
bool | isValid (const QVariant &value) const |
bool | isNull () const |
bool | isValid () const |
Public Attributes | |
Nature | nature |
QString | id |
QString | name |
Represents a field to be used by a TaskType.
A field is represented by an id (which is used to refer to a field), a name and a nature. The nature indicates what kind of value can be associated with a field.
Definition at line 26 of file tasktype.h.
Defines the different possible natures for Field objects. If new values are added to this enumeration, don't forget to update isValid(const QVariant&) const.
Numerical |
Allows everything that can be represented as a number. ie "123" is allowed but "foo" is not. |
Textual |
Allows everything that can be represented as a string. |
Definition at line 33 of file tasktype.h.
bool domain::Field::isNull | ( | ) | const |
Indicates whether this is an existing field. A field exists when it has an id set.
Definition at line 215 of file tasktype.cpp.
bool domain::Field::isValid | ( | ) | const |
Indicates whether this is a valid field. A field is valid when it has both an id and a name.
Definition at line 220 of file tasktype.cpp.
bool domain::Field::isValid | ( | const QVariant & | value | ) | const |
Indicates whether the given value is valid for this field.
value
can be converted to a datatype of this fields nature. Definition at line 202 of file tasktype.cpp.
QString domain::Field::id |
The id of this field.
Definition at line 57 of file tasktype.h.
QString domain::Field::name |
The name of this field. Is used to show a field to the user.
Definition at line 62 of file tasktype.h.
The Nature of this field.
Definition at line 50 of file tasktype.h.