summaryrefslogtreecommitdiffstats
path: root/src/kernel/tqvariant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/tqvariant.cpp')
-rw-r--r--src/kernel/tqvariant.cpp154
1 files changed, 77 insertions, 77 deletions
diff --git a/src/kernel/tqvariant.cpp b/src/kernel/tqvariant.cpp
index 71175edac..af0e3183b 100644
--- a/src/kernel/tqvariant.cpp
+++ b/src/kernel/tqvariant.cpp
@@ -93,7 +93,7 @@ TQVariant::Private::Private()
qv_count++;
#endif
typ = TQVariant::Invalid;
- is_null = TRUE;
+ is_null = true;
}
TQVariant::Private::Private( Private* d )
@@ -350,7 +350,7 @@ void TQVariant::Private::clear()
}
typ = TQVariant::Invalid;
- is_null = TRUE;
+ is_null = true;
}
/*!
@@ -426,7 +426,7 @@ void TQVariant::Private::clear()
\code
TQVariant x, y( TQString() ), z( TQString("") );
x.asInt();
- // x.isNull() == TRUE, y.isNull() == TRUE, z.isNull() == FALSE
+ // x.isNull() == true, y.isNull() == true, z.isNull() == false
\endcode
See the \link collection.html Collection Classes\endlink.
@@ -571,7 +571,7 @@ TQVariant::TQVariant( const TQStringList& val )
d = new Private;
d->typ = StringList;
d->value.ptr = new TQStringList( val );
- d->is_null = FALSE;
+ d->is_null = false;
}
#endif // TQT_NO_STRINGLIST
@@ -584,7 +584,7 @@ TQVariant::TQVariant( const TQMap<TQString,TQVariant>& val )
d = new Private;
d->typ = Map;
d->value.ptr = new TQMap<TQString,TQVariant>( val );
- d->is_null = FALSE;
+ d->is_null = false;
}
#endif
/*!
@@ -595,7 +595,7 @@ TQVariant::TQVariant( const TQFont& val )
d = new Private;
d->typ = Font;
d->value.ptr = new TQFont( val );
- d->is_null = FALSE;
+ d->is_null = false;
}
/*!
@@ -631,7 +631,7 @@ TQVariant::TQVariant( const TQBrush& val )
d = new Private;
d->typ = Brush;
d->value.ptr = new TQBrush( val );
- d->is_null = FALSE;
+ d->is_null = false;
}
/*!
@@ -672,7 +672,7 @@ TQVariant::TQVariant( const TQColor& val )
d = new Private;
d->typ = Color;
d->value.ptr = new TQColor( val );
- d->is_null = FALSE;
+ d->is_null = false;
}
#ifndef TQT_NO_PALETTE
@@ -684,7 +684,7 @@ TQVariant::TQVariant( const TQPalette& val )
d = new Private;
d->typ = Palette;
d->value.ptr = new TQPalette( val );
- d->is_null = FALSE;
+ d->is_null = false;
}
/*!
@@ -695,7 +695,7 @@ TQVariant::TQVariant( const TQColorGroup& val )
d = new Private;
d->typ = ColorGroup;
d->value.ptr = new TQColorGroup( val );
- d->is_null = FALSE;
+ d->is_null = false;
}
#endif //TQT_NO_PALETTE
#ifndef TQT_NO_ICONSET
@@ -739,7 +739,7 @@ TQVariant::TQVariant( const TQCursor& val )
d = new Private;
d->typ = Cursor;
d->value.ptr = new TQCursor( val );
- d->is_null = FALSE;
+ d->is_null = false;
}
/*!
@@ -816,7 +816,7 @@ TQVariant::TQVariant( const TQKeySequence& val )
d = new Private;
d->typ = KeySequence;
d->value.ptr = new TQKeySequence( val );
- d->is_null = FALSE;
+ d->is_null = false;
}
#endif
@@ -839,7 +839,7 @@ TQVariant::TQVariant( int val )
d = new Private;
d->typ = Int;
d->value.i = val;
- d->is_null = FALSE;
+ d->is_null = false;
}
/*!
@@ -850,7 +850,7 @@ TQVariant::TQVariant( uint val )
d = new Private;
d->typ = UInt;
d->value.u = val;
- d->is_null = FALSE;
+ d->is_null = false;
}
/*!
@@ -861,7 +861,7 @@ TQVariant::TQVariant( TQ_LLONG val )
d = new Private;
d->typ = LongLong;
d->value.ll = val;
- d->is_null = FALSE;
+ d->is_null = false;
}
/*!
@@ -873,7 +873,7 @@ TQVariant::TQVariant( TQ_ULLONG val )
d = new Private;
d->typ = ULongLong;
d->value.ull = val;
- d->is_null = FALSE;
+ d->is_null = false;
}
/*!
@@ -884,7 +884,7 @@ TQVariant::TQVariant( bool val )
d = new Private;
d->typ = Bool;
d->value.b = val;
- d->is_null = FALSE;
+ d->is_null = false;
}
@@ -896,7 +896,7 @@ TQVariant::TQVariant( double val )
d = new Private;
d->typ = Double;
d->value.d = val;
- d->is_null = FALSE;
+ d->is_null = false;
}
#ifndef TQT_NO_TEMPLATE_VARIANT
@@ -908,7 +908,7 @@ TQVariant::TQVariant( const TQValueList<TQVariant>& val )
d = new Private;
d->typ = List;
d->value.ptr = new TQValueList<TQVariant>( val );
- d->is_null = FALSE;
+ d->is_null = false;
}
#endif
@@ -920,7 +920,7 @@ TQVariant::TQVariant( TQSizePolicy val )
d = new Private;
d->typ = SizePolicy;
d->value.ptr = new TQSizePolicy( val );
- d->is_null = FALSE;
+ d->is_null = false;
}
/*!
@@ -1079,7 +1079,7 @@ void TQVariant::load( TQDataStream& s )
TQString x;
s >> x;
d->typ = t;
- d->is_null = TRUE;
+ d->is_null = true;
}
break;
#ifndef TQT_NO_TEMPLATE_VARIANT
@@ -1088,7 +1088,7 @@ void TQVariant::load( TQDataStream& s )
TQMap<TQString,TQVariant>* x = new TQMap<TQString,TQVariant>;
s >> *x;
d->value.ptr = x;
- d->is_null = FALSE;
+ d->is_null = false;
}
break;
case List:
@@ -1096,7 +1096,7 @@ void TQVariant::load( TQDataStream& s )
TQValueList<TQVariant>* x = new TQValueList<TQVariant>;
s >> *x;
d->value.ptr = x;
- d->is_null = FALSE;
+ d->is_null = false;
}
break;
#endif
@@ -1106,7 +1106,7 @@ void TQVariant::load( TQDataStream& s )
TQCursor* x = new TQCursor;
s >> *x;
d->value.ptr = x;
- d->is_null = FALSE;
+ d->is_null = false;
#endif
}
break;
@@ -1153,7 +1153,7 @@ void TQVariant::load( TQDataStream& s )
TQStringList* x = new TQStringList;
s >> *x;
d->value.ptr = x;
- d->is_null = FALSE;
+ d->is_null = false;
}
break;
#endif // TQT_NO_STRINGLIST
@@ -1162,7 +1162,7 @@ void TQVariant::load( TQDataStream& s )
TQFont* x = new TQFont;
s >> *x;
d->value.ptr = x;
- d->is_null = FALSE;
+ d->is_null = false;
}
break;
case Pixmap:
@@ -1188,7 +1188,7 @@ void TQVariant::load( TQDataStream& s )
TQBrush* x = new TQBrush;
s >> *x;
d->value.ptr = x;
- d->is_null = FALSE;
+ d->is_null = false;
}
break;
case Rect:
@@ -1217,7 +1217,7 @@ void TQVariant::load( TQDataStream& s )
TQColor* x = new TQColor;
s >> *x;
d->value.ptr = x;
- d->is_null = FALSE;
+ d->is_null = false;
}
break;
#ifndef TQT_NO_PALETTE
@@ -1226,7 +1226,7 @@ void TQVariant::load( TQDataStream& s )
TQPalette* x = new TQPalette;
s >> *x;
d->value.ptr = x;
- d->is_null = FALSE;
+ d->is_null = false;
}
break;
case ColorGroup:
@@ -1234,7 +1234,7 @@ void TQVariant::load( TQDataStream& s )
TQColorGroup* x = new TQColorGroup;
s >> *x;
d->value.ptr = x;
- d->is_null = FALSE;
+ d->is_null = false;
}
break;
#endif
@@ -1252,7 +1252,7 @@ void TQVariant::load( TQDataStream& s )
int x;
s >> x;
d->value.i = x;
- d->is_null = FALSE;
+ d->is_null = false;
}
break;
case UInt:
@@ -1260,7 +1260,7 @@ void TQVariant::load( TQDataStream& s )
uint x;
s >> x;
d->value.u = x;
- d->is_null = FALSE;
+ d->is_null = false;
}
break;
case LongLong:
@@ -1282,7 +1282,7 @@ void TQVariant::load( TQDataStream& s )
TQ_INT8 x;
s >> x;
d->value.b = x;
- d->is_null = FALSE;
+ d->is_null = false;
}
break;
case Double:
@@ -1290,7 +1290,7 @@ void TQVariant::load( TQDataStream& s )
double x;
s >> x;
d->value.d = x;
- d->is_null = FALSE;
+ d->is_null = false;
}
break;
case SizePolicy:
@@ -1301,7 +1301,7 @@ void TQVariant::load( TQDataStream& s )
d->value.ptr = new TQSizePolicy( (TQSizePolicy::SizeType)h,
(TQSizePolicy::SizeType)v,
(bool) hfw);
- d->is_null = FALSE;
+ d->is_null = false;
}
break;
case Date:
@@ -1345,7 +1345,7 @@ void TQVariant::load( TQDataStream& s )
TQKeySequence* x = new TQKeySequence;
s >> *x;
d->value.ptr = x;
- d->is_null = FALSE;
+ d->is_null = false;
}
break;
#endif // TQT_NO_ACCEL
@@ -1354,7 +1354,7 @@ void TQVariant::load( TQDataStream& s )
TQPen* x = new TQPen;
s >> *x;
d->value.ptr = x;
- d->is_null = FALSE;
+ d->is_null = false;
}
break;
}
@@ -1560,8 +1560,8 @@ TQDataStream& operator<< ( TQDataStream& s, const TQVariant::Type p )
/*!
\fn bool TQVariant::isValid() const
- Returns TRUE if the storage type of this variant is not
- TQVariant::Invalid; otherwise returns FALSE.
+ Returns true if the storage type of this variant is not
+ TQVariant::Invalid; otherwise returns false.
*/
/*!
@@ -2162,8 +2162,8 @@ const TQPen TQVariant::toPen() const
Returns the variant as an int if the variant can be cast to Int;
otherwise returns 0.
- If \a ok is non-null: \a *ok is set to TRUE if the value could be
- converted to an int; otherwise \a *ok is set to FALSE.
+ If \a ok is non-null: \a *ok is set to true if the value could be
+ converted to an int; otherwise \a *ok is set to false.
\sa asInt(), canCast()
*/
@@ -2203,8 +2203,8 @@ int TQVariant::toInt( bool * ok ) const
Returns the variant as an unsigned int if the variant can be cast
to UInt; otherwise returns 0.
- If \a ok is non-null: \a *ok is set to TRUE if the value could be
- converted to an unsigned int; otherwise \a *ok is set to FALSE.
+ If \a ok is non-null: \a *ok is set to true if the value could be
+ converted to an unsigned int; otherwise \a *ok is set to false.
\sa asUInt(), canCast()
*/
@@ -2240,8 +2240,8 @@ uint TQVariant::toUInt( bool * ok ) const
Returns the variant as a long long int if the variant can be cast
to LongLong; otherwise returns 0.
- If \a ok is non-null: \a *ok is set to TRUE if the value could be
- converted to an int; otherwise \a *ok is set to FALSE.
+ If \a ok is non-null: \a *ok is set to true if the value could be
+ converted to an int; otherwise \a *ok is set to false.
\sa asLongLong(), canCast()
*/
@@ -2277,8 +2277,8 @@ TQ_LLONG TQVariant::toLongLong( bool * ok ) const
Returns the variant as as an unsigned long long int if the variant
can be cast to ULongLong; otherwise returns 0.
- If \a ok is non-null: \a *ok is set to TRUE if the value could be
- converted to an int; otherwise \a *ok is set to FALSE.
+ If \a ok is non-null: \a *ok is set to true if the value could be
+ converted to an int; otherwise \a *ok is set to false.
\sa asULongLong(), canCast()
*/
@@ -2312,12 +2312,12 @@ TQ_ULLONG TQVariant::toULongLong( bool * ok ) const
/*!
Returns the variant as a bool if the variant can be cast to Bool;
- otherWise returns FALSE.
+ otherWise returns false.
- Returns TRUE if the variant has a numeric type and its value is
+ Returns true if the variant has a numeric type and its value is
non-zero, or if the variant has type String, ByteArray or CString
and its lower-case content is not empty, "0" or "false"; otherwise
- returns FALSE.
+ returns false.
\sa asBool(), canCast()
*/
@@ -2344,7 +2344,7 @@ bool TQVariant::toBool() const
return !(str == "0" || str == "false" || str.isEmpty() );
}
default:
- return FALSE;
+ return false;
}
}
@@ -2352,8 +2352,8 @@ bool TQVariant::toBool() const
Returns the variant as a double if the variant can be cast to
Double; otherwise returns 0.0.
- If \a ok is non-null: \a *ok is set to TRUE if the value could be
- converted to a double; otherwise \a *ok is set to FALSE.
+ If \a ok is non-null: \a *ok is set to true if the value could be
+ converted to a double; otherwise \a *ok is set to false.
\sa asDouble(), canCast()
*/
@@ -2935,7 +2935,7 @@ TQMap<TQString, TQVariant>& TQVariant::asMap()
#endif
/*!
- Returns TRUE if the variant's type can be cast to the requested
+ Returns true if the variant's type can be cast to the requested
type, \a t. Such casting is done automatically when calling the
toInt(), toBool(), ... or asInt(), asBool(), ... methods.
@@ -2966,7 +2966,7 @@ TQMap<TQString, TQVariant>& TQVariant::asMap()
bool TQVariant::canCast( Type t ) const
{
if ( Type( d->typ ) == t )
- return TRUE;
+ return true;
switch ( t ) {
case Bool:
@@ -2988,7 +2988,7 @@ bool TQVariant::canCast( Type t ) const
case String:
case UInt:
case ULongLong:
- return TRUE;
+ return true;
default: break;
}
break;
@@ -3012,7 +3012,7 @@ bool TQVariant::canCast( Type t ) const
case Time:
case UInt:
case ULongLong:
- return TRUE;
+ return true;
default: break;
}
break;
@@ -3028,7 +3028,7 @@ bool TQVariant::canCast( Type t ) const
case Date:
case DateTime:
case String:
- return TRUE;
+ return true;
default: break;
}
break;
@@ -3043,7 +3043,7 @@ bool TQVariant::canCast( Type t ) const
case ULongLong:
case Double:
case String:
- return TRUE;
+ return true;
default: break;
}
break;
@@ -3054,7 +3054,7 @@ bool TQVariant::canCast( Type t ) const
case ByteArray:
case CString:
case String:
- return TRUE;
+ return true;
default: break;
}
break;
@@ -3070,9 +3070,9 @@ bool TQVariant::canCast( Type t ) const
TQValueList<TQVariant>::ConstIterator end = listEnd();
for( ; it != end; ++it ) {
if ( !(*it).canCast( String ) )
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
#endif
case Invalid:
@@ -3095,7 +3095,7 @@ bool TQVariant::canCast( Type t ) const
case Pen:
break;
}
- return FALSE;
+ return false;
}
/*!
@@ -3103,8 +3103,8 @@ bool TQVariant::canCast( Type t ) const
done, the variant is set to the default value of the requested
type (e.g. an empty string if the requested type \a t is
TQVariant::String, an empty point array if the requested type \a t
- is TQVariant::PointArray, etc). Returns TRUE if the current type of
- the variant was successfully cast; otherwise returns FALSE.
+ is TQVariant::PointArray, etc). Returns true if the current type of
+ the variant was successfully cast; otherwise returns false.
\sa canCast()
*/
@@ -3232,8 +3232,8 @@ bool TQVariant::cast( Type t )
}
/*!
- Compares this TQVariant with \a v and returns TRUE if they are
- equal; otherwise returns FALSE.
+ Compares this TQVariant with \a v and returns true if they are
+ equal; otherwise returns false.
*/
bool TQVariant::operator==( const TQVariant &v ) const
@@ -3273,12 +3273,12 @@ bool TQVariant::operator==( const TQVariant &v ) const
}
default:
- Q_ASSERT(FALSE);
+ Q_ASSERT(false);
}
}
if (!v.canCast(d->typ)) {
- return FALSE;
+ return false;
}
switch( d->typ ) {
@@ -3297,16 +3297,16 @@ bool TQVariant::operator==( const TQVariant &v ) const
return v.toList() == toList();
case Map: {
if ( v.toMap().count() != toMap().count() )
- return FALSE;
+ return false;
TQMap<TQString, TQVariant>::ConstIterator it = v.toMap().begin();
TQMap<TQString, TQVariant>::ConstIterator it2 = toMap().begin();
while ( it != v.toMap().end() ) {
if ( *it != *it2 )
- return FALSE;
+ return false;
++it;
++it2;
}
- return TRUE;
+ return true;
}
#endif
case String:
@@ -3377,12 +3377,12 @@ bool TQVariant::operator==( const TQVariant &v ) const
case Invalid:
break;
}
- return FALSE;
+ return false;
}
/*!
- Compares this TQVariant with \a v and returns TRUE if they are not
- equal; otherwise returns FALSE.
+ Compares this TQVariant with \a v and returns true if they are not
+ equal; otherwise returns false.
*/
bool TQVariant::operator!=( const TQVariant &v ) const
@@ -3401,7 +3401,7 @@ void* TQVariant::rawAccess( void* ptr, Type typ, bool deepCopy )
clear();
d->typ = typ;
d->value.ptr = ptr;
- d->is_null = FALSE;
+ d->is_null = false;
if ( deepCopy ) {
TQVariant::Private* p = new Private( d );
d->typ = Invalid;
@@ -3420,7 +3420,7 @@ void* TQVariant::rawAccess( void* ptr, Type typ, bool deepCopy )
}
/*!
- Returns TRUE if this is a NULL variant, FALSE otherwise.
+ Returns true if this is a NULL variant, false otherwise.
*/
bool TQVariant::isNull() const
{