C

Qt Quick Ultralite tvii_effects Example

/****************************************************************************** ** ** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Quick Ultralite module. ** ** $QT_BEGIN_LICENSE:COMM$ ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** $QT_END_LICENSE$ ** ******************************************************************************/
#include <qul/painteditemdelegate.h> #include <qul/image.h> #include <platforminterface/drawingdevice.h> #include <platforminterface/rect.h> #include <platforminterface/rgba32.h> #ifdef QUL_TVIIC_PLATFORM #include <ut_class_surface.h> #endif class NeedleTrailDelegate : public Qul::PaintedItemDelegate { public: Qul::Property<double> rotation; Qul::Property<Qul::SharedImage> mask; void rotationChanged(); Qul::PlatformInterface::Rect boundingRect(Qul::PlatformInterface::Size size) const override; void paint(Qul::PlatformInterface::DrawingDevice *device, const Qul::PlatformInterface::Rect &clip, const Qul::PlatformInterface::Transform &transform, Qul::PlatformInterface::Size size, float opacity) const override; private: mutable float m_trailAngle = 0.f; mutable bool m_initialized = false; #ifdef QUL_TVIIC_PLATFORM mutable CSurface<1> m_trailMask; #endif };