diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-12-08 15:17:51 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-12-08 19:38:03 +0900 |
| commit | 7d612f7c91d55501276a385a30dbadb121e7bd9f (patch) | |
| tree | 4c6f1546e16db32779dfbf5c9e107b938faee6bb /src/kernel/tqmetaobject.cpp | |
| parent | 5a863a8932d14b99c5f838c4efa1618070d71b29 (diff) | |
| download | tqt-7d612f7c91d55501276a385a30dbadb121e7bd9f.tar.gz tqt-7d612f7c91d55501276a385a30dbadb121e7bd9f.zip | |
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/kernel/tqmetaobject.cpp')
| -rw-r--r-- | src/kernel/tqmetaobject.cpp | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/src/kernel/tqmetaobject.cpp b/src/kernel/tqmetaobject.cpp index 4e5686295..4464f716d 100644 --- a/src/kernel/tqmetaobject.cpp +++ b/src/kernel/tqmetaobject.cpp @@ -173,7 +173,7 @@ typedef const TQMetaData TQConstMetaData; class TQ_EXPORT TQMemberDict : public TQAsciiDict<TQConstMetaData> { public: - TQMemberDict( int size = 17, bool cs = TRUE, bool ck = TRUE ) : + TQMemberDict( int size = 17, bool cs = true, bool ck = true ) : TQAsciiDict<TQConstMetaData>(size,cs,ck) {} TQMemberDict( const TQMemberDict &dict ) : TQAsciiDict<TQConstMetaData>(dict) {} ~TQMemberDict() { clear(); } @@ -325,7 +325,7 @@ TQMetaObject::~TQMetaObject() /*! Returns the number of slots for this class. - If \a super is TRUE, inherited slots are included. + If \a super is true, inherited slots are included. \sa slotNames() */ @@ -340,7 +340,7 @@ int TQMetaObject::numSlots( bool super ) const // number of slots /*! Returns the number of signals for this class. - If \a super is TRUE, inherited signals are included. + If \a super is true, inherited signals are included. \sa signalNames() */ @@ -358,7 +358,7 @@ int TQMetaObject::numSignals( bool super ) const // number of signals Returns the meta data of the slot with the name \a n or 0 if no such slot exists. - If \a super is TRUE, inherited slots are included. + If \a super is true, inherited slots are included. */ const TQMetaData* TQMetaObject::slot( int index, bool super ) const { @@ -376,7 +376,7 @@ const TQMetaData* TQMetaObject::slot( int index, bool super ) const Returns the meta data of the signal with the name \a n or 0 if no such signal exists. - If \a super is TRUE, inherited signals are included. + If \a super is true, inherited signals are included. */ const TQMetaData* TQMetaObject::signal( int index, bool super ) const { @@ -411,7 +411,7 @@ const TQMetaData* TQMetaObject::signal( int index, bool super ) const /*! \internal Returns the index of the signal with name \n or -1 if no such signal exists. - If \a super is TRUE, inherited signals are included. + If \a super is true, inherited signals are included. */ int TQMetaObject::findSignal( const char* n, bool super ) const { @@ -450,7 +450,7 @@ int TQMetaObject::findSignal( const char* n, bool super ) const /*! \internal Returns the index of the slot with name \n or -1 if no such slot exists. - If \a super is TRUE, inherited slots are included. + If \a super is true, inherited slots are included. */ int TQMetaObject::findSlot( const char* n, bool super ) const { @@ -510,7 +510,7 @@ TQMemberDict *TQMetaObject::init( const TQMetaData * data, int n ) { if ( n == 0 ) // nothing, then make no dict return 0; - TQMemberDict *dict = new TQMemberDict( optDictSize(n), TRUE, FALSE ); + TQMemberDict *dict = new TQMemberDict( optDictSize(n), true, false ); TQ_CHECK_PTR( dict ); while ( n-- ) { // put all members into dict dict->insert( data->name, data ); @@ -523,7 +523,7 @@ TQMemberDict *TQMetaObject::init( const TQMetaData * data, int n ) Returns the number of items of class information available for this class. - If \a super is TRUE, inherited class information is included. + If \a super is true, inherited class information is included. */ int TQMetaObject::numClassInfo( bool super ) const { @@ -534,7 +534,7 @@ int TQMetaObject::numClassInfo( bool super ) const Returns the class information with index \a index or 0 if no such information exists. - If \a super is TRUE, inherited class information is included. + If \a super is true, inherited class information is included. */ const TQClassInfo* TQMetaObject::classInfo( int index, bool super ) const { @@ -552,7 +552,7 @@ const TQClassInfo* TQMetaObject::classInfo( int index, bool super ) const Returns the class information with name \a name or 0 if no such information exists. - If \a super is TRUE, inherited class information is included. + If \a super is true, inherited class information is included. */ const char* TQMetaObject::classInfo( const char* name, bool super ) const { @@ -570,7 +570,7 @@ const char* TQMetaObject::classInfo( const char* name, bool super ) const /*! Returns the number of properties for this class. - If \a super is TRUE, inherited properties are included. + If \a super is true, inherited properties are included. \sa propertyNames() */ @@ -586,7 +586,7 @@ int TQMetaObject::numProperties( bool super ) const // number of signals Returns the property meta data for the property at index \a index or 0 if no such property exists. - If \a super is TRUE, inherited properties are included. + If \a super is true, inherited properties are included. \sa propertyNames() */ @@ -605,7 +605,7 @@ const TQMetaProperty* TQMetaObject::property( int index, bool super ) const Returns the index for the property with name \a name or -1 if no such property exists. - If \a super is TRUE, inherited properties are included. + If \a super is true, inherited properties are included. \sa property(), propertyNames() */ @@ -627,7 +627,7 @@ int TQMetaObject::findProperty( const char *name, bool super ) const Returns the index for the property \a prop or -1 if the property can not be found. - If \a super is TRUE, inherited properties are included. + If \a super is true, inherited properties are included. \sa property(), propertyNames() */ @@ -653,7 +653,7 @@ const TQMetaProperty* TQMetaObject::resolveProperty( const TQMetaProperty* p ) c { if ( !superclass ) return 0; - return superclass->property( superclass->findProperty( p->n, TRUE ), TRUE ); + return superclass->property( superclass->findProperty( p->n, true ), true ); } /*!\internal @@ -668,20 +668,20 @@ int TQMetaObject::resolveProperty( int index ) const if ( !superclass ) return -1; const TQMetaProperty* p = d->propData + ( index - propertyOffset() ); - return superclass->findProperty( p->n, TRUE ); + return superclass->findProperty( p->n, true ); } /*! Returns a list with the names of all this class's properties. - If \a super is TRUE, inherited properties are included. + If \a super is true, inherited properties are included. \sa property() */ TQStrList TQMetaObject::propertyNames( bool super ) const { - TQStrList l( FALSE ); + TQStrList l( false ); if ( superclass && super ) { TQStrList sl = superclass->propertyNames( super ); @@ -700,11 +700,11 @@ TQStrList TQMetaObject::propertyNames( bool super ) const /*! Returns a list with the names of all this class's signals. - If \a super is TRUE, inherited signals are included. + If \a super is true, inherited signals are included. */ TQStrList TQMetaObject::signalNames( bool super ) const { - TQStrList l( FALSE ); + TQStrList l( false ); int n = numSignals( super ); for( int i = 0; i < n; ++i ) { l.append( signal(i, super)->name ); @@ -715,13 +715,13 @@ TQStrList TQMetaObject::signalNames( bool super ) const /*! Returns a list with the names of all this class's slots. - If \a super is TRUE, inherited slots are included. + If \a super is true, inherited slots are included. \sa numSlots() */ TQStrList TQMetaObject::slotNames( bool super ) const { - TQStrList l( FALSE ); + TQStrList l( false ); int n = numSlots( super ); for( int i = 0; i < n; ++i ) l.append( slot( i, super)->name ); @@ -745,7 +745,7 @@ int TQMetaObject::numEnumerators( bool super ) const */ TQStrList TQMetaObject::enumeratorNames( bool super ) const { - TQStrList l( FALSE ); + TQStrList l( false ); if ( superclass && super ) { TQStrList sl = superclass->enumeratorNames( super ); @@ -777,8 +777,8 @@ const TQMetaEnum* TQMetaObject::enumerator( const char* name, bool super ) const /*! - Returns TRUE if this class inherits \a clname within the meta - object inheritance chain; otherwise returns FALSE. + Returns true if this class inherits \a clname within the meta + object inheritance chain; otherwise returns false. (A class is considered to inherit itself.) */ @@ -787,10 +787,10 @@ bool TQMetaObject::inherits( const char* clname ) const const TQMetaObject *meta = this; while ( meta ) { if ( qstrcmp(clname, meta->className()) == 0 ) - return TRUE; + return true; meta = meta->superclass; } - return FALSE; + return false; } /*! \internal */ @@ -813,7 +813,7 @@ TQMetaObject *TQMetaObject::metaObject( const char *class_name ) bool TQMetaObject::hasMetaObject( const char *class_name ) { if ( !qt_metaobjects ) - return FALSE; + return false; #ifdef TQT_THREAD_SUPPORT TQMutexLocker( tqt_global_mutexpool ? tqt_global_mutexpool->get( &qt_metaobjects ) : 0 ); @@ -837,9 +837,9 @@ bool TQMetaObject::tqt_static_property( TQObject* o, int id, int f, TQVariant* v return superclass->tqt_static_property( o, id, f, v ); switch ( f ) { case 3: case 4: case 5: - return TRUE; + return true; default: - return FALSE; + return false; } } @@ -877,10 +877,10 @@ bool TQMetaObject::tqt_static_property( TQObject* o, int id, int f, TQVariant* v */ TQStrList TQMetaProperty::enumKeys() const { - TQStrList l( FALSE ); + TQStrList l( false ); const TQMetaEnum* ed = enumData; if ( !enumData && meta ) - ed = (*meta)->enumerator( t, TRUE ); + ed = (*meta)->enumerator( t, true ); if ( !ed ) return l; if ( ed != 0 ) { @@ -907,7 +907,7 @@ int TQMetaProperty::keyToValue( const char* key ) const { const TQMetaEnum* ed = enumData; if ( !enumData && meta ) - ed = (*meta)->enumerator( t, TRUE ); + ed = (*meta)->enumerator( t, true ); if ( !ed ) return -1; for ( uint i = 0; i < ed->count; ++i ) { @@ -928,7 +928,7 @@ const char* TQMetaProperty::valueToKey( int value ) const { const TQMetaEnum* ed = enumData; if ( !enumData && meta ) - ed = (*meta)->enumerator( t, TRUE ); + ed = (*meta)->enumerator( t, true ); if ( !ed ) return 0; for ( uint i = 0; i < ed->count; ++i ) { @@ -948,7 +948,7 @@ int TQMetaProperty::keysToValue( const TQStrList& keys ) const { const TQMetaEnum* ed = enumData; if ( !enumData && meta ) - ed = (*meta)->enumerator( t, TRUE ); + ed = (*meta)->enumerator( t, true ); if ( !ed ) return -1; int value = 0; @@ -976,7 +976,7 @@ TQStrList TQMetaProperty::valueToKeys( int value ) const TQStrList keys; const TQMetaEnum* ed = enumData; if ( !enumData && meta ) - ed = (*meta)->enumerator( t, TRUE ); + ed = (*meta)->enumerator( t, true ); if ( !ed ) return keys; @@ -997,7 +997,7 @@ bool TQMetaProperty::writable() const return testFlags( Writable ); const TQMetaObject* mo = (*meta); const TQMetaProperty* parent = mo->resolveProperty( this ); - return parent ? parent->writable() : FALSE; + return parent ? parent->writable() : false; } /*!\internal @@ -1008,14 +1008,14 @@ bool TQMetaProperty::stdSet() const return testFlags( StdSet ); const TQMetaObject* mo = (*meta); const TQMetaProperty* parent = mo->resolveProperty( this ); - return parent ? parent->stdSet() : FALSE; + return parent ? parent->stdSet() : false; } /*!\internal */ int TQMetaProperty::id() const { - return _id < 0 ? (*meta)->indexOfProperty( this, TRUE ) : _id; + return _id < 0 ? (*meta)->indexOfProperty( this, true ) : _id; } /*! \internal @@ -1032,21 +1032,21 @@ void TQMetaProperty::clear() bool TQMetaProperty::isValid() const { if ( testFlags( UnresolvedEnum ) ) { - if ( !enumData && (!meta || !(*meta)->enumerator( t, TRUE ) ) ) - return FALSE; + if ( !enumData && (!meta || !(*meta)->enumerator( t, true ) ) ) + return false; } if ( !testFlags( Override ) || testFlags( Readable ) ) return testFlags( Readable ); const TQMetaObject* mo = (*meta); const TQMetaProperty* parent = mo->resolveProperty( this ); - return parent ? parent->isValid() : FALSE; + return parent ? parent->isValid() : false; } bool TQMetaProperty::isSetType() const { const TQMetaEnum* ed = enumData; if ( !enumData && meta ) - ed = (*meta)->enumerator( t, TRUE ); + ed = (*meta)->enumerator( t, true ); return ( ed != 0 && ed->set ); } @@ -1072,7 +1072,7 @@ bool TQMetaProperty::isEnumType() const /*! \fn bool TQMetaProperty::writable() const - Returns TRUE if the property is writable; otherwise returns FALSE. + Returns true if the property is writable; otherwise returns false. */ @@ -1086,8 +1086,8 @@ bool TQMetaProperty::isEnumType() const /*! \fn bool TQMetaProperty::isEnumType() const - Returns TRUE if the property's type is an enumeration value; - otherwise returns FALSE. + Returns true if the property's type is an enumeration value; + otherwise returns false. \sa isSetType(), enumKeys() */ @@ -1095,17 +1095,17 @@ bool TQMetaProperty::isEnumType() const /*! \fn bool TQMetaProperty::isSetType() const - Returns TRUE if the property's type is an enumeration value that + 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 + together; otherwise returns false. A set type is implicitly also an enum type. \sa isEnumType(), enumKeys() */ -/*! Returns TRUE if the property is designable for object \a o; - otherwise returns FALSE. +/*! Returns true if the property is designable for object \a o; + otherwise returns false. If no object \a o is given, the function returns a static approximation. @@ -1113,22 +1113,22 @@ bool TQMetaProperty::isEnumType() const bool TQMetaProperty::designable( TQObject* o ) const { if ( !isValid() || !writable() ) - return FALSE; + return false; if ( o ) { - int idx = _id >= 0 ? _id : (*meta)->indexOfProperty( this, TRUE ); + int idx = _id >= 0 ? _id : (*meta)->indexOfProperty( this, true ); return idx >= 0 && o->tqt_property( idx, 3, 0 ); } if ( testFlags( DesignableOverride ) ) { const TQMetaObject* mo = (*meta); const TQMetaProperty* parent = mo->resolveProperty( this ); - return parent ? parent->designable() : FALSE; + return parent ? parent->designable() : false; } return !testFlags( NotDesignable ); } /*! - Returns TRUE if the property is scriptable for object \a o; - otherwise returns FALSE. + Returns true if the property is scriptable for object \a o; + otherwise returns false. If no object \a o is given, the function returns a static approximation. @@ -1136,20 +1136,20 @@ bool TQMetaProperty::designable( TQObject* o ) const bool TQMetaProperty::scriptable( TQObject* o ) const { if ( o ) { - int idx = _id >= 0 ? _id : (*meta)->indexOfProperty( this, TRUE ); + int idx = _id >= 0 ? _id : (*meta)->indexOfProperty( this, true ); return idx >= 0 && o->tqt_property( idx, 4, 0 ); } if ( testFlags( ScriptableOverride ) ) { const TQMetaObject* mo = (*meta); const TQMetaProperty* parent = mo->resolveProperty( this ); - return parent ? parent->scriptable() : FALSE; + return parent ? parent->scriptable() : false; } return !testFlags( NotScriptable ); } /*! - Returns TRUE if the property shall be stored for object \a o; - otherwise returns FALSE. + Returns true if the property shall be stored for object \a o; + otherwise returns false. If no object \a o is given, the function returns a static approximation. @@ -1157,15 +1157,15 @@ bool TQMetaProperty::scriptable( TQObject* o ) const bool TQMetaProperty::stored( TQObject* o ) const { if ( !isValid() || !writable() ) - return FALSE; + return false; if ( o ) { - int idx = _id >= 0 ? _id : (*meta)->indexOfProperty( this, TRUE ); + int idx = _id >= 0 ? _id : (*meta)->indexOfProperty( this, true ); return idx >= 0 && o->tqt_property( idx, 5, 0 ); } if ( testFlags( StoredOverride ) ) { const TQMetaObject* mo = (*meta); const TQMetaProperty* parent = mo->resolveProperty( this ); - return parent ? parent->stored() : FALSE; + return parent ? parent->stored() : false; } return !testFlags( NotStored ); } @@ -1173,7 +1173,7 @@ bool TQMetaProperty::stored( TQObject* o ) const /*! Tries to reset the property for object \a o with a reset method. - On success, returns TRUE; otherwise returns FALSE. + On success, returns true; otherwise returns false. Reset methods are optional, usually only a few properties support them. @@ -1181,8 +1181,8 @@ bool TQMetaProperty::stored( TQObject* o ) const bool TQMetaProperty::reset( TQObject* o ) const { if ( !o ) - return FALSE; - int idx = _id >= 0 ? _id : (*meta)->indexOfProperty( this, TRUE ); + return false; + int idx = _id >= 0 ? _id : (*meta)->indexOfProperty( this, true ); if ( idx < 0 ) return 0; return o->tqt_property( idx, 2, 0 ); |
