Qt 4.8
Public Functions | Private Functions | Properties | Friends | List of all members
QMetaPropertyBuilder Class Reference

The QMetaPropertyBuilder class enables modifications to a property definition on a meta object builder. More...

#include <qmetaobjectbuilder_p.h>

Public Functions

bool hasNotifySignal () const
 Returns true if this property has a notify signal; false otherwise. More...
 
bool hasStdCppSet () const
 Returns true if the property has a C++ setter function that follows Qt's standard "name" / "setName" pattern. More...
 
int index () const
 Returns the index of this property within its QMetaObjectBuilder. More...
 
bool isConstant () const
 Returns true if the property is constant; otherwise returns false. More...
 
bool isDesignable () const
 Returns true if this property is designable; otherwise returns false. More...
 
bool isEditable () const
 Returns true if the property is editable; otherwise returns false. More...
 
bool isEnumOrFlag () const
 Returns true if the property is an enumerator or flag type; otherwise returns false. More...
 
bool isFinal () const
 Returns true if the property is final; otherwise returns false. More...
 
bool isReadable () const
 Returns true if this property is readable; otherwise returns false. More...
 
bool isResettable () const
 Returns true if this property can be reset to a default value; otherwise returns false. More...
 
bool isScriptable () const
 Returns true if the property is scriptable; otherwise returns false. More...
 
bool isStored () const
 Returns true if the property is stored; otherwise returns false. More...
 
bool isUser () const
 Returns true if this property is designated as the USER property, i.e., the one that the user can edit or that is significant in some other way. More...
 
bool isWritable () const
 Returns true if this property is writable; otherwise returns false. More...
 
QByteArray name () const
 Returns the name associated with this property. More...
 
QMetaMethodBuilder notifySignal () const
 Returns the notify signal associated with this property. More...
 
 QMetaPropertyBuilder ()
 
void removeNotifySignal ()
 Removes the notify signal from this property. More...
 
void setConstant (bool value)
 Sets the CONSTANT flag on this property to value. More...
 
void setDesignable (bool value)
 Sets this property to designable if value is true. More...
 
void setEditable (bool value)
 Sets this property to editable if value is true. More...
 
void setEnumOrFlag (bool value)
 Sets this property to be of an enumerator or flag type if value is true. More...
 
void setFinal (bool value)
 Sets the FINAL flag on this property to value. More...
 
void setNotifySignal (const QMetaMethodBuilder &value)
 Sets the notify signal associated with this property to value. More...
 
void setReadable (bool value)
 Sets this property to readable if value is true. More...
 
void setResettable (bool value)
 Sets this property to resettable if value is true. More...
 
void setScriptable (bool value)
 Sets this property to scriptable if value is true. More...
 
void setStdCppSet (bool value)
 Sets the C++ setter flag on this property to value, which is true if the property has a C++ setter function that follows Qt's standard "name" / "setName" pattern. More...
 
void setStored (bool value)
 Sets this property to storable if value is true. More...
 
void setUser (bool value)
 Sets the USER flag on this property to value. More...
 
void setWritable (bool value)
 Sets this property to writable if value is true. More...
 
QByteArray type () const
 Returns the type associated with this property. More...
 

Private Functions

QMetaPropertyBuilderPrivated_func () const
 
 QMetaPropertyBuilder (const QMetaObjectBuilder *mobj, int index)
 

Properties

int _index
 
const QMetaObjectBuilder_mobj
 

Friends

class QMetaObjectBuilder
 

Detailed Description

The QMetaPropertyBuilder class enables modifications to a property definition on a meta object builder.

Warning
This function is not part of the public interface.

Definition at line 236 of file qmetaobjectbuilder_p.h.

Constructors and Destructors

◆ QMetaPropertyBuilder() [1/2]

QMetaPropertyBuilder::QMetaPropertyBuilder ( )
inline
Warning
This function is not part of the public interface.

Definition at line 239 of file qmetaobjectbuilder_p.h.

239 : _mobj(0), _index(0) {}
const QMetaObjectBuilder * _mobj

◆ QMetaPropertyBuilder() [2/2]

