43 #include "private/qcssparser_p.h" 47 #ifndef QT_NO_CSSPARSER 151 2*r1.
width() - pw, 2*r1.
height() - pw), 135*16, -45*16);
154 2*r2.
width() - pw, 2*r2.
height() - pw), 45*16, 45*16);
159 2*r1.
width() - pw, 2*r1.
height() - pw), -90 * 16, -45 * 16);
162 2*r2.
width() - pw, 2*r2.
height() - pw), -90 * 16, 45 * 16);
167 2*r1.
width() - pw, 2*r1.
height() - pw), 135*16, 45*16);
170 2*r2.
width() - pw, 2*r2.
height() - pw), 180*16, 45*16);
175 2*r1.
width() - pw, 2*r1.
height() - pw), 45*16, -45*16);
178 2*r2.
width() - pw, 2*r2.
height() - pw), 315*16, 45*16);
206 if (width == 1 || (dw1 == 0 && dw2 == 0)) {
216 quad << QPointF(x1 + dw1, y1) << QPointF(x1, y2)
217 << QPointF(x2, y2) << QPointF(x2 - dw2, y1);
220 quad << QPointF(x1, y1) << QPointF(x1, y2)
221 << QPointF(x2, y2 - dw2) << QPointF(x2, y1 + dw1);
224 quad << QPointF(x1, y1 + dw1) << QPointF(x1, y2 - dw2)
225 << QPointF(x2, y2) << QPointF(x2, y1);
242 p->
drawLine(
QLineF(x1 + width/2, (y1 + y2)/2, x2 - width/2, (y1 + y2)/2));
244 p->
drawLine(
QLineF((x1+x2)/2, y1 + width/2, (x1+x2)/2, y2 - width/2));
248 int wby3 =
qRound(width/3);
249 int dw1by3 =
qRound(dw1/3);
250 int dw2by3 =
qRound(dw2/3);
254 qDrawEdge(p, x1 + dw1 - dw1by3, y2 - wby3, x2 - dw2 + dw1by3, y2,
259 qDrawEdge(p, x2 - wby3, y1 + dw1 - dw1by3, x2, y2 - dw2 + dw2by3, dw1by3, dw2by3,
263 qDrawEdge(p, x1 + dw1 - dw1by3, y1, x2 - dw2 + dw2by3, y1 + wby3, dw1by3, dw2by3,
269 qDrawEdge(p, x1, y1 + dw1 - dw1by3, x1 + wby3, y2 - dw2 + dw2by3, dw1by3, dw2by3,
288 int wby2 =
qRound(width/2);
292 qDrawEdge(p, x1 + dw1by2, y1 + wby2, x2 - dw2by2, y2, dw1by2, dw2by2,
TopEdge, s2, c);
300 qDrawEdge(p, x1 + wby2, y1 + dw1by2, x2, y2 - dw2by2, dw1by2, dw2by2,
LeftEdge, s2, c);
304 qDrawEdge(p, x1, y1 + dw1by2, x1 + wby2, y2 - dw2by2, dw1by2, dw2by2,
RightEdge, s2, c);
324 *tlr = *trr =
QSize(0, 0);
326 *blr = *brr =
QSize(0, 0);
328 *tlr = *blr =
QSize(0, 0);
330 *trr = *brr =
QSize(0, 0);
349 const int *borders,
const QBrush *colors,
const QSize *radii)
352 QSize tlr, trr, blr, brr;
366 qDrawRoundedCorners(p, x1, y1, x2, y2, blr, brr, BottomEdge, styles[BottomEdge], colors[BottomEdge]);
378 qDrawRoundedCorners(p, x1, y1, x2, y2, trr, brr, RightEdge, styles[RightEdge], colors[RightEdge]);
390 qDrawRoundedCorners(p, x1, y1, x2, y2, tlr, blr, LeftEdge, styles[LeftEdge], colors[LeftEdge]);
402 qDrawRoundedCorners(p, x1, y1, x2, y2, tlr, trr, TopEdge, styles[TopEdge], colors[TopEdge]);
406 #endif //QT_NO_CSSPARSER
The QPainter class performs low-level painting on widgets and other paint devices.
bool isEmpty() const
Returns true if either of the width and height is less than or equal to 0; otherwise returns false...
qreal y() const
Returns the y-coordinate of the rectangle's top edge.
void drawArc(const QRectF &rect, int a, int alen)
Draws the arc defined by the given rectangle, startAngle and spanAngle.
#define QT_END_NAMESPACE
This macro expands to.
const QColor & color() const
Returns the brush color.
void setCapStyle(Qt::PenCapStyle pcs)
Sets the pen's cap style to the given style.
qreal width() const
Returns the width.
The QPointF class defines a point in the plane using floating point precision.
qreal height() const
Returns the height.
qreal left() const
Returns the x-coordinate of the rectangle's left edge.
void restore()
Restores the current painter state (pops a saved state off the stack).
static QPen qPenFromStyle(const QBrush &b, qreal width, BorderStyle s)
QSize expandedTo(const QSize &) const
Returns a size holding the maximum width and height of this size and the given otherSize.
int width() const
Returns the width of the rectangle.
void qNormalizeRadii(const QRect &br, const QSize *radii, QSize *tlr, QSize *trr, QSize *blr, QSize *brr)
void drawLine(const QLineF &line)
Draws a line defined by line.
int height() const
Returns the height of the rectangle.
The QPen class defines how a QPainter should draw lines and outlines of shapes.
The QSizeF class defines the size of a two-dimensional object using floating point precision...
void save()
Saves the current painter state (pushes the state onto a stack).
The QLineF class provides a two-dimensional vector using floating point precision.
void qDrawEdge(QPainter *p, qreal x1, qreal y1, qreal x2, qreal y2, qreal dw1, qreal dw2, QCss::Edge edge, QCss::BorderStyle style, QBrush c)
int width() const
Returns the width.
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QRectF class defines a rectangle in the plane using floating point precision. ...
void drawConvexPolygon(const QPointF *points, int pointCount)
Draws the convex polygon defined by the first pointCount points in the array points using the current...
qreal height() const
Returns the height of the rectangle.
void qDrawRoundedCorners(QPainter *p, qreal x1, qreal y1, qreal x2, qreal y2, const QSizeF &r1, const QSizeF &r2, Edge edge, BorderStyle s, QBrush c)
The QPolygonF class provides a vector of points using floating point precision.
qreal width() const
Returns the width of the rectangle.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
qreal x() const
Returns the x-coordinate of the rectangle's left edge.
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 qDrawBorder(QPainter *p, const QRect &rect, const QCss::BorderStyle *styles, const int *borders, const QBrush *colors, const QSize *radii)
int height() const
Returns the height.
The QRect class defines a rectangle in the plane using integer precision.
static bool paintsOver(const QCss::BorderStyle *styles, const QBrush *colors, QCss::Edge e1, QCss::Edge e2)
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
The QSize class defines the size of a two-dimensional object using integer point precision.
QColor lighter(int f=150) const
Returns a lighter (or darker) color, but does not change this object.
Q_DECL_CONSTEXPR int qRound(qreal d)