Acts like a union for the most common Qt data types. More...
#include <qvariant.h>
Inherits QShared.
Unfortunately one can not use C++ unions with classes that have constructors and destructors since the compiler and the runtime library could not determine which destructor to call.
To come around this QVariant can store the most common Qt and C++ data types. Like every union it can hold one value of a certain type at a time.
Invalid
- invalid
String
- a QString
StringList
- a QStringList
IntList
- a QValueListDoubleList
- a QValueListFont
- a QFont
Pixmap
- a QPixmap
Brush
- a QBrush
Rect
- a QRect
Size
- a QSize
Color
- a QColor
Palette
- a QPalette
ColorGroup
- a QColorGroup
IconSet
- a QIconSet
Point
- a QPoint
Image
- a QImage
Int
- an int
Bool
- a bool
Double
- a doublea
CString
- a QCString
Creates an invalid variant.
Reads the variant from the data stream.
Creates a new variant with a boolean value.
Creates a new variant with a brush value.
Creates a new variant with a color value.
Creates a new variant with a color group value.
Creates a new variant with a c-string value.
Creates a new variant with a font value.
Creates a new variant with an empty iconset.
Creates a new variant with an image value.
Creates a new variant with a color palette value.
Creates a new variant with a pixmap value.
Creates a new variant with a point value.
Creates a new variant with a rect value.
Creates a new variant with a size value.
Creates a new variant with a string value.
Creates a new variant with a string list value.
Creates a new variant with a floating point list value.
Creates a new variant with a integer list value.
Constructs a deep copy of the variant passed as argument to this constructor.
Creates a new variant with a c-string value.
Creates a new variant with a floating point value.
Creates a new variant with an integer value.
[virtual]
Destroys the QVariant and the contained object.
Note that subclasses that re-implement clear() should reimplement the destructor to call clear(). This constructor calls clear(), but since it is the destructor, QVariant::clear() is called rather than any subclass.
[virtual protected]
De-allocate, based on the type, producing an Invalid variant.
Returns TRUE if the storage type of this variant is QVariant::Invalid.
[virtual]
Internal function for loading a variant. Use the stream operators instead.
[static]
Converts the string representation of the storage type to its enum representation.
Assigns the value of one variant to another. This creates a deep copy.
[virtual]
Internal function for saving a variant. Use the stream operators instead.
Changes the value of this variant. The previous value is dropped.
Changes the value of this variant. The previous value is dropped.
Changes the value of this variant. The previous value is dropped.
Changes the value of this variant. The previous value is dropped.
Changes the value of this variant. The previous value is dropped.
Changes the value of this variant. The previous value is dropped.
Changes the value of this variant. The previous value is dropped.
Changes the value of this variant. The previous value is dropped.
Changes the value of this variant. The previous value is dropped.
Changes the value of this variant. The previous value is dropped.
Changes the value of this variant. The previous value is dropped.
Changes the value of this variant. The previous value is dropped.
Changes the value of this variant. The previous value is dropped.
Changes the value of this variant. The previous value is dropped.
Changes the value of this variant. The previous value is dropped. This function creates a copy of the list. This is very fast since QStringList is implicit shared.
Changes the value of this variant. The previous value is dropped. This function creates a copy of the list. This is very fast since QStringList is implicit shared.
Changes the value of this variant. The previous value is dropped. This function creates a copy of the list. This is very fast since QStringList is implicit shared.
Changes the value of this variant. The previous value is dropped. The Variant creates a copy of the passed string.
Changes the value of this variant. The previous value is dropped.
Changes the value of this variant. The previous value is dropped.
Returns the stoarge type of the value stored in the variant currently.
[virtual]
Returns the type stored in the variant currently in ASCII format.
The returned strings describe the C++ datatype used to store the
data, for example "QFont", "QString" or "QValueList Converts the enum representation of the storage type to its
string representation.
Search the documentation, FAQ, qt-interest archive and more (uses
www.troll.no):
This file is part of the Qt toolkit,
copyright © 1995-99
Troll Tech, all rights reserved.const char* QVariant::typeToName ( Type typ )
[static]
Copyright İ 1999 Troll Tech Trademarks