本文整理汇总了C++中Offsets::point方法的典型用法代码示例。如果您正苦于以下问题:C++ Offsets::point方法的具体用法?C++ Offsets::point怎么用?C++ Offsets::point使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Offsets
的用法示例。
在下文中一共展示了Offsets::point方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawPixmap
void Layer::drawPixmap()
{
if ((boundingRect().width() == 0) || (boundingRect().height() == 0))
return;
// TODO Forward
if (m_currentPixmap)
delete m_currentPixmap;
m_currentPixmap = new QPixmap(boundingRect().width() * m_areaToDraw, boundingRect().height());
QPainter p(m_currentPixmap);
int xPoint = 0;
for (int i = 0; i < m_offsets[m_columnOffset].size(); i++) {
Offsets offset = m_offsets[m_columnOffset].at(i);
if (((m_type == Quasi::MirroredType) && (i != 0)
&& (offset.point() - m_latestPoint < 0))
|| m_shouldMirror) {
m_drawingMirrored = !m_drawingMirrored;
m_shouldMirror = false;
}
QPixmap pix = generatePartialPixmap(offset.point(), offset.size());
p.drawPixmap(xPoint, 0, pix);
xPoint += pix.width();
m_latestPoint = offset.point();
if ((m_type == Quasi::MirroredType)
&& (i == m_offsets[m_columnOffset].size() - 1)
&& (offset.size() < m_numColumns))
m_shouldMirror = true;
}
if (m_direction == Quasi::ForwardDirection)
m_columnOffset = (m_columnOffset - 1 < 0) ? m_offsets.size() - 1 : m_columnOffset - 1;
else
m_columnOffset = (m_columnOffset + 1) % m_offsets.size();
p.end();
}