You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tqt3/doc/html/ntqvariant.html

1150 lines
63 KiB

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qvariant.cpp:353 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQVariant Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
<a href="index.html">
<font color="#004faf">Home</font></a>
| <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
| <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQVariant Class Reference</h1>
<p>The TQVariant class acts like a union for the most common TQt data types.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qvariant-h.html">ntqvariant.h</a>&gt;</tt>
<p><a href="qvariant-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn>enum <a href="#Type-enum"><b>Type</b></a> { Invalid, Map, List, String, StringList, Font, Pixmap, Brush, Rect, Size, Color, Palette, ColorGroup, IconSet, Point, Image, Int, UInt, Bool, Double, CString, PointArray, Region, Bitmap, Cursor, SizePolicy, Date, Time, DateTime, ByteArray, BitArray, KeySequence, Pen, LongLong, ULongLong }</li>
<li class=fn><a href="#TQVariant"><b>TQVariant</b></a> ()</li>
<li class=fn><a href="#~TQVariant"><b>~TQVariant</b></a> ()</li>
<li class=fn><a href="#TQVariant-2"><b>TQVariant</b></a> ( const&nbsp;TQVariant&nbsp;&amp;&nbsp;p )</li>
<li class=fn><a href="#TQVariant-3"><b>TQVariant</b></a> ( TQDataStream&nbsp;&amp;&nbsp;s )</li>
<li class=fn><a href="#TQVariant-4"><b>TQVariant</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-5"><b>TQVariant</b></a> ( const&nbsp;TQCString&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-6"><b>TQVariant</b></a> ( const&nbsp;char&nbsp;*&nbsp;val )</li>
<li class=fn><a href="#TQVariant-7"><b>TQVariant</b></a> ( const&nbsp;TQStringList&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-8"><b>TQVariant</b></a> ( const&nbsp;TQFont&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-9"><b>TQVariant</b></a> ( const&nbsp;TQPixmap&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-a"><b>TQVariant</b></a> ( const&nbsp;TQImage&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-b"><b>TQVariant</b></a> ( const&nbsp;TQBrush&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-c"><b>TQVariant</b></a> ( const&nbsp;TQPoint&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-d"><b>TQVariant</b></a> ( const&nbsp;TQRect&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-e"><b>TQVariant</b></a> ( const&nbsp;TQSize&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-f"><b>TQVariant</b></a> ( const&nbsp;TQColor&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-g"><b>TQVariant</b></a> ( const&nbsp;TQPalette&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-h"><b>TQVariant</b></a> ( const&nbsp;TQColorGroup&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-i"><b>TQVariant</b></a> ( const&nbsp;TQIconSet&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-j"><b>TQVariant</b></a> ( const&nbsp;TQPointArray&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-k"><b>TQVariant</b></a> ( const&nbsp;TQRegion&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-l"><b>TQVariant</b></a> ( const&nbsp;TQBitmap&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-m"><b>TQVariant</b></a> ( const&nbsp;TQCursor&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-n"><b>TQVariant</b></a> ( const&nbsp;TQDate&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-o"><b>TQVariant</b></a> ( const&nbsp;TQTime&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-p"><b>TQVariant</b></a> ( const&nbsp;TQDateTime&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-q"><b>TQVariant</b></a> ( const&nbsp;TQByteArray&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-r"><b>TQVariant</b></a> ( const&nbsp;TQBitArray&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-s"><b>TQVariant</b></a> ( const&nbsp;TQKeySequence&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-t"><b>TQVariant</b></a> ( const&nbsp;TQPen&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-u"><b>TQVariant</b></a> ( const&nbsp;TQValueList&lt;TQVariant&gt;&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-v"><b>TQVariant</b></a> ( const&nbsp;TQMap&lt;TQString,&nbsp;TQVariant&gt;&nbsp;&amp;&nbsp;val )</li>
<li class=fn><a href="#TQVariant-w"><b>TQVariant</b></a> ( int&nbsp;val )</li>
<li class=fn><a href="#TQVariant-x"><b>TQVariant</b></a> ( uint&nbsp;val )</li>
<li class=fn><a href="#TQVariant-y"><b>TQVariant</b></a> ( Q_LLONG&nbsp;val )</li>
<li class=fn><a href="#TQVariant-z"><b>TQVariant</b></a> ( Q_ULLONG&nbsp;val )</li>
<li class=fn><a href="#TQVariant-10"><b>TQVariant</b></a> ( bool&nbsp;val, int )</li>
<li class=fn><a href="#TQVariant-11"><b>TQVariant</b></a> ( double&nbsp;val )</li>
<li class=fn><a href="#TQVariant-12"><b>TQVariant</b></a> ( TQSizePolicy&nbsp;val )</li>
<li class=fn>TQVariant &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;TQVariant&nbsp;&amp;&nbsp;variant )</li>
<li class=fn>bool <a href="#operator-eq-eq"><b>operator==</b></a> ( const&nbsp;TQVariant&nbsp;&amp;&nbsp;v ) const</li>
<li class=fn>bool <a href="#operator!-eq"><b>operator!=</b></a> ( const&nbsp;TQVariant&nbsp;&amp;&nbsp;v ) const</li>
<li class=fn>Type <a href="#type"><b>type</b></a> () const</li>
<li class=fn>const char * <a href="#typeName"><b>typeName</b></a> () const</li>
<li class=fn>bool <a href="#canCast"><b>canCast</b></a> ( Type&nbsp;t ) const</li>
<li class=fn>bool <a href="#cast"><b>cast</b></a> ( Type&nbsp;t )</li>
<li class=fn>bool <a href="#isValid"><b>isValid</b></a> () const</li>
<li class=fn>bool <a href="#isNull"><b>isNull</b></a> () const</li>
<li class=fn>void <a href="#clear"><b>clear</b></a> ()</li>
<li class=fn>const TQString <a href="#toString"><b>toString</b></a> () const</li>
<li class=fn>const TQCString <a href="#toCString"><b>toCString</b></a> () const</li>
<li class=fn>const TQStringList <a href="#toStringList"><b>toStringList</b></a> () const</li>
<li class=fn>const TQFont <a href="#toFont"><b>toFont</b></a> () const</li>
<li class=fn>const TQPixmap <a href="#toPixmap"><b>toPixmap</b></a> () const</li>
<li class=fn>const TQImage <a href="#toImage"><b>toImage</b></a> () const</li>
<li class=fn>const TQBrush <a href="#toBrush"><b>toBrush</b></a> () const</li>
<li class=fn>const TQPoint <a href="#toPoint"><b>toPoint</b></a> () const</li>
<li class=fn>const TQRect <a href="#toRect"><b>toRect</b></a> () const</li>
<li class=fn>const TQSize <a href="#toSize"><b>toSize</b></a> () const</li>
<li class=fn>const TQColor <a href="#toColor"><b>toColor</b></a> () const</li>
<li class=fn>const TQPalette <a href="#toPalette"><b>toPalette</b></a> () const</li>
<li class=fn>const TQColorGroup <a href="#toColorGroup"><b>toColorGroup</b></a> () const</li>
<li class=fn>const TQIconSet <a href="#toIconSet"><b>toIconSet</b></a> () const</li>
<li class=fn>const TQPointArray <a href="#toPointArray"><b>toPointArray</b></a> () const</li>
<li class=fn>const TQBitmap <a href="#toBitmap"><b>toBitmap</b></a> () const</li>
<li class=fn>const TQRegion <a href="#toRegion"><b>toRegion</b></a> () const</li>
<li class=fn>const TQCursor <a href="#toCursor"><b>toCursor</b></a> () const</li>
<li class=fn>const TQDate <a href="#toDate"><b>toDate</b></a> () const</li>
<li class=fn>const TQTime <a href="#toTime"><b>toTime</b></a> () const</li>
<li class=fn>const TQDateTime <a href="#toDateTime"><b>toDateTime</b></a> () const</li>
<li class=fn>const TQByteArray <a href="#toByteArray"><b>toByteArray</b></a> () const</li>
<li class=fn>const TQBitArray <a href="#toBitArray"><b>toBitArray</b></a> () const</li>
<li class=fn>const TQKeySequence <a href="#toKeySequence"><b>toKeySequence</b></a> () const</li>
<li class=fn>const TQPen <a href="#toPen"><b>toPen</b></a> () const</li>
<li class=fn>int <a href="#toInt"><b>toInt</b></a> ( bool&nbsp;*&nbsp;ok = 0 ) const</li>
<li class=fn>uint <a href="#toUInt"><b>toUInt</b></a> ( bool&nbsp;*&nbsp;ok = 0 ) const</li>
<li class=fn>Q_LLONG <a href="#toLongLong"><b>toLongLong</b></a> ( bool&nbsp;*&nbsp;ok = 0 ) const</li>
<li class=fn>Q_ULLONG <a href="#toULongLong"><b>toULongLong</b></a> ( bool&nbsp;*&nbsp;ok = 0 ) const</li>
<li class=fn>bool <a href="#toBool"><b>toBool</b></a> () const</li>
<li class=fn>double <a href="#toDouble"><b>toDouble</b></a> ( bool&nbsp;*&nbsp;ok = 0 ) const</li>
<li class=fn>const TQValueList&lt;TQVariant&gt; <a href="#toList"><b>toList</b></a> () const</li>
<li class=fn>const TQMap&lt;TQString, TQVariant&gt; <a href="#toMap"><b>toMap</b></a> () const</li>
<li class=fn>TQSizePolicy <a href="#toSizePolicy"><b>toSizePolicy</b></a> () const</li>
<li class=fn>TQValueListConstIterator&lt;TQString&gt; stringListBegin () const &nbsp;<em>(obsolete)</em></li>
<li class=fn>TQValueListConstIterator&lt;TQString&gt; stringListEnd () const &nbsp;<em>(obsolete)</em></li>
<li class=fn>TQValueListConstIterator&lt;TQVariant&gt; listBegin () const &nbsp;<em>(obsolete)</em></li>
<li class=fn>TQValueListConstIterator&lt;TQVariant&gt; listEnd () const &nbsp;<em>(obsolete)</em></li>
<li class=fn>TQMapConstIterator&lt;TQString, TQVariant&gt; mapBegin () const &nbsp;<em>(obsolete)</em></li>
<li class=fn>TQMapConstIterator&lt;TQString, TQVariant&gt; mapEnd () const &nbsp;<em>(obsolete)</em></li>
<li class=fn>TQMapConstIterator&lt;TQString, TQVariant&gt; mapFind ( const&nbsp;TQString&nbsp;&amp;&nbsp;key ) const &nbsp;<em>(obsolete)</em></li>
<li class=fn>TQString &amp; <a href="#asString"><b>asString</b></a> ()</li>
<li class=fn>TQCString &amp; <a href="#asCString"><b>asCString</b></a> ()</li>
<li class=fn>TQStringList &amp; <a href="#asStringList"><b>asStringList</b></a> ()</li>
<li class=fn>TQFont &amp; <a href="#asFont"><b>asFont</b></a> ()</li>
<li class=fn>TQPixmap &amp; <a href="#asPixmap"><b>asPixmap</b></a> ()</li>
<li class=fn>TQImage &amp; <a href="#asImage"><b>asImage</b></a> ()</li>
<li class=fn>TQBrush &amp; <a href="#asBrush"><b>asBrush</b></a> ()</li>
<li class=fn>TQPoint &amp; <a href="#asPoint"><b>asPoint</b></a> ()</li>
<li class=fn>TQRect &amp; <a href="#asRect"><b>asRect</b></a> ()</li>
<li class=fn>TQSize &amp; <a href="#asSize"><b>asSize</b></a> ()</li>
<li class=fn>TQColor &amp; <a href="#asColor"><b>asColor</b></a> ()</li>
<li class=fn>TQPalette &amp; <a href="#asPalette"><b>asPalette</b></a> ()</li>
<li class=fn>TQColorGroup &amp; <a href="#asColorGroup"><b>asColorGroup</b></a> ()</li>
<li class=fn>TQIconSet &amp; <a href="#asIconSet"><b>asIconSet</b></a> ()</li>
<li class=fn>TQPointArray &amp; <a href="#asPointArray"><b>asPointArray</b></a> ()</li>
<li class=fn>TQBitmap &amp; <a href="#asBitmap"><b>asBitmap</b></a> ()</li>
<li class=fn>TQRegion &amp; <a href="#asRegion"><b>asRegion</b></a> ()</li>
<li class=fn>TQCursor &amp; <a href="#asCursor"><b>asCursor</b></a> ()</li>
<li class=fn>TQDate &amp; <a href="#asDate"><b>asDate</b></a> ()</li>
<li class=fn>TQTime &amp; <a href="#asTime"><b>asTime</b></a> ()</li>
<li class=fn>TQDateTime &amp; <a href="#asDateTime"><b>asDateTime</b></a> ()</li>
<li class=fn>TQByteArray &amp; <a href="#asByteArray"><b>asByteArray</b></a> ()</li>
<li class=fn>TQBitArray &amp; <a href="#asBitArray"><b>asBitArray</b></a> ()</li>
<li class=fn>TQKeySequence &amp; <a href="#asKeySequence"><b>asKeySequence</b></a> ()</li>
<li class=fn>TQPen &amp; <a href="#asPen"><b>asPen</b></a> ()</li>
<li class=fn>int &amp; <a href="#asInt"><b>asInt</b></a> ()</li>
<li class=fn>uint &amp; <a href="#asUInt"><b>asUInt</b></a> ()</li>
<li class=fn>Q_LLONG &amp; <a href="#asLongLong"><b>asLongLong</b></a> ()</li>
<li class=fn>Q_ULLONG &amp; <a href="#asULongLong"><b>asULongLong</b></a> ()</li>
<li class=fn>bool &amp; <a href="#asBool"><b>asBool</b></a> ()</li>
<li class=fn>double &amp; <a href="#asDouble"><b>asDouble</b></a> ()</li>
<li class=fn>TQValueList&lt;TQVariant&gt; &amp; <a href="#asList"><b>asList</b></a> ()</li>
<li class=fn>TQMap&lt;TQString, TQVariant&gt; &amp; <a href="#asMap"><b>asMap</b></a> ()</li>
<li class=fn>TQSizePolicy &amp; <a href="#asSizePolicy"><b>asSizePolicy</b></a> ()</li>
</ul>
<h2>Static Public Members</h2>
<ul>
<li class=fn>const char * <a href="#typeToName"><b>typeToName</b></a> ( Type&nbsp;typ )</li>
<li class=fn>Type <a href="#nameToType"><b>nameToType</b></a> ( const&nbsp;char&nbsp;*&nbsp;name )</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>
The TQVariant class acts like a union for the most common TQt data types.
<p>
<p> Because C++ forbids unions from including types that have
non-default constructors or destructors, most interesting TQt
classes cannot be used in unions. Without TQVariant, this would be
a problem for <a href="ntqobject.html#property">TQObject::property</a>() and for database work, etc.
<p> A TQVariant object holds a single value of a single <a href="#type">type</a>() at a
time. (Some type()s are multi-valued, for example a string list.)
You can find out what type, T, the variant holds, convert it to a
different type using one of the asT() functions, e.g. <a href="#asSize">asSize</a>(),
get its value using one of the toT() functions, e.g. <a href="#toSize">toSize</a>(), and
check whether the type can be converted to a particular type using
<a href="#canCast">canCast</a>().
<p> The methods named toT() (for any supported T, see the <a href="#Type-enum">Type</a>
documentation for a list) are const. If you ask for the stored
type, they return a copy of the stored object. If you ask for a
type that can be generated from the stored type, toT() copies and
converts and leaves the object itself unchanged. If you ask for a
type that cannot be generated from the stored type, the result
depends on the type (see the function documentation for details).
<p> Note that three data types supported by TQVariant are <a href="shclass.html#explicitly-shared">explicitly shared</a>, namely <a href="ntqimage.html">TQImage</a>, <a href="ntqpointarray.html">TQPointArray</a>, and <a href="ntqcstring.html">TQCString</a>, and in these
cases the toT() methods return a <a href="shclass.html#shallow-copy">shallow copy</a>. In almost all cases
you must make a <a href="shclass.html#deep-copy">deep copy</a> of the returned values before modifying
them.
<p> The asT() functions are not const. They do conversion like the
toT() methods, set the variant to hold the converted value, and
return a reference to the new contents of the variant.
<p> Here is some example code to demonstrate the use of TQVariant:
<p> <pre>
<a href="ntqdatastream.html">TQDataStream</a> out(...);
TQVariant v(123); // The variant now contains an int
int x = v.<a href="#toInt">toInt</a>(); // x = 123
out &lt;&lt; v; // Writes a type tag and an int to out
v = <a href="#TQVariant">TQVariant</a>("hello"); // The variant now contains a TQCString
v = <a href="#TQVariant">TQVariant</a>(tr("hello"));// The variant now contains a TQString
int y = v.<a href="#toInt">toInt</a>(); // y = 0 since v cannot be converted to an int
<a href="ntqstring.html">TQString</a> s = v.<a href="#toString">toString</a>(); // s = tr("hello") (see TQObject::tr())
out &lt;&lt; v; // Writes a type tag and a TQString to out
...
<a href="ntqdatastream.html">TQDataStream</a> in(...); // (opening the previously written stream)
in &gt;&gt; v; // Reads an Int variant
int z = v.<a href="#toInt">toInt</a>(); // z = 123
<a href="ntqapplication.html#qDebug">qDebug</a>("Type is %s", // prints "Type is int"
v.<a href="#typeName">typeName</a>());
v.<a href="#asInt">asInt</a>() += 100; // The variant now hold the value 223.
v = <a href="#TQVariant">TQVariant</a>( TQStringList() );
v.<a href="#asStringList">asStringList</a>().append( "Hello" );
</pre>
<p> You can even store <a href="ntqvaluelist.html">TQValueList</a><TQVariant>s and
<a href="ntqmap.html">TQMap</a><TQString,TQVariant>s in a variant, so you can easily construct
arbitrarily complex data structures of arbitrary types. This is
very powerful and versatile, but may prove less memory and speed
efficient than storing specific types in standard data structures.
<p> TQVariant also supports the notion of NULL values, where you have a
defined type with no value set.
<pre>
TQVariant x, y( TQString() ), z( TQString("") );
x.<a href="#asInt">asInt</a>();
// x.<a href="#isNull">isNull</a>() == TRUE, y.isNull() == TRUE, z.isNull() == FALSE
</pre>
<p> See the <a href="collection.html">Collection Classes</a>.
<p>See also <a href="misc.html">Miscellaneous Classes</a> and <a href="objectmodel.html">Object Model</a>.
<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="Type-enum"></a>TQVariant::Type</h3>
<p> This enum type defines the types of variable that a TQVariant can
contain.
<ul>
<li><tt>TQVariant::Invalid</tt> - no type
<li><tt>TQVariant::BitArray</tt> - a <a href="ntqbitarray.html">TQBitArray</a>
<li><tt>TQVariant::ByteArray</tt> - a <a href="qbytearray.html">TQByteArray</a>
<li><tt>TQVariant::Bitmap</tt> - a <a href="ntqbitmap.html">TQBitmap</a>
<li><tt>TQVariant::Bool</tt> - a bool
<li><tt>TQVariant::Brush</tt> - a <a href="ntqbrush.html">TQBrush</a>
<li><tt>TQVariant::Color</tt> - a <a href="ntqcolor.html">TQColor</a>
<li><tt>TQVariant::ColorGroup</tt> - a <a href="qcolorgroup.html">TQColorGroup</a>
<li><tt>TQVariant::Cursor</tt> - a <a href="ntqcursor.html">TQCursor</a>
<li><tt>TQVariant::Date</tt> - a <a href="qdate.html">TQDate</a>
<li><tt>TQVariant::DateTime</tt> - a <a href="ntqdatetime.html">TQDateTime</a>
<li><tt>TQVariant::Double</tt> - a double
<li><tt>TQVariant::Font</tt> - a <a href="ntqfont.html">TQFont</a>
<li><tt>TQVariant::IconSet</tt> - a <a href="ntqiconset.html">TQIconSet</a>
<li><tt>TQVariant::Image</tt> - a <a href="ntqimage.html">TQImage</a>
<li><tt>TQVariant::Int</tt> - an int
<li><tt>TQVariant::KeySequence</tt> - a <a href="ntqkeysequence.html">TQKeySequence</a>
<li><tt>TQVariant::List</tt> - a <a href="ntqvaluelist.html">TQValueList</a><TQVariant>
<li><tt>TQVariant::LongLong</tt> - a long long
<li><tt>TQVariant::ULongLong</tt> - an unsigned long long
<li><tt>TQVariant::Map</tt> - a <a href="ntqmap.html">TQMap</a><TQString,TQVariant>
<li><tt>TQVariant::Palette</tt> - a <a href="ntqpalette.html">TQPalette</a>
<li><tt>TQVariant::Pen</tt> - a <a href="ntqpen.html">TQPen</a>
<li><tt>TQVariant::Pixmap</tt> - a <a href="ntqpixmap.html">TQPixmap</a>
<li><tt>TQVariant::Point</tt> - a <a href="ntqpoint.html">TQPoint</a>
<li><tt>TQVariant::PointArray</tt> - a <a href="ntqpointarray.html">TQPointArray</a>
<li><tt>TQVariant::Rect</tt> - a <a href="ntqrect.html">TQRect</a>
<li><tt>TQVariant::Region</tt> - a <a href="ntqregion.html">TQRegion</a>
<li><tt>TQVariant::Size</tt> - a <a href="ntqsize.html">TQSize</a>
<li><tt>TQVariant::SizePolicy</tt> - a <a href="ntqsizepolicy.html">TQSizePolicy</a>
<li><tt>TQVariant::String</tt> - a <a href="ntqstring.html">TQString</a>
<li><tt>TQVariant::CString</tt> - a <a href="ntqcstring.html">TQCString</a>
<li><tt>TQVariant::StringList</tt> - a <a href="ntqstringlist.html">TQStringList</a>
<li><tt>TQVariant::Time</tt> - a <a href="qtime.html">TQTime</a>
<li><tt>TQVariant::UInt</tt> - an unsigned int
</ul><p> Note that TQt's definition of bool depends on the compiler.
<a href="qglobal-h.html">ntqglobal.h</a> has the system-dependent definition of bool.
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQVariant"></a>TQVariant::TQVariant ()
</h3>
Constructs an invalid variant.
<h3 class=fn><a name="TQVariant-10"></a>TQVariant::TQVariant ( bool&nbsp;val, int )
</h3>
Constructs a new variant with a boolean value, <em>val</em>. The integer
argument is a dummy, necessary for compatibility with some
compilers.
<h3 class=fn><a name="TQVariant-11"></a>TQVariant::TQVariant ( double&nbsp;val )
</h3>
Constructs a new variant with a floating point value, <em>val</em>.
<h3 class=fn><a name="TQVariant-12"></a>TQVariant::TQVariant ( <a href="ntqsizepolicy.html">TQSizePolicy</a>&nbsp;val )
</h3>
Constructs a new variant with a size policy value, <em>val</em>.
<h3 class=fn><a name="TQVariant-2"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqvariant.html">TQVariant</a>&nbsp;&amp;&nbsp;p )
</h3>
Constructs a copy of the variant, <em>p</em>, passed as the argument to
this constructor. Usually this is a <a href="shclass.html#deep-copy">deep copy</a>, but a <a href="shclass.html#shallow-copy">shallow copy</a>
is made if the stored data type is <a href="shclass.html#explicitly-shared">explicitly shared</a>, as e.g.
<a href="ntqimage.html">TQImage</a> is.
<h3 class=fn><a name="TQVariant-3"></a>TQVariant::TQVariant ( <a href="ntqdatastream.html">TQDataStream</a>&nbsp;&amp;&nbsp;s )
</h3>
Reads the variant from the data stream, <em>s</em>.
<h3 class=fn><a name="TQVariant-4"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqstring.html">TQString</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a string value, <em>val</em>.
<h3 class=fn><a name="TQVariant-5"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqcstring.html">TQCString</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a C-string value, <em>val</em>.
<p> If you want to modify the <a href="ntqcstring.html">TQCString</a> after you've passed it to this
constructor, we recommend passing a <a href="shclass.html#deep-copy">deep copy</a> (see
<a href="ntqcstring.html#copy">TQCString::copy</a>()).
<h3 class=fn><a name="TQVariant-6"></a>TQVariant::TQVariant ( const&nbsp;char&nbsp;*&nbsp;val )
</h3>
Constructs a new variant with a C-string value of <em>val</em> if <em>val</em>
is non-null. The variant creates a <a href="shclass.html#deep-copy">deep copy</a> of <em>val</em>.
<p> If <em>val</em> is null, the resulting variant has type Invalid.
<h3 class=fn><a name="TQVariant-7"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqstringlist.html">TQStringList</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a string list value, <em>val</em>.
<h3 class=fn><a name="TQVariant-8"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqfont.html">TQFont</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a font value, <em>val</em>.
<h3 class=fn><a name="TQVariant-9"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqpixmap.html">TQPixmap</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a pixmap value, <em>val</em>.
<h3 class=fn><a name="TQVariant-a"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqimage.html">TQImage</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with an image value, <em>val</em>.
<p> Because <a href="ntqimage.html">TQImage</a> is <a href="shclass.html#explicitly-shared">explicitly shared</a>, you may need to pass a <a href="shclass.html#deep-copy">deep copy</a> to the variant using <a href="ntqimage.html#copy">TQImage::copy</a>(), e.g. if you intend
changing the image you've passed later on.
<h3 class=fn><a name="TQVariant-b"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqbrush.html">TQBrush</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a brush value, <em>val</em>.
<h3 class=fn><a name="TQVariant-c"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqpoint.html">TQPoint</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a point value, <em>val</em>.
<h3 class=fn><a name="TQVariant-d"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqrect.html">TQRect</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a rect value, <em>val</em>.
<h3 class=fn><a name="TQVariant-e"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqsize.html">TQSize</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a size value, <em>val</em>.
<h3 class=fn><a name="TQVariant-f"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqcolor.html">TQColor</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a color value, <em>val</em>.
<h3 class=fn><a name="TQVariant-g"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqpalette.html">TQPalette</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a color palette value, <em>val</em>.
<h3 class=fn><a name="TQVariant-h"></a>TQVariant::TQVariant ( const&nbsp;<a href="qcolorgroup.html">TQColorGroup</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a color group value, <em>val</em>.
<h3 class=fn><a name="TQVariant-i"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqiconset.html">TQIconSet</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with an icon set value, <em>val</em>.
<h3 class=fn><a name="TQVariant-j"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqpointarray.html">TQPointArray</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a point array value, <em>val</em>.
<p> Because <a href="ntqpointarray.html">TQPointArray</a> is <a href="shclass.html#explicitly-shared">explicitly shared</a>, you may need to pass a
<a href="shclass.html#deep-copy">deep copy</a> to the variant using <a href="ntqpointarray.html#copy">TQPointArray::copy</a>(), e.g. if you
intend changing the point array you've passed later on.
<h3 class=fn><a name="TQVariant-k"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqregion.html">TQRegion</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a region value, <em>val</em>.
<h3 class=fn><a name="TQVariant-l"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqbitmap.html">TQBitmap</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a bitmap value, <em>val</em>.
<h3 class=fn><a name="TQVariant-m"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqcursor.html">TQCursor</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a cursor value, <em>val</em>.
<h3 class=fn><a name="TQVariant-n"></a>TQVariant::TQVariant ( const&nbsp;<a href="qdate.html">TQDate</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a date value, <em>val</em>.
<h3 class=fn><a name="TQVariant-o"></a>TQVariant::TQVariant ( const&nbsp;<a href="qtime.html">TQTime</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a time value, <em>val</em>.
<h3 class=fn><a name="TQVariant-p"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqdatetime.html">TQDateTime</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a date/time value, <em>val</em>.
<h3 class=fn><a name="TQVariant-q"></a>TQVariant::TQVariant ( const&nbsp;<a href="qbytearray.html">TQByteArray</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a bytearray value, <em>val</em>.
<h3 class=fn><a name="TQVariant-r"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqbitarray.html">TQBitArray</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a bitarray value, <em>val</em>.
<h3 class=fn><a name="TQVariant-s"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqkeysequence.html">TQKeySequence</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a key sequence value, <em>val</em>.
<h3 class=fn><a name="TQVariant-t"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqpen.html">TQPen</a>&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a pen value, <em>val</em>.
<h3 class=fn><a name="TQVariant-u"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqvaluelist.html">TQValueList</a>&lt;TQVariant&gt;&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a list value, <em>val</em>.
<h3 class=fn><a name="TQVariant-v"></a>TQVariant::TQVariant ( const&nbsp;<a href="ntqmap.html">TQMap</a>&lt;TQString,&nbsp;TQVariant&gt;&nbsp;&amp;&nbsp;val )
</h3>
Constructs a new variant with a map of TQVariants, <em>val</em>.
<h3 class=fn><a name="TQVariant-w"></a>TQVariant::TQVariant ( int&nbsp;val )
</h3>
Constructs a new variant with an integer value, <em>val</em>.
<h3 class=fn><a name="TQVariant-x"></a>TQVariant::TQVariant ( uint&nbsp;val )
</h3>
Constructs a new variant with an unsigned integer value, <em>val</em>.
<h3 class=fn><a name="TQVariant-y"></a>TQVariant::TQVariant ( Q_LLONG&nbsp;val )
</h3>
Constructs a new variant with a long long integer value, <em>val</em>.
<h3 class=fn><a name="TQVariant-z"></a>TQVariant::TQVariant ( Q_ULLONG&nbsp;val )
</h3>
Constructs a new variant with an unsigned long long integer value, <em>val</em>.
<h3 class=fn><a name="~TQVariant"></a>TQVariant::~TQVariant ()
</h3>
Destroys the TQVariant and the contained object.
<p> Note that subclasses that reimplement <a href="#clear">clear</a>() should reimplement
the destructor to call clear(). This destructor calls clear(), but
because it is the destructor, <a href="#clear">TQVariant::clear</a>() is called rather
than a subclass's clear().
<h3 class=fn><a href="ntqbitarray.html">TQBitArray</a>&nbsp;&amp; <a name="asBitArray"></a>TQVariant::asBitArray ()
</h3>
<p> Tries to convert the variant to hold a <a href="ntqbitarray.html">TQBitArray</a> value. If that is
not possible then the variant is set to an empty bitarray.
<p> Returns a reference to the stored bitarray.
<p> <p>See also <a href="#toBitArray">toBitArray</a>().
<h3 class=fn><a href="ntqbitmap.html">TQBitmap</a>&nbsp;&amp; <a name="asBitmap"></a>TQVariant::asBitmap ()
</h3>
<p> Tries to convert the variant to hold a bitmap value. If that is
not possible the variant is set to a null bitmap.
<p> Returns a reference to the stored bitmap.
<p> <p>See also <a href="#toBitmap">toBitmap</a>().
<h3 class=fn>bool &amp; <a name="asBool"></a>TQVariant::asBool ()
</h3>
Returns the variant's value as bool reference.
<h3 class=fn><a href="ntqbrush.html">TQBrush</a>&nbsp;&amp; <a name="asBrush"></a>TQVariant::asBrush ()
</h3>
<p> Tries to convert the variant to hold a brush value. If that is not
possible the variant is set to a default black brush.
<p> Returns a reference to the stored brush.
<p> <p>See also <a href="#toBrush">toBrush</a>().
<h3 class=fn><a href="qbytearray.html">TQByteArray</a>&nbsp;&amp; <a name="asByteArray"></a>TQVariant::asByteArray ()
</h3>
<p> Tries to convert the variant to hold a <a href="qbytearray.html">TQByteArray</a> value. If that
is not possible then the variant is set to an empty bytearray.
<p> Returns a reference to the stored bytearray.
<p> <p>See also <a href="#toByteArray">toByteArray</a>().
<h3 class=fn><a href="ntqcstring.html">TQCString</a>&nbsp;&amp; <a name="asCString"></a>TQVariant::asCString ()
</h3>
<p> Tries to convert the variant to hold a string value. If that is
not possible the variant is set to an empty string.
<p> Returns a reference to the stored string.
<p> <p>See also <a href="#toCString">toCString</a>().
<h3 class=fn><a href="ntqcolor.html">TQColor</a>&nbsp;&amp; <a name="asColor"></a>TQVariant::asColor ()
</h3>
<p> Tries to convert the variant to hold a <a href="ntqcolor.html">TQColor</a> value. If that is
not possible the variant is set to an invalid color.
<p> Returns a reference to the stored color.
<p> <p>See also <a href="#toColor">toColor</a>() and <a href="ntqcolor.html#isValid">TQColor::isValid</a>().
<h3 class=fn><a href="qcolorgroup.html">TQColorGroup</a>&nbsp;&amp; <a name="asColorGroup"></a>TQVariant::asColorGroup ()
</h3>
<p> Tries to convert the variant to hold a <a href="qcolorgroup.html">TQColorGroup</a> value. If that
is not possible the variant is set to a color group of all black
colors.
<p> Returns a reference to the stored color group.
<p> <p>See also <a href="#toColorGroup">toColorGroup</a>().
<h3 class=fn><a href="ntqcursor.html">TQCursor</a>&nbsp;&amp; <a name="asCursor"></a>TQVariant::asCursor ()
</h3>
<p> Tries to convert the variant to hold a <a href="ntqcursor.html">TQCursor</a> value. If that is
not possible the variant is set to a default arrow cursor.
<p> Returns a reference to the stored cursor.
<p> <p>See also <a href="#toCursor">toCursor</a>().
<h3 class=fn><a href="qdate.html">TQDate</a>&nbsp;&amp; <a name="asDate"></a>TQVariant::asDate ()
</h3>
<p> Tries to convert the variant to hold a <a href="qdate.html">TQDate</a> value. If that is not
possible then the variant is set to an invalid date.
<p> Returns a reference to the stored date.
<p> <p>See also <a href="#toDate">toDate</a>().
<h3 class=fn><a href="ntqdatetime.html">TQDateTime</a>&nbsp;&amp; <a name="asDateTime"></a>TQVariant::asDateTime ()
</h3>
<p> Tries to convert the variant to hold a <a href="ntqdatetime.html">TQDateTime</a> value. If that is
not possible then the variant is set to an invalid date/time.
<p> Returns a reference to the stored date/time.
<p> <p>See also <a href="#toDateTime">toDateTime</a>().
<h3 class=fn>double &amp; <a name="asDouble"></a>TQVariant::asDouble ()
</h3>
Returns the variant's value as double reference.
<h3 class=fn><a href="ntqfont.html">TQFont</a>&nbsp;&amp; <a name="asFont"></a>TQVariant::asFont ()
</h3>
<p> Tries to convert the variant to hold a <a href="ntqfont.html">TQFont</a>. If that is not
possible the variant is set to the application's default font.
<p> Returns a reference to the stored font.
<p> <p>See also <a href="#toFont">toFont</a>().
<h3 class=fn><a href="ntqiconset.html">TQIconSet</a>&nbsp;&amp; <a name="asIconSet"></a>TQVariant::asIconSet ()
</h3>
<p> Tries to convert the variant to hold a <a href="ntqiconset.html">TQIconSet</a> value. If that is
not possible the variant is set to an empty iconset.
<p> Returns a reference to the stored iconset.
<p> <p>See also <a href="#toIconSet">toIconSet</a>().
<h3 class=fn><a href="ntqimage.html">TQImage</a>&nbsp;&amp; <a name="asImage"></a>TQVariant::asImage ()
</h3>
<p> Tries to convert the variant to hold an image value. If that is
not possible the variant is set to a null image.
<p> Returns a reference to the stored image.
<p> <p>See also <a href="#toImage">toImage</a>().
<h3 class=fn>int &amp; <a name="asInt"></a>TQVariant::asInt ()
</h3>
Returns the variant's value as int reference.
<h3 class=fn><a href="ntqkeysequence.html">TQKeySequence</a>&nbsp;&amp; <a name="asKeySequence"></a>TQVariant::asKeySequence ()
</h3>
<p> Tries to convert the variant to hold a <a href="ntqkeysequence.html">TQKeySequence</a> value. If that
is not possible then the variant is set to an empty key sequence.
<p> Returns a reference to the stored key sequence.
<p> <p>See also <a href="#toKeySequence">toKeySequence</a>().
<h3 class=fn><a href="ntqvaluelist.html">TQValueList</a>&lt;TQVariant&gt;&nbsp;&amp; <a name="asList"></a>TQVariant::asList ()
</h3>
Returns the variant's value as variant list reference.
<p> Note that if you want to iterate over the list, you should iterate
over a copy, e.g.
<pre>
<a href="ntqvaluelist.html">TQValueList</a>&lt;TQVariant&gt; list = myVariant.asList();
TQValueList&lt;TQVariant&gt;::Iterator it = list.<a href="ntqvaluelist.html#begin">begin</a>();
while( it != list.<a href="ntqvaluelist.html#end">end</a>() ) {
myProcessing( *it );
++it;
}
</pre>
<h3 class=fn>Q_LLONG &amp; <a name="asLongLong"></a>TQVariant::asLongLong ()
</h3>
Returns the variant's value as long long reference.
<h3 class=fn><a href="ntqmap.html">TQMap</a>&lt;TQString,&nbsp;TQVariant&gt;&nbsp;&amp; <a name="asMap"></a>TQVariant::asMap ()
</h3>
Returns the variant's value as variant map reference.
<p> Note that if you want to iterate over the map, you should iterate
over a copy, e.g.
<pre>
<a href="ntqmap.html">TQMap</a>&lt;TQString, TQVariant&gt; map = myVariant.asMap();
TQMap&lt;TQString, TQVariant&gt;::Iterator it = map.<a href="ntqmap.html#begin">begin</a>();
while( it != map.<a href="ntqmap.html#end">end</a>() ) {
myProcessing( *it );
++it;
}
</pre>
<h3 class=fn><a href="ntqpalette.html">TQPalette</a>&nbsp;&amp; <a name="asPalette"></a>TQVariant::asPalette ()
</h3>
<p> Tries to convert the variant to hold a <a href="ntqpalette.html">TQPalette</a> value. If that is
not possible the variant is set to a palette of black colors.
<p> Returns a reference to the stored palette.
<p> <p>See also <a href="#toString">toString</a>().
<h3 class=fn><a href="ntqpen.html">TQPen</a>&nbsp;&amp; <a name="asPen"></a>TQVariant::asPen ()
</h3>
<p> Tries to convert the variant to hold a <a href="ntqpen.html">TQPen</a> value. If that
is not possible then the variant is set to an empty pen.
<p> Returns a reference to the stored pen.
<p> <p>See also <a href="#toPen">toPen</a>().
<h3 class=fn><a href="ntqpixmap.html">TQPixmap</a>&nbsp;&amp; <a name="asPixmap"></a>TQVariant::asPixmap ()
</h3>
<p> Tries to convert the variant to hold a pixmap value. If that is
not possible the variant is set to a null pixmap.
<p> Returns a reference to the stored pixmap.
<p> <p>See also <a href="#toPixmap">toPixmap</a>().
<h3 class=fn><a href="ntqpoint.html">TQPoint</a>&nbsp;&amp; <a name="asPoint"></a>TQVariant::asPoint ()
</h3>
<p> Tries to convert the variant to hold a point value. If that is not
possible the variant is set to a (0, 0) point.
<p> Returns a reference to the stored point.
<p> <p>See also <a href="#toPoint">toPoint</a>().
<h3 class=fn><a href="ntqpointarray.html">TQPointArray</a>&nbsp;&amp; <a name="asPointArray"></a>TQVariant::asPointArray ()
</h3>
<p> Tries to convert the variant to hold a <a href="ntqpointarray.html">TQPointArray</a> value. If that
is not possible the variant is set to an empty point array.
<p> Returns a reference to the stored point array.
<p> <p>See also <a href="#toPointArray">toPointArray</a>().
<h3 class=fn><a href="ntqrect.html">TQRect</a>&nbsp;&amp; <a name="asRect"></a>TQVariant::asRect ()
</h3>
<p> Tries to convert the variant to hold a rectangle value. If that is
not possible the variant is set to an empty rectangle.
<p> Returns a reference to the stored rectangle.
<p> <p>See also <a href="#toRect">toRect</a>().
<h3 class=fn><a href="ntqregion.html">TQRegion</a>&nbsp;&amp; <a name="asRegion"></a>TQVariant::asRegion ()
</h3>
<p> Tries to convert the variant to hold a <a href="ntqregion.html">TQRegion</a> value. If that is
not possible the variant is set to a null region.
<p> Returns a reference to the stored region.
<p> <p>See also <a href="#toRegion">toRegion</a>().
<h3 class=fn><a href="ntqsize.html">TQSize</a>&nbsp;&amp; <a name="asSize"></a>TQVariant::asSize ()
</h3>
<p> Tries to convert the variant to hold a <a href="ntqsize.html">TQSize</a> value. If that is not
possible the variant is set to an invalid size.
<p> Returns a reference to the stored size.
<p> <p>See also <a href="#toSize">toSize</a>() and <a href="ntqsize.html#isValid">TQSize::isValid</a>().
<h3 class=fn><a href="ntqsizepolicy.html">TQSizePolicy</a>&nbsp;&amp; <a name="asSizePolicy"></a>TQVariant::asSizePolicy ()
</h3>
<p> Tries to convert the variant to hold a <a href="ntqsizepolicy.html">TQSizePolicy</a> value. If that
fails, the variant is set to an arbitrary (valid) size policy.
<h3 class=fn><a href="ntqstring.html">TQString</a>&nbsp;&amp; <a name="asString"></a>TQVariant::asString ()
</h3>
<p> Tries to convert the variant to hold a string value. If that is
not possible the variant is set to an empty string.
<p> Returns a reference to the stored string.
<p> <p>See also <a href="#toString">toString</a>().
<h3 class=fn><a href="ntqstringlist.html">TQStringList</a>&nbsp;&amp; <a name="asStringList"></a>TQVariant::asStringList ()
</h3>
<p> Tries to convert the variant to hold a <a href="ntqstringlist.html">TQStringList</a> value. If that
is not possible the variant is set to an empty string list.
<p> Returns a reference to the stored string list.
<p> Note that if you want to iterate over the list, you should
iterate over a copy, e.g.
<pre>
<a href="ntqstringlist.html">TQStringList</a> list = myVariant.asStringList();
TQStringList::Iterator it = list.<a href="ntqvaluelist.html#begin">begin</a>();
while( it != list.<a href="ntqvaluelist.html#end">end</a>() ) {
myProcessing( *it );
++it;
}
</pre>
<p> <p>See also <a href="#toStringList">toStringList</a>().
<h3 class=fn><a href="qtime.html">TQTime</a>&nbsp;&amp; <a name="asTime"></a>TQVariant::asTime ()
</h3>
<p> Tries to convert the variant to hold a <a href="qtime.html">TQTime</a> value. If that is not
possible then the variant is set to an invalid time.
<p> Returns a reference to the stored time.
<p> <p>See also <a href="#toTime">toTime</a>().
<h3 class=fn>uint &amp; <a name="asUInt"></a>TQVariant::asUInt ()
</h3>
Returns the variant's value as unsigned int reference.
<h3 class=fn>Q_ULLONG &amp; <a name="asULongLong"></a>TQVariant::asULongLong ()
</h3>
Returns the variant's value as unsigned long long reference.
<h3 class=fn>bool <a name="canCast"></a>TQVariant::canCast ( <a href="ntqvariant.html#Type-enum">Type</a>&nbsp;t ) const
</h3>
Returns TRUE if the variant's type can be cast to the requested
type, <em>t</em>. Such casting is done automatically when calling the
<a href="#toInt">toInt</a>(), <a href="#toBool">toBool</a>(), ... or <a href="#asInt">asInt</a>(), <a href="#asBool">asBool</a>(), ... methods.
<p> The following casts are done automatically:
<center><table cellpadding="4" cellspacing="2" border="0">
<tr bgcolor="#a2c511"> <th valign="top">Type <th valign="top">Automatically Cast To
<tr bgcolor="#f0f0f0"> <td valign="top">Bool <td valign="top">Double, Int, UInt, LongLong, ULongLong, String, CString, ByteArray
<tr bgcolor="#d0d0d0"> <td valign="top">Color <td valign="top">String. CString. ByteArray
<tr bgcolor="#f0f0f0"> <td valign="top">Date <td valign="top">String, CString, ByteArray, DateTime
<tr bgcolor="#d0d0d0"> <td valign="top">DateTime <td valign="top">String, CString, ByteArray, Date, Time
<tr bgcolor="#f0f0f0"> <td valign="top">Double <td valign="top">String, CString, ByteArray, Int, Bool, UInt, LongLong, ULongLong
<tr bgcolor="#d0d0d0"> <td valign="top">Font <td valign="top">String, CString, ByteArray
<tr bgcolor="#f0f0f0"> <td valign="top">Int <td valign="top">String, CString, ByteArray, Double, Bool, UInt, LongLong, ULongLong, KeySequence
<tr bgcolor="#d0d0d0"> <td valign="top">LongLong <td valign="top">String, CString, ByteArray, Double, Bool, UInt, LongLong, ULongLong, KeySequence
<tr bgcolor="#f0f0f0"> <td valign="top">ULongLong <td valign="top">String, CString, ByteArray, Double, Bool, UInt, LongLong, ULongLong, KeySequence
<tr bgcolor="#d0d0d0"> <td valign="top">List <td valign="top">StringList (if the list contains only strings or
something that can be cast to a string)
<tr bgcolor="#f0f0f0"> <td valign="top">String <td valign="top">CString, ByteArray, CString, Int, UInt, Bool, Double, Date,
Time, DateTime, KeySequence, Font, Color
<tr bgcolor="#d0d0d0"> <td valign="top">CString <td valign="top">String, ByteArray, Int, UInt, Bool, Double, Date, ULongLong, LongLong
<tr bgcolor="#f0f0f0"> <td valign="top">ByteArray <td valign="top">String, CString, Int, UInt, Bool, Double, Date, ULongLong, LongLong
<tr bgcolor="#d0d0d0"> <td valign="top">StringList <td valign="top">List
<tr bgcolor="#f0f0f0"> <td valign="top">Time <td valign="top">String
<tr bgcolor="#d0d0d0"> <td valign="top">Int <td valign="top">String, CString, ByteArray, Double, Bool, UInt, LongLong, ULongLong, KeySequence
<tr bgcolor="#f0f0f0"> <td valign="top">KeySequence <td valign="top">String, CString, ByteArray, Int, UInt, LongLong, ULongLong
</table></center>
<h3 class=fn>bool <a name="cast"></a>TQVariant::cast ( <a href="ntqvariant.html#Type-enum">Type</a>&nbsp;t )
</h3>
Casts the variant to the requested type. If the cast cannot be
done, the variant is set to the default value of the requested
type (e.g. an empty string if the requested type <em>t</em> is
TQVariant::String, an empty point array if the requested type <em>t</em>
is TQVariant::PointArray, etc). Returns TRUE if the current type of
the variant was successfully cast; otherwise returns FALSE.
<p> <p>See also <a href="#canCast">canCast</a>().
<h3 class=fn>void <a name="clear"></a>TQVariant::clear ()
</h3>
Convert this variant to type Invalid and free up any resources
used.
<h3 class=fn>bool <a name="isNull"></a>TQVariant::isNull () const
</h3>
Returns TRUE if this is a NULL variant, FALSE otherwise.
<h3 class=fn>bool <a name="isValid"></a>TQVariant::isValid () const
</h3>
<p> Returns TRUE if the storage type of this variant is not
TQVariant::Invalid; otherwise returns FALSE.
<h3 class=fn><a href="qvaluelistconstiterator.html">TQValueListConstIterator</a>&lt;TQVariant&gt; <a name="listBegin"></a>TQVariant::listBegin () const
</h3>
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> Returns an iterator to the first item in the list if the variant's
type is appropriate; otherwise returns a null iterator.
<h3 class=fn><a href="qvaluelistconstiterator.html">TQValueListConstIterator</a>&lt;TQVariant&gt; <a name="listEnd"></a>TQVariant::listEnd () const
</h3>
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> Returns the end iterator for the list if the variant's type is
appropriate; otherwise returns a null iterator.
<h3 class=fn><a href="qmapconstiterator.html">TQMapConstIterator</a>&lt;TQString,&nbsp;TQVariant&gt; <a name="mapBegin"></a>TQVariant::mapBegin () const
</h3>
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> Returns an iterator to the first item in the map, if the variant's
type is appropriate; otherwise returns a null iterator.
<h3 class=fn><a href="qmapconstiterator.html">TQMapConstIterator</a>&lt;TQString,&nbsp;TQVariant&gt; <a name="mapEnd"></a>TQVariant::mapEnd () const
</h3>
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> Returns the end iterator for the map, if the variant's type is
appropriate; otherwise returns a null iterator.
<h3 class=fn><a href="qmapconstiterator.html">TQMapConstIterator</a>&lt;TQString,&nbsp;TQVariant&gt; <a name="mapFind"></a>TQVariant::mapFind ( const&nbsp;<a href="ntqstring.html">TQString</a>&nbsp;&amp;&nbsp;key ) const
</h3>
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> Returns an iterator to the item in the map with <em>key</em> as key, if
the variant's type is appropriate and <em>key</em> is a valid key;
otherwise returns a null iterator.
<h3 class=fn><a href="ntqvariant.html#Type-enum">Type</a> <a name="nameToType"></a>TQVariant::nameToType ( const&nbsp;char&nbsp;*&nbsp;name )<tt> [static]</tt>
</h3>
Converts the string representation of the storage type given in <em>name</em>, to its enum representation.
<p> If the string representation cannot be converted to any enum
representation, the variant is set to <a href="#Type-enum">Invalid</a>.
<h3 class=fn>bool <a name="operator!-eq"></a>TQVariant::operator!= ( const&nbsp;<a href="ntqvariant.html">TQVariant</a>&nbsp;&amp;&nbsp;v ) const
</h3>
Compares this TQVariant with <em>v</em> and returns TRUE if they are not
equal; otherwise returns FALSE.
<h3 class=fn><a href="ntqvariant.html">TQVariant</a>&nbsp;&amp; <a name="operator-eq"></a>TQVariant::operator= ( const&nbsp;<a href="ntqvariant.html">TQVariant</a>&nbsp;&amp;&nbsp;variant )
</h3>
Assigns the value of the variant <em>variant</em> to this variant.
<p> This is a <a href="shclass.html#deep-copy">deep copy</a> of the variant, but note that if the variant
holds an <a href="shclass.html#explicitly-shared">explicitly shared</a> type such as <a href="ntqimage.html">TQImage</a>, a <a href="shclass.html#shallow-copy">shallow copy</a> is
performed.
<h3 class=fn>bool <a name="operator-eq-eq"></a>TQVariant::operator== ( const&nbsp;<a href="ntqvariant.html">TQVariant</a>&nbsp;&amp;&nbsp;v ) const
</h3>
Compares this TQVariant with <em>v</em> and returns TRUE if they are
equal; otherwise returns FALSE.
<h3 class=fn><a href="qvaluelistconstiterator.html">TQValueListConstIterator</a>&lt;TQString&gt; <a name="stringListBegin"></a>TQVariant::stringListBegin () const
</h3>
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> Returns an iterator to the first string in the list if the
variant's type is StringList; otherwise returns a null iterator.
<h3 class=fn><a href="qvaluelistconstiterator.html">TQValueListConstIterator</a>&lt;TQString&gt; <a name="stringListEnd"></a>TQVariant::stringListEnd () const
</h3>
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> Returns the end iterator for the list if the variant's type is
StringList; otherwise returns a null iterator.
<h3 class=fn>const&nbsp;<a href="ntqbitarray.html">TQBitArray</a> <a name="toBitArray"></a>TQVariant::toBitArray () const
</h3>
Returns the variant as a <a href="ntqbitarray.html">TQBitArray</a> if the variant has <a href="#type">type</a>()
BitArray; otherwise returns an empty bitarray.
<p> <p>See also <a href="#asBitArray">asBitArray</a>().
<h3 class=fn>const&nbsp;<a href="ntqbitmap.html">TQBitmap</a> <a name="toBitmap"></a>TQVariant::toBitmap () const
</h3>
Returns the variant as a <a href="ntqbitmap.html">TQBitmap</a> if the variant has <a href="#type">type</a>() Bitmap;
otherwise returns a null TQBitmap.
<p> <p>See also <a href="#asBitmap">asBitmap</a>().
<h3 class=fn>bool <a name="toBool"></a>TQVariant::toBool () const
</h3>
Returns the variant as a bool if the variant can be cast to Bool;
otherWise returns FALSE.
<p> 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.
<p> <p>See also <a href="#asBool">asBool</a>() and <a href="#canCast">canCast</a>().
<h3 class=fn>const&nbsp;<a href="ntqbrush.html">TQBrush</a> <a name="toBrush"></a>TQVariant::toBrush () const
</h3>
Returns the variant as a <a href="ntqbrush.html">TQBrush</a> if the variant has <a href="#type">type</a>() Brush;
otherwise returns a default brush (with all black colors).
<p> <p>See also <a href="#asBrush">asBrush</a>().
<h3 class=fn>const&nbsp;<a href="qbytearray.html">TQByteArray</a> <a name="toByteArray"></a>TQVariant::toByteArray () const
</h3>
Returns the variant as a <a href="qbytearray.html">TQByteArray</a> if the variant can be cast to
a ByteArray; otherwise returns an empty bytearray.
<p> <p>See also <a href="#asByteArray">asByteArray</a>() and <a href="#canCast">canCast</a>().
<h3 class=fn>const&nbsp;<a href="ntqcstring.html">TQCString</a> <a name="toCString"></a>TQVariant::toCString () const
</h3>
Returns the variant as a <a href="ntqcstring.html">TQCString</a> if the variant can be cast to a
CString; otherwise returns 0.
<p> <p>See also <a href="#asCString">asCString</a>() and <a href="#canCast">canCast</a>().
<h3 class=fn>const&nbsp;<a href="ntqcolor.html">TQColor</a> <a name="toColor"></a>TQVariant::toColor () const
</h3>
Returns the variant as a <a href="ntqcolor.html">TQColor</a> if the variant can be cast to Color;
otherwise returns an invalid color.
<p> <p>See also <a href="#asColor">asColor</a>() and <a href="#canCast">canCast</a>().
<h3 class=fn>const&nbsp;<a href="qcolorgroup.html">TQColorGroup</a> <a name="toColorGroup"></a>TQVariant::toColorGroup () const
</h3>
Returns the variant as a <a href="qcolorgroup.html">TQColorGroup</a> if the variant has <a href="#type">type</a>()
ColorGroup; otherwise returns a completely black color group.
<p> <p>See also <a href="#asColorGroup">asColorGroup</a>().
<h3 class=fn>const&nbsp;<a href="ntqcursor.html">TQCursor</a> <a name="toCursor"></a>TQVariant::toCursor () const
</h3>
Returns the variant as a <a href="ntqcursor.html">TQCursor</a> if the variant has <a href="#type">type</a>() Cursor;
otherwise returns the default arrow cursor.
<p> <p>See also <a href="#asCursor">asCursor</a>().
<h3 class=fn>const&nbsp;<a href="qdate.html">TQDate</a> <a name="toDate"></a>TQVariant::toDate () const
</h3>
Returns the variant as a <a href="qdate.html">TQDate</a> if the variant can be cast to Date;
otherwise returns an invalid date.
<p> Note that if the <a href="#type">type</a>() is String, CString or ByteArray an invalid
date will be returned if the string cannot be parsed as a
TQt::ISODate format date.
<p> <p>See also <a href="#asDate">asDate</a>() and <a href="#canCast">canCast</a>().
<h3 class=fn>const&nbsp;<a href="ntqdatetime.html">TQDateTime</a> <a name="toDateTime"></a>TQVariant::toDateTime () const
</h3>
Returns the variant as a <a href="ntqdatetime.html">TQDateTime</a> if the variant can be cast to
DateTime; otherwise returns an invalid TQDateTime.
<p> Note that if the <a href="#type">type</a>() is String, CString or ByteArray an invalid
TQDateTime will be returned if the string cannot be parsed as a
TQt::ISODate format date/time.
<p> <p>See also <a href="#asDateTime">asDateTime</a>().
<h3 class=fn>double <a name="toDouble"></a>TQVariant::toDouble ( bool&nbsp;*&nbsp;ok = 0 ) const
</h3>
Returns the variant as a double if the variant can be cast to
Double; otherwise returns 0.0.
<p> If <em>ok</em> is non-null: <em>*ok</em> is set to TRUE if the value could be
converted to a double; otherwise <em>*ok</em> is set to FALSE.
<p> <p>See also <a href="#asDouble">asDouble</a>() and <a href="#canCast">canCast</a>().
<h3 class=fn>const&nbsp;<a href="ntqfont.html">TQFont</a> <a name="toFont"></a>TQVariant::toFont () const
</h3>
Returns the variant as a <a href="ntqfont.html">TQFont</a> if the variant can be cast to Font;
otherwise returns the application's default font.
<p> <p>See also <a href="#asFont">asFont</a>() and <a href="#canCast">canCast</a>().
<h3 class=fn>const&nbsp;<a href="ntqiconset.html">TQIconSet</a> <a name="toIconSet"></a>TQVariant::toIconSet () const
</h3>
Returns the variant as a <a href="ntqiconset.html">TQIconSet</a> if the variant has <a href="#type">type</a>()
IconSet; otherwise returns an icon set of null pixmaps.
<p> <p>See also <a href="#asIconSet">asIconSet</a>().
<h3 class=fn>const&nbsp;<a href="ntqimage.html">TQImage</a> <a name="toImage"></a>TQVariant::toImage () const
</h3>
Returns the variant as a <a href="ntqimage.html">TQImage</a> if the variant has <a href="#type">type</a>() Image;
otherwise returns a null image.
<p> <p>See also <a href="#asImage">asImage</a>().
<h3 class=fn>int <a name="toInt"></a>TQVariant::toInt ( bool&nbsp;*&nbsp;ok = 0 ) const
</h3>
Returns the variant as an int if the variant can be cast to Int;
otherwise returns 0.
<p> If <em>ok</em> is non-null: <em>*ok</em> is set to TRUE if the value could be
converted to an int; otherwise <em>*ok</em> is set to FALSE.
<p> <p>See also <a href="#asInt">asInt</a>() and <a href="#canCast">canCast</a>().
<h3 class=fn>const&nbsp;<a href="ntqkeysequence.html">TQKeySequence</a> <a name="toKeySequence"></a>TQVariant::toKeySequence () const
</h3>
Returns the variant as a <a href="ntqkeysequence.html">TQKeySequence</a> if the variant can be cast
to a KeySequence; otherwise returns an empty key sequence.
<p> <p>See also <a href="#asKeySequence">asKeySequence</a>() and <a href="#canCast">canCast</a>().
<h3 class=fn>const&nbsp;<a href="ntqvaluelist.html">TQValueList</a>&lt;TQVariant&gt; <a name="toList"></a>TQVariant::toList () const
</h3>
Returns the variant as a <a href="ntqvaluelist.html">TQValueList</a><TQVariant> if the variant has
<a href="#type">type</a>() List or StringList; otherwise returns an empty list.
<p> Note that if you want to iterate over the list, you should iterate
over a copy, e.g.
<pre>
<a href="ntqvaluelist.html">TQValueList</a>&lt;TQVariant&gt; list = myVariant.toList();
TQValueList&lt;TQVariant&gt;::Iterator it = list.<a href="ntqvaluelist.html#begin">begin</a>();
while( it != list.<a href="ntqvaluelist.html#end">end</a>() ) {
myProcessing( *it );
++it;
}
</pre>
<p> <p>See also <a href="#asList">asList</a>().
<h3 class=fn>Q_LLONG <a name="toLongLong"></a>TQVariant::toLongLong ( bool&nbsp;*&nbsp;ok = 0 ) const
</h3>
Returns the variant as a long long int if the variant can be cast
to LongLong; otherwise returns 0.
<p> If <em>ok</em> is non-null: <em>*ok</em> is set to TRUE if the value could be
converted to an int; otherwise <em>*ok</em> is set to FALSE.
<p> <p>See also <a href="#asLongLong">asLongLong</a>() and <a href="#canCast">canCast</a>().
<h3 class=fn>const&nbsp;<a href="ntqmap.html">TQMap</a>&lt;TQString,&nbsp;TQVariant&gt; <a name="toMap"></a>TQVariant::toMap () const
</h3>
Returns the variant as a <a href="ntqmap.html">TQMap</a><TQString,TQVariant> if the variant has
<a href="#type">type</a>() Map; otherwise returns an empty map.
<p> Note that if you want to iterate over the map, you should iterate
over a copy, e.g.
<pre>
<a href="ntqmap.html">TQMap</a>&lt;TQString, TQVariant&gt; map = myVariant.toMap();
TQMap&lt;TQString, TQVariant&gt;::Iterator it = map.<a href="ntqmap.html#begin">begin</a>();
while( it != map.<a href="ntqmap.html#end">end</a>() ) {
myProcessing( *it );
++it;
}
</pre>
<p> <p>See also <a href="#asMap">asMap</a>().
<h3 class=fn>const&nbsp;<a href="ntqpalette.html">TQPalette</a> <a name="toPalette"></a>TQVariant::toPalette () const
</h3>
Returns the variant as a <a href="ntqpalette.html">TQPalette</a> if the variant has <a href="#type">type</a>()
Palette; otherwise returns a completely black palette.
<p> <p>See also <a href="#asPalette">asPalette</a>().
<h3 class=fn>const&nbsp;<a href="ntqpen.html">TQPen</a> <a name="toPen"></a>TQVariant::toPen () const
</h3>
Returns the variant as a <a href="ntqpen.html">TQPen</a> if the variant has <a href="#type">type</a>()
Pen; otherwise returns an empty TQPen.
<p> <p>See also <a href="#asPen">asPen</a>().
<h3 class=fn>const&nbsp;<a href="ntqpixmap.html">TQPixmap</a> <a name="toPixmap"></a>TQVariant::toPixmap () const
</h3>
Returns the variant as a <a href="ntqpixmap.html">TQPixmap</a> if the variant has <a href="#type">type</a>() Pixmap;
otherwise returns a null pixmap.
<p> <p>See also <a href="#asPixmap">asPixmap</a>().
<h3 class=fn>const&nbsp;<a href="ntqpoint.html">TQPoint</a> <a name="toPoint"></a>TQVariant::toPoint () const
</h3>
Returns the variant as a <a href="ntqpoint.html">TQPoint</a> if the variant has <a href="#type">type</a>() Point;
otherwise returns a point (0, 0).
<p> <p>See also <a href="#asPoint">asPoint</a>().
<h3 class=fn>const&nbsp;<a href="ntqpointarray.html">TQPointArray</a> <a name="toPointArray"></a>TQVariant::toPointArray () const
</h3>
Returns the variant as a <a href="ntqpointarray.html">TQPointArray</a> if the variant has <a href="#type">type</a>()
PointArray; otherwise returns an empty TQPointArray.
<p> <p>See also <a href="#asPointArray">asPointArray</a>().
<h3 class=fn>const&nbsp;<a href="ntqrect.html">TQRect</a> <a name="toRect"></a>TQVariant::toRect () const
</h3>
Returns the variant as a <a href="ntqrect.html">TQRect</a> if the variant has <a href="#type">type</a>() Rect;
otherwise returns an empty rectangle.
<p> <p>See also <a href="#asRect">asRect</a>().
<h3 class=fn>const&nbsp;<a href="ntqregion.html">TQRegion</a> <a name="toRegion"></a>TQVariant::toRegion () const
</h3>
Returns the variant as a <a href="ntqregion.html">TQRegion</a> if the variant has <a href="#type">type</a>() Region;
otherwise returns an empty TQRegion.
<p> <p>See also <a href="#asRegion">asRegion</a>().
<h3 class=fn>const&nbsp;<a href="ntqsize.html">TQSize</a> <a name="toSize"></a>TQVariant::toSize () const
</h3>
Returns the variant as a <a href="ntqsize.html">TQSize</a> if the variant has <a href="#type">type</a>() Size;
otherwise returns an invalid size.
<p> <p>See also <a href="#asSize">asSize</a>().
<h3 class=fn><a href="ntqsizepolicy.html">TQSizePolicy</a> <a name="toSizePolicy"></a>TQVariant::toSizePolicy () const
</h3>
Returns the variant as a <a href="ntqsizepolicy.html">TQSizePolicy</a> if the variant has <a href="#type">type</a>()
SizePolicy; otherwise returns an undefined (but legal) size
policy.
<h3 class=fn>const&nbsp;<a href="ntqstring.html">TQString</a> <a name="toString"></a>TQVariant::toString () const
</h3>
Returns the variant as a <a href="ntqstring.html">TQString</a> if the variant can be cast to
String, otherwise returns <a href="ntqstring.html#TQString-null">TQString::null</a>.
<p> <p>See also <a href="#asString">asString</a>() and <a href="#canCast">canCast</a>().
<h3 class=fn>const&nbsp;<a href="ntqstringlist.html">TQStringList</a> <a name="toStringList"></a>TQVariant::toStringList () const
</h3>
Returns the variant as a <a href="ntqstringlist.html">TQStringList</a> if the variant has <a href="#type">type</a>()
StringList or List of a type that can be converted to <a href="ntqstring.html">TQString</a>;
otherwise returns an empty list.
<p> Note that if you want to iterate over the list, you should iterate
over a copy, e.g.
<pre>
<a href="ntqstringlist.html">TQStringList</a> list = myVariant.toStringList();
TQStringList::Iterator it = list.<a href="ntqvaluelist.html#begin">begin</a>();
while( it != list.<a href="ntqvaluelist.html#end">end</a>() ) {
myProcessing( *it );
++it;
}
</pre>
<p> <p>See also <a href="#asStringList">asStringList</a>().
<h3 class=fn>const&nbsp;<a href="qtime.html">TQTime</a> <a name="toTime"></a>TQVariant::toTime () const
</h3>
Returns the variant as a <a href="qtime.html">TQTime</a> if the variant can be cast to Time;
otherwise returns an invalid date.
<p> Note that if the <a href="#type">type</a>() is String, CString or ByteArray an invalid
time will be returned if the string cannot be parsed as a
TQt::ISODate format time.
<p> <p>See also <a href="#asTime">asTime</a>().
<h3 class=fn>uint <a name="toUInt"></a>TQVariant::toUInt ( bool&nbsp;*&nbsp;ok = 0 ) const
</h3>
Returns the variant as an unsigned int if the variant can be cast
to UInt; otherwise returns 0.
<p> If <em>ok</em> is non-null: <em>*ok</em> is set to TRUE if the value could be
converted to an unsigned int; otherwise <em>*ok</em> is set to FALSE.
<p> <p>See also <a href="#asUInt">asUInt</a>() and <a href="#canCast">canCast</a>().
<h3 class=fn>Q_ULLONG <a name="toULongLong"></a>TQVariant::toULongLong ( bool&nbsp;*&nbsp;ok = 0 ) const
</h3>
Returns the variant as as an unsigned long long int if the variant
can be cast to ULongLong; otherwise returns 0.
<p> If <em>ok</em> is non-null: <em>*ok</em> is set to TRUE if the value could be
converted to an int; otherwise <em>*ok</em> is set to FALSE.
<p> <p>See also <a href="#asULongLong">asULongLong</a>() and <a href="#canCast">canCast</a>().
<h3 class=fn><a href="ntqvariant.html#Type-enum">Type</a> <a name="type"></a>TQVariant::type () const
</h3>
<p> Returns the storage type of the value stored in the variant.
Usually it's best to test with <a href="#canCast">canCast</a>() whether the variant can
deliver the data type you are interested in.
<h3 class=fn>const char * <a name="typeName"></a>TQVariant::typeName () const
</h3>
Returns the name of the type stored in the variant. The returned
strings describe the C++ datatype used to store the data: for
example, "TQFont", "TQString", or "TQValueList<TQVariant>". An Invalid
variant returns 0.
<h3 class=fn>const char * <a name="typeToName"></a>TQVariant::typeToName ( <a href="ntqvariant.html#Type-enum">Type</a>&nbsp;typ )<tt> [static]</tt>
</h3>
Converts the enum representation of the storage type, <em>typ</em>, to
its string representation.
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt toolkit</a>.
Copyright &copy; 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>