QMetaPropertyBuilder::QMetaPropertyBuilder ( const QMetaObjectBuilder mobj,
int  index 
)
inlineprivate

Definition at line 283 of file qmetaobjectbuilder_p.h.

284  : _mobj(mobj), _index(index) {}
int index() const
Returns the index of this property within its QMetaObjectBuilder.
const QMetaObjectBuilder * _mobj

Functions

◆ d_func()

QMetaPropertyBuilderPrivate * QMetaPropertyBuilder::d_func ( ) const
private

Definition at line 2035 of file qmetaobjectbuilder.cpp.

Referenced by QMetaMethodBuilder::QMetaMethodBuilder().

2036 {
2037  if (_mobj && _index >= 0 && _index < _mobj->d->properties.size())
2038  return &(_mobj->d->properties[_index]);
2039  else
2040  return 0;
2041 }
double d
Definition: qnumeric_p.h:62
QMetaObjectBuilderPrivate * d
const QMetaObjectBuilder * _mobj
QList< QMetaPropertyBuilderPrivate > properties

◆ hasNotifySignal()

bool QMetaPropertyBuilder::hasNotifySignal ( ) const

Returns true if this property has a notify signal; false otherwise.

See also
notifySignal(), setNotifySignal(), removeNotifySignal()

Definition at line 2090 of file qmetaobjectbuilder.cpp.

2091 {
2093  if (d)
2094  return d->flag(Notify);
2095  else
2096  return false;
2097 }
double d
Definition: qnumeric_p.h:62
QMetaPropertyBuilderPrivate * d_func() const

◆ hasStdCppSet()

bool QMetaPropertyBuilder::hasStdCppSet ( ) const

Returns true if the property has a C++ setter function that follows Qt's standard "name" / "setName" pattern.

Designer and uic query hasStdCppSet() in order to avoid expensive QObject::setProperty() calls. All properties in Qt [should] follow this pattern. The default value is false.

See also
setStdCppSet()

Definition at line 2277 of file qmetaobjectbuilder.cpp.

2278 {
2280  if (d)
2281  return d->flag(StdCppSet);
2282  else
2283  return false;
2284 }
double d
Definition: qnumeric_p.h:62
QMetaPropertyBuilderPrivate * d_func() const

◆ index()

int QMetaPropertyBuilder::index ( ) const
inline

Returns the index of this property within its QMetaObjectBuilder.

Definition at line 241 of file qmetaobjectbuilder_p.h.

241 { return _index; }

◆ isConstant()

bool QMetaPropertyBuilder::isConstant ( ) const

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

The default value is false.

Definition at line 2305 of file qmetaobjectbuilder.cpp.

2306 {
2308  if (d)
2309  return d->flag(Constant);
2310  else
2311  return false;
2312 }
double d
Definition: qnumeric_p.h:62
QMetaPropertyBuilderPrivate * d_func() const

◆ isDesignable()

bool QMetaPropertyBuilder::isDesignable ( ) const

Returns true if this property is designable; otherwise returns false.

This default value is false.

See also
setDesignable(), isScriptable(), isStored()

Definition at line 2197 of file qmetaobjectbuilder.cpp.

2198 {
2200  if (d)
2201  return d->flag(Designable);
2202  else
2203  return false;
2204 }
double d
Definition: qnumeric_p.h:62
QMetaPropertyBuilderPrivate * d_func() const

◆ isEditable()

bool QMetaPropertyBuilder::isEditable ( ) const

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

This default value is false.

See also
setEditable(), isDesignable(), isScriptable(), isStored()

Definition at line 2242 of file qmetaobjectbuilder.cpp.

2243 {
2245  if (d)
2246  return d->flag(Editable);
2247  else
2248  return false;
2249 }
double d
Definition: qnumeric_p.h:62
QMetaPropertyBuilderPrivate * d_func() const

◆ isEnumOrFlag()

bool QMetaPropertyBuilder::isEnumOrFlag ( ) const

Returns true if the property is an enumerator or flag type; otherwise returns false.

This default value is false.

See also
setEnumOrFlag()

Definition at line 2292 of file qmetaobjectbuilder.cpp.

