KDStateMachineEditor API Documentation 2.3
Loading...
Searching...
No Matches
KDSME::ObjectHelper Namespace Reference

Enumerations

enum  DisplayOption { NoStrip , StripNameSpace }

Functions

KDSME_CORE_EXPORT QString addressToString (const void *p)
KDSME_CORE_EXPORT QString className (const QObject *object, DisplayOption option=NoStrip)
template<class FilterType, class ItemType>
QList< FilterType > copy_if_type (const QList< ItemType > &list)
KDSME_CORE_EXPORT int depth (const QObject *root, const QObject *object)
KDSME_CORE_EXPORT bool descendantOf (const QObject *ascendant, const QObject *object)
KDSME_CORE_EXPORT QString displayString (const QObject *object, DisplayOption option=NoStrip)
KDSME_CORE_EXPORT const char * enumToString (const QMetaObject *metaObject, const char *name, int value)
template<class C, class P>
C filter (const C &source, const P &predicate)
template<typename T>
T * findParentOfType (QObject *object)
KDSME_CORE_EXPORT int stringToEnum (const QMetaObject *metaObject, const char *name, const char *key)
KDSME_CORE_EXPORT QString toString (const QPointF &point)
KDSME_CORE_EXPORT QString toString (const QRectF &rect)
KDSME_CORE_EXPORT QString toString (const QSizeF &size)

Enumeration Type Documentation

◆ DisplayOption

Enumerator
NoStrip 
StripNameSpace 

Definition at line 37 of file objecthelper.h.

Function Documentation

◆ addressToString()

QString KDSME::ObjectHelper::addressToString ( const void * p)

◆ className()

QString KDSME::ObjectHelper::className ( const QObject * object,
ObjectHelper::DisplayOption option = NoStrip )

◆ copy_if_type()

template<class FilterType, class ItemType>
QList< FilterType > KDSME::ObjectHelper::copy_if_type ( const QList< ItemType > & list)

Filters the list list

Returns a list that only contains item of type FilterType

Definition at line 74 of file objecthelper.h.

Referenced by KDSME::Element::childElements(), KDSME::State::childStates(), and KDSME::State::transitions().

◆ depth()

int KDSME::ObjectHelper::depth ( const QObject * root,
const QObject * object )

Determines the depth of object obj relative to object root

Returns
Depth, -1 in case obj is null

Definition at line 99 of file objecthelper.cpp.

References depth().

Referenced by depth().

◆ descendantOf()

bool KDSME::ObjectHelper::descendantOf ( const QObject * ascendant,
const QObject * object )

Determines if the QObject obj is a descendant of the QObject ascendant.

Parameters
ascendantis a pointer to a QObject.
objectis a pointer to a QObject.
Returns
true if obj is a descendant of ascendant; false otherwise.

Definition at line 87 of file objecthelper.cpp.

References descendantOf().

Referenced by descendantOf().

◆ displayString()

QString KDSME::ObjectHelper::displayString ( const QObject * object,
DisplayOption option = NoStrip )

Definition at line 47 of file objecthelper.cpp.

References addressToString(), and className().

◆ enumToString()

const char * KDSME::ObjectHelper::enumToString ( const QMetaObject * metaObject,
const char * name,
int value )

Definition at line 58 of file objecthelper.cpp.

Referenced by KDSME::Element::typeToString().

◆ filter()

template<class C, class P>
C KDSME::ObjectHelper::filter ( const C & source,
const P & predicate )

Filter out each item in source for that predicate is true

Returns a copy of the original container source

Definition at line 90 of file objecthelper.h.

◆ findParentOfType()

template<typename T>
T * KDSME::ObjectHelper::findParentOfType ( QObject * object)

Finds the parent QObject of the specified type T, if such exists.

Parameters
objectis a pointer to a QObject.
Returns
zero on failure; else a pointer to a data type T.

Definition at line 106 of file objecthelper.h.

References findParentOfType().

Referenced by findParentOfType().

◆ stringToEnum()

int KDSME::ObjectHelper::stringToEnum ( const QMetaObject * metaObject,
const char * name,
const char * key )

Definition at line 65 of file objecthelper.cpp.

Referenced by KDSME::Element::stringToType().

◆ toString() [1/3]

QString KDSME::ObjectHelper::toString ( const QPointF & point)

Definition at line 72 of file objecthelper.cpp.

Referenced by toString().

◆ toString() [2/3]

QString KDSME::ObjectHelper::toString ( const QRectF & rect)

Definition at line 82 of file objecthelper.cpp.

References toString().

◆ toString() [3/3]

QString KDSME::ObjectHelper::toString ( const QSizeF & size)

Definition at line 77 of file objecthelper.cpp.


© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDStateMachineEditor
Create Qt State Machine metacode using a graphical user interface
https://github.com/KDAB/KDStateMachineEditor
Generated on for KDStateMachineEditor API Documentation by doxygen 1.15.0