本文整理汇总了C++中MythUIType::GetChildAt方法的典型用法代码示例。如果您正苦于以下问题:C++ MythUIType::GetChildAt方法的具体用法?C++ MythUIType::GetChildAt怎么用?C++ MythUIType::GetChildAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythUIType
的用法示例。
在下文中一共展示了MythUIType::GetChildAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetArea
/** \brief Return the first MythUIType which accepts focus found at the given
* coordinates
*
* \param p QPoint coordinates
* \param recursive Whether to perform a recursive search
*
* \return The widget at these coordinates
*/
MythUIType *MythUIType::GetChildAt(const QPoint &p, bool recursive,
bool focusable) const
{
if (GetArea().contains(p))
{
if (!IsVisible() || !IsEnabled())
return NULL;
if (m_ChildrenList.isEmpty())
return NULL;
/* check all children */
QList<MythUIType *>::const_iterator it;
for (it = m_ChildrenList.end() - 1; it != m_ChildrenList.begin() - 1; --it)
{
if (!(*it))
continue;
// If this point doesn't fall within the child's area then move on
// This requires that the area is actually accurate and in some
// cases this still isn't true
if (!(*it)->GetArea().contains(p - GetArea().topLeft()))
continue;
MythUIType *child = *it;
if (recursive && (focusable && !child->CanTakeFocus()))
child = child->GetChildAt(p - GetArea().topLeft(), recursive,
focusable);
if (child)
{
// NOTE: Assumes no selectible ui type will contain another
// selectible ui type.
if (focusable && !child->CanTakeFocus())
continue;
return child;
}
}
}
return NULL;
}