55 #include "private/qvariant_p.h" 57 #ifndef QT_NO_GEOM_VARIANT 75 static void construct(QVariant::Private *x,
const void *copy)
81 v_construct<QString>(x, copy);
84 v_construct<QChar>(x, copy);
87 v_construct<QStringList>(x, copy);
90 v_construct<QVariantMap>(x, copy);
93 v_construct<QVariantHash>(x, copy);
96 v_construct<QVariantList>(x, copy);
99 v_construct<QDate>(x, copy);
102 v_construct<QTime>(x, copy);
105 v_construct<QDateTime>(x, copy);
108 v_construct<QByteArray>(x, copy);
111 v_construct<QBitArray>(x, copy);
113 #ifndef QT_NO_GEOM_VARIANT 115 v_construct<QSize>(x, copy);
118 v_construct<QSizeF>(x, copy);
121 v_construct<QRect>(x, copy);
124 v_construct<QLineF>(x, copy);
127 v_construct<QLine>(x, copy);
130 v_construct<QRectF>(x, copy);
133 v_construct<QPoint>(x, copy);
136 v_construct<QPointF>(x, copy);
139 #ifndef QT_BOOTSTRAPPED 141 v_construct<QUrl>(x, copy);
145 v_construct<QLocale>(x, copy);
149 v_construct<QRegExp>(x, copy);
152 #ifndef QT_BOOTSTRAPPED 154 v_construct<QEasingCurve>(x, copy);
158 x->data.i = copy ? *
static_cast<const int *
>(copy) : 0;
161 x->data.u = copy ? *
static_cast<const uint *
>(copy) : 0
u;
164 x->data.b = copy ? *
static_cast<const bool *
>(copy) :
false;
167 x->data.d = copy ? *
static_cast<const double*
>(copy) : 0.0;
170 x->data.f = copy ? *
static_cast<const float*
>(copy) : 0.0f;
173 x->data.o = copy ? *
static_cast<QObject *const*
>(copy) : 0;
190 x->data.shared =
new QVariant::PrivateShared(ptr);
207 v_clear<QStringList>(
d);
210 v_clear<QVariantMap>(
d);
213 v_clear<QVariantHash>(
d);
216 v_clear<QVariantList>(
d);
225 v_clear<QDateTime>(
d);
228 v_clear<QByteArray>(
d);
231 v_clear<QBitArray>(
d);
233 #ifndef QT_NO_GEOM_VARIANT 259 #ifndef QT_BOOTSTRAPPED 272 #ifndef QT_BOOTSTRAPPED 274 v_clear<QEasingCurve>(
d);
291 delete d->data.shared;
297 d->is_shared =
false;
300 static bool isNull(
const QVariant::Private *
d)
317 #ifndef QT_NO_GEOM_VARIANT 335 #ifndef QT_BOOTSTRAPPED 371 return *
static_cast<const T *
>(a->data.shared->ptr) == *static_cast<const T *>(b->data.shared->ptr);
383 static bool compare(
const QVariant::Private *
a,
const QVariant::Private *b)
391 if (m1->
count() != m2->count())
396 if (*it != *it2 || it.key() != it2.key())
411 #ifndef QT_NO_GEOM_VARIANT 429 #ifndef QT_BOOTSTRAPPED 440 return a->data.i == b->data.i;
442 return a->data.u == b->data.u;
444 return a->data.ll == b->data.ll;
446 return a->data.ull == b->data.ull;
448 return a->data.b == b->data.b;
450 return a->data.d == b->data.d;
452 return a->data.f == b->data.f;
454 return a->data.o == b->data.o;
461 #ifndef QT_BOOTSTRAPPED 472 return compareNumericMetaType<long>(
a, b);
474 return compareNumericMetaType<ulong>(
a, b);
476 return compareNumericMetaType<short>(
a, b);
478 return compareNumericMetaType<ushort>(
a, b);
480 return compareNumericMetaType<uchar>(
a, b);
482 return compareNumericMetaType<char>(
a, b);
487 qFatal(
"QVariant::compare: type %d unknown to QVariant.", a->type);
489 const void *a_ptr = a->is_shared ? a->data.shared->ptr : &(a->data.ptr);
490 const void *b_ptr = b->is_shared ? b->data.shared->ptr : &(b->data.ptr);
497 if (typeNameLen > 0 && typeName[typeNameLen - 1] ==
'*')
498 return *
static_cast<void *
const *
>(a_ptr) == *static_cast<void *const *>(b_ptr);
500 if (a->is_null && b->is_null)
503 return a_ptr == b_ptr;
517 return qlonglong(*static_cast<signed char *>(d->data.shared->ptr));
519 return qlonglong(*static_cast<short *>(d->data.shared->ptr));
521 return qlonglong(*static_cast<long *>(d->data.shared->ptr));
539 return qulonglong(*static_cast<unsigned char *>(d->data.shared->ptr));
541 return qulonglong(*static_cast<ushort *>(d->data.shared->ptr));
543 return qulonglong(*static_cast<ulong *>(d->data.shared->ptr));
553 switch (
uint(d->type)) {
586 switch (
uint(d->type)) {
615 template<
typename TInput,
typename LiteralWrapper>
618 TInput str =
v_cast<TInput>(
d)->toLower();
619 return !(str == LiteralWrapper(
"0") || str == LiteralWrapper(
"false") || str.isEmpty());
637 #ifndef QT_BOOTSTRAPPED 641 *
static_cast<QUrl *
>(result) =
QUrl(*v_cast<QString>(d));
652 *str =
QString(*v_cast<QChar>(d));
676 #if !defined(QT_NO_DATESTRING) 694 if (v_cast<QStringList>(d)->count() == 1)
697 #ifndef QT_BOOTSTRAPPED 730 #ifndef QT_NO_GEOM_VARIANT 747 *s =
QSizeF(*(v_cast<QSize>(d)));
771 *s =
QLineF(*(v_cast<QLine>(d)));
783 for (
int i = 0; i < list->
size(); ++i)
796 #ifndef QT_NO_DATESTRING 811 #ifndef QT_NO_DATESTRING 824 #ifndef QT_NO_DATESTRING 851 *ba =
QByteArray(1, *static_cast<char *>(d->data.shared->ptr));
866 *ba =
QByteArray(d->data.b ?
"true" :
"false");
903 bool *b =
static_cast<bool *
>(result);
906 *b = qt_convertToBool<QByteArray, QByteArray>(
d);
909 *b = qt_convertToBool<QString, QLatin1String>(
d);
937 double *f =
static_cast<double *
>(result);
946 *f = double(d->data.b);
949 *f = double(d->data.f);
972 float *f =
static_cast<float *
>(result);
981 *f = float(d->data.b);
984 *f = float(d->data.d);
1010 for (
int i = 0; i < slist->
size(); ++i)
1035 #ifndef QT_NO_GEOM_VARIANT 1038 *
static_cast<QRect *
>(result) = (v_cast<QRectF>(d))->toRect();
1044 *
static_cast<QRectF *
>(result) = *v_cast<QRect>(d);
1050 *
static_cast<QPointF *
>(result) = *v_cast<QPoint>(d);
1056 *
static_cast<QPoint *
>(result) = (v_cast<QPointF>(d))->toPoint();
1072 #if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM) 1127 #ifndef QT_BOOTSTRAPPED 1135 #ifndef QT_BOOTSTRAPPED 1140 #ifndef QT_NO_GEOM_VARIANT 1179 #ifndef QT_NO_DATASTREAM 1186 #if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM) 1429 if ((
d.is_shared && !
d.data.shared->ref.deref()) || (!
d.is_shared &&
d.type >
Char &&
d.type <
UserType))
1447 d.data.shared->ref.ref();
1450 d.is_null = p.
d.is_null;
1454 #ifndef QT_NO_DATASTREAM 1463 #endif //QT_NO_DATASTREAM 1500 #ifndef QT_NO_CAST_FROM_ASCII 1791 {
create(typeOrUserType, copy);
d.is_null =
false; }
1799 d.type = typeOrUserType;
1800 d.data.ptr = *
reinterpret_cast<void *const*
>(copy);
1803 create(typeOrUserType, copy);
1809 {
d.is_null =
false;
d.type =
Int;
d.data.i = val; }
1811 {
d.is_null =
false;
d.type =
UInt;
d.data.u = val; }
1813 {
d.is_null =
false;
d.type =
LongLong;
d.data.ll = val; }
1815 {
d.is_null =
false;
d.type =
ULongLong;
d.data.ull = val; }
1817 {
d.is_null =
false;
d.type =
Bool;
d.data.b = val; }
1819 {
d.is_null =
false;
d.type =
Double;
d.data.d = val; }
1822 {
d.is_null =
false;
d.type =
ByteArray; v_construct<QByteArray>(&
d, val); }
1824 {
d.is_null =
false;
d.type =
BitArray; v_construct<QBitArray>(&
d, val); }
1826 {
d.is_null =
false;
d.type =
String; v_construct<QString>(&
d, val); }
1828 {
d.is_null =
false;
d.type =
Char; v_construct<QChar>(&
d, val); }
1830 {
QString str(val);
d.is_null =
false;
d.type =
String; v_construct<QString>(&
d, str); }
1832 {
d.is_null =
false;
d.type =
StringList; v_construct<QStringList>(&
d, val); }
1835 {
d.is_null =
false;
d.type =
Date; v_construct<QDate>(&
d, val); }
1837 {
d.is_null =
false;
d.type =
Time; v_construct<QTime>(&
d, val); }
1839 {
d.is_null =
false;
d.type =
DateTime; v_construct<QDateTime>(&
d, val); }
1840 #ifndef QT_BOOTSTRAPPED 1842 {
d.is_null =
false;
d.type =
EasingCurve; v_construct<QEasingCurve>(&
d, val); }
1845 {
d.is_null =
false;
d.type =
List; v_construct<QVariantList>(&
d, list); }
1847 {
d.is_null =
false;
d.type =
Map; v_construct<QVariantMap>(&
d,
map); }
1849 {
d.is_null =
false;
d.type =
Hash; v_construct<QVariantHash>(&
d,
hash); }
1850 #ifndef QT_NO_GEOM_VARIANT 1860 #ifndef QT_BOOTSTRAPPED 1864 #ifndef QT_NO_REGEXP 1923 if (
this == &variant)
1927 if (variant.
d.is_shared) {
1928 variant.
d.data.shared->ref.ref();
1931 d.type = variant.
d.type;
1933 d.is_null = variant.
d.is_null;
1960 if (!
d.is_shared ||
d.data.shared->ref == 1)
1966 if (!
d.data.shared->ref.deref())
1968 d.data.shared = dd.data.shared;
1995 if ((
d.is_shared && !
d.data.shared->ref.deref()) || (!
d.is_shared &&
d.type <
UserType &&
d.type >
Char))
1999 d.is_shared =
false;
2028 if (!name || !*name)
2030 if (strcmp(name,
"Q3CString") == 0)
2032 if (strcmp(name,
"Q_LLONG") == 0)
2034 if (strcmp(name,
"Q_ULLONG") == 0)
2036 if (strcmp(name,
"QIconSet") == 0)
2038 if (strcmp(name,
"UserType") == 0)
2045 #ifndef QT_NO_DATASTREAM 2104 qint8 is_null =
false;
2116 create(static_cast<int>(u), 0);
2117 d.is_null = is_null;
2130 qWarning(
"QVariant::load: unable to load type %d.",
d.type);
2169 Q_ASSERT_X(
false,
"QVariant::save",
"Invalid type to save");
2170 qWarning(
"QVariant::save: unable to save type %d.",
d.type);
2218 s << static_cast<quint32>(p);
2223 #endif //QT_NO_DATASTREAM 2235 template <
typename T>
2237 const QVariant::Handler *
handler, T * = 0)
2243 handler->convert(&d, t, &ret, 0);
2283 return qVariantToHelper<QVariantMap>(
d,
Map,
handler);
2294 return qVariantToHelper<QVariantHash>(
d,
Hash,
handler);
2365 #ifndef QT_BOOTSTRAPPED 2388 #ifndef QT_NO_GEOM_VARIANT 2514 #endif // QT_NO_GEOM_VARIANT 2516 #ifndef QT_BOOTSTRAPPED 2561 #ifndef QT_NO_REGEXP 2595 template <
typename T>
2597 const QVariant::Handler *
handler,
bool *ok,
const T& val)
2599 uint t = qMetaTypeId<T>();
2627 return qNumVariantToHelper<int>(
d,
handler, ok, d.data.i);
2646 return qNumVariantToHelper<uint>(
d,
handler, ok, d.data.u);
2661 return qNumVariantToHelper<qlonglong>(
d,
handler, ok, d.data.ll);
2677 return qNumVariantToHelper<qulonglong>(
d,
handler, ok, d.data.ull);
2712 return qNumVariantToHelper<double>(
d,
handler, ok, d.data.d);
2727 return qNumVariantToHelper<float>(
d,
handler, ok, d.data.f);
2742 return qNumVariantToHelper<qreal>(
d,
handler, ok, d.data.real);
2753 return qVariantToHelper<QVariantList>(
d,
List,
handler);
2895 if (currentType ==
uint(t))
2961 if (
d.type ==
uint(t))
3049 if (
d.type != v2.
d.type) {
3067 return d.is_shared ?
d.data.shared->ptr :
reinterpret_cast<const void *
>(&
d.data.ptr);
3087 void *QVariant::castOrDetach(
Type t)
3089 if (
d.type !=
uint(t)) {
3107 #ifndef QT_NO_DEBUG_STREAM 3110 #ifndef Q_BROKEN_DEBUG_STREAM 3116 qWarning(
"This compiler doesn't support streaming QVariant to QDebug");
3124 #ifndef Q_BROKEN_DEBUG_STREAM 3128 qWarning(
"This compiler doesn't support streaming QVariant::Type to QDebug");
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QVariant class acts like a union for the most common Qt data types.
The QDebug class provides an output stream for debugging information.
static uint hash(const uchar *p, int n)
QVariant & operator=(const QVariant &other)
Assigns the value of the variant variant to this variant.
QRegExp toRegExp() const
Returns the variant as a QRegExp if the variant has type() RegExp ; otherwise returns an empty QRegEx...
#define QT_END_NAMESPACE
This macro expands to.
QPointF toPointF() const
Returns the variant as a QPointF if the variant has type() Point or PointF ; otherwise returns a null...
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
QLine toLine() const
Returns the variant as a QLine if the variant has type() Line ; otherwise returns an invalid QLine...
~QVariant()
Destroys the QVariant and the contained object.
The QEasingCurve class provides easing curves for controlling animation.
void create(int type, const void *copy)
The QLine class provides a two-dimensional vector using integer precision.
QMap< QString, QVariant > toMap() const
Returns the variant as a QMap<QString, QVariant> if the variant has type() Map ; otherwise returns an...
QDataStream & operator>>(QDataStream &s, QVariant &p)
Reads a variant p from the stream s.
The QRegExp class provides pattern matching using regular expressions.
bool isValid() const
Returns true if this date is valid; otherwise returns false.
bool isNull() const
Returns true if this is a NULL variant, false otherwise.
#define it(className, varName)
QDebug & nospace()
Clears the stream's internal flag that records whether the last character was a space and returns a r...
#define at(className, varName)
The QByteArray class provides an array of bytes.
The QPointF class defines a point in the plane using floating point precision.
static void clear(QVariant::Private *d)
int count(const Key &key) const
Returns the number of items associated with key key.
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
QDateTime toDateTime() const
Returns the variant as a QDateTime if the variant has type() DateTime , Date , or String ; otherwise ...
QList< QVariant > toList() const
Returns the variant as a QVariantList if the variant has type() List or StringList ; otherwise return...
bool isValid() const
Returns true if both the date and the time are valid; otherwise returns false.
Q_DECL_CONSTEXPR qint64 qRound64(qreal d)
The QDate class provides date functions.
static Q_DECL_CONSTEXPR bool qFuzzyCompare(double p1, double p2)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
bool toBool() const
Returns the variant as a bool if the variant has type() Bool.
long ASN1_INTEGER_get ASN1_INTEGER * a
void setStatus(Status status)
Sets the status of the data stream to the status given.
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
int qstrcmp(const char *str1, const char *str2)
A safe strcmp() function.
QRectF toRectF() const
Returns the variant as a QRectF if the variant has type() Rect or RectF ; otherwise returns an invali...
static const char * typeToName(Type type)
Converts the enum representation of the storage type, typ, to its string representation.
The QObject class is the base class of all Qt objects.
static const ushort map_from_three[MapFromThreeCount]
const QVariant::Handler qt_kernel_variant_handler
The QSizeF class defines the size of a two-dimensional object using floating point precision...
The QChar class provides a 16-bit Unicode character.
QByteArray toByteArray() const
Returns the variant as a QByteArray if the variant has type() ByteArray or String (converted using QS...
bool canConvert() const
Returns true if the variant can be converted to the template type T, otherwise false.
const T * v_cast(const QVariant::Private *d, T *=0)
The QLineF class provides a two-dimensional vector using floating point precision.
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
static void streamDebug(QDebug dbg, const QVariant &v)
static QString toString(Register *reg, int type, bool *ok=0)
QStringList toStringList() const
Returns the variant as a QStringList if the variant has type() StringList, String ...
static QDateTime fromString(const QString &s, Qt::DateFormat f=Qt::TextDate)
Returns the QDateTime represented by the string, using the format given, or an invalid datetime if th...
void load(QDataStream &ds)
Internal function for loading a variant from stream s.
void append(const T &t)
Inserts value at the end of the list.
The QTime class provides clock time functions.
QFuture< void > map(Sequence &sequence, MapFunction function)
#define QT_BEGIN_NAMESPACE
This macro expands to.
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.
static bool compare(const QVariant::Private *a, const QVariant::Private *b)
Compares a to b.
The QRectF class defines a rectangle in the plane using floating point precision. ...
static const Handler * handler
const_iterator ConstIterator
Qt-style synonym for QMap::const_iterator.
bool canConvert(Type t) const
Returns true if the variant's type can be cast to the requested type, t.
static bool qIsFloatingPoint(uint tp)
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
QHash< QString, QVariant > toHash() const
Returns the variant as a QHash<QString, QVariant> if the variant has type() Hash ; otherwise returns ...
qulonglong toULongLong(bool *ok=0) const
Returns the variant as as an unsigned long long int if the variant has type() ULongLong ...
Q_CORE_EXPORT void qWarning(const char *,...)
QVariant()
Constructs an invalid variant.
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Type
This enum type defines the types of variable that a QVariant can contain.
static bool qIsNumericType(uint tp)
const T * ptr(const T &t)
T qNumVariantToHelper(const QVariant::Private &d, const QVariant::Handler *handler, bool *ok, const T &val)
static const quint32 qCanConvertMatrix[QVariant::LastCoreType+1]
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the map.
QLocale toLocale() const
Returns the variant as a QLocale if the variant has type() Locale ; otherwise returns an invalid QLoc...
const char * typeName() const
Returns the name of the type stored in the variant.
QUrl toUrl() const
Returns the variant as a QUrl if the variant has type() Url ; otherwise returns an invalid QUrl...
QSize toSize() const
Returns the variant as a QSize if the variant has type() Size ; otherwise returns an invalid QSize...
static qulonglong qConvertToUnsignedNumber(const QVariant::Private *d, bool *ok)
T qVariantToHelper(const QVariant::Private &d, QVariant::Type t, const QVariant::Handler *handler, T *=0)
static QTime fromString(const QString &s, Qt::DateFormat f=Qt::TextDate)
Returns the time represented in the string as a QTime using the format given, or an invalid time if t...
bool convert(Type t)
Casts the variant to the requested type, t.
int version() const
Returns the version number of the data serialization format.
The QBitArray class provides an array of bits.
QSizeF toSizeF() const
Returns the variant as a QSizeF if the variant has type() SizeF ; otherwise returns an invalid QSizeF...
static bool convert(const QVariant::Private *d, QVariant::Type t, void *result, bool *ok)
QDate toDate() const
Returns the variant as a QDate if the variant has type() Date , DateTime , or String ; otherwise retu...
Q_CORE_EXPORT void qFatal(const char *,...)
void clear()
Convert this variant to type Invalid and free up any resources used.
#define Q_ASSERT_X(cond, where, what)
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the map...
QEasingCurve toEasingCurve() const
Returns the variant as a QEasingCurve if the variant has type() EasingCurve ; otherwise returns a def...
int userType() const
Returns the storage type of the value stored in the variant.
QLineF toLineF() const
Returns the variant as a QLineF if the variant has type() LineF ; otherwise returns an invalid QLineF...
The QDateTime class provides date and time functions.
bool qt_convertToBool(const QVariant::Private *const d)
static void construct(QVariant::Private *x, const void *copy)
QRect toRect() const
Returns the variant as a QRect if the variant has type() Rect ; otherwise returns an invalid QRect...
Type type() const
Returns the storage type of the value stored in the variant.
uint qstrlen(const char *str)
const void * constData() const
The QPoint class defines a point in the plane using integer precision.
static QDate fromString(const QString &s, Qt::DateFormat f=Qt::TextDate)
Returns the QDate represented by the string, using the format given, or an invalid date if the string...
uint toUInt(bool *ok=0) const
Returns the variant as an unsigned int if the variant has type() UInt , Bool , ByteArray ...
int size() const
Returns the number of items in the list.
float toFloat(bool *ok=0) const
Returns the variant as a float if the variant has type() Double , QMetaType::Float ...
The QRect class defines a rectangle in the plane using integer precision.
Q_CORE_EXPORT const QVariant::Handler * qcoreVariantHandler()
double toDouble(bool *ok=0) const
Returns the variant as a double if the variant has type() Double , QMetaType::Float ...
static qreal toDouble(const QChar *&str)
void save(QDataStream &ds) const
Internal function for saving a variant to the stream s.
The QSize class defines the size of a two-dimensional object using integer point precision.
The QDataStream class provides serialization of binary data to a QIODevice.
QTime toTime() const
Returns the variant as a QTime if the variant has type() Time , DateTime , or String ; otherwise retu...
bool cmp(const QVariant &other) const
static qlonglong qConvertToNumber(const QVariant::Private *d, bool *ok)
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
static Type nameToType(const char *name)
Converts the string representation of the storage type given in name, to its enum representation...
static qlonglong qMetaTypeNumber(const QVariant::Private *d)
QDebug & space()
Writes a space character to the debug stream and returns a reference to the stream.
static QChar fromAscii(char c)
Converts the ASCII character c to its equivalent QChar.
QChar toChar() const
Returns the variant as a QChar if the variant has type() Char , Int , or UInt ; otherwise returns an ...
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
static qulonglong qMetaTypeUNumber(const QVariant::Private *d)
static QByteArray number(int, int base=10)
Returns a byte array containing the string equivalent of the number n to base base (10 by default)...
QPoint toPoint() const
Returns the variant as a QPoint if the variant has type() Point or PointF ; otherwise returns a null ...
bool compareNumericMetaType(const QVariant::Private *const a, const QVariant::Private *const b)
static bool isNull(const QVariant::Private *d)
qreal toReal(bool *ok=0) const
Returns the variant as a qreal if the variant has type() Double , QMetaType::Float ...
bool isValid() const
Returns true if the time is valid; otherwise returns false.
friend Q_CORE_EXPORT QDebug operator<<(QDebug, const QVariant &)
T qvariant_cast(const QVariant &value)
Returns the given value converted to the template type T.
QBitArray toBitArray() const
Returns the variant as a QBitArray if the variant has type() BitArray ; otherwise returns an empty bi...