34 #ifndef GAMMARAY_UTIL_H
35 #define GAMMARAY_UTIL_H
37 #include "gammaray_core_export.h"
60 GAMMARAY_CORE_EXPORT QString
displayString(
const QObject *
object);
88 GAMMARAY_CORE_EXPORT QString
enumToString(
const QVariant &value,
89 const char *typeName = 0,
90 const QObject *
object = 0);
97 inline QString
enumToString(T value,
const char *typeName = 0,
const QObject *
object = 0)
99 return enumToString(QVariant::fromValue<T>(value), typeName,
object);
115 GAMMARAY_CORE_EXPORT
bool descendantOf(
const QObject *ascendant,
const QObject *
object);
124 template <
typename T>
129 if (qobject_cast<T*>(
object)) {
130 return qobject_cast<T*>(object);
132 return findParentOfType<T>(
object->parent());
143 GAMMARAY_CORE_EXPORT QVariant
iconForObject(
const QObject *
object);
173 #endif // GAMMARAY_UTIL_H