Qt 4.8
|
The QVariant class acts like a union for the most common Qt data types. More...
#include <qvariant.h>
Public Types | |
typedef Private | DataPtr |
enum | Type { Invalid = 0, Bool = 1, Int = 2, UInt = 3, LongLong = 4, ULongLong = 5, Double = 6, Char = 7, Map = 8, List = 9, String = 10, StringList = 11, ByteArray = 12, BitArray = 13, Date = 14, Time = 15, DateTime = 16, Url = 17, Locale = 18, Rect = 19, RectF = 20, Size = 21, SizeF = 22, Line = 23, LineF = 24, Point = 25, PointF = 26, RegExp = 27, Hash = 28, EasingCurve = 29, LastCoreType = EasingCurve, Font = 64, Pixmap = 65, Brush = 66, Color = 67, Palette = 68, Icon = 69, Image = 70, Polygon = 71, Region = 72, Bitmap = 73, Cursor = 74, SizePolicy = 75, KeySequence = 76, Pen = 77, TextLength = 78, TextFormat = 79, Matrix = 80, Transform = 81, Matrix4x4 = 82, Vector2D = 83, Vector3D = 84, Vector4D = 85, Quaternion = 86, LastGuiType = Quaternion, UserType = 127, LastType = 0xffffffff } |
This enum type defines the types of variable that a QVariant can contain. More... | |
Public Functions | |
bool | canConvert (Type t) const |
Returns true if the variant's type can be cast to the requested type, t. More... | |
template<typename T > | |
bool | canConvert () const |
Returns true if the variant can be converted to the template type T , otherwise false. More... | |
void | clear () |
Convert this variant to type Invalid and free up any resources used. More... | |
const void * | constData () const |
bool | convert (Type t) |
Casts the variant to the requested type, t. More... | |
void * | data () |
const void * | data () const |
DataPtr & | data_ptr () |
void | detach () |
bool | isDetached () const |
bool | isNull () const |
Returns true if this is a NULL variant, false otherwise. More... | |
bool | isValid () const |
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false. More... | |
void | load (QDataStream &ds) |
Internal function for loading a variant from stream s. More... | |
bool | operator!= (const QVariant &v) const |
Compares this QVariant with v and returns true if they are not equal; otherwise returns false. More... | |
QVariant & | operator= (const QVariant &other) |
Assigns the value of the variant variant to this variant. More... | |
bool | operator== (const QVariant &v) const |
Compares this QVariant with v and returns true if they are equal; otherwise returns false. More... | |
QVariant () | |
Constructs an invalid variant. More... | |
QVariant (Type type) | |
Constructs a null variant of type type. More... | |
QVariant (int typeOrUserType, const void *copy) | |
Constructs variant of type typeOrUserType, and initializes with copy if copy is not 0. More... | |
QVariant (int typeOrUserType, const void *copy, uint flags) | |
QVariant (const QVariant &other) | |
Constructs a copy of the variant, p, passed as the argument to this constructor. More... | |
QVariant (QDataStream &s) | |
Reads the variant from the data stream, s. More... | |
QVariant (int i) | |
Constructs a new variant with an integer value, val. More... | |
QVariant (uint ui) | |
Constructs a new variant with an unsigned integer value, val. More... | |
QVariant (qlonglong ll) | |
Constructs a new variant with a long long integer value, val. More... | |
QVariant (qulonglong ull) | |
Constructs a new variant with an unsigned long long integer value, val. More... | |
QVariant (bool b) | |
Constructs a new variant with a boolean value, val. More... | |
QVariant (double d) | |
Constructs a new variant with a floating point value, val. More... | |
QVariant (float f) | |
Constructs a new variant with a floating point value, val. More... | |
QT_ASCII_CAST_WARN_CONSTRUCTOR | QVariant (const char *str) |
Constructs a new variant with a string value of val. More... | |
QVariant (const QByteArray &bytearray) | |
Constructs a new variant with a bytearray value, val. More... | |
QVariant (const QBitArray &bitarray) | |
Constructs a new variant with a bitarray value, val. More... | |
QVariant (const QString &string) | |
Constructs a new variant with a string value, val. More... | |
QVariant (const QLatin1String &string) | |
Constructs a new variant with a string value, val. More... | |
QVariant (const QStringList &stringlist) | |
Constructs a new variant with a string list value, val. More... | |
QVariant (const QChar &qchar) | |
Constructs a new variant with a char value, c. More... | |
QVariant (const QDate &date) | |
Constructs a new variant with a date value, val. More... | |
QVariant (const QTime &time) | |
Constructs a new variant with a time value, val. More... | |
QVariant (const QDateTime &datetime) | |
Constructs a new variant with a date/time value, val. More... | |
QVariant (const QList< QVariant > &list) | |
Constructs a new variant with a list value, val. More... | |
QVariant (const QMap< QString, QVariant > &map) | |
Constructs a new variant with a map of QVariants, val. More... | |
QVariant (const QHash< QString, QVariant > &hash) | |
Constructs a new variant with a hash of QVariants, val. More... | |
QVariant (const QSize &size) | |
Constructs a new variant with a size value of val. More... | |
QVariant (const QSizeF &size) | |
Constructs a new variant with a size value of val. More... | |
QVariant (const QPoint &pt) | |
Constructs a new variant with a point value of val. More... | |
QVariant (const QPointF &pt) | |
Constructs a new variant with a point value of val. More... | |
QVariant (const QLine &line) | |
Constructs a new variant with a line value of val. More... | |
QVariant (const QLineF &line) | |
Constructs a new variant with a line value of val. More... | |
QVariant (const QRect &rect) | |
Constructs a new variant with a rect value of val. More... | |
QVariant (const QRectF &rect) | |
Constructs a new variant with a rect value of val. More... | |
QVariant (const QUrl &url) | |
Constructs a new variant with a url value of val. More... | |
QVariant (const QLocale &locale) | |
Constructs a new variant with a locale value, l. More... | |
QVariant (const QRegExp ®Exp) | |
Constructs a new variant with the regexp value regExp. More... | |
QVariant (const QEasingCurve &easing) | |
Constructs a new variant with an easing curve value, val. More... | |
QVariant (Qt::GlobalColor color) | |
Constructs a new variant of type QVariant::Color and initializes it with color. More... | |
void | save (QDataStream &ds) const |
Internal function for saving a variant to the stream s. More... | |
template<typename T > | |
void | setValue (const T &value) |
Stores a copy of value. More... | |
void | swap (QVariant &other) |
Swaps variant other with this variant. More... | |
QBitArray | toBitArray () const |
Returns the variant as a QBitArray if the variant has type() BitArray ; otherwise returns an empty bit array. More... | |
bool | toBool () const |
Returns the variant as a bool if the variant has type() Bool. More... | |
QByteArray | toByteArray () const |
Returns the variant as a QByteArray if the variant has type() ByteArray or String (converted using QString::fromAscii()); otherwise returns an empty byte array. More... | |
QChar | toChar () const |
Returns the variant as a QChar if the variant has type() Char , Int , or UInt ; otherwise returns an invalid QChar. More... | |
QDate | toDate () const |
Returns the variant as a QDate if the variant has type() Date , DateTime , or String ; otherwise returns an invalid date. More... | |
QDateTime | toDateTime () const |
Returns the variant as a QDateTime if the variant has type() DateTime , Date , or String ; otherwise returns an invalid date/time. More... | |
double | toDouble (bool *ok=0) const |
Returns the variant as a double if the variant has type() Double , QMetaType::Float , Bool , ByteArray , Int , LongLong , String , UInt , or ULongLong ; otherwise returns 0.0. More... | |
QEasingCurve | toEasingCurve () const |
Returns the variant as a QEasingCurve if the variant has type() EasingCurve ; otherwise returns a default easing curve. More... | |
float | toFloat (bool *ok=0) const |
Returns the variant as a float if the variant has type() Double , QMetaType::Float , Bool , ByteArray , Int , LongLong , String , UInt , or ULongLong ; otherwise returns 0.0. More... | |
QHash< QString, QVariant > | toHash () const |
Returns the variant as a QHash<QString, QVariant> if the variant has type() Hash ; otherwise returns an empty map. More... | |
int | toInt (bool *ok=0) const |
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char , Double , LongLong , String , UInt , or ULongLong ; otherwise returns 0. More... | |
QLine | toLine () const |
Returns the variant as a QLine if the variant has type() Line ; otherwise returns an invalid QLine. More... | |
QLineF | toLineF () const |
Returns the variant as a QLineF if the variant has type() LineF ; otherwise returns an invalid QLineF. More... | |
QList< QVariant > | toList () const |
Returns the variant as a QVariantList if the variant has type() List or StringList ; otherwise returns an empty list. More... | |
QLocale | toLocale () const |
Returns the variant as a QLocale if the variant has type() Locale ; otherwise returns an invalid QLocale. More... | |
qlonglong | toLongLong (bool *ok=0) const |
Returns the variant as a long long int if the variant has type() LongLong , Bool , ByteArray , Char , Double , Int , String , UInt , or ULongLong ; otherwise returns 0. More... | |
QMap< QString, QVariant > | toMap () const |
Returns the variant as a QMap<QString, QVariant> if the variant has type() Map ; otherwise returns an empty map. More... | |
QPoint | toPoint () const |
Returns the variant as a QPoint if the variant has type() Point or PointF ; otherwise returns a null QPoint. More... | |
QPointF | toPointF () const |
Returns the variant as a QPointF if the variant has type() Point or PointF ; otherwise returns a null QPointF. More... | |
qreal | toReal (bool *ok=0) const |
Returns the variant as a qreal if the variant has type() Double , QMetaType::Float , Bool , ByteArray , Int , LongLong , String , UInt , or ULongLong ; otherwise returns 0.0. More... | |
QRect | toRect () const |
Returns the variant as a QRect if the variant has type() Rect ; otherwise returns an invalid QRect. More... | |
QRectF | toRectF () const |
Returns the variant as a QRectF if the variant has type() Rect or RectF ; otherwise returns an invalid QRectF. More... | |
QRegExp | toRegExp () const |
Returns the variant as a QRegExp if the variant has type() RegExp ; otherwise returns an empty QRegExp. More... | |
QSize | toSize () const |
Returns the variant as a QSize if the variant has type() Size ; otherwise returns an invalid QSize. More... | |
QSizeF | toSizeF () const |
Returns the variant as a QSizeF if the variant has type() SizeF ; otherwise returns an invalid QSizeF. More... | |
QString | toString () const |
Returns the variant as a QString if the variant has type() String , Bool , ByteArray , Char , Date , DateTime , Double , Int , LongLong , StringList , Time , UInt , or ULongLong ; otherwise returns an empty string. More... | |
QStringList | toStringList () const |
Returns the variant as a QStringList if the variant has type() StringList, String , or List of a type that can be converted to QString; otherwise returns an empty list. More... | |
QTime | toTime () const |
Returns the variant as a QTime if the variant has type() Time , DateTime , or String ; otherwise returns an invalid time. More... | |
uint | toUInt (bool *ok=0) const |
Returns the variant as an unsigned int if the variant has type() UInt , Bool , ByteArray , Char , Double , Int , LongLong , String , or ULongLong ; otherwise returns 0. More... | |
qulonglong | toULongLong (bool *ok=0) const |
Returns the variant as as an unsigned long long int if the variant has type() ULongLong , Bool , ByteArray , Char , Double , Int , LongLong , String , or UInt ; otherwise returns 0. More... | |
QUrl | toUrl () const |
Returns the variant as a QUrl if the variant has type() Url ; otherwise returns an invalid QUrl. More... | |
Type | type () const |
Returns the storage type of the value stored in the variant. More... | |
const char * | typeName () const |
Returns the name of the type stored in the variant. More... | |
int | userType () const |
Returns the storage type of the value stored in the variant. More... | |
template<typename T > | |
T | value () const |
Returns the stored value converted to the template type T . More... | |
~QVariant () | |
Destroys the QVariant and the contained object. More... | |
Static Public Functions | |
template<typename T > | |
static QVariant | fromValue (const T &value) |
Returns a QVariant containing a copy of value. More... | |
static Type | nameToType (const char *name) |
Converts the string representation of the storage type given in name, to its enum representation. More... | |
static const char * | typeToName (Type type) |
Converts the enum representation of the storage type, typ, to its string representation. More... | |
Protected Functions | |
bool | cmp (const QVariant &other) const |
void | create (int type, const void *copy) |
Protected Variables | |
Private | d |
Static Protected Variables | |
static const Handler * | handler = &qt_kernel_variant_handler |
Private Functions | |
QVariant (void *) | |
QVariant (bool, int) | |
Use the QVariant(bool) constructor instead. More... | |
Friends | |
Q_CORE_EXPORT QDebug | operator<< (QDebug, const QVariant &) |
bool | operator== (const QVariant &, const QVariantComparisonHelper &) |
int | qRegisterGuiVariant () |
int | qUnregisterGuiVariant () |
bool | qvariant_cast_helper (const QVariant &, QVariant::Type, void *) |
Related Functions | |
(Note that these are not member functions.) | |
bool | operator!= (const QVariant &v1, const QVariant &v2) |
Returns false if v1 and v2 are equal; otherwise returns true. More... | |
bool | operator== (const QVariant &v1, const QVariant &v2) |
Returns true if v1 and v2 are equal; otherwise returns false. More... | |
T | qvariant_cast (const QVariant &value) |
Returns the given value converted to the template type T . More... | |
bool | qVariantCanConvert (const QVariant &value) |
Returns true if the given value can be converted to the template type specified; otherwise returns false. More... | |
QVariant | qVariantFromValue (const T &value) |
Returns a variant containing a copy of the given value with template type T . More... | |
QVariantHash | |
Synonym for QHash<QString, QVariant>. More... | |
QVariantList | |
Synonym for QList<QVariant>. More... | |
QVariantMap | |
Synonym for QMap<QString, QVariant>. More... | |
void | qVariantSetValue (QVariant &variant, const T &value) |
Sets the contents of the given variant to a copy of the value with the specified template type T . More... | |
T | qVariantValue (const QVariant &value) |
Returns the given value converted to the template type T . More... | |
The QVariant class acts like a union for the most common Qt data types.
Because C++ forbids unions from including types that have non-default constructors or destructors, most interesting Qt classes cannot be used in unions. Without QVariant, this would be a problem for QObject::property() and for database work, etc.
A QVariant object holds a single value of a single type() 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 convert(), get its value using one of the toT() functions (e.g., toSize()) and check whether the type can be converted to a particular type using canConvert().
The methods named toT() (e.g., toInt(), toString()) 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.
Here is some example code to demonstrate the use of QVariant:
You can even store QList<QVariant> and QMap<QString, QVariant> values 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.
QVariant also supports the notion of null values, where you can have a defined type with no value set. However, note that QVariant types can only be cast when they have had a value set.
QVariant can be extended to support other types than those mentioned in the Type enum. See the QMetaType documentation for details.
Because QVariant is part of the QtCore library, it cannot provide conversion functions to data types defined in QtGui, such as QColor, QImage, and QPixmap. In other words, there is no toColor()
function. Instead, you can use the QVariant::value() or the qvariant_cast() template function. For example:
The inverse conversion (e.g., from QColor to QVariant) is automatic for all data types supported by QVariant, including GUI-related types:
()-and-convert()-Consecutively
When using canConvert() and convert() consecutively, it is possible for canConvert() to return true, but convert() to return false. This is typically because canConvert() only reports the general ability of QVariant to convert between types given suitable data; it is still possible to supply data which cannot actually be converted.
For example, canConvert() would return true when called on a variant containing a string because, in principle, QVariant is able to convert strings of numbers to integers. However, if the string contains non-numeric characters, it cannot be converted to an integer, and any attempt to convert it will fail. Hence, it is important to have both functions return true for a successful conversion.
Definition at line 92 of file qvariant.h.
Definition at line 439 of file qvariant.h.
enum QVariant::Type |
This enum type defines the types of variable that a QVariant can contain.
Definition at line 95 of file qvariant.h.
|
inline |
QVariant::~QVariant | ( | ) |
Destroys the QVariant and the contained object.
Note that subclasses that reimplement clear() should reimplement the destructor to call clear(). This destructor calls clear(), but because it is the destructor, QVariant::clear() is called rather than a subclass's clear().
Definition at line 1427 of file qvariant.cpp.
QVariant::QVariant | ( | Type | type | ) |
Constructs a null variant of type type.
Definition at line 1788 of file qvariant.cpp.
QVariant::QVariant | ( | int | typeOrUserType, |
const void * | copy | ||
) |
Constructs variant of type typeOrUserType, and initializes with copy if copy is not 0.
Note that you have to pass the address of the variable you want stored.
Usually, you never have to use this constructor, use QVariant::fromValue() instead to construct variants from the pointer types represented by QMetaType::VoidStar
, QMetaType::QObjectStar
and QMetaType::QWidgetStar
.
Definition at line 1790 of file qvariant.cpp.
QVariant::QVariant | ( | int | typeOrUserType, |
const void * | copy, | ||
uint | flags | ||
) |
Definition at line 1796 of file qvariant.cpp.
QVariant::QVariant | ( | const QVariant & | other | ) |
Constructs a copy of the variant, p, passed as the argument to this constructor.
Definition at line 1443 of file qvariant.cpp.
QVariant::QVariant | ( | QDataStream & | s | ) |
Reads the variant from the data stream, s.
Definition at line 1458 of file qvariant.cpp.
QVariant::QVariant | ( | int | i | ) |
Constructs a new variant with an integer value, val.
Definition at line 1808 of file qvariant.cpp.
QVariant::QVariant | ( | uint | ui | ) |
Constructs a new variant with an unsigned integer value, val.
Definition at line 1810 of file qvariant.cpp.
QVariant::QVariant | ( | qlonglong | ll | ) |
Constructs a new variant with a long long integer value, val.
Definition at line 1812 of file qvariant.cpp.
QVariant::QVariant | ( | qulonglong | ull | ) |
Constructs a new variant with an unsigned long long integer value, val.
Definition at line 1814 of file qvariant.cpp.
QVariant::QVariant | ( | bool | b | ) |
Constructs a new variant with a boolean value, val.
Definition at line 1816 of file qvariant.cpp.
QVariant::QVariant | ( | double | d | ) |
Constructs a new variant with a floating point value, val.
Definition at line 1818 of file qvariant.cpp.
|
inline |
Constructs a new variant with a floating point value, val.
Definition at line 184 of file qvariant.h.
QVariant::QVariant | ( | const char * | val | ) |
Constructs a new variant with a string value of val.
The variant creates a deep copy of val, using the encoding set by QTextCodec::setCodecForCStrings().
Note that val is converted to a QString for storing in the variant and QVariant::type() will return QMetaType::QString for the variant.
You can disable this operator by defining QT_NO_CAST_FROM_ASCII
when you compile your applications.
Definition at line 1501 of file qvariant.cpp.
QVariant::QVariant | ( | const QByteArray & | bytearray | ) |
Constructs a new variant with a bytearray value, val.
Definition at line 1821 of file qvariant.cpp.
QVariant::QVariant | ( | const QBitArray & | bitarray | ) |
Constructs a new variant with a bitarray value, val.
Definition at line 1823 of file qvariant.cpp.
QVariant::QVariant | ( | const QString & | string | ) |
Constructs a new variant with a string value, val.
Definition at line 1825 of file qvariant.cpp.
QVariant::QVariant | ( | const QLatin1String & | string | ) |
Constructs a new variant with a string value, val.
Definition at line 1829 of file qvariant.cpp.
QVariant::QVariant | ( | const QStringList & | stringlist | ) |
Constructs a new variant with a string list value, val.
Definition at line 1831 of file qvariant.cpp.
QVariant::QVariant | ( | const QChar & | qchar | ) |
Constructs a new variant with a char value, c.
Definition at line 1827 of file qvariant.cpp.
QVariant::QVariant | ( | const QDate & | date | ) |
Constructs a new variant with a date value, val.
Definition at line 1834 of file qvariant.cpp.
QVariant::QVariant | ( | const QTime & | time | ) |
Constructs a new variant with a time value, val.
Definition at line 1836 of file qvariant.cpp.
QVariant::QVariant | ( | const QDateTime & | datetime | ) |
Constructs a new variant with a date/time value, val.
Definition at line 1838 of file qvariant.cpp.
Constructs a new variant with a list value, val.
Definition at line 1844 of file qvariant.cpp.
Constructs a new variant with a map of QVariants, val.
Definition at line 1846 of file qvariant.cpp.
Constructs a new variant with a hash of QVariants, val.
Definition at line 1848 of file qvariant.cpp.
QVariant::QVariant | ( | const QSize & | size | ) |
Constructs a new variant with a size value of val.
Definition at line 1857 of file qvariant.cpp.
QVariant::QVariant | ( | const QSizeF & | size | ) |
Constructs a new variant with a size value of val.
Definition at line 1858 of file qvariant.cpp.
QVariant::QVariant | ( | const QPoint & | pt | ) |
Constructs a new variant with a point value of val.
Definition at line 1851 of file qvariant.cpp.
QVariant::QVariant | ( | const QPointF & | pt | ) |
Constructs a new variant with a point value of val.
Definition at line 1852 of file qvariant.cpp.
QVariant::QVariant | ( | const QLine & | line | ) |
Constructs a new variant with a line value of val.
Definition at line 1855 of file qvariant.cpp.
QVariant::QVariant | ( | const QLineF & | line | ) |
Constructs a new variant with a line value of val.
Definition at line 1854 of file qvariant.cpp.
QVariant::QVariant | ( | const QRect & | rect | ) |
Constructs a new variant with a rect value of val.
Definition at line 1856 of file qvariant.cpp.
QVariant::QVariant | ( | const QRectF & | rect | ) |
Constructs a new variant with a rect value of val.
Definition at line 1853 of file qvariant.cpp.
QVariant::QVariant | ( | const QUrl & | url | ) |
Constructs a new variant with a url value of val.
Definition at line 1861 of file qvariant.cpp.
QVariant::QVariant | ( | const QLocale & | locale | ) |
Constructs a new variant with a locale value, l.
Definition at line 1863 of file qvariant.cpp.
QVariant::QVariant | ( | const QRegExp & | regExp | ) |
Constructs a new variant with the regexp value regExp.
Definition at line 1865 of file qvariant.cpp.
QVariant::QVariant | ( | const QEasingCurve & | val | ) |
Constructs a new variant with an easing curve value, val.
Definition at line 1841 of file qvariant.cpp.
QVariant::QVariant | ( | Qt::GlobalColor | color | ) |
Constructs a new variant of type QVariant::Color and initializes it with color.
This is a convenience constructor that allows QVariant(Qt::blue);
to create a valid QVariant storing a QColor.
Note: This constructor will assert if the application does not link to the Qt GUI library.
Definition at line 1867 of file qvariant.cpp.
|
inlineprivate |
Definition at line 429 of file qvariant.h.
|
inlineprivate |
bool QVariant::canConvert | ( | Type | t | ) | const |
Returns true if the variant's type can be cast to the requested type, t.
Such casting is done automatically when calling the toInt(), toBool(), ... methods.
The following casts are done automatically:
Type | Automatically Cast To |
Bool | Char , Double , Int , LongLong , String , UInt , ULongLong |
ByteArray | Double , Int , LongLong , String , UInt , ULongLong |
Char | Bool , Int , UInt , LongLong , ULongLong |
Color | String |
Date | DateTime , String |
DateTime | Date , String , Time |
Double | Bool , Int , LongLong , String , UInt , ULongLong |
Font | String |
Int | Bool , Char , Double , LongLong , String , UInt , ULongLong |
KeySequence | Int , String |
List | StringList (if the list's items can be converted to strings) |
LongLong | Bool , ByteArray , Char , Double , Int , String , UInt , ULongLong |
Point | PointF |
Rect | RectF |
String | Bool , ByteArray , Char , Color , Date , DateTime , Double , Font , Int , KeySequence , LongLong , StringList , Time , UInt , ULongLong |
StringList | List , String (if the list contains exactly one item) |
Time | String |
UInt | Bool , Char , Double , Int , LongLong , String , ULongLong |
ULongLong | Bool , Char , Double , Int , LongLong , String , UInt |
Definition at line 2886 of file qvariant.cpp.
Referenced by QOCIResultPrivate::bindValue(), QScript::callQtMethod(), cmp(), convert(), QItemDelegate::drawBackground(), QOCICols::execBatch(), QHeaderViewPrivate::flipSortIndicator(), QComboMenuDelegate::getStyleOption(), QAbstractItemDelegate::helpEvent(), QStyledItemDelegate::initStyleOption(), QScriptEnginePrivate::jscValueToVariant(), operator>>(), QHeaderView::paintEvent(), QHeaderView::paintSection(), QDeclarativeObjectMethodScriptClass::property(), QVariantToVARIANT(), QHeaderView::sectionSizeFromContents(), QDeclarativeListAccessor::setList(), QItemDelegate::setOptions(), QVideoSurfaceFormat::setProperty(), QTest::toString(), QScript::variantFromValue(), QScript::variantProtoFuncToString(), VARIANTToQVariant(), and variantToString().
|
inline |
Returns true if the variant can be converted to the template type T
, otherwise false.
Example:
Definition at line 340 of file qvariant.h.
void QVariant::clear | ( | ) |
Convert this variant to type Invalid and free up any resources used.
Definition at line 1993 of file qvariant.cpp.
Referenced by QAbstractSpinBoxPrivate::clearCache(), convert(), load(), operator=(), QDBusAbstractInterfacePrivate::property(), and QDateTimeEditPrivate::validateAndInterpret().
|
protected |
Definition at line 3046 of file qvariant.cpp.
Referenced by isDetached().
const void * QVariant::constData | ( | ) | const |
Definition at line 3065 of file qvariant.cpp.
Referenced by QDBusMarshaller::appendRegisteredType(), QDBusMarshaller::appendVariantInternal(), QDeclarativeListAccessor::at(), QOCIResultPrivate::bindValue(), QScript::callQtMethod(), QDeclarativeContextPrivate::context_at(), QDeclarativeContextPrivate::context_count(), QDeclarativeListAccessor::count(), QDBusArgumentPrivate::createSignature(), data(), QDBusConnectionPrivate::deliverCall(), detach(), QDB2Result::exec(), QSQLiteResult::exec(), QSymSQLResult::exec(), QODBCResult::exec(), QVariantAnimation::interpolated(), QAxServerBase::Invoke(), QAxEventSink::Invoke(), load(), operator=(), QOCIResultPrivate::outValues(), QAxBase::querySubObject(), QVariant(), qvariant_cast(), QVariantToVoidStar(), save(), QDeclarativeEnginePrivate::scriptValueFromVariant(), QDeclarativeAnimationPropertyUpdater::setValue(), QDeclarativeMetaType::toQObject(), QScriptEnginePrivate::toQObject(), QDeclarativeEnginePrivate::toQObject(), QPropertyAnimationPrivate::updateProperty(), QMYSQLResult::virtual_hook(), QDeclarativePropertyPrivate::write(), QMetaProperty::write(), and QDeclarativePropertyPrivate::writeEnumProperty().
bool QVariant::convert | ( | Type | t | ) |
Casts the variant to the requested type, t.
If the cast cannot be done, the variant is cleared. Returns true if the current type of the variant was successfully cast; otherwise returns false.
Definition at line 2959 of file qvariant.cpp.
Referenced by QScript::callQtMethod(), cmp(), QVariantAnimationPrivate::convertValues(), QDeclarativePropertyAnimationPrivate::convertVariant(), data(), QIBaseResult::gotoNext(), QScriptEnginePrivate::jscValueToVariant(), parseColorValue(), QCss::Parser::parseTerm(), QDeclarativeObjectMethodScriptClass::property(), QVariantToVARIANT(), QMimeDataPrivate::retrieveTypedData(), setFontSizeFromValue(), QScript::variantFromValue(), VARIANTToQVariant(), QDeclarativePropertyPrivate::write(), QMetaProperty::write(), and QDeclarativePropertyPrivate::writeEnumProperty().
|
protected |
Constructs a variant private of type type, and initializes with copy if copy is not 0.
Definition at line 1407 of file qvariant.cpp.
Referenced by convert(), data(), load(), and QVariant().
void * QVariant::data | ( | ) |
Definition at line 3077 of file qvariant.cpp.
Referenced by QScript::callQtMethod(), convert(), QScriptEnginePrivate::convertValue(), QDBusConnectionPrivate::deliverCall(), QMimeDataPrivate::getData(), QAxEventSink::Invoke(), QScriptEnginePrivate::jscValueFromVariant(), QScriptEnginePrivate::jscValueToVariant(), QMetaObject::newInstance(), QAxEventSink::OnChanged(), QDBusAbstractInterfacePrivate::property(), qDBusReplyFill(), QMetaProperty::read(), QDirModelPrivate::restorePersistentIndexes(), QSqlTableModelPrivate::setRecord(), QScript::variantFromValue(), QMetaProperty::write(), QDeclarativePropertyPrivate::writeEnumProperty(), and writeProperty().
|
inline |
Definition at line 326 of file qvariant.h.
|
inline |
Definition at line 440 of file qvariant.h.
Referenced by qVariantSetValue().
void QVariant::detach | ( | ) |
Definition at line 1958 of file qvariant.cpp.
Referenced by data().
|
inlinestatic |
Returns a QVariant containing a copy of value.
Behaves exactly like setValue() otherwise.
Example:
Definition at line 336 of file qvariant.h.
Referenced by QDBusConnectionPrivate::activateCall(), QNetworkManagerInterface::activateConnection(), QDeclarativeListAccessor::at(), QXmlQuery::bindVariable(), QScript::ClassObjectDelegate::call(), QConnmanManagerInterface::connectService(), QScript::ClassObjectDelegate::construct(), QDeclarativeContext::contextProperty(), NamedNodeMap::create(), NodeList::create(), Node::create(), QNetworkAccessManager::createRequest(), QLocale::createSeparatedList(), QDeclarativeEnginePrivate::darker(), QNetworkManagerInterface::deactivateConnection(), QDeclarativeEngineDebugPrivate::decode(), QConnmanManagerInterface::disableTechnology(), QNetworkSessionPrivateImpl::do_open(), QConnmanManagerInterface::enableTechnology(), QBBInputContext::eventFilter(), QScriptDebuggerCommandExecutor::execute(), QDeclarativeEnginePrivate::formatDate(), QDeclarativeEnginePrivate::formatDateTime(), QDeclarativeEnginePrivate::formatTime(), QDeclarativeCustomParserNodePrivate::fromProperty(), QSQLiteResult::handle(), QSQLite2Result::handle(), QPSQLResult::handle(), QMYSQLResult::handle(), QOCIResult::handle(), QSQLiteDriver::handle(), QOCIDriver::handle(), QSQLite2Driver::handle(), QMYSQLDriver::handle(), QPSQLDriver::handle(), QScript::ClassObjectDelegate::hasInstance(), QDeclarativeEnginePrivate::hsla(), QHttpNetworkConnectionChannel::init(), QDeclarativeVisualDataModelPartsMetaObject::initialValue(), NestedListModel::insert(), QAccessibleAbstractSpinBox::invokeMethodEx(), QAccessibleWidgetEx::invokeMethodEx(), QAccessibleAbstractSlider::invokeMethodEx(), QAccessibleTextEdit::invokeMethodEx(), QAccessibleLineEdit::invokeMethodEx(), QOCIResult::lastInsertId(), QDeclarativeEnginePrivate::lighter(), Document::load(), QConnmanManagerInterface::lookupService(), messageToScriptValue(), QDeclarativeVisualDataModel::modelIndex(), operator<<(), QDeclarativeVisualDataModel::parentModelIndex(), parseCookieHeader(), parseHeaderValue(), QTipLabel::placeTip(), QDeclarativeEnginePrivate::point(), QVideoSurfaceFormat::property(), qDBusPropertyGet(), qDBusPropertyGetAll(), qmlsqldatabase_change_version(), qmlsqldatabase_executeSql(), qmlsqldatabase_open_sync(), qmlsqldatabase_transaction_shared(), QLocale::quoteString(), QDeclarativePropertyPrivate::readValueProperty(), QDeclarativeVMEMetaObject::readVarPropertyAsVariant(), QDeclarativeEnginePrivate::rect(), QConnmanManagerInterface::registerCounter(), QConnmanManagerInterface::requestScan(), QConnmanManagerInterface::requestSession(), QDeclarativeEnginePrivate::rgba(), QDeclarativeWorkerScriptEnginePrivate::scriptValueToVariant(), QDeclarativeEnginePrivate::scriptValueToVariant(), QOfonoSmsInterface::sendMessage(), QOfonoPrimaryDataContextInterface::setApn(), QScriptDebuggerCommand::setBreakpointData(), QDeclarativeContext::setContextProperty(), QDeclarativeListModelParser::setCustomData(), QDeclarativeVisualDataModel::setDelegate(), QDeclarativeListAccessor::setList(), ModelNode::setListValue(), ModelNode::setObjectValue(), QScriptDebuggerResponse::setResult(), QScriptDebuggerEvent::setScriptValue(), QScriptDebuggerCommand::setScriptValue(), QScriptDebuggerCommand::setSubordinateScriptValue(), QDeclarativeEnginePrivate::size(), QNetworkAccessBackend::start(), QDeclarativeEnginePrivate::tint(), QLocale::toCurrencyString(), QPatternist::AtomicValue::toQt(), QDeclarativeListScriptClass::toVariant(), QScriptEnginePrivate::toVariant(), QDBusDemarshaller::toVariantInternal(), QConnmanManagerInterface::unregisterCounter(), QDeclarativeBinding::update(), NestedListModel::valueForNode(), QDeclarativeStringConverters::variantFromString(), VARIANTToQVariant(), and QDeclarativeEnginePrivate::vector3d().
|
inline |
Definition at line 537 of file qvariant.h.
Referenced by qVariantSetValue().
bool QVariant::isNull | ( | ) | const |
Returns true if this is a NULL variant, false otherwise.
Definition at line 3102 of file qvariant.cpp.
Referenced by QNetworkReplyImplPrivate::_q_copyReadyRead(), QLocale::amText(), QPatternist::VariableLoader::announceExternalVariable(), QNetworkReplyImplPrivate::appendDownstreamDataSignalEmissions(), QOCIResultPrivate::bindValues(), QAbstractSpinBoxPrivate::bound(), convert(), QPatternist::URILoader::createRequest(), QLocale::createSeparatedList(), QLocale::currencySymbol(), QLocale::dateFormat(), QLocale::dateTimeFormat(), QLocale::dayName(), QPatternist::VariableLoader::evaluateSequence(), QIBaseResult::exec(), QDB2Result::exec(), QSQLiteResult::exec(), QSymSQLResult::exec(), QODBCResult::exec(), QSqlResult::exec(), QOCICols::execBatch(), QNetworkReplyImplPrivate::finished(), QLocale::firstDayOfWeek(), QUrlModel::flags(), QConnmanManagerInterface::getServices(), QConnmanManagerInterface::getTechnologies(), QStyledItemDelegate::initStyleOption(), QDB2Result::isNull(), QSqlCachedResult::isNull(), QODBCResult::isNull(), QTextDocument::loadResource(), QLocale::measurementSystem(), QLocale::monthName(), QLocale::nativeCountryName(), QLocale::nativeLanguageName(), operator<<(), QTextTableData::paddingProperty(), QItemDelegate::paint(), QLocale::pmText(), qCreateParamString(), qMakeFieldInfo(), qt_keyrelease_scanner(), QLocale::quoteString(), QXmlItem::QXmlItem(), QItemDelegate::rect(), QInternalMimeData::retrieveData(), QAbstractXmlNodeModel::sequencedTypedValue(), QNetworkHeadersPrivate::setCookedHeader(), QVideoSurfaceFormat::setProperty(), QSqlTableModelPrivate::setRecord(), ShaderEffectItem::setSource(), QLocale::standaloneDayName(), QLocale::standaloneMonthName(), QSimpleXmlNodeModel::stringValue(), QTextBlockFormat::tabPositions(), QLocale::timeFormat(), QLocale::toCurrencyString(), QTest::toString(), QLocale::toString(), QLocale::uiLanguages(), QLocalePrivate::updateSystemPrivate(), QMYSQLResult::virtual_hook(), and QLocale::weekdays().
|
inline |
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false.
Definition at line 485 of file qvariant.h.
Referenced by QStateMachinePrivate::applyProperties(), QDBusAbstractInterface::asyncCall(), QStyleSheetStyleSelector::attribute(), QDBusAbstractInterface::call(), QScript::callQtMethod(), QItemDelegate::check(), QTreeWidgetItem::childrenCheckState(), QDeclarativeContext::contextProperty(), QNetworkAccessManager::createRequest(), QSqlRelationalTableModel::data(), QProxyFontEngine::drawAsOutline(), QAxBase::dynamicCall(), QStyledItemDelegate::editorEvent(), QItemDelegate::editorEvent(), QScriptDebuggerCommandExecutor::execute(), QDeclarativeInclude::finished(), QDeclarativeXMLHttpRequest::finished(), QStandardItem::flags(), QNetworkReplyImplPrivate::getDownloadBuffer(), QApplicationPrivate::globalEventProcessor(), QSqlQueryModel::headerData(), QAbstractItemDelegate::helpEvent(), QColorDialogPrivate::init(), QNetworkReplyImplPrivate::initCacheSaveDevice(), QStateMachinePrivate::initializeAnimation(), QSideBarDelegate::initStyleOption(), QStyledItemDelegate::initStyleOption(), QDeclarativeItem::inputMethodQuery(), QComboBox::insertItem(), QAxBase::internalInvoke(), QAxServerBase::Invoke(), QNetworkManagerSettingsConnection::isAutoConnect(), QTreeModel::itemData(), QAbstractItemModel::itemData(), kdeColor(), load(), loadSingleEngine(), QDeclarativeAnimatedImage::movieRequestFinished(), QDeclarativeDataLoader::networkReplyFinished(), QDeclarativePixmapReader::networkRequestDone(), QAxEventSink::OnChanged(), QItemDelegate::paint(), QHeaderView::paintEvent(), QHeaderView::paintSection(), QNetworkAccessHttpBackend::postRequest(), QNetworkAccessManagerPrivate::prepareMultipart(), qDBusPropertyGet(), qt_mac_update_os_settings(), QDBusAbstractInterfaceBase::qt_metacall(), QAxBase::querySubObject(), readAllProperties(), QVariantAnimationPrivate::recalculateCurrentInterval(), QItemDelegate::rect(), QDeclarativeFontObject::replyFinished(), QDeclarativeXmlListModel::requestFinished(), QDeclarativeXMLHttpRequest::requestFromUrl(), QDeclarativeEngineDebugService::resetBinding(), QTextDocument::resource(), QMimeDataPrivate::retrieveTypedData(), save(), QAxServerBase::Save(), QDeclarativeBorderImage::sciRequestFinished(), QHeaderView::sectionSizeFromContents(), QHeaderView::sectionSizeHint(), QNetworkAccessCacheBackend::sendCacheContents(), QScriptDebuggerEvent::setAttribute(), QNetworkRequest::setAttribute(), QScriptDebuggerCommand::setAttribute(), QNetworkAccessBackend::setAttribute(), QNetworkReply::setAttribute(), QStandardItem::setData(), QTableModel::setData(), QTreeWidgetItem::setData(), QStyledItemDelegate::setEditorData(), QItemDelegate::setEditorData(), QDeclarativePropertyAnimation::setFrom(), QStandardItemPrivate::setItemData(), QDeclarativeListAccessor::setList(), QItemDelegate::setOptions(), QPrinter::setOutputFormat(), QStyleSheetStyle::setPalette(), QObject::setProperty(), QTextFormat::setProperty(), QNetworkSessionPrivateImpl::setSessionProperty(), QDeclarativePropertyAnimation::setTo(), QNetworkReplyImplPrivate::setup(), QVariantAnimationPrivate::setValueAt(), QStyledItemDelegate::sizeHint(), QItemDelegate::sizeHint(), QHttpSocketEngine::slotSocketConnected(), QScriptEngineDebugger::standardWindow(), QNetworkAccessBackend::start(), QMacStylePrivate::timerEvent(), QTest::toString(), QPatternist::AtomicValue::toXDM(), QDeclarativeTransitionManager::transition(), QStyleSheetStyle::unsetPalette(), QPropertyAnimation::updateState(), QHeaderView::viewportEvent(), QWizardHeader::vistaDisabled(), QWizardPrivate::vistaDisabled(), and QAbstractSocket::waitForConnected().
void QVariant::load | ( | QDataStream & | s | ) |
Internal function for loading a variant from stream s.
Use the stream operators instead.
Definition at line 2093 of file qvariant.cpp.
Referenced by operator>>().
|
static |
Converts the string representation of the storage type given in name, to its enum representation.
If the string representation cannot be converted to any enum representation, the variant is set to Invalid
.
Definition at line 2026 of file qvariant.cpp.
Referenced by MetaObjectGenerator::addProperty(), QDBusMetaObjectGenerator::findType(), QAxBase::internalInvoke(), QAxServerBase::Invoke(), qax_generateDocumentation(), qDBusNameToTypeId(), QAxServerBase::qt_metacall(), QVariantToVARIANT(), QMetaProperty::read(), toType(), VARIANTToQVariant(), and QMetaProperty::write().
|
inline |
Compares this QVariant with v and returns true if they are not equal; otherwise returns false.
Definition at line 406 of file qvariant.h.
Assigns the value of the variant variant to this variant.
Definition at line 1921 of file qvariant.cpp.
Referenced by QDBusVariant::setVariant().
|
inline |
Compares this QVariant with v and returns true if they are equal; otherwise returns false.
In the case of custom types, their equalness operators are not called. Instead the values' addresses are compared.
Definition at line 404 of file qvariant.h.
void QVariant::save | ( | QDataStream & | s | ) | const |
Internal function for saving a variant to the stream s.
Use the stream operators instead.
Definition at line 2140 of file qvariant.cpp.
Referenced by operator<<().
|
inline |
Stores a copy of value.
If T
is a type that QVariant doesn't support, QMetaType is used to store the value. A compile error will occur if QMetaType doesn't handle the type.
Example:
Definition at line 527 of file qvariant.h.
Referenced by QAxBase::asVariant(), QScript::callQtMethod(), QDeclarativePropertyAnimationPrivate::convertVariant(), QAxBase::internalInvoke(), QTextBlockFormat::setTabPositions(), and VARIANTToQVariant().
|
inline |
Swaps variant other with this variant.
This operation is very fast and never fails.
Definition at line 227 of file qvariant.h.
QBitArray QVariant::toBitArray | ( | ) | const |
Returns the variant as a QBitArray if the variant has type() BitArray ; otherwise returns an empty bit array.
Definition at line 2590 of file qvariant.cpp.
bool QVariant::toBool | ( | ) | const |
Returns the variant as a bool if the variant has type() Bool.
Returns true if the variant has type() Bool , Char , Double , Int , LongLong , UInt , or ULongLong and the value is non-zero, or if the variant has type String or ByteArray and its lower-case content is not empty, "0" or "false"; otherwise returns false.
Definition at line 2691 of file qvariant.cpp.
Referenced by allowsMessages(), QDBusMarshaller::appendVariantInternal(), Maemo::appendVariantToDBusMessage(), QTextFormat::boolProperty(), QNetworkManagerInterfaceDeviceWired::carrier(), QPaintBuffer::commandDescription(), copyArgument(), QNetworkReplyImplPrivate::createCache(), QNetworkManagerConnectionActive::defaultRoute(), QIcdEngine::doRequestUpdate(), QTextLine::draw(), QProxyFontEngine::drawAsOutline(), QWindowsVistaStyle::drawControl(), QSqlDriver::formatValue(), QPSQLDriver::formatValue(), getNetworkAttrs(), QScript::ClassObjectDelegate::hasInstance(), QNetworkManagerSettingsConnection::isAutoConnect(), QmlJSDebugger::isEditorItem(), QGraphicsWidget::itemChange(), loadSingleEngine(), macValue(), QPSPrintEnginePrivate::QPSPrintEnginePrivate(), qt_mac_update_os_settings(), QVariantToVoidStar(), QIBaseResult::record(), QPSQLDriver::record(), QTextEditPrivate::relayoutDocument(), QTextEdit::resizeEvent(), QStyleSheetStyle::setGeometry(), setPenAndDrawBackground(), QMacPrintEngine::setProperty(), QWin32PrintEngine::setProperty(), QtopiaPrintEngine::setProperty(), QPdfBaseEngine::setProperty(), QGraphicsItem::setSelected(), QNetworkSessionPrivateImpl::setSessionProperty(), QNetworkReplyImplPrivate::setup(), QGraphicsItemPrivate::setVisibleHelper(), streamDebug(), QImageReader::supportsAnimation(), QPatternist::AtomicValue::toXDM(), QDeclarativeStateGroupPrivate::updateAutoState(), ShaderEffectItem::updateEffectState(), variantHash(), QScript::variantProtoFuncValueOf(), QDeclarativeWorkerScriptEnginePrivate::variantToScriptValue(), variantToString(), Maemo::IAPConfPrivate::variantToValue(), QWizardHeader::vistaDisabled(), QWizardPrivate::vistaDisabled(), QNetworkManagerInterface::wirelessEnabled(), QNetworkManagerInterface::wirelessHardwareEnabled(), and QApplicationPrivate::x11_apply_settings().
QByteArray QVariant::toByteArray | ( | ) | const |
Returns the variant as a QByteArray if the variant has type() ByteArray or String (converted using QString::fromAscii()); otherwise returns an empty byte array.
Definition at line 2383 of file qvariant.cpp.
Referenced by QIcdEngine::addConfiguration(), QFontDatabasePrivate::addQPF2File(), QDBusMarshaller::appendVariantInternal(), Maemo::appendVariantToDBusMessage(), QTextHtmlParserNode::applyBackgroundImage(), QIcdEngine::asyncUpdateConfigurationsSlot(), QMacPasteboardMimeAny::convertFromMime(), QMacPasteboardMimeHTMLText::convertFromMime(), QMacPasteboardMimeVCard::convertFromMime(), copyArgument(), QMimeData::data(), QIcdEngine::doRequestUpdate(), QDeclarativeXMLHttpRequest::downloadProgress(), QDeclarativeXMLHttpRequest::error(), QIBaseResult::exec(), QDB2Result::exec(), QODBCResult::exec(), QOCICols::execBatch(), QDeclarativeXMLHttpRequest::finished(), QDB2Driver::formatValue(), QSqlDriver::formatValue(), QTDSDriver::formatValue(), QMYSQLDriver::formatValue(), QODBCDriver::formatValue(), QPSQLDriver::formatValue(), headerValue(), QTextHtmlParser::importStyleSheet(), QFileDialogPrivate::init(), QTextDocument::loadResource(), macValue(), QVariantToVoidStar(), QOCICols::readPiecewise(), QPlatformFontDatabase::registerQPF2Font(), QInternalMimeData::retrieveData(), QMimeDataPrivate::retrieveTypedData(), QPpmHandler::setOption(), QTextBrowserPrivate::setSource(), QPageSetupWidget::setupPrinter(), QHttpSocketEngine::slotSocketConnected(), QScriptEngineDebugger::standardWindow(), streamDebug(), toUrl(), QPatternist::AtomicValue::toXDM(), variantToString(), QSettingsPrivate::variantToString(), Maemo::IAPConfPrivate::variantToValue(), QMYSQLResult::virtual_hook(), QDeclarativePropertyPrivate::write(), QMetaProperty::write(), and QDeclarativePropertyPrivate::writeEnumProperty().
QChar QVariant::toChar | ( | ) | const |
Returns the variant as a QChar if the variant has type() Char , Int , or UInt ; otherwise returns an invalid QChar.
Definition at line 2579 of file qvariant.cpp.
Referenced by Maemo::appendVariantToDBusMessage(), QSortFilterProxyModel::lessThan(), QStandardItem::operator<(), and streamDebug().
QDate QVariant::toDate | ( | ) | const |
Returns the variant as a QDate if the variant has type() Date , DateTime , or String ; otherwise returns an invalid date.
If the type() is String , an invalid date will be returned if the string cannot be parsed as a Qt::ISODate format date.
Definition at line 2311 of file qvariant.cpp.
Referenced by QStyledItemDelegate::displayText(), QDateTimeEditPrivate::emitSignals(), QIBaseResult::exec(), QDB2Result::exec(), QODBCResult::exec(), QSqlDriver::formatValue(), QIBaseDriver::formatValue(), QOCIDriver::formatValue(), QDateTimeEditPrivate::init(), QSortFilterProxyModel::lessThan(), operator/(), QStandardItem::operator<(), QSystemLocale::query(), QVariantToVoidStar(), streamDebug(), QPatternist::AtomicValue::toXDM(), QDateTimeEditPrivate::updateTimeSpec(), QItemDelegatePrivate::valueToText(), QAbstractSpinBoxPrivate::variantCompare(), and QMYSQLResult::virtual_hook().
QDateTime QVariant::toDateTime | ( | ) | const |
Returns the variant as a QDateTime if the variant has type() DateTime , Date , or String ; otherwise returns an invalid date/time.
If the type() is String , an invalid date/time will be returned if the string cannot be parsed as a Qt::ISODate format date/time.
Definition at line 2349 of file qvariant.cpp.
Referenced by QOCIResultPrivate::bindValue(), QStyledItemDelegate::displayText(), QDateTimeEditPrivate::emitSignals(), QIBaseResult::exec(), QDB2Result::exec(), QODBCResult::exec(), QOCICols::execBatch(), QDB2Driver::formatValue(), QSqlDriver::formatValue(), QIBaseDriver::formatValue(), QOCIDriver::formatValue(), QTDSDriver::formatValue(), QODBCDriver::formatValue(), QPSQLDriver::formatValue(), QDateTimeEditPrivate::getMaximum(), QDateTimeEditPrivate::getMinimum(), headerValue(), QSortFilterProxyModel::lessThan(), macValue(), operator*(), operator+(), operator-(), operator/(), QStandardItem::operator<(), QSystemLocale::query(), QVariantToVoidStar(), QDateTimeEditPrivate::stepBy(), streamDebug(), QDateTimeEditPrivate::textFromValue(), QPatternist::AtomicValue::toXDM(), QDateTimeEditPrivate::updateTimeSpec(), QDateTimeEditPrivate::validateAndInterpret(), QItemDelegatePrivate::valueToText(), QAbstractSpinBoxPrivate::variantCompare(), and QDeclarativeWorkerScriptEnginePrivate::variantToScriptValue().
double QVariant::toDouble | ( | bool * | ok = 0 | ) | const |
Returns the variant as a double if the variant has type() Double , QMetaType::Float , Bool , ByteArray , Int , LongLong , String , UInt , or ULongLong ; otherwise returns 0.0.
If ok is non-null: *
{ok} is set to true if the value could be converted to a double; otherwise *
{ok} is set to false.
Definition at line 2710 of file qvariant.cpp.
Referenced by QDBusMarshaller::appendVariantInternal(), QPaintBuffer::commandDescription(), copyArgument(), QIBaseResult::exec(), QSQLiteResult::exec(), QSymSQLResult::exec(), QOCICols::execBatch(), QPSQLDriver::formatValue(), QSortFilterProxyModel::lessThan(), macFormatCurrency(), macValue(), QMacPrintEngine::metric(), operator*(), operator+(), operator-(), operator/(), QStandardItem::operator<(), QMacPrintEngine::property(), QVariantToVoidStar(), QApplication::setDoubleClickInterval(), streamDebug(), QDoubleSpinBoxPrivate::textFromValue(), QSystemLocalePrivate::toCurrencyString(), QPatternist::AtomicValue::toXDM(), QItemDelegatePrivate::valueToText(), QAbstractSpinBoxPrivate::variantCompare(), variantHash(), QScript::variantProtoFuncValueOf(), variantToString(), Maemo::IAPConfPrivate::variantToValue(), and QDeclarativePropertyPrivate::write().
QEasingCurve QVariant::toEasingCurve | ( | ) | const |
Returns the variant as a QEasingCurve if the variant has type() EasingCurve ; otherwise returns a default easing curve.
Definition at line 2366 of file qvariant.cpp.
Referenced by streamDebug().
float QVariant::toFloat | ( | bool * | ok = 0 | ) | const |
Returns the variant as a float if the variant has type() Double , QMetaType::Float , Bool , ByteArray , Int , LongLong , String , UInt , or ULongLong ; otherwise returns 0.0.
If ok is non-null: *
{ok} is set to true if the value could be converted to a double; otherwise *
{ok} is set to false.
Definition at line 2725 of file qvariant.cpp.
Referenced by QSortFilterProxyModel::lessThan(), QStandardItem::operator<(), QPngHandler::setOption(), streamDebug(), QPatternist::AtomicValue::toXDM(), QItemDelegatePrivate::valueToText(), and variantHash().
QVariantHash QVariant::toHash | ( | ) | const |
Returns the variant as a QHash<QString, QVariant> if the variant has type() Hash ; otherwise returns an empty map.
Definition at line 2292 of file qvariant.cpp.
Referenced by streamDebug().
int QVariant::toInt | ( | bool * | ok = 0 | ) | const |
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char , Double , LongLong , String , UInt , or ULongLong ; otherwise returns 0.
If ok is non-null: *
{ok} is set to true if the value could be converted to an int; otherwise *
{ok} is set to false.
Warning: If the value is convertible to a LongLong but is too large to be represented in an int, the resulting arithmetic overflow will not be reflected in ok. A simple workaround is to use QString::toInt(). Fixing this bug has been postponed to Qt 5 in order to avoid breaking existing code.
Definition at line 2625 of file qvariant.cpp.
Referenced by QFileDialogPrivate::_q_deleteCurrent(), QCalendarWidgetPrivate::_q_monthChanged(), QPageSetupWidget::_q_paperSizeChanged(), QPrintDialogPrivate::_q_printRangeSelected(), QFontDatabasePrivate::addQPF2File(), QDBusMarshaller::appendVariantInternal(), Maemo::appendVariantToDBusMessage(), QProxyFontEngine::ascent(), QIcdEngine::asyncUpdateConfigurationsSlot(), QNetworkAccessManagerPrivate::authenticationRequired(), QProxyFontEngine::averageCharWidth(), QSettings::beginReadArray(), QCss::Declaration::brushValues(), QTreeWidgetItem::childrenCheckState(), QCss::Declaration::colorValues(), QmlJSDebugger::LiveSelectionTool::contextMenuElementHovered(), QmlJSDebugger::LiveSelectionTool::contextMenuElementSelected(), copyArgument(), QDeclarativeListAccessor::count(), QNetworkReplyImplPrivate::createCache(), QNetworkAccessManager::createRequest(), QMYSQLResult::data(), QDeclarativeEngineDebugPrivate::decode(), QProxyFontEngine::descent(), QBBInputContext::dispatchRequestSoftwareInputPanel(), QDeclarativeXmlQueryEngine::doQueryJob(), QDeclarativeXMLHttpRequest::downloadProgress(), QWindowsVistaStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), QWindowsVistaStyle::drawPrimitive(), QStyledItemDelegate::editorEvent(), QItemDelegate::editorEvent(), QDeclarativeXMLHttpRequest::error(), QIBaseResult::exec(), QSQLiteResult::exec(), QSymSQLResult::exec(), QOCICols::execBatch(), QScriptDebuggerCommandExecutor::execute(), QScriptDebuggerAgent::extension(), QDeclarativeXMLHttpRequest::finished(), QStandardItem::flags(), QHeaderViewPrivate::flipSortIndicator(), QNetworkSessionManagerPrivate::forceSessionClose(), QProxyFontEngine::glyphCount(), QBBInputContext::hasSelectedText(), QImageReader::imageFormat(), QDeclarativeVisualDataModel::indexOf(), QMacPrintEnginePrivate::initialize(), QStyledItemDelegate::initStyleOption(), QTextFormat::intProperty(), QAccessibleTextEdit::invokeMethodEx(), QAccessibleLineEdit::invokeMethodEx(), QKde::kdeToolBarIconSize(), QProxyFontEngine::leading(), QSortFilterProxyModel::lessThan(), QProxyFontEngine::lineThickness(), QNetworkAccessHttpBackend::loadFromCacheIfAllowed(), macFormatCurrency(), macValue(), QProxyFontEngine::maxCharWidth(), QLocale::measurementSystem(), QNetworkReplyImplPrivate::metaDataChanged(), QProxyFontEngine::minLeftBearing(), QProxyFontEngine::minRightBearing(), QTextFormat::objectIndex(), QBBInputContext::onGetCursorPosition(), QBBInputContext::onGetTextAfterCursor(), QBBInputContext::onGetTextBeforeCursor(), QDeclarativeWorkerScriptEnginePrivate::onMessage(), QBBInputContext::onSetComposingRegion(), operator*(), operator+(), operator-(), operator/(), QStandardItem::operator<(), QItemDelegate::paint(), QHeaderView::paintSection(), parseColorValue(), parseCSStoXMLAttrs(), parseShorthandBackgroundProperty(), parseStyleValue(), QIBaseDriver::primaryIndex(), QSQLite2Driver::primaryIndex(), QPSQLDriver::primaryIndex(), qExtractSecurityPolicyFromString(), QFontEngineQPA::QFontEngineQPA(), QFontEngineQPF::QFontEngineQPF(), qGetTableInfo(), qMakeFieldInfo(), QApplicationPrivate::qt_mac_apply_settings(), qt_mac_update_os_settings(), QSystemLocale::query(), QVariantToVARIANT(), QVariantToVoidStar(), QIBaseResult::record(), QIBaseDriver::record(), QOCIDriver::record(), QTDSDriver::record(), QPSQLDriver::record(), QTextControlPrivate::rectForPosition(), QPlatformFontDatabase::registerQPF2Font(), QNetworkAccessHttpBackend::sendCacheContents(), QDeclarativeWorkerScriptEnginePrivate::sendMessage(), QWinSettingsPrivate::set(), QAccessibleAbstractSlider::setCurrentValue(), QScriptBreakpointsModel::setData(), setFontSizeFromValue(), setFontStyleFromValue(), setFontVariantFromValue(), setFontWeightFromValue(), QTextHtmlParserNode::setListStyle(), QTiffHandler::setOption(), QJpegHandler::setOption(), QPngHandler::setOption(), QItemDelegate::setOptions(), QDeclarativeValueTypeScriptClass::setProperty(), QMacPrintEngine::setProperty(), QWin32PrintEngine::setProperty(), QtopiaPrintEngine::setProperty(), QPdfBaseEngine::setProperty(), QAbstractSocket::setSocketOption(), setTextDecorationFromValues(), setTextTransformFromValue(), QPageSetupWidget::setupPrinter(), QAccessibleItemRow::state(), QAccessibleTable2Cell::state(), streamDebug(), QStyleSheetStyle::styleHint(), QPrinter::supportedPaperSources(), QPrinter::supportedResolutions(), QSpinBoxPrivate::textFromValue(), QMacStylePrivate::timerEvent(), QSystemLocalePrivate::toCurrencyString(), QProxyFontEngine::underlinePosition(), QTabBarPrivate::Tab::TabBarAnimation::updateCurrentValue(), ShaderEffectItem::updateEffectState(), QLocalePrivate::updateSystemPrivate(), QAbstractSpinBoxPrivate::variantCompare(), variantHash(), QScript::variantProtoFuncValueOf(), Maemo::IAPConfPrivate::variantToValue(), QApplicationPrivate::x11_apply_settings(), and QProxyFontEngine::xHeight().
QLine QVariant::toLine | ( | ) | const |
Returns the variant as a QLine if the variant has type() Line ; otherwise returns an invalid QLine.
Definition at line 2494 of file qvariant.cpp.
Referenced by streamDebug().
QLineF QVariant::toLineF | ( | ) | const |
Returns the variant as a QLineF if the variant has type() LineF ; otherwise returns an invalid QLineF.
Definition at line 2478 of file qvariant.cpp.
Referenced by streamDebug().
QVariantList QVariant::toList | ( | ) | const |
Returns the variant as a QVariantList if the variant has type() List or StringList ; otherwise returns an empty list.
Definition at line 2751 of file qvariant.cpp.
Referenced by Maemo::IcdPrivate::addrinfo(), Maemo::appendVariantToDBusMessage(), QMacPasteboardMimeFileUri::convertFromMime(), QMacPasteboardMimeUrl::convertFromMime(), createArrayBuffer(), QPatternist::VariableLoader::evaluateSequence(), QIBaseResult::exec(), QSqlResult::execBatch(), QOCICols::execBatch(), QScriptDebuggerAgent::extension(), Maemo::get_addrinfo_all_result(), QTextFormat::lengthVectorProperty(), macValue(), QMacPrintEngine::metric(), QMacPrintEngine::property(), QVariantToVARIANT(), QVariantToVoidStar(), QMimeDataPrivate::retrieveTypedData(), Maemo::IcdPrivate::scan(), QWinSettingsPrivate::set(), QMacPrintEngine::setProperty(), QWin32PrintEngine::setProperty(), QPdfBaseEngine::setProperty(), QStyleSheetStyle::sizeFromContents(), Maemo::IcdPrivate::state(), Maemo::IcdPrivate::statistics(), streamDebug(), QStyleSheetStyle::subControlRect(), QPrinter::supportedPaperSources(), QStyleSheetStyle::titleBarLayout(), QMimeData::urls(), QDeclarativeEngineDebugService::valueContents(), VARIANTToQVariant(), Maemo::variantToSignature(), variantToString(), Maemo::IAPConfPrivate::variantToValue(), and QConfFileSettingsPrivate::writeIniFile().
QLocale QVariant::toLocale | ( | ) | const |
Returns the variant as a QLocale if the variant has type() Locale ; otherwise returns an invalid QLocale.
Definition at line 2545 of file qvariant.cpp.
qlonglong QVariant::toLongLong | ( | bool * | ok = 0 | ) | const |
Returns the variant as a long long int if the variant has type() LongLong , Bool , ByteArray , Char , Double , Int , String , UInt , or ULongLong ; otherwise returns 0.
If ok is non-null: *
ok
is set to true if the value could be converted to an int; otherwise *
ok
is set to false.
Definition at line 2659 of file qvariant.cpp.
Referenced by QNetworkReplyImplPrivate::_q_copyReadyRead(), QNetworkReplyImplPrivate::appendDownstreamDataSignalEmissions(), QDBusMarshaller::appendVariantInternal(), Maemo::appendVariantToDBusMessage(), QOCIResultPrivate::bindValue(), cmp(), copyArgument(), QMYSQLResult::data(), QStyledItemDelegate::displayText(), QIBaseResult::exec(), QSQLiteResult::exec(), QSymSQLResult::exec(), QOCICols::execBatch(), QScriptDebuggerAgent::extension(), QNetworkReplyImplPrivate::finished(), QNetworkReplyImplPrivate::getDownloadBuffer(), QSortFilterProxyModel::lessThan(), macFormatCurrency(), macValue(), QStandardItem::operator<(), QNetworkAccessHttpBackend::postRequest(), QVariantToVARIANT(), QVariantToVoidStar(), QWinSettingsPrivate::set(), streamDebug(), QSystemLocalePrivate::toCurrencyString(), QPatternist::AtomicValue::toXDM(), QItemDelegatePrivate::valueToText(), QAbstractItemModelPrivate::variantLessThan(), and variantToString().
QVariantMap QVariant::toMap | ( | ) | const |
Returns the variant as a QMap<QString, QVariant> if the variant has type() Map ; otherwise returns an empty map.
Definition at line 2281 of file qvariant.cpp.
Referenced by macValue(), streamDebug(), and QDeclarativeEngineDebugService::valueContents().
QPoint QVariant::toPoint | ( | ) | const |
Returns the variant as a QPoint if the variant has type() Point or PointF ; otherwise returns a null QPoint.
Definition at line 2400 of file qvariant.cpp.
Referenced by QGraphicsView::inputMethodQuery(), QGraphicsScene::inputMethodQuery(), QPlainTextEdit::inputMethodQuery(), QTextEdit::inputMethodQuery(), QGraphicsTextItem::inputMethodQuery(), QGraphicsProxyWidgetPrivate::inputMethodQueryHelper(), QGraphicsProxyWidget::itemChange(), QVariantToVoidStar(), and streamDebug().
QPointF QVariant::toPointF | ( | ) | const |
Returns the variant as a QPointF if the variant has type() Point or PointF ; otherwise returns a null QPointF.
Definition at line 2509 of file qvariant.cpp.
Referenced by QPaintBuffer::commandDescription(), QGraphicsView::inputMethodQuery(), QGraphicsScene::inputMethodQuery(), QPlainTextEdit::inputMethodQuery(), QTextEdit::inputMethodQuery(), QGraphicsTextItem::inputMethodQuery(), QGraphicsProxyWidgetPrivate::inputMethodQueryHelper(), QPainterReplayer::process(), QGraphicsItem::setPos(), QGraphicsItem::setTransformOriginPoint(), streamDebug(), and ShaderEffectItem::updateEffectState().
qreal QVariant::toReal | ( | bool * | ok = 0 | ) | const |
Returns the variant as a qreal if the variant has type() Double , QMetaType::Float , Bool , ByteArray , Int , LongLong , String , UInt , or ULongLong ; otherwise returns 0.0.
If ok is non-null: *
{ok} is set to true if the value could be converted to a double; otherwise *
{ok} is set to false.
Definition at line 2740 of file qvariant.cpp.
Referenced by QmlJSDebugger::QmlToolBar::changeAnimationSpeed(), cmp(), QStyledItemDelegate::displayText(), QPrinter::getPageMargins(), QSmoothedAnimation::init(), QTextTableData::paddingProperty(), parseBrushValue(), parseColorValue(), QmlJSDebugger::QmlToolBar::setAnimationSpeed(), setFontSizeFromValue(), QGraphicsItem::setOpacity(), QGraphicsItem::setRotation(), QGraphicsItem::setScale(), QGraphicsItem::setZValue(), QDeclarativeParentAnimation::transition(), QDeclarativeBulkValueAnimator::updateCurrentValue(), QAbstractItemModelPrivate::variantLessThan(), and QDeclarativeWorkerScriptEnginePrivate::variantToScriptValue().
QRect QVariant::toRect | ( | ) | const |
Returns the variant as a QRect if the variant has type() Rect ; otherwise returns an invalid QRect.
Definition at line 2416 of file qvariant.cpp.
Referenced by QWindowsVistaStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), QWindowsVistaStyle::drawPrimitive(), QScrollArea::ensureWidgetVisible(), QMacInputContext::globalEventProcessor(), QGraphicsView::inputMethodQuery(), QGraphicsScene::inputMethodQuery(), QPlainTextEdit::inputMethodQuery(), QTextEdit::inputMethodQuery(), QGraphicsTextItem::inputMethodQuery(), QGraphicsProxyWidgetPrivate::inputMethodQueryHelper(), qt_keyrelease_scanner(), QtWndProc(), QVariantToVoidStar(), QSvgIOHandler::setOption(), QJpegHandler::setOption(), QPdfBaseEngine::setProperty(), streamDebug(), QWSInputContext::translateIMQueryEvent(), QWinInputContext::update(), and QXIMInputContext::update().
QRectF QVariant::toRectF | ( | ) | const |
Returns the variant as a QRectF if the variant has type() Rect or RectF ; otherwise returns an invalid QRectF.
Definition at line 2463 of file qvariant.cpp.
Referenced by QGraphicsView::inputMethodQuery(), QGraphicsScene::inputMethodQuery(), QPlainTextEdit::inputMethodQuery(), QTextEdit::inputMethodQuery(), QDeclarativeKeysAttached::inputMethodQuery(), QGraphicsTextItem::inputMethodQuery(), QGraphicsProxyWidgetPrivate::inputMethodQueryHelper(), streamDebug(), and ShaderEffectItem::updateEffectState().
QRegExp QVariant::toRegExp | ( | ) | const |
Returns the variant as a QRegExp if the variant has type() RegExp ; otherwise returns an empty QRegExp.
Definition at line 2562 of file qvariant.cpp.
Referenced by QDeclarativeWorkerScriptEnginePrivate::variantToScriptValue().
QSize QVariant::toSize | ( | ) | const |
Returns the variant as a QSize if the variant has type() Size ; otherwise returns an invalid QSize.
Definition at line 2432 of file qvariant.cpp.
Referenced by QGraphicsScenePrivate::drawItemHelper(), QStyleSheetStyle::pixelMetric(), QVariantToVoidStar(), QGraphicsSvgItem::setMaximumCacheSize(), QJpegHandler::setOption(), QSvgIOHandler::setOption(), QImageReader::size(), and streamDebug().
QSizeF QVariant::toSizeF | ( | ) | const |
Returns the variant as a QSizeF if the variant has type() SizeF ; otherwise returns an invalid QSizeF.
Definition at line 2447 of file qvariant.cpp.
Referenced by QMacPrintEngine::setProperty(), QWin32PrintEngine::setProperty(), QPdfBaseEngine::setProperty(), streamDebug(), and ShaderEffectItem::updateEffectState().
QString QVariant::toString | ( | ) | const |
Returns the variant as a QString if the variant has type() String , Bool , ByteArray , Char , Date , DateTime , Double , Int , LongLong , StringList , Time , UInt , or ULongLong ; otherwise returns an empty string.
Definition at line 2270 of file qvariant.cpp.
Referenced by QFileDialogPrivate::_q_currentChanged(), QInputDialogPrivate::_q_currentRowChanged(), QFileDialogPrivate::_q_deleteCurrent(), QFileDialogPrivate::_q_enterDirectory(), QFileDialogPrivate::_q_goToDirectory(), QFileDialogPrivate::_q_navigateToParent(), QFileDialogPrivate::_q_selectionChanged(), QIcdEngine::addConfiguration(), QFontDatabasePrivate::addQPF2File(), QLocale::amText(), QTextCharFormat::anchorName(), QTextCharFormat::anchorNames(), QPSQLDriverPrivate::appendTables(), QDBusMarshaller::appendVariantInternal(), Maemo::appendVariantToDBusMessage(), QIcdEngine::asyncUpdateConfigurationsSlot(), QStyleSheetStyleSelector::attribute(), QOCIResultPrivate::bindValue(), QCss::Declaration::borderImageValue(), QUnsortedModelEngine::buildIndices(), QMultiInputContext::changeSlave(), QAbstractItemViewPrivate::checkMouseMove(), QAccessibleTable2::columnDescription(), QAccessibleItemView::columnDescription(), QNetworkManagerEngine::connectToId(), convert(), QMacPasteboardMimeAny::convertFromMime(), QMacPasteboardMimePlainText::convertFromMime(), QMacPasteboardMimeUnicodeText::convertFromMime(), QMacPasteboardMimeVCard::convertFromMime(), QDeclarativePropertyAnimationPrivate::convertVariant(), copyArgument(), QLocale::createSeparatedList(), QLocale::currencySymbol(), QDeclarativeEnginePrivate::darker(), QSqlRelationalTableModel::data(), QDeclarativeFolderListModel::data(), QLocale::dateFormat(), QLocale::dateTimeFormat(), QLocale::dayName(), QStyledItemDelegate::displayText(), QIcdEngine::doRequestUpdate(), ModelNode::dump(), QTextHtmlExporter::emitBackgroundAttribute(), QIBaseResult::exec(), QDB2Result::exec(), QSQLiteResult::exec(), QSymSQLResult::exec(), QODBCResult::exec(), QOCICols::execBatch(), QScript::QtPropertyFunction::execute(), QCss::ValueExtractor::extractBackground(), QFileSystemModel::fileName(), QSortedModelEngine::filter(), QCompletionEngine::filterHistory(), QDBusConnectionPrivate::findMetaObject(), fontNameSubstitute(), QSqlDriver::formatValue(), QNetworkManagerSettingsConnection::getId(), QNetworkManagerSettingsConnection::getMacAddress(), QDBusConnectionPrivate::getNameOwnerNoCache(), getNetworkAttrs(), QNetworkManagerSettingsConnection::getSsid(), QComboMenuDelegate::getStyleOption(), QImageReaderPrivate::getText(), QNetworkManagerSettingsConnection::getType(), QNetworkManagerSettingsConnection::getUuid(), QApplicationPrivate::globalEventProcessor(), QScriptToolTipJob::handleResponse(), QDBusConnectionPrivate::handleSignal(), QAbstractItemDelegate::helpEvent(), QMimeData::html(), QNetworkManagerInterfaceAccessPoint::hwAddress(), QNetworkManagerInterfaceDeviceWired::hwAddress(), QNetworkManagerInterfaceDeviceWireless::hwAddress(), QCss::Declaration::iconValue(), QTextHtmlParser::importStyleSheet(), intValueHelper(), Maemo::ProxyConfPrivate::isHostExcluded(), QComboBoxDelegate::isSeparator(), QComboBoxPrivate::itemText(), QKde::kdeStyle(), QKde::kdeToolButtonStyle(), QAbstractItemView::keyPressEvent(), QCss::ValueExtractor::lengthValue(), QSortFilterProxyModel::lessThan(), QDeclarativeEnginePrivate::lighter(), QLibraryInfo::location(), QAbstractItemModel::match(), QLocale::monthName(), QLocale::nativeCountryName(), QLocale::nativeLanguageName(), QNetworkManagerInterfaceDevice::networkInterface(), QAxSelect::on_ActiveXList_clicked(), QAxSelect::on_ActiveXList_doubleClicked(), QBBInputContext::onGetSelectedText(), QBBInputContext::onGetTextAfterCursor(), QBBInputContext::onGetTextBeforeCursor(), QBBInputContext::onSetComposingRegion(), QStandardItem::operator<(), operator<<(), QFontFamilyDelegate::paint(), QScriptDebuggerLocalsItemDelegate::paint(), QNetworkManagerEngine::parseConnection(), parseShorthandBackgroundProperty(), QFSCompleter::pathFromIndex(), QCompleter::pathFromIndex(), QLocale::pmText(), QRelation::populateDictionary(), QIBaseDriver::primaryIndex(), QOCIDriver::primaryIndex(), QSQLite2Driver::primaryIndex(), QTDSDriver::primaryIndex(), QMYSQLDriver::primaryIndex(), QPSQLDriver::primaryIndex(), qDBusPropertyGet(), qDBusPropertyGetAll(), qDBusPropertySet(), qExtractSecurityPolicyFromString(), qGetTableInfo(), qmlsqldatabase_executeSql(), qmlsqldatabase_item(), qmlsqldatabase_open_sync(), QMultiInputContext::QMultiInputContext(), QApplicationPrivate::qt_mac_apply_settings(), QFileDialogPrivate::qt_mac_filedialog_event_proc(), QSystemLocale::query(), QLocale::quoteString(), QVariantToVARIANT(), QVariantToVoidStar(), MetaObjectGenerator::readClassInfo(), MetaObjectGenerator::readEventInfo(), MetaObjectGenerator::readInterfaceInfo(), QOCICols::readPiecewise(), QCss::Declaration::realValue(), QIBaseDriver::record(), QOCIDriver::record(), QTDSDriver::record(), QPSQLDriver::record(), QPlatformFontDatabase::registerQPF2Font(), QDeclarativeXMLHttpRequest::requestFromUrl(), QFileDialogPrivate::retranslateStrings(), QMimeDataPrivate::retrieveTypedData(), QAccessibleTable2::rowDescription(), QAccessibleItemView::rowDescription(), Maemo::IcdPrivate::scan(), QFileDialog::selectedFiles(), QFileDialog::selectFile(), QNetworkManagerConnectionActive::serviceName(), QConnmanEngine::servicePropertyChangedContext(), QDeclarativeEngineDebugService::setBinding(), QAxBase::setControl(), QStringListModel::setData(), QScriptDebuggerLocalsModel::setData(), QDirModel::setData(), QSqlRelationalTableModel::setData(), QUrlModel::setData(), QScriptBreakpointsModel::setData(), QFileSystemModel::setData(), setFontFamilyFromValues(), setFontSizeFromValue(), QFileDialogComboBox::setHistory(), QXpmHandler::setOption(), QXbmHandler::setOption(), QPngHandler::setOption(), QMacPrintEngine::setProperty(), QWin32PrintEngine::setProperty(), QtopiaPrintEngine::setProperty(), QPdfBaseEngine::setProperty(), QTextBrowserPrivate::setSource(), QGraphicsItem::setToolTip(), QUrlModel::setUrl(), QFileDialogComboBox::showPopup(), QFontFamilyDelegate::sizeHint(), QNetworkManagerInterfaceAccessPoint::ssid(), QLocale::standaloneDayName(), QLocale::standaloneMonthName(), QNetworkSessionPrivateImpl::stateChange(), streamDebug(), QTextFormat::stringProperty(), QDeclarativeVisualDataModel::stringValue(), QNetworkSessionPrivateImpl::syncStateWithInterface(), QGuiPlatformPlugin::systemIconThemeName(), QIBaseDriver::tables(), QSQLiteDriver::tables(), QOCIDriver::tables(), QSQLite2Driver::tables(), QTDSDriver::tables(), QMYSQLDriver::tables(), QPSQLDriver::tables(), QConnmanEngine::technologyPropertyChangedContext(), QMimeData::text(), QAccessibleHeader::text(), QAccessibleItemRow::text(), QAccessibleTable2Cell::text(), QAccessibleTable2HeaderCell::text(), QAccessibleItemRow::text_helper(), QLocale::timeFormat(), QDeclarativeEnginePrivate::tint(), QLocale::toCurrencyString(), QGraphicsItem::toolTip(), QLocale::toString(), toUrl(), QPatternist::AtomicValue::toXDM(), QNetworkManagerInterfaceDevice::udi(), QItemDelegate::updateEditorGeometry(), QLocalePrivate::updateSystemPrivate(), QItemDelegatePrivate::valueToText(), variantHash(), QAbstractItemModelPrivate::variantLessThan(), QScript::variantProtoFuncToString(), QScript::variantProtoFuncValueOf(), VARIANTToQVariant(), QDeclarativeWorkerScriptEnginePrivate::variantToScriptValue(), variantToString(), QSettingsPrivate::variantToString(), Maemo::IAPConfPrivate::variantToValue(), QHeaderView::viewportEvent(), QMYSQLResult::virtual_hook(), QDeclarativePropertyPrivate::write(), and QApplicationPrivate::x11_apply_settings().
QStringList QVariant::toStringList | ( | ) | const |
Returns the variant as a QStringList if the variant has type() StringList, String , or List of a type that can be converted to QString; otherwise returns an empty list.
Definition at line 2259 of file qvariant.cpp.
Referenced by QTextCharFormat::anchorName(), QTextCharFormat::anchorNames(), QDBusMarshaller::appendVariantInternal(), Maemo::appendVariantToDBusMessage(), QStyleSheetStyleSelector::attribute(), copyArgument(), QNetworkManagerIp4Config::domains(), QPatternist::VariableLoader::evaluateSequence(), QScriptDebuggerCommandExecutor::execute(), fontPath(), QNetworkManagerSettingsConnection::getSeenBssids(), QScriptCompleteExpressionJob::handleResponse(), QLibraryPrivate::isPlugin(), kdeColor(), parseBrushValue(), parseColorValue(), parseCSStoXMLAttrs(), qt_applyFontDatabaseSettings(), QApplicationPrivate::qt_mac_apply_settings(), qtValue(), QVariantToVoidStar(), QCss::Declaration::rectValue(), Maemo::IcdPrivate::scan(), QPdfBaseEngine::setProperty(), streamDebug(), QLocale::uiLanguages(), QFactoryLoader::updateDir(), variantToString(), and QApplicationPrivate::x11_apply_settings().
QTime QVariant::toTime | ( | ) | const |
Returns the variant as a QTime if the variant has type() Time , DateTime , or String ; otherwise returns an invalid time.
If the type() is String , an invalid time will be returned if the string cannot be parsed as a Qt::ISODate format time.
Definition at line 2330 of file qvariant.cpp.
Referenced by QStyledItemDelegate::displayText(), QDateTimeEditPrivate::emitSignals(), QIBaseResult::exec(), QDB2Result::exec(), QODBCResult::exec(), QDeclarativeEnginePrivate::formatTime(), QSqlDriver::formatValue(), QIBaseDriver::formatValue(), QPSQLDriver::formatValue(), QDateTimeEditPrivate::init(), QSortFilterProxyModel::lessThan(), QStandardItem::operator<(), QSystemLocale::query(), QVariantToVoidStar(), streamDebug(), QDateTimeEditPrivate::updateTimeSpec(), QItemDelegatePrivate::valueToText(), QAbstractSpinBoxPrivate::variantCompare(), and QMYSQLResult::virtual_hook().
uint QVariant::toUInt | ( | bool * | ok = 0 | ) | const |
Returns the variant as an unsigned int if the variant has type() UInt , Bool , ByteArray , Char , Double , Int , LongLong , String , or ULongLong ; otherwise returns 0.
If ok is non-null: *
{ok} is set to true if the value could be converted to an unsigned int; otherwise *
{ok} is set to false.
Warning: If the value is convertible to a ULongLong but is too large to be represented in an unsigned int, the resulting arithmetic overflow will not be reflected in ok. A simple workaround is to use QString::toUInt(). Fixing this bug has been postponed to Qt 5 in order to avoid breaking existing code.
Definition at line 2644 of file qvariant.cpp.
Referenced by Maemo::IcdPrivate::addrinfo(), QDBusMarshaller::appendVariantInternal(), Maemo::appendVariantToDBusMessage(), QIcdEngine::asyncUpdateConfigurationsSlot(), QNetworkManagerInterfaceDeviceWireless::bitrate(), QLocalSocket::connectToServer(), copyArgument(), QNetworkManagerInterfaceDevice::deviceType(), QOCICols::execBatch(), QLocale::firstDayOfWeek(), QNetworkManagerInterfaceAccessPoint::flags(), QNetworkManagerInterfaceAccessPoint::frequency(), QNetworkManagerSettingsConnection::getTimestamp(), QColorDialogPrivate::init(), QNetworkManagerInterfaceDevice::ip4Address(), QSortFilterProxyModel::lessThan(), QNetworkManagerInterfaceAccessPoint::maxBitrate(), QNetworkManagerInterfaceAccessPoint::mode(), QNetworkManagerInterfaceDeviceWireless::mode(), QStandardItem::operator<(), QPainterReplayer::process(), QFontEngineQPF::QFontEngineQPF(), QVariantToVARIANT(), QVariantToVoidStar(), QDBusConnectionInterface::registerService(), QNetworkManagerInterfaceAccessPoint::rsnFlags(), QNetworkManagerInterfaceDeviceWired::speed(), Maemo::IcdPrivate::state(), QNetworkManagerInterface::state(), QNetworkManagerInterfaceDevice::state(), QNetworkManagerConnectionActive::state(), Maemo::IcdPrivate::statistics(), streamDebug(), QNetworkManagerInterfaceAccessPoint::strength(), QSystemLocalePrivate::toCurrencyString(), QDBusConnectionInterface::unregisterService(), QScript::variantProtoFuncValueOf(), QNetworkManagerInterfaceDeviceWireless::wirelessCapabilities(), and QNetworkManagerInterfaceAccessPoint::wpaFlags().
qulonglong QVariant::toULongLong | ( | bool * | ok = 0 | ) | const |
Returns the variant as as an unsigned long long int if the variant has type() ULongLong , Bool , ByteArray , Char , Double , Int , LongLong , String , or UInt ; otherwise returns 0.
If ok is non-null: *
{ok} is set to true if the value could be converted to an int; otherwise *
{ok} is set to false.
Definition at line 2675 of file qvariant.cpp.
Referenced by QDBusMarshaller::appendVariantInternal(), Maemo::appendVariantToDBusMessage(), QOCIResultPrivate::bindValue(), copyArgument(), QStyledItemDelegate::displayText(), QOCICols::execBatch(), QSortFilterProxyModel::lessThan(), QStandardItem::operator<(), QVariantToVARIANT(), QVariantToVoidStar(), streamDebug(), QSystemLocalePrivate::toCurrencyString(), QPatternist::AtomicValue::toXDM(), QItemDelegatePrivate::valueToText(), and variantToString().
QUrl QVariant::toUrl | ( | ) | const |
Returns the variant as a QUrl if the variant has type() Url ; otherwise returns an invalid QUrl.
Definition at line 2528 of file qvariant.cpp.
Referenced by QFileDialogPrivate::_q_goToDirectory(), QUrlModel::addUrls(), QUrlModel::changed(), QMacPasteboardMimeFileUri::convertFromMime(), QMacPasteboardMimeUrl::convertFromMime(), QDeclarativeInclude::finished(), QDeclarativeXMLHttpRequest::finished(), headerValue(), QUrlModel::mimeData(), QDeclarativeAnimatedImage::movieRequestFinished(), QDeclarativeDataLoader::networkReplyFinished(), QDeclarativePixmapReader::networkRequestDone(), QSidebar::removeEntry(), QDeclarativeFontObject::replyFinished(), QDeclarativeXmlListModel::requestFinished(), QMimeDataPrivate::retrieveTypedData(), QDeclarativeBorderImage::sciRequestFinished(), QSidebar::selectUrl(), QNetworkAccessCacheBackend::sendCacheContents(), QUrlModel::setData(), streamDebug(), toUrl(), QPatternist::AtomicValue::toXDM(), QMimeData::urls(), and QDeclarativePropertyPrivate::write().
QVariant::Type QVariant::type | ( | ) | const |
Returns the storage type of the value stored in the variant.
Although this function is declared as returning QVariant::Type, the return value should be interpreted as QMetaType::Type. In particular, QVariant::UserType is returned here only if the value is equal or greater than QMetaType::User.
Note that return values in the ranges QVariant::Char through QVariant::RegExp and QVariant::Font through QVariant::Transform correspond to the values in the ranges QMetaType::QChar through QMetaType::QRegExp and QMetaType::QFont through QMetaType::QQuaternion.
Pay particular attention when working with char and QChar variants. Note that there is no QVariant constructor specifically for type char, but there is one for QChar. For a variant of type QChar, this function returns QVariant::Char, which is the same as QMetaType::QChar, but for a variant of type char
, this function returns QMetaType::Char, which is not the same as QVariant::Char.
Also note that the types void*
, long
, short
, unsigned
long
, unsigned
short
, unsigned
char
, float
, QObject*
, and QWidget*
are represented in QMetaType::Type but not in QVariant::Type, and they can be returned by this function. However, they are considered to be user defined types when tested against QVariant::Type.
To test whether an instance of QVariant contains a data type that is compatible with the data type you are interested in, use canConvert().
Definition at line 1901 of file qvariant.cpp.
Referenced by QPageSetupWidget::_q_paperSizeChanged(), QFontDatabasePrivate::addQPF2File(), Maemo::IcdPrivate::addrinfo(), QDBusMarshaller::appendVariantInternal(), Maemo::appendVariantToDBusMessage(), QTextHtmlParserNode::applyBackgroundImage(), QStyleSheetStyleSelector::attribute(), QOCIResultPrivate::bindValue(), QCss::Declaration::brushValues(), QCss::Declaration::colorValues(), Maemo::constantVariantList(), create(), createArrayBuffer(), QAccessibleAbstractSpinBox::currentValue(), QItemDelegate::decoration(), do_dbus_call(), QAxBase::dynamicCall(), QPatternist::VariableLoader::evaluateSequence(), QDB2Result::exec(), QSQLiteResult::exec(), QSymSQLResult::exec(), QODBCResult::exec(), QSqlResult::exec(), QTextHtmlExporter::findUrlForImage(), QDeclarativeEnginePrivate::formatTime(), QSqlDriver::formatValue(), QComboMenuDelegate::getStyleOption(), QIBaseResult::gotoNext(), headerValue(), QTextHtmlParser::importStyleSheet(), QDateTimeEditPrivate::init(), QStyledItemDelegate::initStyleOption(), QGraphicsView::inputMethodQuery(), QGraphicsScene::inputMethodQuery(), QPlainTextEdit::inputMethodQuery(), QTextEdit::inputMethodQuery(), QGraphicsTextItem::inputMethodQuery(), QGraphicsProxyWidgetPrivate::inputMethodQueryHelper(), QPatternist::VariableLoader::isSameType(), QComboBoxPrivate::itemIcon(), QAbstractItemView::keyPressEvent(), QSortFilterProxyModel::lessThan(), QTextDocument::loadResource(), macFormatCurrency(), macValue(), operator*(), operator+(), operator-(), operator/(), operator<<(), QOCIResultPrivate::outValues(), QItemDelegate::paint(), qCreateParamString(), qOraOutValue(), qtValue(), QVariantToVARIANT(), QVariantToVoidStar(), QItemDelegate::rect(), QPlatformFontDatabase::registerQPF2Font(), QTextEditPrivate::relayoutDocument(), QTextEdit::resizeEvent(), QInternalMimeData::retrieveData(), QMimeDataPrivate::retrieveTypedData(), save(), Maemo::IcdPrivate::scan(), QWinSettingsPrivate::set(), QStandardItem::setData(), QUrlModel::setData(), QTiffHandler::setOption(), QStyleSheetStyle::setProperties(), QDeclarativeValueTypeScriptClass::setProperty(), QTextBrowserPrivate::setSource(), QPageSetupWidget::setupPrinter(), Maemo::IcdPrivate::state(), Maemo::IcdPrivate::statistics(), streamDebug(), QSystemLocalePrivate::toCurrencyString(), toUrl(), ShaderEffectItem::updateEffectState(), QMimeData::urls(), QDeclarativeEngineDebugService::valueContents(), QAbstractSpinBoxPrivate::variantCompare(), QScript::variantProtoFuncValueOf(), VARIANTToQVariant(), Maemo::variantToSignature(), QSettingsPrivate::variantToString(), Maemo::IAPConfPrivate::variantToValue(), QMYSQLResult::virtual_hook(), QMetaProperty::write(), and QConfFileSettingsPrivate::writeIniFile().
const char * QVariant::typeName | ( | ) | const |
Returns the name of the type stored in the variant.
The returned strings describe the C++ datatype used to store the data: for example, "QFont", "QString", or "QVariantList". An Invalid variant returns 0.
Definition at line 1984 of file qvariant.cpp.
Referenced by QScript::callQtMethod(), QDBusConnectionPrivate::deliverCall(), QAxBase::dynamicCallHelper(), QScriptEnginePrivate::jscValueToVariant(), QAxServerBase::Load(), operator+(), operator-(), operator<<(), QDBusAbstractInterfacePrivate::property(), qDBusReplyFill(), QVariantToVARIANT(), QAxServerBase::Save(), QNetworkHeadersPrivate::setCookedHeader(), ShaderEffectItem::setSource(), QTest::toString(), QPatternist::AtomicValue::toXDM(), QAbstractSpinBoxPrivate::variantCompare(), QScript::variantFromValue(), variantHash(), QScript::variantProtoFuncToString(), variantToString(), and QMetaProperty::write().
|
static |
Converts the enum representation of the storage type, typ, to its string representation.
Returns a null pointer if the type is QVariant::Invalid or doesn't exist.
Definition at line 2008 of file qvariant.cpp.
Referenced by QDBusMarshaller::append(), QDBusMarshaller::appendVariantInternal(), QDBusMarshaller::beginArray(), QDBusMarshaller::beginMap(), QDBusArgumentPrivate::createSignature(), QDBusMetaObjectGenerator::findType(), generateInterfaceXml(), operator<<(), qDBusReplyFill(), QDeclarativeCompiler::testLiteralAssignment(), and typeName().
int QVariant::userType | ( | ) | const |
Returns the storage type of the value stored in the variant.
For non-user types, this is the same as type().
Definition at line 1913 of file qvariant.cpp.
Referenced by QTextCharFormat::anchorName(), QTextCharFormat::anchorNames(), QPatternist::VariableLoader::announceExternalVariable(), QDBusMarshaller::append(), QDBusMarshaller::appendRegisteredType(), QDBusMarshaller::appendVariantInternal(), QTextFormat::boolProperty(), QTextFormat::brushProperty(), QScript::callQtMethod(), QTextFormat::colorProperty(), QDeclarativeGestureAreaParser::compile(), QDeclarativeConnectionsParser::compile(), QDeclarativePropertyChangesParser::compileList(), QDeclarativeListModelParser::compileProperty(), QDeclarativeContextPrivate::context_at(), QDeclarativeContextPrivate::context_count(), QScriptEnginePrivate::convertValue(), QDeclarativePropertyAnimationPrivate::convertVariant(), copyArgument(), QStyledItemDelegate::createEditor(), QItemDelegate::createEditor(), QPatternist::URILoader::createRequest(), QDBusArgumentPrivate::createSignature(), QDeclarativeEnginePrivate::darker(), QDBusConnectionPrivate::deliverCall(), QStyledItemDelegate::displayText(), do_dbus_call(), QTextFormat::doubleProperty(), QPatternist::VariableLoader::evaluateSequence(), headerValue(), QDeclarativeKeysAttached::inputMethodQuery(), QTextFormat::intProperty(), QPatternist::VariableLoader::isSameType(), QPatternist::VariableLoader::itemForName(), QScriptEnginePrivate::jscValueFromVariant(), QTextFormat::lengthVectorProperty(), QSortFilterProxyModel::lessThan(), QDeclarativeEnginePrivate::lighter(), QDeclarativeObjectMethodScriptClass::matchScore(), QScriptEnginePrivate::newVariant(), QTextFormat::objectIndex(), QStandardItem::operator<(), QTextTableData::paddingProperty(), QTextFormat::penProperty(), QDBusConnectionPrivate::prepareReply(), QDeclarativeObjectMethodScriptClass::property(), QDeclarativeContextScriptClass::property(), QDBusAbstractInterfacePrivate::property(), qDBusReplyFill(), qvariant_cast(), save(), QDeclarativeEnginePrivate::scriptValueFromVariant(), QStyledItemDelegate::setEditorData(), QItemDelegate::setEditorData(), QDeclarativeListAccessor::setList(), QStyledItemDelegate::setModelData(), QItemDelegate::setModelData(), QDeclarativeObjectScriptClass::setProperty(), streamDebug(), QTextFormat::stringProperty(), QDeclarativeEnginePrivate::tint(), QDeclarativeMetaType::toQObject(), QScriptEnginePrivate::toQObject(), QDeclarativeEnginePrivate::toQObject(), QTest::toString(), QPatternist::AtomicValue::toXDM(), typeOfVariant(), QDeclarativeBinding::update(), QPropertyAnimationPrivate::updateProperty(), QDeclarativeEngineDebugService::valueContents(), QItemDelegatePrivate::valueToText(), variantHash(), variantToQObject(), QDeclarativeWorkerScriptEnginePrivate::variantToScriptValue(), variantToString(), QDeclarativePropertyPrivate::write(), QMetaProperty::write(), QDeclarativePropertyPrivate::writeEnumProperty(), writeProperty(), and QDeclarativeVMEMetaObject::writeVarProperty().
|
inline |
Returns the stored value converted to the template type T
.
Call canConvert() to find out whether a type can be converted. If the value cannot be converted, default-constructed value will be returned.
If the type T
is supported by QVariant, this function behaves exactly as toString(), toInt() etc.
Example:
Definition at line 332 of file qvariant.h.
Referenced by QNetworkManagerInterfaceDeviceWireless::activeAccessPoint(), QNetworkManagerInterface::activeConnections(), QNetworkReply::attribute(), QPaintBuffer::commandDescription(), QNetworkManagerConnectionActive::connection(), copyArgument(), QDeclarativeEnginePrivate::darker(), QDeclarativeEngineDebugPrivate::decode(), QNetworkManagerConnectionActive::devices(), QOfonoNetworkRegistrationInterface::getCellId(), QOfonoNetworkRegistrationInterface::getLac(), QNetworkReply::header(), QSortFilterProxyModel::headerData(), QDeclarativeVisualDataModelDataMetaObject::initialValue(), QNetworkManagerInterfaceDevice::ip4config(), QDeclarativeBasePositioner::itemChange(), QDeclarativeItem::itemChange(), QDeclarativeEnginePrivate::lighter(), QFontEngineQPA::maxCharWidth(), QFontEngineQPF::maxCharWidth(), QFontEngineQPA::minLeftBearing(), QFontEngineQPF::minLeftBearing(), QFontEngineQPA::minRightBearing(), QFontEngineQPF::minRightBearing(), operator<<(), operator>>(), QPainterReplayer::process(), QTreeWidgetItem::read(), QSvgIOHandler::setOption(), QNetworkManagerConnectionActive::specificObject(), QDeclarativeEnginePrivate::tint(), QPatternist::AtomicValue::toXDM(), QPatternist::VariableLoader::valueFor(), QLocale::weekdays(), and QConfFileSettingsPrivate::writeIniFile().
Returns false if v1 and v2 are equal; otherwise returns true.
|
friend |
Definition at line 3108 of file qvariant.cpp.
|
friend |
Returns true if v1 and v2 are equal; otherwise returns false.
|
friend |
Definition at line 811 of file qguivariant.cpp.
|
friend |
Definition at line 820 of file qguivariant.cpp.
|
related |
Returns the given value converted to the template type T
.
This function is equivalent to QVariant::value().
Definition at line 571 of file qvariant.h.
Referenced by do_dbus_call(), getImage(), getPixmap(), qDBusPropertySet(), qDBusReplyFill(), QVariantToVARIANT(), streamDebug(), and variantToString().
|
friend |
Definition at line 447 of file qvariant.h.
|
related |
Returns true if the given value can be converted to the template type specified; otherwise returns false.
This function is equivalent to QVariant::canConvert(value).
Definition at line 597 of file qvariant.h.
|
related |
Returns a variant containing a copy of the given value with template type T
.
This function is equivalent to QVariant::fromValue(value).
For example, a QObject pointer can be stored in a variant with the following code:
Definition at line 451 of file qvariant.h.
|
related |
Synonym for QHash<QString, QVariant>.
|
related |
Synonym for QList<QVariant>.
Referenced by VARIANTToQVariant().
|
related |
Synonym for QMap<QString, QVariant>.
|
related |
Sets the contents of the given variant to a copy of the value with the specified template type T
.
This function is equivalent to QVariant::setValue(value).
Definition at line 460 of file qvariant.h.
|
related |
Returns the given value converted to the template type T
.
This function is equivalent to QVariant::value<T>(value).
Definition at line 593 of file qvariant.h.
|
protected |
Definition at line 417 of file qvariant.h.
Referenced by canConvert(), clear(), cmp(), constData(), convert(), create(), data(), detach(), isNull(), load(), operator=(), QVariant(), qvariant_cast_helper(), qVariantToHelper(), save(), swap(), toBitArray(), toBool(), toByteArray(), toChar(), toDate(), toDateTime(), toDouble(), toEasingCurve(), toFloat(), toHash(), toInt(), toLine(), toLineF(), toList(), toLocale(), toLongLong(), toMap(), toPoint(), toPointF(), toReal(), toRect(), toRectF(), toRegExp(), toSize(), toSizeF(), toString(), toStringList(), toTime(), toUInt(), toULongLong(), toUrl(), type(), typeName(), userType(), and ~QVariant().
|
staticprotected |
Definition at line 419 of file qvariant.h.
Referenced by clear(), cmp(), convert(), create(), detach(), isNull(), operator<<(), operator=(), qcoreVariantHandler(), qRegisterGuiVariant(), qUnregisterGuiVariant(), QVariant(), qvariant_cast_helper(), toBitArray(), toBool(), toByteArray(), toChar(), toDate(), toDateTime(), toDouble(), toEasingCurve(), toFloat(), toHash(), toInt(), toLine(), toLineF(), toList(), toLocale(), toLongLong(), toMap(), toPoint(), toPointF(), toReal(), toRect(), toRectF(), toRegExp(), toSize(), toSizeF(), toString(), toStringList(), toTime(), toUInt(), toULongLong(), toUrl(), and ~QVariant().