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
qquickfluentwinui3focusstroke.cpp
Go to the documentation of this file.
1
2// Copyright (C) 2024 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
5#include <QtGui/qpainter.h>
6#include <QtGui/qpainterpath.h>
7#include <QtQuick/private/qquickitem_p.h>
14{
18 path.moveTo(rect.left(), rect.top() + m_radius);
19 path.lineTo(rect.left(), rect.bottom() - m_radius);
20 path.arcTo(QRectF(rect.left(), rect.bottom() - 2 * m_radius, 2 * m_radius, 2 * m_radius), 180, 90);
21 path.lineTo(rect.right() - m_radius, rect.bottom());
22 path.arcTo(QRectF(rect.right() - 2 * m_radius, rect.bottom() - 2 * m_radius, 2 * m_radius, 2 * m_radius), 270, 90);
23 path.lineTo(rect.right(), rect.top() + m_radius);
24 path.lineTo(rect.right(), rect.top() + m_radius);
25 path.lineTo(rect.right(), rect.top());
26 path.lineTo(rect.left(), rect.top());
27 painter->fillPath(path, m_color);
28}
30{
31 return m_color;
32}
34{
35 if (color == m_color)
36 return;
37 m_color = color;
38 update();
39}
41{
42 return m_radius;
43}
45{
46 if (m_radius == radius)
47 return;
48 m_radius = radius;
49 update();
50}
52#include "moc_qquickfluentwinui3focusstroke_p.cpp"
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\inmodule QtGui
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
void fillPath(const QPainterPath &path, const QBrush &brush)
Fills the given path using the given brush.
@ Antialiasing
Definition qpainter.h:52
void setRenderHint(RenderHint hint, bool on=true)
Sets the given render hint on the painter if on is true; otherwise clears the render hint.
QQuickFluentWinUI3FocusStroke(QQuickItem *parent=nullptr)
void paint(QPainter *painter) override
This function, which is usually called by the QML Scene Graph, paints the contents of an item in loca...
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
virtual QRectF boundingRect() const
Returns the extents of the item in its own coordinate system: a rectangle from {0,...
void update()
Schedules a call to updatePaintNode() for this item.
The QQuickPaintedItem class provides a way to use the QPainter API in the QML Scene Graph.
\inmodule QtCore\reentrant
Definition qrect.h:484
rect
[4]
Combined button and popup list for selecting options.
GLuint color
[2]
GLsizei const GLchar *const * path
QPainter painter(this)
[7]