java.lang.Object
io.qt.core.QVariant
public final class QVariant extends Object
The QVariant class contains a set of static methods to convert between datatypes.
You can check with this class whether a datatype can be converted to another. This is datatypes which cannot simply be cast to each other, but requires processing to convert, i.e., you cannot use the instanceof operator as you would for classes with the same super class.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
QVariant.Type
Deprecated. -
Method Summary
Modifier and Type Method Description static boolean
canConvert(Object obj, int targetType)
static boolean
canConvert(Object obj, QMetaType type)
static boolean
canConvert(Object obj, QMetaType.Type type)
static boolean
canConvert(Object obj, QVariant.Type type)
Deprecated.static boolean
canConvertToBitArray(Object obj)
static boolean
canConvertToBoolean(Object obj)
static boolean
canConvertToByteArray(Object obj)
static boolean
canConvertToChar(Object obj)
static boolean
canConvertToCollection(Object obj)
static boolean
canConvertToDate(Object obj)
static boolean
canConvertToDateTime(Object obj)
static boolean
canConvertToDouble(Object obj)
static <E extends Enum<?>>
booleancanConvertToEnum(Class<E> enumClass, Object obj)
static boolean
canConvertToFlags(Object obj)
static boolean
canConvertToFloat(Object obj)
static boolean
canConvertToInt(Object obj)
static boolean
canConvertToLine(Object obj)
static boolean
canConvertToLineF(Object obj)
static boolean
canConvertToList(Object obj)
static boolean
canConvertToLocale(Object obj)
static boolean
canConvertToLong(Object obj)
static boolean
canConvertToMap(Object obj)
static boolean
canConvertToPoint(Object obj)
static boolean
canConvertToPointF(Object obj)
static boolean
canConvertToRect(Object obj)
static boolean
canConvertToRectF(Object obj)
static boolean
canConvertToRegularExpression(Object obj)
static boolean
canConvertToSize(Object obj)
static boolean
canConvertToSizeF(Object obj)
static boolean
canConvertToString(Object obj)
static boolean
canConvertToStringList(Object obj)
static boolean
canConvertToTime(Object obj)
static Object
convert(Object obj, int userType)
static Object
convert(Object obj, QMetaType userType)
static Object
convert(Object obj, QMetaType.Type type)
static Object
convert(Object obj, QMetaType.Type type, boolean[] ok)
static Object
convert(Object obj, QVariant.Type type)
Deprecated.static Object
convert(Object obj, QVariant.Type type, boolean[] ok)
Deprecated.static <T> T
convert(Object value, Class<T> cl)
static Object
loadObject(QDataStream stream)
static Object
loadObject(QDataStream stream, Boolean[] ok)
static void
saveObject(QDataStream stream, Object variant)
static void
saveObject(QDataStream stream, Object variant, Boolean[] ok)
static QBitArray
toBitArray(Object obj)
static boolean
toBoolean(Object obj)
static QByteArray
toByteArray(Object obj)
static char
toChar(Object obj)
static Collection<?>
toCollection(Object obj)
static QDate
toDate(Object obj)
static QDateTime
toDateTime(Object obj)
static double
toDouble(Object obj)
static double
toDouble(Object obj, boolean[] ok)
static <E extends Enum<?>>
EtoEnum(Class<E> enumClass, Object obj)
static <E extends Enum<?>>
EtoEnum(Class<E> enumClass, Object obj, boolean[] ok)
static <F extends QFlags<?>>
FtoFlags(Class<F> flagsClass, Object obj)
static <F extends QFlags<?>>
FtoFlags(Class<F> flagsClass, Object obj, boolean[] ok)
static float
toFloat(Object obj)
static float
toFloat(Object obj, boolean[] ok)
static QHash<String,Object>
toHash(Object obj)
static int
toInt(Object obj)
static int
toInt(Object obj, boolean[] ok)
static QLine
toLine(Object obj)
static QLineF
toLineF(Object obj)
static QList<Object>
toList(Object obj)
static QLocale
toLocale(Object obj)
static long
toLong(Object obj)
static long
toLong(Object obj, boolean[] ok)
static QMap<String,Object>
toMap(Object obj)
static QPoint
toPoint(Object obj)
static QPointF
toPointF(Object obj)
static QRect
toRect(Object obj)
static QRectF
toRectF(Object obj)
static QRegularExpression
toRegularExpression(Object obj)
static QSize
toSize(Object obj)
static QSizeF
toSizeF(Object obj)
static String
toString(Object obj)
static QStringList
toStringList(Object obj)
static QTime
toTime(Object obj)
static int
type(Object obj)
-
Method Details
-
convert
-
convert
-
convert
Deprecated. -
convert
Deprecated. -
convert
-
convert
-
canConvert
-
canConvert
-
canConvert
Deprecated. -
canConvert
-
type
-
canConvertToDouble
-
toDouble
-
toDouble
-
canConvertToFloat
-
toFloat
-
toFloat
-
canConvertToString
-
toString
-
canConvertToBoolean
-
toBoolean
-
canConvertToByteArray
-
toByteArray
-
canConvertToBitArray
-
toBitArray
-
canConvertToChar
-
toChar
-
canConvertToDate
-
toDate
-
canConvertToDateTime
-
toDateTime
-
canConvertToInt
-
toInt
-
toInt
-
canConvertToLine
-
toLine
-
canConvertToLineF
-
toLineF
-
canConvertToLocale
-
toLocale
-
canConvertToPoint
-
toPoint
-
canConvertToPointF
-
toPointF
-
canConvertToRect
-
toRect
-
canConvertToRectF
-
toRectF
-
canConvertToRegularExpression
-
toRegularExpression
-
canConvertToSize
-
toSize
-
canConvertToSizeF
-
toSizeF
-
canConvertToTime
-
toTime
-
canConvertToLong
-
toLong
-
toLong
-
canConvertToList
-
toList
-
canConvertToStringList
-
toStringList
-
canConvertToCollection
-
toCollection
-
canConvertToMap
-
toHash
-
toMap
-
convert
-
canConvertToEnum
-
canConvertToFlags
-
toEnum
-
toEnum
-
toFlags
-
toFlags
-
saveObject
-
saveObject
-
loadObject
-
loadObject
-