Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qsgrhiinternaltextnode.cpp
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
6#include <private/qquadpath_p.h>
7#include <private/qsgcurvefillnode_p.h>
8#include <private/qsgcurvestrokenode_p.h>
9#include <private/qsgcurveprocessor_p.h>
10
12
17
19{
21 node->setColor(color);
22 node->setStrokeWidth(rect.height());
23
25 QPointF c = rect.center();
26 path.moveTo(QVector2D(rect.left(), c.y()));
27 path.lineTo(QVector2D(rect.right(), c.y()));
28
30 [&node](const std::array<QVector2D, 3> &s,
31 const std::array<QVector2D, 3> &p,
32 const std::array<QVector2D, 3> &n,
33 bool isLine) {
34 Q_ASSERT(isLine);
35 node->appendTriangle(s, std::array<QVector2D, 2>{p.at(0), p.at(2)}, n);
36 });
37 node->cookGeometry();
38 appendChildNode(node);
39}
40
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\inmodule QtCore\reentrant
Definition qpoint.h:217
\inmodule QtCore\reentrant
Definition qrect.h:484
static void processStroke(const QQuadPath &strokePath, float miterLimit, float penWidth, Qt::PenJoinStyle joinStyle, Qt::PenCapStyle capStyle, addStrokeTriangleCallback addTriangle, int subdivisions=3)
void setStrokeWidth(float width)
void setColor(QColor col) override
void addDecorationNode(const QRectF &rect, const QColor &color) override
QSGRhiInternalTextNode(QSGRenderContext *renderContext)
The QVector2D class represents a vector or vertex in 2D space.
Definition qvectornd.h:31
rect
[4]
Combined button and popup list for selecting options.
@ MiterJoin
@ FlatCap
GLuint color
[2]
GLfloat n
GLdouble s
[6]
Definition qopenglext.h:235
const GLubyte * c
GLsizei const GLchar *const * path
GLfloat GLfloat p
[1]
static bool isLine(const QBezier &bezier)