java.lang.Object
io.qt.core.QVariant
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
-
Constructor Summary
ConstructorDescriptionQVariant
(QMetaType.Type metaType) QVariant
(QMetaType.Type metaType, Object value) -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
static boolean
static boolean
static boolean
canConvertToChar
(Object obj) static boolean
static boolean
canConvertToDate
(Object obj) static boolean
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
static boolean
canConvertToSize
(Object obj) static boolean
canConvertToSizeF
(Object obj) static boolean
canConvertToString
(Object obj) static boolean
static boolean
canConvertToTime
(Object obj) static Object
static Object
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
boolean
static QVariant
boolean
isValid()
static boolean
static Object
loadObject
(QDataStream stream) static Object
loadObject
(QDataStream stream, Boolean[] ok) metaType()
static void
saveObject
(QDataStream stream, Object variant) static void
saveObject
(QDataStream stream, Object variant, Boolean[] ok) static QBitArray
toBitArray
(Object obj) static boolean
static QByteArray
toByteArray
(Object obj) static char
static Collection<?>
toCollection
(Object obj) static QDate
static QDateTime
toDateTime
(Object obj) static double
static double
static <E extends Enum<?>>
Estatic <E extends Enum<?>>
Estatic <F extends QFlags<?>>
Fstatic <F extends QFlags<?>>
Fstatic float
static float
static int
static int
static QLine
static QLineF
static QLocale
static long
static long
static QPoint
static QPointF
static QRect
static QRectF
static QRegularExpression
static QSize
static QSizeF
toString()
static String
static QStringList
toStringList
(Object obj) static QTime
static int
int
userType()
value()
<T> T
-
Constructor Details
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
-
Method Details
-
fromValue
-
userType
public int userType() -
metaType
-
value
-
value
-
isValid
public boolean isValid() -
toString
-
equals
-
isValid
-
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
-