本文整理汇总了C++中QRectF::moveRight方法的典型用法代码示例。如果您正苦于以下问题:C++ QRectF::moveRight方法的具体用法?C++ QRectF::moveRight怎么用?C++ QRectF::moveRight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QRectF
的用法示例。
在下文中一共展示了QRectF::moveRight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
QList<QRectF> Mode6::locate()
{
QList<QRectF> results;
if (rect.height() > 360){
return results;
}
QSize size = ARender::instance()->getActualSize();
QRectF init = rect;
init.moveRight(0);
int end = size.height()*(Config::getValue("/Danmaku/Protect", false) ? 0.85 : 1) - rect.height();
int stp = Config::getValue("/Danmaku/Grating", 10);
for (int height = 0; height <= end; height += stp){
init.moveTop(height);
results.append(init);
}
return results;
}
示例2: paintEvent
//.........这里部分代码省略.........
// clip the markers
p.setClipRect(m_markerRect);
{
QPen pen = p.pen();
paintMarkers(p, m_RootMarkers, m_RootDraws, m_markerRect);
p.setPen(pen);
}
// stop clipping
p.setClipRect(viewport()->rect());
QRectF currentRect = eidAxisRect;
// draw the current label and line
{
uint32_t curEID = m_Ctx.CurEvent();
currentRect.setLeft(offsetOf(curEID));
currentRect.setWidth(
qMax(m_eidAxisLabelWidth, m_eidAxisLabelTextWidth + dataBarHeight + margin * 2));
// recentre
currentRect.moveLeft(currentRect.left() - currentRect.width() / 2 + m_eidWidth / 2);
// remember where the middle would have been, without clamping
qreal realMiddle = currentRect.center().x();
// clamp the position from the left or right side
if(currentRect.left() < eidAxisRect.left())
currentRect.moveLeft(eidAxisRect.left());
else if(currentRect.right() > eidAxisRect.right())
currentRect.moveRight(eidAxisRect.right());
// re-add the top margin so the lines match up with the border around the EID axis
QRectF currentBackRect = currentRect.marginsAdded(QMargins(0, margin, 0, 0));
p.fillRect(currentBackRect, palette().brush(QPalette::Base));
p.drawRect(currentBackRect);
// draw the 'current marker' pixmap
const QPixmap &px = Pixmaps::flag_green(devicePixelRatio());
p.drawPixmap(currentRect.topLeft() + QPointF(margin, 1), px, px.rect());
// move to where the text should be and draw it
currentRect.setLeft(currentRect.left() + margin * 2 + dataBarHeight);
p.drawText(currentRect, QString::number(curEID), to);
// draw a line from the bottom of the shadow downwards
QPointF currentTop = currentRect.center();
currentTop.setX(int(qBound(eidAxisRect.left(), realMiddle, eidAxisRect.right() - 2.0)) + 0.5);
currentTop.setY(currentRect.bottom());
QPointF currentBottom = currentTop;
currentBottom.setY(m_markerRect.bottom());
p.drawLine(currentTop, currentBottom);
}
to.setAlignment(Qt::AlignLeft | Qt::AlignTop);
if(!m_UsageTarget.isEmpty() || !m_HistoryTarget.isEmpty())
{
p.setRenderHint(QPainter::Antialiasing);