2293 {
2295  if (d)
2296  return d->flag(EnumOrFlag);
2297  else
2298  return false;
2299 }
double d
Definition: qnumeric_p.h:62
QMetaPropertyBuilderPrivate * d_func() const

◆ isFinal()

bool QMetaPropertyBuilder::isFinal ( ) const

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

The default value is false.

Definition at line 2318 of file qmetaobjectbuilder.cpp.

2319 {
2321  if (d)
2322  return d->flag(Final);
2323  else
2324  return false;
2325 }
double d
Definition: qnumeric_p.h:62
QMetaPropertyBuilderPrivate * d_func() const

◆ isReadable()

bool QMetaPropertyBuilder::isReadable ( ) const

Returns true if this property is readable; otherwise returns false.

The default value is true.

See also
setReadable(), isWritable()

Definition at line 2152 of file qmetaobjectbuilder.cpp.

2153 {
2155  if (d)
2156  return d->flag(Readable);
2157  else
2158  return false;
2159 }
double d
Definition: qnumeric_p.h:62
QMetaPropertyBuilderPrivate * d_func() const

◆ isResettable()

bool QMetaPropertyBuilder::isResettable ( ) const

Returns true if this property can be reset to a default value; otherwise returns false.

The default value is false.

See also
setResettable()

Definition at line 2182 of file qmetaobjectbuilder.cpp.

2183 {
2185  if (d)
2186  return d->flag(Resettable);
2187  else
2188  return false;
2189 }
double d
Definition: qnumeric_p.h:62
QMetaPropertyBuilderPrivate * d_func() const

◆ isScriptable()

bool QMetaPropertyBuilder::isScriptable ( ) const

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

This default value is true.

See also
setScriptable(), isDesignable(), isStored()

Definition at line 2212 of file qmetaobjectbuilder.cpp.

2213 {
2215  if (d)
2216  return d->flag(Scriptable);
2217  else
2218  return false;
2219 }
double d
Definition: qnumeric_p.h:62
QMetaPropertyBuilderPrivate * d_func() const

◆ isStored()

bool QMetaPropertyBuilder::isStored ( ) const

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

This default value is false.

See also
setStored(), isDesignable(), isScriptable()

Definition at line 2227 of file qmetaobjectbuilder.cpp.

2228 {
2230  if (d)
2231  return d->flag(Stored);
2232  else
2233  return false;
2234 }
double d
Definition: qnumeric_p.h:62
QMetaPropertyBuilderPrivate * d_func() const

◆ isUser()

bool QMetaPropertyBuilder::isUser ( ) const

Returns true if this property is designated as the USER property, i.e., the one that the user can edit or that is significant in some other way.

Otherwise it returns false. This default value is false.

See also
setUser(), isDesignable(), isScriptable()

Definition at line 2259 of file qmetaobjectbuilder.cpp.

2260 {
2262  if (d)
2263  return d->flag(User);
2264  else
2265  return false;
2266 }
double d
Definition: qnumeric_p.h:62
QMetaPropertyBuilderPrivate * d_func() const

◆ isWritable()

bool QMetaPropertyBuilder::isWritable ( ) const

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

The default value is true.

See also
setWritable(), isReadable()

Definition at line 2167 of file qmetaobjectbuilder.cpp.

2168 {
2170  if (d)
2171  return d->flag(Writable);
2172  else
2173  return false;
2174 }
double d
Definition: qnumeric_p.h:62
QMetaPropertyBuilderPrivate * d_func() const

◆ name()

QByteArray QMetaPropertyBuilder::name ( ) const

Returns the name associated with this property.

See also
type()

Definition at line 2062 of file qmetaobjectbuilder.cpp.

Referenced by QDeclarativeOpenMetaObject::name(), and QDeclarativePropertyMapMetaObject::propertyCreated().

2063 {
2065  if (d)
2066  return d->name;
2067  else
2068  return QByteArray();
2069 }
double d
Definition: qnumeric_p.h:62
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
QMetaPropertyBuilderPrivate * d_func() const

◆ notifySignal()

QMetaMethodBuilder QMetaPropertyBuilder::notifySignal ( ) const

Returns the notify signal associated with this property.

