本文整理汇总了C++中QPolygonF::push_front方法的典型用法代码示例。如果您正苦于以下问题:C++ QPolygonF::push_front方法的具体用法?C++ QPolygonF::push_front怎么用?C++ QPolygonF::push_front使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPolygonF
的用法示例。
在下文中一共展示了QPolygonF::push_front方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setX
void ViewProfileDivider::setX (double x,
double xLow,
double xHigh)
{
// Convert to screen coordinates
m_xScene = m_sceneWidth * (x - xLow) / (xHigh - xLow);
sendSignalMoved ();
updateGeometryPaddle ();
updateGeometryDivider ();
updateGeometryNonPaddle ();
// Triangle vertices
double xLeft = rect().left() + rect().width() / 2.0 - ARROW_WIDTH / 2.0;
double xRight = rect().left() + rect().width() / 2.0 + ARROW_WIDTH / 2.0;
double yTop = rect().top() + rect().height() / 2.0 - ARROW_HEIGHT / 2.0;
double yMiddle = rect().top() + rect().height() / 2.0;
double yBottom = rect().top() + rect().height() / 2.0 + ARROW_HEIGHT / 2.0;
QPolygonF polygonArrow;
if (m_isLowerBoundary) {
// Draw arrow pointing to the right
polygonArrow.push_front (QPointF (xLeft, yTop));
polygonArrow.push_front (QPointF (xRight, yMiddle));
polygonArrow.push_front (QPointF (xLeft, yBottom));
} else {
// Draw arrow pointing to the left
polygonArrow.push_front (QPointF (xRight, yTop));
polygonArrow.push_front (QPointF (xLeft, yMiddle));
polygonArrow.push_front (QPointF (xRight, yBottom));
}
m_arrow->setPolygon (polygonArrow);
m_arrow->setPen (QPen (Qt::black));
m_arrow->setBrush (QBrush (ARROW_COLOR));
}
示例2: digitalPattern_Rotate
bool DataConverter::digitalPattern_Rotate(QPolygonF &points, qreal angle)
{
if (angle == 0.0)
return true;
if (angle < -180.0 || angle > 180.0)
{
qDebug("[DataConverter::digitalPattern_Rotate] Error: Angle: [%f]", angle);
return false;
}
if (points.size() < 10)
{
qDebug("[DataConverter::digitalPattern_Rotate] Error: Polygon Point Count: [%d]", points.size());
return false;
}
//
QTransform transform;
transform.rotate(angle);
points = transform.map(points);
//
int bottomIndex = 0;
{
qreal tmpX = -9999.99;
for (int i = 0; i < points.size(); i++)
{
if (points.at(i).y() < 0.0)
continue;
if (points.at(i).x() > 0.0)
continue;
if (points.at(i).x() > tmpX)
{
tmpX = points.at(i).x();
bottomIndex = i;
}
}
}
qDebug("** bottomIndex: [%d]", bottomIndex);
if (bottomIndex > 0)
{
QPointF tmpPoint;
for (int i = points.size() - 1; i >= bottomIndex; i--)
{
tmpPoint = points.last();
points.pop_back();
points.push_front(tmpPoint);
}
}
return true;
}