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
-
Method Summary
Modifier and Type Method Description static boolean
canConvert(Object obj, int targetType)
static boolean
canConvert(Object obj, QMetaType.Type type)
static boolean
canConvert(Object obj, QVariant.Type type)
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
canConvertToRegExp(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.Type type)
static Object
convert(Object obj, QMetaType.Type type, boolean[] ok)
static Object
convert(Object obj, QVariant.Type type)
static Object
convert(Object obj, QVariant.Type type, boolean[] ok)
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 int
toInt(Object obj)
static int
toInt(Object obj, boolean[] ok)
static QLine
toLine(Object obj)
static QLineF
toLineF(Object obj)
static List<?>
toList(Object obj)
static QLocale
toLocale(Object obj)
static long
toLong(Object obj)
static long
toLong(Object obj, boolean[] ok)
static Map<String,?>
toMap(Object obj)
static QPoint
toPoint(Object obj)
static QPointF
toPointF(Object obj)
static QRect
toRect(Object obj)
static QRectF
toRectF(Object obj)
static QRegExp
toRegExp(Object obj)
static QRegularExpression
toRegularExpression(Object obj)
static QSize
toSize(Object obj)
static QSizeF
toSizeF(Object obj)
static String
toString(Object obj)
static List<String>
toStringList(Object obj)
static QTime
toTime(Object obj)
static int
type(Object obj)
-
Method Details
-
convert
-
convert
-
convert
-
convert
-
convert
-
canConvert
-
canConvert
-
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
-
canConvertToRegExp
-
toRegExp
-
canConvertToRegularExpression
-
toRegularExpression
-
canConvertToSize
-
toSize
-
canConvertToSizeF
-
toSizeF
-
canConvertToTime
-
toTime
-
canConvertToLong
-
toLong
-
toLong
-
canConvertToList
-
toList
-
canConvertToStringList
-
toStringList
-
canConvertToCollection
-
toCollection
-
canConvertToMap
-
toMap
-
convert
-
canConvertToEnum
-
canConvertToFlags
-
toEnum
-
toEnum
-
toFlags
-
toFlags
-
saveObject
-
saveObject
-
loadObject
-
loadObject
-