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

The QMetaMethodBuilder class enables modifications to a method definition on a meta object builder. More...

#include <qmetaobjectbuilder_p.h>

Public Functions

QMetaMethod::Access access () const
 Returns the access specification of this method (private, protected, or public). More...
 
int attributes () const
 Returns the additional attributes for this method. More...
 
int index () const
 Returns the index of this method within its QMetaObjectBuilder. More...
 
QMetaMethod::MethodType methodType () const
 Returns the type of this method (signal, slot, method, or constructor). More...
 
QList< QByteArrayparameterNames () const
 Returns the list of parameter names for this method. More...
 
 QMetaMethodBuilder ()
 
QByteArray returnType () const
 Returns the return type for this method; empty if the method's return type is void. More...
 
void setAccess (QMetaMethod::Access value)
 Sets the access specification of this method (private, protected, or public) to value. More...
 
void setAttributes (int value)
 Sets the additional attributes for this method to value. More...
 
void setParameterNames (const QList< QByteArray > &value)
 Sets the list of parameter names for this method to value. More...
 
void setReturnType (const QByteArray &value)
 Sets the return type for this method to value. More...
 
void setTag (const QByteArray &value)
 Sets the tag associated with this method to value. More...
 
QByteArray signature () const
 Returns the signature of this method. More...
 
QByteArray tag () const
 Returns the tag associated with this method. More...
 

Private Functions

QMetaMethodBuilderPrivated_func () const
 
 QMetaMethodBuilder (const QMetaObjectBuilder *mobj, int index)
 

Properties

int _index
 
const QMetaObjectBuilder_mobj
 

Friends

class QMetaObjectBuilder
 
class QMetaPropertyBuilder
 

Detailed Description

The QMetaMethodBuilder class enables modifications to a method definition on a meta object builder.

Warning
This function is not part of the public interface.

Definition at line 198 of file qmetaobjectbuilder_p.h.

Constructors and Destructors

◆ QMetaMethodBuilder() [1/2]

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

Definition at line 201 of file qmetaobjectbuilder_p.h.

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

◆ QMetaMethodBuilder() [2/2]

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

Definition at line 230 of file qmetaobjectbuilder_p.h.

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

Functions

◆ access()

QMetaMethod::Access QMetaMethodBuilder::access ( ) const

Returns the access specification of this method (private, protected, or public).

The default value is QMetaMethod::Public for methods, slots, and constructors. The default value is QMetaMethod::Protected for signals.

See also
setAccess()

Definition at line 1977 of file qmetaobjectbuilder.cpp.

1978 {
1980  if (d)
1981  return d->access();
1982  else
1983  return QMetaMethod::Public;
1984 }
double d
Definition: qnumeric_p.h:62
QMetaMethod::Access access() const
QMetaMethodBuilderPrivate * d_func() const

◆ attributes()

int QMetaMethodBuilder::attributes ( ) const

Returns the additional attributes for this method.

See also
setAttributes()

Definition at line 2005 of file qmetaobjectbuilder.cpp.

2006 {
2008  if (d)
2009  return (d->attributes >> 4);
2010  else
2011  return 0;
2012 }
double d
Definition: qnumeric_p.h:62
QMetaMethodBuilderPrivate * d_func() const

◆ d_func()

QMetaMethodBuilderPrivate * QMetaMethodBuilder::d_func ( ) const
private

Definition at line 1835 of file qmetaobjectbuilder.cpp.

1836 {
1837  // Positive indices indicate methods, negative indices indicate constructors.
1838  if (_mobj && _index >= 0 && _index < _mobj->d->methods.size())
1839  return &(_mobj->d->methods[_index]);
1840  else if (_mobj && -_index >= 1 && -_index <= _mobj->d->constructors.size())
1841  return &(_mobj->d->constructors[(-_index) - 1]);
1842  else
1843  return 0;
1844 }
double d
Definition: qnumeric_p.h:62
QMetaObjectBuilderPrivate * d
QList< QMetaMethodBuilderPrivate > constructors
const QMetaObjectBuilder * _mobj
QList< QMetaMethodBuilderPrivate > methods

◆ index()

int QMetaMethodBuilder::index ( ) const

Returns the index of this method within its QMetaObjectBuilder.

Definition at line 1854 of file qmetaobjectbuilder.cpp.

1855 {
1856  if (_index >= 0)
1857  return _index; // Method, signal, or slot
1858  else
1859  return (-_index) - 1; // Constructor
1860 }

◆ methodType()

QMetaMethod::MethodType QMetaMethodBuilder::methodType ( ) const

Returns the type of this method (signal, slot, method, or constructor).

Definition at line 1865 of file qmetaobjectbuilder.cpp.

1866 {
1868  if (d)
1869  return d->methodType();
1870  else
1871  return QMetaMethod::Method;
1872 }
double d
Definition: qnumeric_p.h:62
QMetaMethodBuilderPrivate * d_func() const
QMetaMethod::MethodType methodType() const

◆ parameterNames()

QList< QByteArray > QMetaMethodBuilder::parameterNames ( ) const

Returns the list of parameter names for this method.

See also
setParameterNames()

Definition at line 1922 of file qmetaobjectbuilder.cpp.

