1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 21:57:34 +00:00

LibCore: Add CObject::for_each_child_of_type<T>()

Use this to iterate over all the GRadioButtons in a group.
This commit is contained in:
Andreas Kling 2019-05-27 04:18:24 +02:00
parent 0c85d3dba9
commit 3873c51781
3 changed files with 21 additions and 5 deletions

View file

@ -20,3 +20,10 @@ private:
template<typename Callback> void for_each_in_group(Callback);
static Size circle_size();
};
template<> inline bool is<GRadioButton>(const CObject& object)
{
if (!is<GWidget>(object))
return false;
return to<GWidget>(object).is_radio_button();
}