See also
hasNotifySignal(), setNotifySignal(), removeNotifySignal()

Definition at line 2104 of file qmetaobjectbuilder.cpp.

2105 {
2107  if (d && d->notifySignal >= 0)
2109  else
2110  return QMetaMethodBuilder();
2111 }
double d
Definition: qnumeric_p.h:62
The QMetaMethodBuilder class enables modifications to a method definition on a meta object builder...
const QMetaObjectBuilder * _mobj
QMetaPropertyBuilderPrivate * d_func() const

◆ removeNotifySignal()

void QMetaPropertyBuilder::removeNotifySignal ( )

Removes the notify signal from this property.

See also
hasNotifySignal(), notifySignal(), setNotifySignal()

Definition at line 2137 of file qmetaobjectbuilder.cpp.

2138 {
2140  if (d) {
2141  d->notifySignal = -1;
2142  d->setFlag(Notify, false);
2143  }
2144 }
double d
Definition: qnumeric_p.h:62
void setFlag(int f, bool value)
QMetaPropertyBuilderPrivate * d_func() const

◆ setConstant()

void QMetaPropertyBuilder::setConstant ( bool  value)

Sets the CONSTANT flag on this property to value.

See also
isConstant()

Definition at line 2455 of file qmetaobjectbuilder.cpp.

2456 {
2458  if (d)
2459  d->setFlag(Constant, value);
2460 }
double d
Definition: qnumeric_p.h:62
void setFlag(int f, bool value)
QMetaPropertyBuilderPrivate * d_func() const

◆ setDesignable()

void QMetaPropertyBuilder::setDesignable ( bool  value)

Sets this property to designable if value is true.

See also
isDesignable(), setScriptable(), setStored()

Definition at line 2368 of file qmetaobjectbuilder.cpp.

2369 {
2371  if (d)
2372  d->setFlag(Designable, value);
2373 }
double d
Definition: qnumeric_p.h:62
void setFlag(int f, bool value)
QMetaPropertyBuilderPrivate * d_func() const

◆ setEditable()

void QMetaPropertyBuilder::setEditable ( bool  value)

Sets this property to editable if value is true.

See also
isEditable(), setDesignable(), setScriptable(), setStored()

Definition at line 2404 of file qmetaobjectbuilder.cpp.

2405 {
2407  if (d)
2408  d->setFlag(Editable, value);
2409 }
double d
Definition: qnumeric_p.h:62
void setFlag(int f, bool value)
QMetaPropertyBuilderPrivate * d_func() const

◆ setEnumOrFlag()

void QMetaPropertyBuilder::setEnumOrFlag ( bool  value)

Sets this property to be of an enumerator or flag type if value is true.

See also
isEnumOrFlag()

Definition at line 2443 of file qmetaobjectbuilder.cpp.

2444 {
2446  if (d)
2447  d->setFlag(EnumOrFlag, value);
2448 }
double d
Definition: qnumeric_p.h:62
void setFlag(int f, bool value)
QMetaPropertyBuilderPrivate * d_func() const

◆ setFinal()

void QMetaPropertyBuilder::setFinal ( bool  value)

Sets the FINAL flag on this property to value.

See also
isFinal()

Definition at line 2467 of file qmetaobjectbuilder.cpp.

2468 {
2470  if (d)
2471  d->setFlag(Final, value);
2472 }
double d
Definition: qnumeric_p.h:62
void setFlag(int f, bool value)
QMetaPropertyBuilderPrivate * d_func() const

◆ setNotifySignal()

void QMetaPropertyBuilder::setNotifySignal ( const QMetaMethodBuilder value)

Sets the notify signal associated with this property to value.

See also
hasNotifySignal(), notifySignal(), removeNotifySignal()

Definition at line 2118 of file qmetaobjectbuilder.cpp.

2119 {
2121  if (d) {
2122  if (value._mobj) {
2123  d->notifySignal = value._index;
2124  d->setFlag(Notify, true);
2125  } else {
2126  d->notifySignal = -1;
2127  d->setFlag(Notify, false);
2128  }
2129  }
2130 }
double d
Definition: qnumeric_p.h:62
const QMetaObjectBuilder * _mobj
void setFlag(int f, bool value)
QMetaPropertyBuilderPrivate * d_func() const

