java.lang.Object
io.qt.internal.QtJambiObject
io.qt.QtObject
io.qt.core.QVariant
- All Implemented Interfaces:
QtObjectInterface
,Cloneable
,Comparable<QVariant>
Acts like a union for the most common Qt data types
Java wrapper for Qt's class QVariant
-
Nested Class Summary
Nested classes/interfaces inherited from class io.qt.QtObject
QtObject.QPrivateConstructor
-
Constructor Summary
ModifierConstructorDescriptionQVariant()
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) QVariant
(QMetaType.Type metaType) QVariant
(QModelIndex modelIndex) QVariant
(QPersistentModelIndex modelIndex) QVariant
(QVariant.Type type) protected
Constructor for internal use only.QVariant
(Collection<? extends Object> list) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
canConvert
(int targetTypeId) final boolean
canConvert
(QMetaType.Type targetType) final boolean
canConvert
(QVariant.Type targetType) static boolean
canConvert
(Object obj, int targetType) Deprecated.static boolean
canConvert
(Object obj, QMetaType.Type 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()
protected final boolean
protected final int
int
final boolean
convert
(int targetTypeId) final boolean
static Object
Convenient static function for type conversion.static Object
Convenient static function for type conversion.static Object
Convenient static function for type conversion.static Object
convert
(Object obj, QMetaType.Type metaType) Convenient static function for type conversion.static Object
convert
(Object obj, QMetaType.Type metaType, boolean[] ok) Convenient static function for type conversion.static Object
Convenient static function for type conversion.static Object
convert
(Object obj, QVariant.Type metaType) Convenient static function for type conversion.static Object
convert
(Object obj, QVariant.Type metaType, boolean[] ok) Convenient static function for type conversion.static <T> T
Convenient static function for type conversion.convertTo
(int t) protected final void
final void
detach()
boolean
Used to check if this object shares native resources with the other object if the other object is a subtype of QtJambiInterface.static <T> QVariant
fromValue
(T value) int
hashCode()
final boolean
final boolean
isNull()
final boolean
isValid()
static boolean
Deprecated.final void
load
(QDataStream ds) static Object
loadObject
(QDataStream stream) Deprecated.static Object
loadObject
(QDataStream stream, Boolean[] ok) Deprecated.UseQDataStream.readObject(Class, QMetaType...)
instead.static QVariant.Type
nameToType
(String name) void
final void
save
(QDataStream ds) 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 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 QRegExp
toRegExp()
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()
static int
Deprecated.final String
typeName()
static String
typeToName
(int typeId) 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
public QVariant(boolean b) -
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
QVariant
-
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
-
QVariant
public QVariant(long ll) -
QVariant
Constructor for internal use only.- Parameters:
p
- expected to benull
.
-
QVariant
-
-
Method Details
-
canConvert
-
clear
-
cmp
-
compare
-
convertTo
-
convert
-
create
-
value
-
detach
-
isDetached
-
isNull
-
isValid
-
load
-
writeTo
-
readFrom
-
save
-
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
-
toRegExp
-
toRegularExpression
-
toSize
-
toSizeF
-
toString
-
toStringList
-
toTime
-
toUrl
-
toUuid
-
type
-
typeName
-
userType
-
value
-
fromValue
-
nameToType
-
typeToName
-
equals
Description copied from class:QtObject
Used to check if this object shares native resources with the other object if the other object is a subtype of QtJambiInterface. Otherwise it will return the result of calling the super class implementation. -
compareTo
- Specified by:
compareTo
in interfaceComparable<QVariant>
-
hashCode
-
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. -
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
-
canConvert
-
convert
-
canConvert
Deprecated.Convenient static function for type conversion. -
canConvert
Convenient static function for type conversion. -
clone
-
QDataStream.readObject(Class, QMetaType...)
instead.