6#include <QtCore/qmath.h>
7#include <QtQuick/private/qquickitem_p.h>
8#include <QtQuick/private/qsgadaptationlayer_p.h>
9#include <QtQuickControls2Impl/private/qquickanimatednode_p.h>
10#include <QtQuickTemplates2/private/qquickabstractbutton_p.h>
11#include <QtQuickTemplates2/private/qquickabstractbutton_p_p.h>
69 m_value = m_from + (m_to - m_from) *
p;
72 const qreal dx = (1.0 -
p) * (m_anchor.
x() - m_bounds.
width() / 2);
73 const qreal dy = (1.0 -
p) * (m_anchor.
y() - m_bounds.
height() / 2);
89 rectNode->setRect(
QRectF(0, 0, m_value, m_value));
90 rectNode->setRadius(m_value / 2);
91 rectNode->setTopLeftRadius(-1);
92 rectNode->setTopRightRadius(-1);
93 rectNode->setBottomLeftRadius(-1);
94 rectNode->setBottomRightRadius(-1);
101 m_to = ripple->diameter();
102 m_anchor = ripple->anchorPoint();
103 m_bounds = ripple->boundingRect();
110 rectNode->setColor(ripple->color());
124 bool m_active =
false;
146 opacity = 1.0 - opacity;
156 if (m_active != ripple->isActive()) {
157 m_active = ripple->isActive();
168 const qreal w = ripple->width();
169 const qreal h = ripple->height();
175 rectNode->setRect(
QRectF(0, 0, sz, sz));
176 rectNode->setRadius(sz / 2);
178 rectNode->setRect(
QRectF(0, 0,
w,
h));
179 rectNode->setRadius(ripple->clipRadius());
181 rectNode->setTopLeftRadius(-1);
182 rectNode->setTopRightRadius(-1);
183 rectNode->setBottomLeftRadius(-1);
184 rectNode->setBottomRightRadius(-1);
187 rectNode->setColor(ripple->color());
218 if (m_color ==
color)
235 m_clipRadius = radius;
257 if (m_trigger ==
Press)
341 if (!backgroundNode) {
346 backgroundNode->sync(
this);
356 enterNode->sync(
this);
366 exitNode->sync(
this);
377 if (
event->timerId() == m_enterDelay)
383 if (m_enterDelay <= 0)
389 if (m_enterDelay > 0) {
400 if (m_enterDelay > 0) {
413#include "moc_qquickmaterialripple_p.cpp"
415#include "qquickmaterialripple.moc"
The QColor class provides colors based on RGB, HSV or CMYK values.
\inmodule QtCore\compares equality \compareswith equality QLine \endcompareswith
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
void translate(const QVector3D &vector)
Multiplies this matrix by another that translates coordinates by the components of vector.
int startTimer(int interval, Qt::TimerType timerType=Qt::CoarseTimer)
This is an overloaded function that will start a timer of type timerType and a timeout of interval mi...
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
QString objectName
the name of this object
virtual void timerEvent(QTimerEvent *event)
This event handler can be reimplemented in a subclass to receive timer events for the object.
void killTimer(int id)
Kills the timer with timer identifier, id.
void deleteLater()
\threadsafe
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
void setDuration(int duration)
void setRect(const QRectF &)
void setRadius(qreal radius)
static QQuickItemPrivate * get(QQuickItem *item)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Q_INVOKABLE QPointF mapFromItem(const QQuickItem *item, const QPointF &point) const
Maps the given point in item's coordinate system to the equivalent point within this item's coordinat...
void setFlag(Flag flag, bool enabled=true)
Enables the specified flag for this item if enabled is true; if enabled is false, the flag is disable...
virtual QRectF boundingRect() const
Returns the extents of the item in its own coordinate system: a rectangle from {0,...
qreal width
This property holds the width of this item.
virtual void itemChange(ItemChange, const ItemChangeData &)
Called when change occurs for this item.
qreal height
This property holds the height of this item.
ItemChange
Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes.
void update()
Schedules a call to updatePaintNode() for this item.
QQuickMaterialRippleBackgroundNode(QQuickMaterialRipple *ripple)
void updateCurrentTime(int time) override
void sync(QQuickItem *item) override
void updateCurrentTime(int time) override
void sync(QQuickItem *item) override
QQuickMaterialRippleWaveNode(QQuickMaterialRipple *ripple)
void setPressed(bool pressed)
QSGNode * updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override
Called on the render thread when it is time to sync the state of the item with the scene graph.
void setClipRadius(qreal radius)
void setActive(bool active)
void setAnchor(QQuickItem *anchor)
void itemChange(ItemChange change, const ItemChangeData &data) override
Called when change occurs for this item.
void setColor(const QColor &color)
void setTrigger(Trigger trigger)
void timerEvent(QTimerEvent *event) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
QPointF anchorPoint() const
QQuickMaterialRipple(QQuickItem *parent=nullptr)
\inmodule QtCore\reentrant
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr QPointF center() const noexcept
Returns the center point of the rectangle.
virtual void setAntialiasing(bool antialiasing)
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
int childCount() const
Returns the number of child nodes.
void appendChildNode(QSGNode *node)
Appends node to this node's list of children.
QSGNode * firstChild() const
Returns the first child of this node.
NodeType type() const
Returns the type of this node.
The QSGOpacityNode class is used to change opacity of nodes.
void setOpacity(qreal opacity)
Sets the opacity of this node to opacity.
Combined button and popup list for selecting options.
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
bool qFuzzyIsNull(qfloat16 f) noexcept
qfloat16 qSqrt(qfloat16 f)
int qRound(qfloat16 d) noexcept
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLenum GLsizei length
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLfloat GLfloat GLfloat GLfloat h
static const int WAVE_OPACITY_DECAY_DURATION
static const qreal WAVE_TOUCH_DOWN_ACCELERATION
static const int RIPPLE_ENTER_DELAY
static const int OPACITY_ENTER_DURATION_FAST