GammaRay API Documentaion
2.6.0
|
Variant conversion functions, extendable by plugins. More...
Typedefs | |
typedef QString(* | GenericStringConverter) (const QVariant &value, bool *ok) |
Functions | |
QVariant | decoration (const QVariant &value) |
QString | displayString (const QVariant &value) |
template<typename T > | |
QString | displayString (T value) |
void | registerGenericStringConverter (GenericStringConverter converter) |
void | registerStringConverter (int type, Converter< QString > *converter) |
template<typename T , typename FuncT > | |
void | registerStringConverter (FuncT f) |
QVariant | serializableVariant (const QVariant &value) |
Variant conversion functions, extendable by plugins.
|
inline |
Returns a human readable string version of the given value. Thihs is a convenience overload of the QVariant-based version above.
void GammaRay::VariantHandler::registerGenericStringConverter | ( | GenericStringConverter | converter | ) |
Register a generic string conversion function for various variant types. This can be used when you have a converter that can dynamically check if it can handle a given variant, and the types it can handle aren't known at compile time (example: QQmlListProperty).
converter | The converter function. It's second parameter is used to indicate if the value could be handled. |
void GammaRay::VariantHandler::registerStringConverter | ( | int | type, |
Converter< QString > * | converter | ||
) |
Register a string conversion functions for a variant type.
|
inline |
Register a string conversion function for a variant type.
T | The type for which to use this converter function. |
Converts the given variant into an variant of a different type that can be transferred to another process. This is most prominently needed for pointer types, e.g. const QMatrix4x4* -> QMatrix4x4, primarily for the fancy display delegate on the client side.