Logo Search packages:      
Sourcecode: qt-gstreamer version File versions  Download package

Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | Related Functions

QGlib::Value Class Reference

Wrapper class for GValue. More...

#include <QGlib/Value>

List of all members.

Public Member Functions

bool canTransformTo (Type type) const
void clear ()
 Data (const Data &other)
 Data ()
template<typename T >
get (bool *ok=NULL) const
void init (Type type)
template<typename T >
void init ()
bool isValid () const
 operator const GValue * () const
 operator GValue * ()
Valueoperator= (const Value &other)
template<typename T >
void set (const T &data)
bool toBool (bool *ok=NULL) const
QByteArray toByteArray (bool *ok=NULL) const
char toChar (bool *ok=NULL) const
int toInt (bool *ok=NULL) const
qint64 toInt64 (bool *ok=NULL) const
long toLong (bool *ok=NULL) const
QString toString (bool *ok=NULL) const
uchar toUChar (bool *ok=NULL) const
uint toUInt (bool *ok=NULL) const
quint64 toUInt64 (bool *ok=NULL) const
ulong toULong (bool *ok=NULL) const
Value transformTo (Type type) const
Type type () const
Type type () const
 Value (char val)
 Creates a new Value of Type::Char and sets it to hold val.
 Value (Type type)
 Value (const Value &other)
GValue * value ()
 Value (float val)
 Creates a new Value of Type::Float and sets it to hold val.
 Value (double val)
 Creates a new Value of Type::Double and sets it to hold val.
 Value (uint val)
 Creates a new Value of Type::Uint and sets it to hold val.
 Value (ulong val)
 Creates a new Value of Type::Ulong and sets it to hold val.
 Value (long val)
 Creates a new Value of Type::Long and sets it to hold val.
 Value (const QByteArray &val)
 Creates a new Value of Type::String and sets it to hold val.
const GValue * value () const
 Value (const char *val)
 Creates a new Value of Type::String and sets it to hold val.
 Value (const QString &val)
 Creates a new Value of Type::String and sets it to hold val.
 Value (const GValue *gvalue)
 Value (qint64 val)
 Creates a new Value of Type::Int64 and sets it to hold val.
 Value (quint64 val)
 Creates a new Value of Type::Uint64 and sets it to hold val.
 Value (int val)
 Creates a new Value of Type::Int and sets it to hold val.
 Value (bool val)
 Creates a new Value of Type::Bool and sets it to hold val.
 Value ()
 Value (uchar val)
 Creates a new Value of Type::Uchar and sets it to hold val.

Static Public Member Functions

template<typename T >
static Value create (const T &data)
static void registerValueVTable (Type type, const ValueVTable &vtable)

Public Attributes

GValue m_value

Private Member Functions

void getData (Type dataType, void *data) const
void setData (Type dataType, const void *data)

Private Attributes

QSharedDataPointer< Data > d

Friends

struct ValueImpl

Related Functions

(Note that these are not member functions.)


QTGLIB_EXPORT QDebug operator<< (QDebug debug, const Value &value)

Detailed Description

Wrapper class for GValue.

This class serves as a wrapper for GValue. GValue is a data type that can hold different types of values inside, like a QVariant.

A Value object holds a single value of a single type() at a time. To create a new Value, use the static create() method or one of the constructors. To get the held value, use the template get() method or one of the toT() functions (ex. toInt()).

To set a value to an invalid Value (on which isValid() returns false), you must first initialize this Value using one of the init() methods (preferably the template one) in order to tell it what kind of value it is going to hold. Once initialized to hold a specific type, you can use the set() method to set a value. To change the type that this value holds, you can call the init() method again at any time. In this case, though, any previously held value will be lost.

Note:
This class is implicitly shared.

Definition at line 134 of file value.cpp.


The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index