1923 {
1925  if (d)
1926  return d->parameterNames;
1927  else
1928  return QList<QByteArray>();
1929 }
double d
Definition: qnumeric_p.h:62
QList< QByteArray > parameterNames
QMetaMethodBuilderPrivate * d_func() const

◆ returnType()

QByteArray QMetaMethodBuilder::returnType ( ) const

Returns the return type for this method; empty if the method's return type is void.

See also
setReturnType(), signature()

Definition at line 1894 of file qmetaobjectbuilder.cpp.

1895 {
1897  if (d)
1898  return d->returnType;
1899  else
1900  return QByteArray();
1901 }
double d
Definition: qnumeric_p.h:62
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
QMetaMethodBuilderPrivate * d_func() const

◆ setAccess()

void QMetaMethodBuilder::setAccess ( QMetaMethod::Access  value)

Sets the access specification of this method (private, protected, or public) to value.

If the method is a signal, this function will be ignored.

See also
access()

Definition at line 1993 of file qmetaobjectbuilder.cpp.

Referenced by QMetaObjectBuilder::addMethod(), and for().

1994 {
1996  if (d && d->methodType() != QMetaMethod::Signal)
1997  d->setAccess(value);
1998 }
double d
Definition: qnumeric_p.h:62
void setAccess(QMetaMethod::Access value)
QMetaMethodBuilderPrivate * d_func() const
QMetaMethod::MethodType methodType() const

◆ setAttributes()

void QMetaMethodBuilder::setAttributes ( int  value)

Sets the additional attributes for this method to value.

See also
attributes()

Definition at line 2019 of file qmetaobjectbuilder.cpp.

Referenced by QMetaObjectBuilder::addMethod().

2020 {
2022  if (d)
2023  d->attributes = ((d->attributes & 0x0f) | (value << 4));
2024 }
double d
Definition: qnumeric_p.h:62
QMetaMethodBuilderPrivate * d_func() const

◆ setParameterNames()

void QMetaMethodBuilder::setParameterNames ( const QList< QByteArray > &  value)

Sets the list of parameter names for this method to value.

See also
parameterNames()

Definition at line 1936 of file qmetaobjectbuilder.cpp.

Referenced by QMetaObjectBuilder::addMethod(), and QDeclarativeCompiler::buildDynamicMeta().

1937 {
1939  if (d)
1940  d->parameterNames = value;
1941 }
double d
Definition: qnumeric_p.h:62
QList< QByteArray > parameterNames
QMetaMethodBuilderPrivate * d_func() const

◆ setReturnType()

void QMetaMethodBuilder::setReturnType ( const QByteArray value)

Sets the return type for this method to value.

If value is empty, then the method's return type is void. The value will be normalized before it is added to the method.

See also
returnType(), signature()

Definition at line 1910 of file qmetaobjectbuilder.cpp.

Referenced by QMetaObjectBuilder::addConstructor(), QMetaObjectBuilder::addMethod(), and QDeclarativeCompiler::buildDynamicMeta().

1911 {
1913  if (d)
1915 }
double d
Definition: qnumeric_p.h:62
QMetaMethodBuilderPrivate * d_func() const
static QByteArray normalizedType(const char *type)
Normalizes a type.

◆ setTag()

void QMetaMethodBuilder::setTag ( const QByteArray value)

Sets the tag associated with this method to value.

See also
setTag()

Definition at line 1962 of file qmetaobjectbuilder.cpp.

Referenced by QMetaObjectBuilder::addMethod().

1963 {
1965  if (d)
1966  d->tag = value;
1967 }
double d
Definition: qnumeric_p.h:62
QMetaMethodBuilderPrivate * d_func() const

◆ signature()

QByteArray QMetaMethodBuilder::signature ( ) const

Returns the signature of this method.

See also
parameterNames(), returnType()

Definition at line 1879 of file qmetaobjectbuilder.cpp.

1880 {
1882  if (d)
1883  return d->signature;
1884  else
1885  return QByteArray();
1886 }
double d
Definition: qnumeric_p.h:62
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
QMetaMethodBuilderPrivate * d_func() const

◆ tag()

QByteArray QMetaMethodBuilder::tag ( ) const

Returns the tag associated with this method.

See also
setTag()

Definition at line 1948 of file qmetaobjectbuilder.cpp.

1949 {
1951  if (d)
1952  return d->tag;
1953  else
1954  return QByteArray();
1955 }
double d
Definition: qnumeric_p.h:62
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
QMetaMethodBuilderPrivate * d_func() const

Friends and Related Functions

◆ QMetaObjectBuilder

friend class QMetaObjectBuilder
friend

Definition at line 227 of file qmetaobjectbuilder_p.h.

◆ QMetaPropertyBuilder

friend class QMetaPropertyBuilder
friend

Definition at line 228 of file qmetaobjectbuilder_p.h.

Properties

◆ _index

int QMetaMethodBuilder::_index
private

Definition at line 225 of file qmetaobjectbuilder_p.h.

Referenced by QMetaPropertyBuilder::setNotifySignal().

◆ _mobj

const QMetaObjectBuilder* QMetaMethodBuilder::_mobj
private

Definition at line 224 of file qmetaobjectbuilder_p.h.

Referenced by QMetaPropertyBuilder::setNotifySignal().


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