- All Implemented Interfaces:
QtObjectInterface
,Cloneable
Acts like a union for the most common Qt data types
Java wrapper for Qt class QVariant
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Deprecated."Use QMetaType::Type instead."Nested classes/interfaces inherited from class io.qt.QtObject
QtObject.QPrivateConstructor
-
Constructor Summary
ConstructorDescriptionQVariant()
QVariant
(boolean b) QVariant
(char qchar) QVariant
(double d) QVariant
(float f) QVariant
(int i) QVariant
(long ll) QVariant
(QByteArray bytearray) QVariant
(QEasingCurve easing) QVariant
(QJsonArray jsonArray) QVariant
(QJsonDocument jsonDocument) QVariant
(QJsonObject jsonObject) QVariant
(QJsonValue jsonValue) Overloaded constructor forQVariant(io.qt.core.QMetaType, java.lang.Object)
withcopy = null
.QVariant
(QMetaType.Type metaType) QVariant
(QMetaType.Type type, Object copy) QVariant
(QModelIndex modelIndex) QVariant
(QPersistentModelIndex modelIndex) QVariant
(QVariant.Type type) Deprecated.Use the constructor taking a QMetaType instead.QVariant
(Collection<? extends Object> list) QVariant
(NavigableMap<String, ? extends Object> map) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
final boolean
canConvert
(int targetTypeId) Deprecated.final boolean
canConvert
(QMetaType targetType) final boolean
canConvert
(QMetaType.Type targetType) final boolean
canConvert
(QVariant.Type targetType) Deprecated.static boolean
canConvert
(Object obj, int targetType) Deprecated.static boolean
canConvert
(Object obj, QMetaType.Type type) Convenient static function for type conversion.static boolean
canConvert
(Object obj, QMetaType type) Convenient static function for type conversion.static boolean
Convenient static function for type conversion.static boolean
Convenient static function for type conversion.static boolean
Convenient static function for type conversion.static boolean
canConvertToChar
(Object obj) Convenient static function for type conversion.static boolean
Convenient static function for type conversion.static boolean
canConvertToDate
(Object obj) Convenient static function for type conversion.static boolean
Convenient static function for type conversion.static boolean
canConvertToDouble
(Object obj) Convenient static function for type conversion.static <E extends Enum<?>>
booleancanConvertToEnum
(Class<E> enumClass, Object obj) Convenient static function for type conversion.static boolean
canConvertToFlags
(Object obj) Convenient static function for type conversion.static boolean
canConvertToFloat
(Object obj) Convenient static function for type conversion.static boolean
canConvertToInt
(Object obj) Convenient static function for type conversion.static boolean
canConvertToLine
(Object obj) Convenient static function for type conversion.static boolean
canConvertToLineF
(Object obj) Convenient static function for type conversion.static boolean
canConvertToList
(Object obj) Convenient static function for type conversion.static boolean
canConvertToLocale
(Object obj) Convenient static function for type conversion.static boolean
canConvertToLong
(Object obj) Convenient static function for type conversion.static boolean
canConvertToMap
(Object obj) Convenient static function for type conversion.static boolean
canConvertToPoint
(Object obj) Convenient static function for type conversion.static boolean
canConvertToPointF
(Object obj) Convenient static function for type conversion.static boolean
canConvertToRect
(Object obj) Convenient static function for type conversion.static boolean
canConvertToRectF
(Object obj) Convenient static function for type conversion.static boolean
Convenient static function for type conversion.static boolean
canConvertToSize
(Object obj) Convenient static function for type conversion.static boolean
canConvertToSizeF
(Object obj) Convenient static function for type conversion.static boolean
canConvertToString
(Object obj) Convenient static function for type conversion.static boolean
Convenient static function for type conversion.static boolean
canConvertToTime
(Object obj) Convenient static function for type conversion.final void
clear()
clone()
Creates and returns a copy of this object.static int
final boolean
convert
(int targetTypeId) Deprecated.final boolean
final boolean
static Object
Convenient static function for type conversion.static Object
Convenient static function for type conversion.static Object
convert
(Object obj, QMetaType.Type type) Convenient static function for type conversion.static Object
convert
(Object obj, QMetaType.Type type, boolean[] ok) Convenient static function for type conversion.static Object
Convenient static function for type conversion.static Object
Convenient static function for type conversion.static <T> T
Convenient static function for type conversion.convertTo
(int type) protected final void
SeeQVariant::
create(int, const void*) protected final void
SeeQVariant::
create(QMetaType, const void*) final void
detach()
SeeQVariant::
detach() protected final boolean
SeeQVariant::
equals(QVariant)const boolean
static QVariant
static <T> QVariant
fromValue
(T value) int
hashCode()
Returns the objects's hash code computed byqHash(QVariant)
.final boolean
SeeQVariant::
isDetached()const final boolean
isNull()
final boolean
isValid()
static boolean
Deprecated.final void
load
(QDataStream ds) SeeQVariant::
load(QDataStream&) static Object
loadObject
(QDataStream stream) Deprecated.UseQDataStream.readObject(Class, QMetaType...)
instead.static Object
loadObject
(QDataStream stream, Boolean[] ok) Deprecated.UseQDataStream.readObject(Class, QMetaType...)
instead.final QMetaType
metaType()
static QVariant.Type
nameToType
(String name) Deprecated.void
final void
save
(QDataStream ds) SeeQVariant::
save(QDataStream&)const static void
saveObject
(QDataStream stream, Object object) Deprecated.UseQDataStream.writeObject(Object)
instead.static void
saveObject
(QDataStream stream, Object object, Boolean[] ok) Deprecated.UseQDataStream.writeObject(Object)
instead.final void
final void
final QBitArray
static QBitArray
toBitArray
(Object obj) Convenient static function for type conversion.final boolean
static boolean
Convenient static function for type conversion.final QByteArray
static QByteArray
toByteArray
(Object obj) Convenient static function for type conversion.final char
toChar()
static char
Convenient static function for type conversion.static Collection<?>
toCollection
(Object obj) Convenient static function for type conversion.final QDate
toDate()
static QDate
Convenient static function for type conversion.final QDateTime
static QDateTime
toDateTime
(Object obj) Convenient static function for type conversion.final double
toDouble()
Overloaded function fortoDouble(boolean[])
withok = null
.final double
toDouble
(boolean[] ok) static double
Convenient static function for type conversion.static double
Convenient static function for type conversion.final QEasingCurve
static <E extends Enum<?>>
EConvenient static function for type conversion.static <E extends Enum<?>>
EConvenient static function for type conversion.static <F extends QFlags<?>>
FConvenient static function for type conversion.static <F extends QFlags<?>>
FConvenient static function for type conversion.final float
toFloat()
Overloaded function fortoFloat(boolean[])
withok = null
.final float
toFloat
(boolean[] ok) static float
Convenient static function for type conversion.static float
Convenient static function for type conversion.toHash()
Convenient static function for type conversion.final int
toInt()
Overloaded function fortoInt(boolean[])
withok = null
.final int
toInt
(boolean[] ok) static int
Convenient static function for type conversion.static int
Convenient static function for type conversion.final QJsonArray
final QJsonDocument
final QJsonObject
final QJsonValue
final QLine
toLine()
static QLine
Convenient static function for type conversion.final QLineF
toLineF()
static QLineF
Convenient static function for type conversion.toList()
Convenient static function for type conversion.final QLocale
toLocale()
static QLocale
Convenient static function for type conversion.final long
toLong()
Overloaded function fortoLong(boolean[])
withok = null
.final long
toLong
(boolean[] ok) static long
Convenient static function for type conversion.toMap()
Convenient static function for type conversion.final QModelIndex
final QPersistentModelIndex
final QPoint
toPoint()
static QPoint
Convenient static function for type conversion.final QPointF
toPointF()
static QPointF
Convenient static function for type conversion.final QRect
toRect()
static QRect
Convenient static function for type conversion.final QRectF
toRectF()
static QRectF
Convenient static function for type conversion.final QRegularExpression
static QRegularExpression
Convenient static function for type conversion.final QSize
toSize()
static QSize
Convenient static function for type conversion.final QSizeF
toSizeF()
static QSizeF
Convenient static function for type conversion.final String
toString()
static String
Convenient static function for type conversion.final QStringList
static QStringList
toStringList
(Object obj) Convenient static function for type conversion.final QTime
toTime()
static QTime
Convenient static function for type conversion.final QUrl
toUrl()
final QUuid
toUuid()
final QVariant.Type
type()
Deprecated.Use typeId() or metaType().static int
Deprecated.final int
typeId()
final String
typeName()
static String
typeToName
(int typeId) Deprecated.final int
userType()
final Object
value()
final <T> T
void
Methods inherited from class io.qt.QtObject
dispose, isDisposed
-
Constructor Details
-
QVariant
public QVariant() -
QVariant
public QVariant(char qchar) -
QVariant
-
QVariant
-
QVariant
-
QVariant
Overloaded constructor for
QVariant(io.qt.core.QMetaType, java.lang.Object)
withcopy = null
. -
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
Deprecated.Use the constructor taking a QMetaType instead.See
QVariant::
QVariant(QVariant::Type) -
QVariant
public QVariant(boolean b) -
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
public QVariant(double d) -
QVariant
public QVariant(float f) -
QVariant
public QVariant(int i) -
QVariant
public QVariant(long ll) -
QVariant
-
QVariant
-
-
Method Details
-
canConvert
-
canConvert
Deprecated.See
QVariant::
canConvert(int)const -
clear
-
convert
-
convert
Deprecated. -
convertTo
-
create
See
QVariant::
create(QMetaType, const void*) -
create
See
QVariant::
create(int, const void*) -
value
-
detach
See
QVariant::
detach() -
equals
See
QVariant::
equals(QVariant)const -
isDetached
See
QVariant::
isDetached()const -
isNull
-
isValid
-
load
See
QVariant::
load(QDataStream&) -
metaType
-
writeTo
-
assign
-
readFrom
-
save
See
QVariant::
save(QDataStream&)const -
setValue
-
swap
-
toBitArray
-
toBoolean
-
toByteArray
-
toChar
-
toDate
-
toDateTime
-
toDouble
Overloaded function for
toDouble(boolean[])
withok = null
. -
toDouble
-
toEasingCurve
-
toFloat
Overloaded function for
toFloat(boolean[])
withok = null
. -
toFloat
-
toHash
-
toInt
Overloaded function for
toInt(boolean[])
withok = null
. -
toInt
-
toJsonArray
-
toJsonDocument
-
toJsonObject
-
toJsonValue
-
toLine
-
toLineF
-
toList
-
toLocale
-
toLong
Overloaded function for
toLong(boolean[])
withok = null
. -
toLong
-
toMap
-
toModelIndex
-
toPersistentModelIndex
-
toPoint
-
toPointF
-
toRect
-
toRectF
-
toRegularExpression
-
toSize
-
toSizeF
-
toString
-
toStringList
-
toTime
-
toUrl
-
toUuid
-
type
Deprecated.Use typeId() or metaType().See
QVariant::
type()const -
typeId
-
typeName
-
userType
-
value
-
compare
-
fromValue
-
fromValue
-
nameToType
Deprecated.See
QVariant::
nameToType(const char*) -
typeToName
Deprecated.See
QVariant::
typeToName(int) -
equals
-
hashCode
Returns the objects's hash code computed byqHash(QVariant)
. -
type
Deprecated.UseQMetaType.fromObject(Object)
instead. -
convert
Convenient static function for type conversion. -
isValid
Deprecated.UseisValid()
instead. -
canConvertToEnum
Convenient static function for type conversion. -
canConvertToFlags
Convenient static function for type conversion. -
toEnum
Convenient static function for type conversion. -
toEnum
Convenient static function for type conversion. -
toFlags
Convenient static function for type conversion. -
toFlags
Convenient static function for type conversion. -
canConvertToDouble
Convenient static function for type conversion. -
toDouble
Convenient static function for type conversion. -
toDouble
Convenient static function for type conversion. -
canConvertToFloat
Convenient static function for type conversion. -
toFloat
Convenient static function for type conversion. -
toFloat
Convenient static function for type conversion. -
canConvertToString
Convenient static function for type conversion. -
toString
Convenient static function for type conversion. -
canConvertToBoolean
Convenient static function for type conversion. -
toBoolean
Convenient static function for type conversion. -
canConvertToByteArray
Convenient static function for type conversion. -
toByteArray
Convenient static function for type conversion. -
canConvertToBitArray
Convenient static function for type conversion. -
toBitArray
Convenient static function for type conversion. -
canConvertToChar
Convenient static function for type conversion. -
toChar
Convenient static function for type conversion. -
canConvertToDate
Convenient static function for type conversion. -
toDate
Convenient static function for type conversion. -
canConvertToDateTime
Convenient static function for type conversion. -
toDateTime
Convenient static function for type conversion. -
canConvertToInt
Convenient static function for type conversion. -
toInt
Convenient static function for type conversion. -
toInt
Convenient static function for type conversion. -
canConvertToLine
Convenient static function for type conversion. -
toLine
Convenient static function for type conversion. -
canConvertToLineF
Convenient static function for type conversion. -
toLineF
Convenient static function for type conversion. -
canConvertToLocale
Convenient static function for type conversion. -
toLocale
Convenient static function for type conversion. -
canConvertToPoint
Convenient static function for type conversion. -
toPoint
Convenient static function for type conversion. -
canConvertToPointF
Convenient static function for type conversion. -
toPointF
Convenient static function for type conversion. -
canConvertToRect
Convenient static function for type conversion. -
toRect
Convenient static function for type conversion. -
canConvertToRectF
Convenient static function for type conversion. -
toRectF
Convenient static function for type conversion. -
canConvertToRegularExpression
Convenient static function for type conversion. -
toRegularExpression
Convenient static function for type conversion. -
canConvertToSize
Convenient static function for type conversion. -
toSize
Convenient static function for type conversion. -
canConvertToSizeF
Convenient static function for type conversion. -
toSizeF
Convenient static function for type conversion. -
canConvertToTime
Convenient static function for type conversion. -
toTime
Convenient static function for type conversion. -
canConvertToLong
Convenient static function for type conversion. -
toLong
Convenient static function for type conversion. -
canConvertToList
Convenient static function for type conversion. -
toList
Convenient static function for type conversion. -
canConvertToStringList
Convenient static function for type conversion. -
toStringList
Convenient static function for type conversion. -
canConvertToCollection
Convenient static function for type conversion. -
toCollection
Convenient static function for type conversion. -
canConvertToMap
Convenient static function for type conversion. -
toHash
Convenient static function for type conversion. -
toMap
Convenient static function for type conversion. -
saveObject
Deprecated.UseQDataStream.writeObject(Object)
instead. -
saveObject
Deprecated.UseQDataStream.writeObject(Object)
instead. -
loadObject
Deprecated.UseQDataStream.readObject(Class, QMetaType...)
instead. -
loadObject
Deprecated.UseQDataStream.readObject(Class, QMetaType...)
instead. -
convert
Convenient static function for type conversion. -
convert
Convenient static function for type conversion. -
convert
Convenient static function for type conversion. -
convert
Convenient static function for type conversion. -
canConvert
-
convert
Convenient static function for type conversion. -
convert
Convenient static function for type conversion. -
canConvert
Deprecated. -
canConvert
Convenient static function for type conversion. -
convert
-
canConvert
Convenient static function for type conversion. -
canConvert
Deprecated.Convenient static function for type conversion. -
clone
Creates and returns a copy of this object.
-