本文整理汇总了C++中MythRect::isNull方法的典型用法代码示例。如果您正苦于以下问题:C++ MythRect::isNull方法的具体用法?C++ MythRect::isNull怎么用?C++ MythRect::isNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythRect
的用法示例。
在下文中一共展示了MythRect::isNull方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetMinArea
/**
* Set the minimum area based on the given size
*/
void MythUIType::SetMinArea(const MythRect &rect)
{
// If a minsize is not set, don't use MinArea
if (!m_Initiator || !m_MinSize.isValid())
return;
QRect bounded(rect);
bool vanish = (m_Vanish && rect.isNull());
if (vanish)
{
bounded.moveLeft(0);
bounded.moveTop(0);
}
else
{
QPoint center = bounded.center();
if (bounded.isNull())
bounded.setSize(GetMinSize());
else
bounded.setSize(bounded.size().expandedTo(GetMinSize()));
bounded.moveCenter(center);
if (bounded.x() + bounded.width() > m_Area.x() + m_Area.width())
bounded.moveRight(m_Area.x() + m_Area.width());
if (bounded.y() + bounded.height() > m_Area.y() + m_Area.height())
bounded.moveBottom(m_Area.x() + m_Area.height());
if (bounded.x() < m_Area.x())
{
bounded.moveLeft(m_Area.x());
if (bounded.width() > m_Area.width())
bounded.setWidth(m_Area.width());
}
if (bounded.y() < m_Area.y())
{
bounded.moveTop(m_Area.y());
if (bounded.height() > m_Area.height())
bounded.setHeight(m_Area.height());
}
}
m_MinArea = bounded;
m_Vanished = vanish;
if (m_Parent)
m_Parent->SetMinAreaParent(m_MinArea, m_Area, this);
}