203 switch (item->
type()) {
225 const qreal pad = itemPenWidth / 2;
227 const qreal penWidth = 0;
231 fgcolor.
red() > 127 ? 0 : 255,
232 fgcolor.
green() > 127 ? 0 : 255,
233 fgcolor.
blue() > 127 ? 0 : 255);
The QColor class provides colors based on RGB, HSV or CMYK values.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
const QTransform & transform() const
Returns the world transformation matrix.
const QColor & color() const
Returns the brush color.
The QGraphicsRectItem class provides a rectangle item that you can add to a QGraphicsScene.
virtual QRectF boundingRect() const =0
This pure virtual function defines the outer bounds of the item as a rectangle; all painting must be ...
The QGraphicsEllipseItem class provides an ellipse item that you can add to a QGraphicsScene.
ushort red
Returns the red color component of this color.
The QGraphicsPolygonItem class provides a polygon item that you can add to a QGraphicsScene.
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
The QRectF class defines a rectangle in the plane using floating point precision. ...
qreal height() const
Returns the height of the rectangle.
virtual int type() const
Returns the type of an item as an int.
qreal width() const
Returns the width of the rectangle.
QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
QPalette palette
the palette that should be used when painting the control
const QBrush & windowText() const
Returns the window text (general foreground) brush of the current color group.
The QGraphicsSimpleTextItem class provides a simple text path item that you can add to a QGraphicsSce...
The QGraphicsLineItem class provides a line item that you can add to a QGraphicsScene.
ushort blue
Returns the blue color component of this color.
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
void setPen(const QColor &color)
Sets the painter's pen to have style Qt::SolidLine, width 0 and the specified color.
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
static Q_DECL_CONSTEXPR bool qFuzzyIsNull(double d)
ushort green
Returns the green color component of this color.
The QGraphicsPathItem class provides a path item that you can add to a QGraphicsScene.