TQMetaProperty Class

Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# TQMetaProperty Class Reference

The TQMetaProperty class stores meta data about a property. More...

`#include <ntqmetaobject.h>`

List of all member functions.

## Public Members

- const char * type () const
- const char * name () const
- bool writable () const
- bool isSetType () const
- bool isEnumType () const
- TQStrList enumKeys () const
- int keyToValue ( const char * key ) const
- const char * valueToKey ( int value ) const
- int keysToValue ( const TQStrList & keys ) const
- TQStrList valueToKeys ( int value ) const
- bool designable ( TQObject * o = 0 ) const
- bool scriptable ( TQObject * o = 0 ) const
- bool stored ( TQObject * o = 0 ) const
- bool reset ( TQObject * o ) const

## Detailed Description

The TQMetaProperty class stores meta data about a property.

Property meta data includes type(), name(), and whether a property is writable(), designable() and stored().

The functions isSetType(), isEnumType() and enumKeys() provide further information about a property's type. The conversion functions keyToValue(), valueToKey(), keysToValue() and valueToKeys() allow conversion between the integer representation of an enumeration or set value and its literal representation.

Actual property values are set and received through TQObject's set and get functions. See TQObject::setProperty() and TQObject::property() for details.

You receive meta property data through an object's meta object. See TQMetaObject::property() and TQMetaObject::propertyNames() for details.

See also Object Model.

## Member Function Documentation

### bool TQMetaProperty::designable ( TQObject * o = 0 ) const

Returns true if the property is designable for object o; otherwise returns false.

If no object o is given, the function returns a static approximation.

### TQStrList TQMetaProperty::enumKeys () const

Returns the possible enumeration keys if this property is an enumeration type (or a set type).

See also isEnumType().

### bool TQMetaProperty::isEnumType () const

Returns true if the property's type is an enumeration value; otherwise returns false.

See also isSetType() and enumKeys().

### bool TQMetaProperty::isSetType () const

Returns true if the property's type is an enumeration value that is used as set, i.e. if the enumeration values can be OR-ed together; otherwise returns false. A set type is implicitly also an enum type.

See also isEnumType() and enumKeys().

### int TQMetaProperty::keyToValue ( const char * key ) const

Converts the enumeration key key to its integer value.

For set types, use keysToValue().

See also valueToKey(), isSetType(), and keysToValue().

### int TQMetaProperty::keysToValue ( const TQStrList & keys ) const

Converts the list of keys keys to their combined (OR-ed) integer value.

See also isSetType() and valueToKey().

### const char * TQMetaProperty::name () const

Returns the name of the property.

### bool TQMetaProperty::reset ( TQObject * o ) const

Tries to reset the property for object o with a reset method. On success, returns true; otherwise returns false.

Reset methods are optional, usually only a few properties support them.

### bool TQMetaProperty::scriptable ( TQObject * o = 0 ) const

Returns true if the property is scriptable for object o; otherwise returns false.

If no object o is given, the function returns a static approximation.

### bool TQMetaProperty::stored ( TQObject * o = 0 ) const

Returns true if the property shall be stored for object o; otherwise returns false.

If no object o is given, the function returns a static approximation.

### const char * TQMetaProperty::type () const

Returns the type of the property.

### const char * TQMetaProperty::valueToKey ( int value ) const

Converts the enumeration value value to its literal key.

For set types, use valueToKeys().

See also isSetType() and valueToKeys().

### TQStrList TQMetaProperty::valueToKeys ( int value ) const

Converts the set value value to a list of keys.

See also isSetType() and valueToKey().

### bool TQMetaProperty::writable () const

Returns true if the property is writable; otherwise returns false.

This file is part of the TQt toolkit. Copyright © 1995-2007 Trolltech. All Rights Reserved.