本文整理汇总了C++中MythUIType::SetArea方法的典型用法代码示例。如果您正苦于以下问题:C++ MythUIType::SetArea方法的具体用法?C++ MythUIType::SetArea怎么用?C++ MythUIType::SetArea使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythUIType
的用法示例。
在下文中一共展示了MythUIType::SetArea方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OptimiseDisplayedArea
void SubtitleScreen::OptimiseDisplayedArea(void)
{
if (!m_refreshArea)
return;
QRegion visible;
QListIterator<MythUIType *> i(m_ChildrenList);
while (i.hasNext())
{
MythUIType *img = i.next();
visible = visible.united(img->GetArea());
}
if (visible.isEmpty())
return;
QRect bounding = visible.boundingRect();
bounding = bounding.translated(m_safeArea.topLeft());
bounding = m_safeArea.intersected(bounding);
int left = m_safeArea.left() - bounding.left();
int top = m_safeArea.top() - bounding.top();
SetArea(MythRect(bounding));
i.toFront();;
while (i.hasNext())
{
MythUIType *img = i.next();
img->SetArea(img->GetArea().translated(left, top));
}
}
示例2: OptimiseDisplayedArea
void TeletextScreen::OptimiseDisplayedArea(void)
{
VideoOutput *vo = m_player->GetVideoOutput();
if (!vo)
return;
MythPainter *osd_painter = vo->GetOSDPainter();
if (!osd_painter)
return;
QHashIterator<int, QImage*> it(m_rowImages);
while (it.hasNext())
{
it.next();
MythImage* image = osd_painter->GetFormatImage();
if (!image || !it.value())
continue;
int row = it.key();
image->Assign(*(it.value()));
MythUIImage *uiimage = new MythUIImage(this, QString("ttrow%1")
.arg(row));
if (uiimage)
{
uiimage->SetImage(image);
uiimage->SetArea(MythRect(0, row * m_rowHeight,
m_safeArea.width(), m_rowHeight * 2));
}
}
QRegion visible;
QListIterator<MythUIType *> i(m_ChildrenList);
while (i.hasNext())
{
MythUIType *img = i.next();
visible = visible.united(img->GetArea());
}
if (visible.isEmpty())
return;
QRect bounding = visible.boundingRect();
bounding = bounding.translated(m_safeArea.topLeft());
bounding = m_safeArea.intersected(bounding);
int left = m_safeArea.left() - bounding.left();
int top = m_safeArea.top() - bounding.top();
SetArea(MythRect(bounding));
i.toFront();;
while (i.hasNext())
{
MythUIType *img = i.next();
img->SetArea(img->GetArea().translated(left, top));
}
}
示例3: CalculatePosition
void MythUIScrollBar::CalculatePosition(void)
{
if (m_maximum > 0)
Show();
else
{
Hide();
return;
}
MythUIType *slider = GetChild("slider");
if (!slider)
{
LOG(VB_GENERAL, LOG_ERR, "Slider element doesn't exist");
return;
}
float percentage = (float)m_sliderPosition / m_maximum;
float relativeSize = (float)m_pageStep / (m_maximum + m_pageStep);
MythRect newSliderArea = slider->GetArea();
MythRect fillArea = GetArea();
QPoint endPos(newSliderArea.left(), newSliderArea.top());
if (m_layout == LayoutHorizontal)
{
int width = qMax((int)(fillArea.width() * relativeSize + 0.5),
m_sliderArea.width());
newSliderArea.setWidth(width);
endPos.setX((int)((fillArea.width() - width) * percentage + 0.5));
}
else
{
int height = qMax((int)(fillArea.height() * relativeSize + 0.5),
m_sliderArea.height());
newSliderArea.setHeight(height);
endPos.setY((int)((fillArea.height() - height) * percentage + 0.5));
}
slider->SetArea(newSliderArea);
slider->SetPosition(endPos);
if (m_hideDelay > 0)
{
if (m_timerId)
killTimer(m_timerId);
m_timerId = startTimer(m_hideDelay);
AdjustAlpha(1, 10, 0, 255);
}
}