本文整理汇总了C++中setPen函数的典型用法代码示例。如果您正苦于以下问题:C++ setPen函数的具体用法?C++ setPen怎么用?C++ setPen使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setPen函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:fiedukow,项目名称:QtBoats,代码行数:12,代码来源:PlayField.cpp
示例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();
}
开发者ID:ShermanHuang,项目名称:kdesdk,代码行数:15,代码来源:seqlinewidget.cpp
示例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);
}
开发者ID:LoweDavince,项目名称:rUNSWift-2014-release,代码行数:12,代码来源:FieldPainter.cpp
示例4: pen
void QgsComposerItem::setFrameOutlineWidth( double outlineWidth )
{
QPen itemPen = pen();
if ( itemPen.widthF() == outlineWidth )
{
//no change
return;
}
itemPen.setWidthF( outlineWidth );
setPen( itemPen );
emit frameChanged();
}
开发者ID:micheledalponte,项目名称:QGIS,代码行数:12,代码来源:qgscomposeritem.cpp
示例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);
}
开发者ID:roteroktober,项目名称:stromx-studio,代码行数:12,代码来源:ConnectorItem.cpp
示例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()));
}
开发者ID:minsoub,项目名称:MapView,代码行数:12,代码来源:LinkItem.cpp
示例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;
}
开发者ID:Vito2015,项目名称:vgcore,代码行数:12,代码来源:gigraph.cpp
示例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);
}
}
开发者ID:colajam93,项目名称:Minesweeper,代码行数:21,代码来源:minesweeperview.cpp
示例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);
}
开发者ID:SanskritFritz,项目名称:bubble-chains,代码行数:12,代码来源:gamedialogs.cpp
示例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);
}
开发者ID:amilcarsantos,项目名称:maemo-midij,代码行数:21,代码来源:MidijDrawGraphicsScene.cpp
示例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);
}
开发者ID:wyl8899,项目名称:QtFlowFree,代码行数:13,代码来源:Board.cpp
示例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();
}
}
}
开发者ID:netrunner-debian-kde-extras,项目名称:kvirc,代码行数:13,代码来源:canvaswidget.cpp
示例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);
}
开发者ID:mehdioa,项目名称:qtmind,代码行数:13,代码来源:pin.cpp
示例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) ;
}
开发者ID:hvennekate,项目名称:data_element,代码行数:13,代码来源:speccanvasitem.cpp
示例16: pen
void QgsComposerItem::refreshFrameColor( const bool updateItem, const QgsExpressionContext &context )
{
//data defined stroke color set?
bool ok = false;
QColor frameColor = mDataDefinedProperties.valueAsColor( QgsComposerObject::FrameColor, context, mFrameColor, &ok );
if ( ok )
{
QPen itemPen = pen();
itemPen.setColor( frameColor );
setPen( itemPen );
}
else
{
QPen itemPen = pen();
itemPen.setColor( mFrameColor );
setPen( itemPen );
}
if ( updateItem )
{
update();
}
}
开发者ID:exlimit,项目名称:QGIS,代码行数:22,代码来源:qgscomposeritem.cpp
示例17: Item
PointPort::PointPort(qreal x, qreal y, Item *parent) : Item(parent), mPointImpl(), mType("NonTyped")
{
mNeedScalingRect = true;
mRadius = 2;
setX1(x - mRadius * 1.6);
setY1(y - mRadius * 1.6);
setX2(x + mRadius * 1.6);
setY2(y + mRadius * 1.6);
mUnrealRadius = mRadius * 1.6;
setPen(QPen(Qt::blue));
setBrush(QBrush(Qt::blue, Qt::SolidPattern));
mDomElementType = portType;
}
开发者ID:Antropovi,项目名称:qreal,代码行数:13,代码来源:pointPort.cpp
示例18: QRectF
void UseCaseItem::initializeItemMembers()
{
if(mItemType == "I_ACTOR")
{
mItemRectF = QRectF(0, 0, 50, 75);
setPen(Qt::NoPen);
if(mItemName.isEmpty())
mItemName = "Actor";
}
else if(mItemType == "I_USECASE")
{
setPen(Qt::NoPen);
if(mItemName.isEmpty())
mItemName = "Use case";
}
setPolygon(QPolygonF(mItemRectF));
mTextNameItem = new QGraphicsTextItem(mItemName, this);
paintItemMembers();
}
开发者ID:pokpokpok,项目名称:QUml,代码行数:22,代码来源:usecaseitem.cpp
示例19: QGraphicsLineItem
Road::Road(const Model::StreetPtr& street,
const double* normalization,
QGraphicsItem* parent)
: QGraphicsLineItem(parent)
{
//TODO find better solution for converting etc
double x[2] = { (street->first->lon.get() - normalization[0]) * 111322.22222222222, //TODO avoid
(street->second->lon.get() - normalization[0]) * 111322.22222222222 }; //TODO avoid
double y[2] = { (street->first->lat.get() - normalization[1]) * 111132.94444444445, //TODO avoid
(street->second->lat.get() - normalization[1]) * 111132.94444444445 }; //TODO avoid
setLine(x[0], y[0], x[1], y[1]);
setPen(QPen(Qt::gray));
}
开发者ID:fiedukow,项目名称:SimCity2013,代码行数:13,代码来源:Road.cpp
示例20: setBrush
void PaintMethods::paintPolygon(const DebugDrawing::Polygon& element, QPainter& painter)
{
setBrush(element.fillStyle, element.fillColor, painter);
setPen(element, painter);
// copy vector2 to QPoints
const int* points = (const int*)(&element + 1);
std::vector<QPoint> qpoints;
for(int n = element.nCount - 1; n >= 0; --n)
qpoints.push_back(QPoint(points[2 * n], points[2 * n + 1]));
painter.drawPolygon(qpoints.data(), element.nCount);
}
开发者ID:BADBDY23,项目名称:BHumanCodeRelease,代码行数:13,代码来源:PaintMethods.cpp
注:本文中的setPen函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论