本文整理汇总了C++中setPen函数的典型用法代码示例。如果您正苦于以下问题:C++ setPen函数的具体用法?C++ setPen怎么用?C++ setPen使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setPen函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QGraphicsRectItem
PlayField::PlayField(qreal pxX, qreal pxY,
qreal pxWidth, qreal pxHeight,
int x, int y,
QGraphicsItem* parent)
: QGraphicsRectItem(0, 0, pxWidth, pxHeight, parent),
state_(WATER),
x(x), y(y)
{
setPos(pxX, pxY);
setPen(QPen(Qt::NoPen));
updateColor();
}
示例2: UMLSceneLine
/**
* Constructor.
*/
SeqLineWidget::SeqLineWidget(UMLView * pView, ObjectWidget * pObject)
: UMLSceneLine( pView -> canvas() )
{
m_scene = pView;
m_pObject = pObject;
setPen( QPen( m_pObject->lineColor(), 0, Qt::DashLine ) );
setZ( 0 );
setVisible( true );
m_DestructionBox.line1 = 0;
m_nLengthY = 250;
setupDestructionBox();
}
示例3: save
void FieldPainter::drawBallPosAbs(const AbsCoord &ball, QColor colour)
{
save();
QPoint newBall = QPoint(ball.x(), ball.y());
QPen absPen(colour);
setPen(absPen);
setBrush(QBrush(colour));
drawEllipse(newBall, 40, 40);
restore();
drawAbsCovEllipse(ball, absPen);
}
示例4: pen
void QgsComposerItem::setFrameOutlineWidth( double outlineWidth )
{
QPen itemPen = pen();
if ( itemPen.widthF() == outlineWidth )
{
//no change
return;
}
itemPen.setWidthF( outlineWidth );
setPen( itemPen );
emit frameChanged();
}
示例5: QGraphicsRectItem
ConnectorItem::ConnectorItem(OperatorModel* op, unsigned int id, ConnectorType type, QGraphicsItem* parent)
: QGraphicsRectItem(parent),
m_op(op),
m_id(id),
m_connectorType(type),
m_currentArrow(0)
{
setRect(-SIZE/2, -SIZE/2, SIZE, SIZE);
setAcceptHoverEvents(true);
setBrush(Qt::black);
setPen(Qt::NoPen);
}
示例6: setPen
void LinkItem::trackNodes()
{
setPen(QPen(Qt::white, 1.0));
//log->print(QString("sourcePoint (x, y) = (%1, %2)").arg(source->getCurrentPoint().x()).arg(source->getCurrentPoint().y()));
//log->print(QString("destPoint (x, y) = (%1, %2)").arg(dest->getCurrentPoint().x()).arg(dest->getCurrentPoint().y()));
setLine(QLineF(source->getCurrentPoint(), dest->getCurrentPoint()));
//setLine(QLineF(source->pos(), dest->pos()));
//log->print(QString("AirPlaneItem pos : (x, y) = (%1, %2)").arg(fromNode->pos().x()).arg(fromNode->pos().y()));
}
示例7: setPen
bool GiGraphics::rawEllipse(const GiContext* ctx, float x, float y, float w, float h)
{
bool usePen = setPen(ctx);
bool useBrush = setBrush(ctx);
if (m_impl->canvas && !m_impl->stopping
&& !isnan(x) && !isnan(y) && !isnan(w) && !isnan(h)) {
m_impl->canvas->drawEllipse(x, y, w, h, usePen, useBrush);
return true;
}
return false;
}
示例8: QGraphicsRectItem
CellRectItem::CellRectItem(int row, int column, CellView view)
: QGraphicsRectItem({basePoint(row, column), cellQSizeF})
, row_(row)
, column_(column)
{
setZValue(cellBackgroundZValue);
if (view == CellView::None || view == CellView::Flag ||
view == CellView::Doubt) {
setPen(
{Qt::darkCyan, 1.5, Qt::SolidLine, Qt::SquareCap, Qt::RoundJoin});
setBrush(cellBrush);
}
else {
setPen({Qt::NoPen});
setBrush({});
}
if (view != CellView::None) {
auto text = getTextItem(view, {row, column});
text->setParentItem(this);
}
}
示例9: GradientButton
GradientButton(GamePanel *parent, const QRect &rect, const QString &text) :
GameButton(parent, rect, text)
{
setBackground(Qt::NoBrush);
setPen(QPen(QColor(Qt::white), 2));
setHoverBackground(QColor(0x2076b1));
setTextColor(Qt::white);
setTextHoverColor(Qt::white);
setFont(&gameStock->Font20);
}
示例10: qDebug
void GraphicsSelectionItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *w)
{
qDebug(__PRETTY_FUNCTION__);
if (m_readOnly)
{
setPen(QPen(Qt::white));
QGraphicsRectItem::paint(painter, option, w);
return;
}
setPen(QPen(Qt::yellow));
QGraphicsRectItem::paint(painter, option, w);
QRectF rect = QGraphicsRectItem::rect();
int bottom = rect.bottom();
int right = rect.right();
painter->drawLine(right - 9, bottom, right, bottom - 9);
painter->drawLine(right - 6, bottom, right, bottom - 6);
painter->drawLine(right - 3, bottom, right, bottom - 3);
}
示例11: QMarginsF
void Board::paintPoint(Point point, int index) {
QRectF rect = Locator<Grid>()->getGridRect(point);
qreal margin = Locator<Grid>()->getGridSize() * (1 - common::predefinedSize::CircleSizeOverGridSize);
auto margins = QMarginsF(margin, margin, margin, margin);
QRectF rectShrinked = rect.marginsRemoved(margins);
auto circle = new QGraphicsEllipseItem(rectShrinked);
auto itemID = common::VisibleItemID::Circle;
QColor color = common::getColor(itemID, index);
circle->setZValue(itemID);
circle->setPen(Qt::NoPen);
circle->setBrush(QBrush(color));
itemList->addItem(circle);
}
示例12: posicion
void Celda::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
{
QPair<int,int> posicion(pos.y()/65,pos.x()/65);
set<QPair<int,int> > movPosibles = juego->getMovimientosPosibles(juego->getTurno());
if (movPosibles.find(posicion) != movPosibles.end())
{
p = pen();
QPen newPen(Qt::SolidLine);
newPen.setWidth(3);
setPen(newPen);
entroHover = 1;
}
}
开发者ID:enzohorquin,项目名称:School-Final-Project-for-Analysis-and-design-of-algorithms-II,代码行数:13,代码来源:celda.cpp
示例13: setPen
void KviCanvasRectangle::setProperty(const QString &property,const QVariant &val)
{
if(m_properties[property].isValid())
{
m_properties.replace(property,val);
if((property == "clrForeground") || (property == "uLineWidth"))
{
setPen(QPen(m_properties["clrForeground"].asColor(),m_properties["uLineWidth"].toInt()));
} else {
hide(); show();
}
}
}
示例14: QGraphicsEllipseItem
Pin::Pin(QGraphicsItem* parent) :
QGraphicsEllipseItem(0, 0, 13, 13, parent),
mColor(Pin::Color::NONE),
mEnabled(false)
{
QLinearGradient lgrad(0, 0, 0, 13);
lgrad.setColorAt(0.0, QColor(50, 50, 50));
lgrad.setColorAt(1.0, QColor(220, 220, 220));
setPen(QPen(QBrush(lgrad), 1));
setAcceptedMouseButtons(Qt::NoButton);
setCursor(Qt::ArrowCursor);
}
示例15: newPen
void specCanvasItem::setPenStyle(const qint8& s)
{
// if (s < 0)
// {
// setStyle(QwtPlotCurve::NoCurve) ;
// return ;
// }
// else
// setStyle(QwtPlotCurve::Lines) ;
QPen newPen(pen()) ;
newPen.setStyle((Qt::PenStyle) s) ;
setPen(newPen) ;
}