Compatibility Members for QObject

以下成员源于类 QObject are part of the Qt compatibility layer. We advise against using them in new code.

公共函数

QObject * child (const char * objName , const char * inheritsClass = 0, bool recursiveSearch = true) const
const char * className () const
void insertChild (QObject * object )
bool isA (const char * className ) const
const char * name () const
const char * name (const char * defaultName ) const
void removeChild (QObject * object )
void setName (const char * name )

保护函数

bool checkConnectArgs (const char * signal , const QObject * object , const char * method )

静态保护成员

QByteArray normalizeSignalSlot (const char * signalSlot )

成员函数文档编制

[protected] bool QObject:: checkConnectArgs (const char * signal , const QObject * object , const char * method )

使用 QMetaObject::checkConnectArgs () 代替。

QObject * QObject:: child (const char * objName , const char * inheritsClass = 0, bool recursiveSearch = true) const

Searches the children and optionally grandchildren of this object, and returns a child that is called objName that inherits inheritsClass 。若 inheritsClass is 0 (the default), any class matches.

recursiveSearch is true (the default), child() performs a depth-first search of the object's children.

If there is no such object, this function returns 0. If there are more than one, the first one found is returned.

const char * QObject:: className () const

使用 metaObject ()->className() instead.

void QObject:: insertChild ( QObject * object )

使用 setParent () instead, i.e., call object-> setParent (this).

bool QObject:: isA (const char * className ) const

比较 className with the object's metaObject ()-> className () 代替。

const char * QObject:: name () const

使用 objectName () 代替。

另请参阅 setName ().

const char * QObject:: name (const char * defaultName ) const

使用 objectName () 代替。

[static protected] QByteArray QObject:: normalizeSignalSlot (const char * signalSlot )

使用 QMetaObject::normalizedSignature () 代替。

void QObject:: removeChild ( QObject * object )

使用 setParent () instead, i.e., call object-> setParent (0).

void QObject:: setName (const char * name )

使用 setObjectName () 代替。

另请参阅 name ().