Module qtjambi
Package io.qt.core

Class QGenericReturnType<T>

java.lang.Object
io.qt.core.QGenericReturnType<T>
Type Parameters:
T -

public final class QGenericReturnType<T> extends Object

Specifies a function pointer's return type.

Qt's object types are represented by pointers, value types by values, e.g.:

Java class QWidget leads to QWidget* function return type, Java class QColor leads to QColor function return type (as value).

Use asRef() to return values and objects as reference type (e.g. QColor&, QObject&).

Use asConstRef() to return values and objects as const reference (e.g. const QColor&).

Use asPointer() to return values as pointers (e.g. QColor*).

  • Method Details

    • asPointer

      public QGenericReturnType<T> asPointer()

      Return value as pointer (e.g. QColor*).

      Returns:
      new instance
    • asRef

      public QGenericReturnType<T> asRef()

      Return value or object as reference (e.g. QColor&, QObject&).

      Returns:
      new instance
    • asConstRef

      public QGenericReturnType<T> asConstRef()

      Return value or object as const reference (e.g. const QColor&).

      Returns:
      new instance
    • of

      public static <T> QGenericReturnType<T> of(Class<T> classType, QMetaType... instantiations)
      Create generic return type from class type.
      Parameters:
      classType -
      instantiations - only useful to specify template types like QList<T>.
      Returns:
      new instance
    • of

      public static <T> QGenericReturnType<T> of(QMetaType metaType)
      Create generic return type from meta type.
      Parameters:
      metaType -
      Returns:
      new instance
    • of

      public static <T> QGenericReturnType<T> of(QMetaType.Type type)
      Create generic return type from meta type.
      Parameters:
      metaType -
      Returns:
      new instance