MCPcopy Create free account
hub / github.com/VCVRack/Rack / getFirstDescendantOfType

Method getFirstDescendantOfType

include/widget/Widget.hpp:101–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99
100 template <class T>
101 T* getFirstDescendantOfType() {
102 for (Widget* child : children) {
103 T* c = dynamic_cast<T*>(child);
104 if (c)
105 return c;
106 c = child->getFirstDescendantOfType<T>();
107 if (c)
108 return c;
109 }
110 return NULL;
111 }
112
113 /** Checks if the given widget is a child of `this` widget.
114 */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected