Module qtjambi
Package io.qt.core

Class QVariant

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.

  • Method Details

    • convert

      public static Object convert(Object obj, QMetaType.Type type)
    • convert

      public static Object convert(Object obj, QMetaType.Type type, boolean[] ok)
    • convert

      public static Object convert(Object obj, QVariant.Type type)
    • convert

      public static Object convert(Object obj, QVariant.Type type, boolean[] ok)
    • convert

      public static Object convert(Object obj, int userType)
    • canConvert

      public static boolean canConvert(Object obj, QMetaType.Type type)
    • canConvert

      public static boolean canConvert(Object obj, QVariant.Type type)
    • canConvert

      public static boolean canConvert(Object obj, int targetType)
    • type

      public static int type(Object obj)
    • canConvertToDouble

      public static boolean canConvertToDouble(Object obj)
    • toDouble

      public static double toDouble(Object obj)
    • toDouble

      public static double toDouble(Object obj, boolean[] ok)
    • canConvertToFloat

      public static boolean canConvertToFloat(Object obj)
    • toFloat

      public static float toFloat(Object obj)
    • toFloat

      public static float toFloat(Object obj, boolean[] ok)
    • canConvertToString

      public static boolean canConvertToString(Object obj)
    • toString

      public static String toString(Object obj)
    • canConvertToBoolean

      public static boolean canConvertToBoolean(Object obj)
    • toBoolean

      public static boolean toBoolean(Object obj)
    • canConvertToByteArray

      public static boolean canConvertToByteArray(Object obj)
    • toByteArray

      public static QByteArray toByteArray(Object obj)
    • canConvertToBitArray

      public static boolean canConvertToBitArray(Object obj)
    • toBitArray

      public static QBitArray toBitArray(Object obj)
    • canConvertToChar

      public static boolean canConvertToChar(Object obj)
    • toChar

      public static char toChar(Object obj)
    • canConvertToDate

      public static boolean canConvertToDate(Object obj)
    • toDate

      public static QDate toDate(Object obj)
    • canConvertToDateTime

      public static boolean canConvertToDateTime(Object obj)
    • toDateTime

      public static QDateTime toDateTime(Object obj)
    • canConvertToInt

      public static boolean canConvertToInt(Object obj)
    • toInt

      public static int toInt(Object obj)
    • toInt

      public static int toInt(Object obj, boolean[] ok)
    • canConvertToLine

      public static boolean canConvertToLine(Object obj)
    • toLine

      public static QLine toLine(Object obj)
    • canConvertToLineF

      public static boolean canConvertToLineF(Object obj)
    • toLineF

      public static QLineF toLineF(Object obj)
    • canConvertToLocale

      public static boolean canConvertToLocale(Object obj)
    • toLocale

      public static QLocale toLocale(Object obj)
    • canConvertToPoint

      public static boolean canConvertToPoint(Object obj)
    • toPoint

      public static QPoint toPoint(Object obj)
    • canConvertToPointF

      public static boolean canConvertToPointF(Object obj)
    • toPointF

      public static QPointF toPointF(Object obj)
    • canConvertToRect

      public static boolean canConvertToRect(Object obj)
    • toRect

      public static QRect toRect(Object obj)
    • canConvertToRectF

      public static boolean canConvertToRectF(Object obj)
    • toRectF

      public static QRectF toRectF(Object obj)
    • canConvertToRegExp

      public static boolean canConvertToRegExp(Object obj)
    • toRegExp

      public static QRegExp toRegExp(Object obj)
    • canConvertToRegularExpression

      public static boolean canConvertToRegularExpression(Object obj)
    • toRegularExpression

      public static QRegularExpression toRegularExpression(Object obj)
    • canConvertToSize

      public static boolean canConvertToSize(Object obj)
    • toSize

      public static QSize toSize(Object obj)
    • canConvertToSizeF

      public static boolean canConvertToSizeF(Object obj)
    • toSizeF

      public static QSizeF toSizeF(Object obj)
    • canConvertToTime

      public static boolean canConvertToTime(Object obj)
    • toTime

      public static QTime toTime(Object obj)
    • canConvertToLong

      public static boolean canConvertToLong(Object obj)
    • toLong

      public static long toLong(Object obj)
    • toLong

      public static long toLong(Object obj, boolean[] ok)
    • canConvertToList

      public static boolean canConvertToList(Object obj)
    • toList

      public static List<?> toList(Object obj)
    • canConvertToStringList

      public static boolean canConvertToStringList(Object obj)
    • toStringList

      public static List<String> toStringList(Object obj)
    • canConvertToCollection

      public static boolean canConvertToCollection(Object obj)
    • toCollection

      public static Collection<?> toCollection(Object obj)
    • canConvertToMap

      public static boolean canConvertToMap(Object obj)
    • toMap

      public static Map<String,?> toMap(Object obj)
    • convert

      public static <T> T convert(Object value, Class<T> cl)
    • canConvertToEnum

      public static <E extends Enum<?>> boolean canConvertToEnum(Class<E> enumClass, Object obj)
    • canConvertToFlags

      public static boolean canConvertToFlags(Object obj)
    • toEnum

      public static <E extends Enum<?>> E toEnum(Class<E> enumClass, Object obj)
    • toEnum

      public static <E extends Enum<?>> E toEnum(Class<E> enumClass, Object obj, boolean[] ok)
    • toFlags

      public static <F extends QFlags<?>> F toFlags(Class<F> flagsClass, Object obj)
    • toFlags

      public static <F extends QFlags<?>> F toFlags(Class<F> flagsClass, Object obj, boolean[] ok)
    • saveObject

      public static void saveObject(QDataStream stream, Object variant)
    • saveObject

      public static void saveObject(QDataStream stream, Object variant, Boolean[] ok)
    • loadObject

      public static Object loadObject(QDataStream stream)
    • loadObject

      public static Object loadObject(QDataStream stream, Boolean[] ok)