java.lang.Object
io.qt.QtObject
io.qt.core.QVariant
- All Implemented Interfaces:
QtObjectInterface,Cloneable
Acts like a union for the most common Qt data types
Java wrapper for Qt's class QVariant
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDeprecated."Use QMetaType::Type instead."Nested classes/interfaces inherited from class io.qt.QtObject
QtObject.QPrivateConstructor -
Constructor Summary
ConstructorsModifierConstructorDescriptionQVariant()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.protectedConstructor for internal use only.QVariant(Collection<? extends Object> list) QVariant(NavigableMap<String, ? extends Object> map) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleancanConvert(int targetTypeId) Deprecated.final booleancanConvert(QMetaType targetType) final booleancanConvert(QMetaType.Type targetType) final booleancanConvert(QVariant.Type targetType) Deprecated.static booleancanConvert(Object obj, int targetType) Deprecated.static booleancanConvert(Object obj, QMetaType type) Convenient static function for type conversion.static booleancanConvert(Object obj, QMetaType.Type type) Convenient static function for type conversion.static booleanConvenient static function for type conversion.static booleanConvenient static function for type conversion.static booleanConvenient static function for type conversion.static booleancanConvertToChar(Object obj) Convenient static function for type conversion.static booleanConvenient static function for type conversion.static booleancanConvertToDate(Object obj) Convenient static function for type conversion.static booleanConvenient static function for type conversion.static booleancanConvertToDouble(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 booleancanConvertToFlags(Object obj) Convenient static function for type conversion.static booleancanConvertToFloat(Object obj) Convenient static function for type conversion.static booleancanConvertToInt(Object obj) Convenient static function for type conversion.static booleancanConvertToLine(Object obj) Convenient static function for type conversion.static booleancanConvertToLineF(Object obj) Convenient static function for type conversion.static booleancanConvertToList(Object obj) Convenient static function for type conversion.static booleancanConvertToLocale(Object obj) Convenient static function for type conversion.static booleancanConvertToLong(Object obj) Convenient static function for type conversion.static booleancanConvertToMap(Object obj) Convenient static function for type conversion.static booleancanConvertToPoint(Object obj) Convenient static function for type conversion.static booleancanConvertToPointF(Object obj) Convenient static function for type conversion.static booleancanConvertToRect(Object obj) Convenient static function for type conversion.static booleancanConvertToRectF(Object obj) Convenient static function for type conversion.static booleanConvenient static function for type conversion.static booleancanConvertToSize(Object obj) Convenient static function for type conversion.static booleancanConvertToSizeF(Object obj) Convenient static function for type conversion.static booleancanConvertToString(Object obj) Convenient static function for type conversion.static booleanConvenient static function for type conversion.static booleancanConvertToTime(Object obj) Convenient static function for type conversion.final voidclear()clone()static intfinal booleanconvert(int targetTypeId) Deprecated.final booleanfinal booleanstatic ObjectConvenient static function for type conversion.static ObjectConvenient static function for type conversion.static ObjectConvenient static function for type conversion.static Objectconvert(Object obj, QMetaType.Type type) Convenient static function for type conversion.static Objectconvert(Object obj, QMetaType.Type type, boolean[] ok) Convenient static function for type conversion.static ObjectConvenient static function for type conversion.static <T> TConvenient static function for type conversion.convertTo(int type) protected final voidprotected final voidfinal voiddetach()protected final booleanbooleanUsed to check if this object shares the same native counterpart with the other object, i.e. the objects are equals if their native counterparts are identical.static <T> QVariantfromValue(T value) inthashCode()final booleanfinal booleanisNull()final booleanisValid()static booleanDeprecated.final voidload(QDataStream ds) static ObjectloadObject(QDataStream stream) Deprecated.UseQDataStream.readObject(Class, QMetaType...)instead.static ObjectloadObject(QDataStream stream, Boolean[] ok) Deprecated.UseQDataStream.readObject(Class, QMetaType...)instead.final QMetaTypemetaType()static QVariant.TypenameToType(String name) Deprecated.voidfinal voidsave(QDataStream ds) static voidsaveObject(QDataStream stream, Object object) Deprecated.UseQDataStream.writeObject(Object)instead.static voidsaveObject(QDataStream stream, Object object, Boolean[] ok) Deprecated.UseQDataStream.writeObject(Object)instead.final voidfinal voidfinal QBitArraystatic QBitArraytoBitArray(Object obj) Convenient static function for type conversion.final booleanstatic booleanConvenient static function for type conversion.final QByteArraystatic QByteArraytoByteArray(Object obj) Convenient static function for type conversion.final chartoChar()static charConvenient static function for type conversion.static Collection<?>toCollection(Object obj) Convenient static function for type conversion.final QDatetoDate()static QDateConvenient static function for type conversion.final QDateTimestatic QDateTimetoDateTime(Object obj) Convenient static function for type conversion.final doubletoDouble()Overloaded function fortoDouble(boolean[])withok = null.final doubletoDouble(boolean[] ok) static doubleConvenient static function for type conversion.static doubleConvenient static function for type conversion.final QEasingCurvestatic <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 floattoFloat()Overloaded function fortoFloat(boolean[])withok = null.final floattoFloat(boolean[] ok) static floatConvenient static function for type conversion.static floatConvenient static function for type conversion.toHash()Convenient static function for type conversion.final inttoInt()Overloaded function fortoInt(boolean[])withok = null.final inttoInt(boolean[] ok) static intConvenient static function for type conversion.static intConvenient static function for type conversion.final QJsonArrayfinal QJsonDocumentfinal QJsonObjectfinal QJsonValuefinal QLinetoLine()static QLineConvenient static function for type conversion.final QLineFtoLineF()static QLineFConvenient static function for type conversion.toList()Convenient static function for type conversion.final QLocaletoLocale()static QLocaleConvenient static function for type conversion.final longtoLong()Overloaded function fortoLong(boolean[])withok = null.final longtoLong(boolean[] ok) static longConvenient static function for type conversion.toMap()Convenient static function for type conversion.final QModelIndexfinal QPersistentModelIndexfinal QPointtoPoint()static QPointConvenient static function for type conversion.final QPointFtoPointF()static QPointFConvenient static function for type conversion.final QRecttoRect()static QRectConvenient static function for type conversion.final QRectFtoRectF()static QRectFConvenient static function for type conversion.final QRegularExpressionstatic QRegularExpressionConvenient static function for type conversion.final QSizetoSize()static QSizeConvenient static function for type conversion.final QSizeFtoSizeF()static QSizeFConvenient static function for type conversion.final StringtoString()static StringConvenient static function for type conversion.final QStringListstatic QStringListtoStringList(Object obj) Convenient static function for type conversion.final QTimetoTime()static QTimeConvenient static function for type conversion.final QUrltoUrl()final QUuidtoUuid()final QVariant.Typetype()Deprecated.Use typeId() or metaType().static intDeprecated.final inttypeId()final StringtypeName()static StringtypeToName(int typeId) Deprecated.final intuserType()final Objectvalue()final <T> TvoidMethods inherited from class io.qt.QtObject
dispose, isDisposed
-
Constructor Details
-
QVariant
public QVariant() -
QVariant
public QVariant(char qchar) -
QVariant
-
QVariant
Overloaded constructor for
QVariant(io.qt.core.QMetaType, java.lang.Object)withcopy = null. -
QVariant
-
QVariant
-
QVariant
Deprecated.Use the constructor taking a QMetaType instead. -
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
public QVariant(double d) -
QVariant
public QVariant(float f) -
QVariant
public QVariant(int i) -
QVariant
public QVariant(long ll) -
QVariant
Constructor for internal use only.- Parameters:
p- expected to benull.
-
QVariant
-
QVariant
-
-
Method Details
-
canConvert
-
canConvert
Deprecated. -
clear
-
convert
-
convert
Deprecated. -
convertTo
-
create
-
create
-
value
-
detach
-
equals
-
isDetached
-
isNull
-
isValid
-
load
-
metaType
-
writeTo
-
readFrom
-
save
-
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(). -
typeId
-
typeName
-
userType
-
value
-
compare
-
fromValue
-
nameToType
Deprecated. -
typeToName
Deprecated. -
equals
Description copied from class:QtObjectUsed to check if this object shares the same native counterpart with the other object, i.e. the objects are equals if their native counterparts are identical. Qt value types override this method to make a value comparison. Otherwise it will return the result of calling the super class implementation. -
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. -
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
-