◆ setReadable()

void QMetaPropertyBuilder::setReadable ( bool  value)

Sets this property to readable if value is true.

See also
isReadable(), setWritable()

Definition at line 2332 of file qmetaobjectbuilder.cpp.

Referenced by QMetaObjectBuilder::addProperty().

2333 {
2335  if (d)
2336  d->setFlag(Readable, value);
2337 }
double d
Definition: qnumeric_p.h:62
void setFlag(int f, bool value)
QMetaPropertyBuilderPrivate * d_func() const

◆ setResettable()

void QMetaPropertyBuilder::setResettable ( bool  value)

Sets this property to resettable if value is true.

See also
isResettable()

Definition at line 2356 of file qmetaobjectbuilder.cpp.

2357 {
2359  if (d)
2360  d->setFlag(Resettable, value);
2361 }
double d
Definition: qnumeric_p.h:62
void setFlag(int f, bool value)
QMetaPropertyBuilderPrivate * d_func() const

◆ setScriptable()

void QMetaPropertyBuilder::setScriptable ( bool  value)

Sets this property to scriptable if value is true.

See also
isScriptable(), setDesignable(), setStored()

Definition at line 2380 of file qmetaobjectbuilder.cpp.

2381 {
2383  if (d)
2384  d->setFlag(Scriptable, value);
2385 }
double d
Definition: qnumeric_p.h:62
void setFlag(int f, bool value)
QMetaPropertyBuilderPrivate * d_func() const

◆ setStdCppSet()

void QMetaPropertyBuilder::setStdCppSet ( bool  value)

Sets the C++ setter flag on this property to value, which is true if the property has a C++ setter function that follows Qt's standard "name" / "setName" pattern.

See also
hasStdCppSet()

Definition at line 2430 of file qmetaobjectbuilder.cpp.

2431 {
2433  if (d)
2434  d->setFlag(StdCppSet, value);
2435 }
double d
Definition: qnumeric_p.h:62
void setFlag(int f, bool value)
QMetaPropertyBuilderPrivate * d_func() const

◆ setStored()

void QMetaPropertyBuilder::setStored ( bool  value)

Sets this property to storable if value is true.

See also
isStored(), setDesignable(), setScriptable()

Definition at line 2392 of file qmetaobjectbuilder.cpp.

2393 {
2395  if (d)
2396  d->setFlag(Stored, value);
2397 }
double d
Definition: qnumeric_p.h:62
void setFlag(int f, bool value)
QMetaPropertyBuilderPrivate * d_func() const

◆ setUser()

void QMetaPropertyBuilder::setUser ( bool  value)

Sets the USER flag on this property to value.

See also
isUser(), setDesignable(), setScriptable()

Definition at line 2416 of file qmetaobjectbuilder.cpp.

2417 {
2419  if (d)
2420  d->setFlag(User, value);
2421 }
double d
Definition: qnumeric_p.h:62
void setFlag(int f, bool value)
QMetaPropertyBuilderPrivate * d_func() const

◆ setWritable()

void QMetaPropertyBuilder::setWritable ( bool  value)

◆ type()

QByteArray QMetaPropertyBuilder::type ( ) const

Returns the type associated with this property.

See also
name()

Definition at line 2076 of file qmetaobjectbuilder.cpp.

2077 {
2079  if (d)
2080  return d->type;
2081  else
2082  return QByteArray();
2083 }
double d
Definition: qnumeric_p.h:62
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
QMetaPropertyBuilderPrivate * d_func() const

Friends and Related Functions

◆ QMetaObjectBuilder

friend class QMetaObjectBuilder
friend

Definition at line 281 of file qmetaobjectbuilder_p.h.

Properties

◆ _index

int QMetaPropertyBuilder::_index
private

Definition at line 279 of file qmetaobjectbuilder_p.h.

◆ _mobj

const QMetaObjectBuilder* QMetaPropertyBuilder::_mobj
private

Definition at line 278 of file qmetaobjectbuilder_p.h.


The documentation for this class was generated from the following files: