![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qquickcontext2d_p.h>
Classes | |
struct | State |
Public Types | |
enum | TextBaseLineType { Alphabetic =0 , Top , Middle , Bottom , Hanging } |
enum | TextAlignType { Start =0 , End , Left , Right , Center } |
enum | PaintCommand { Invalid = 0 , UpdateMatrix , ClearRect , FillRect , StrokeRect , Fill , Stroke , Clip , UpdateBrush , GlobalAlpha , GlobalCompositeOperation , StrokeStyle , FillStyle , LineWidth , LineCap , LineJoin , LineDash , LineDashOffset , MiterLimit , ShadowOffsetX , ShadowOffsetY , ShadowBlur , ShadowColor , Font , TextBaseline , TextAlign , FillText , StrokeText , DrawImage , DrawPixmap , GetImageData } |
Public Member Functions | |
QQuickContext2D (QObject *parent=nullptr) | |
~QQuickContext2D () | |
QStringList | contextNames () const override |
void | init (QQuickCanvasItem *canvasItem, const QVariantMap &args) override |
void | prepare (const QSize &canvasSize, const QSize &tileSize, const QRect &canvasWindow, const QRect &dirtyRect, bool smooth, bool antialiasing) override |
void | flush () override |
void | sync () |
QThread * | thread () const |
QQuickContext2DTexture * | texture () const |
QImage | toImage (const QRectF &bounds) override |
QV4::ReturnedValue | v4value () const override |
QV4::ExecutionEngine * | v4Engine () const override |
void | setV4Engine (QV4::ExecutionEngine *eng) override |
QQuickCanvasItem * | canvas () const |
QQuickContext2DCommandBuffer * | buffer () const |
bool | bufferValid () const |
void | popState () |
void | pushState () |
void | reset () |
void | fill () |
void | clip () |
void | stroke () |
void | fillRect (qreal x, qreal y, qreal w, qreal h) |
void | strokeRect (qreal x, qreal y, qreal w, qreal h) |
void | clearRect (qreal x, qreal y, qreal w, qreal h) |
void | drawText (const QString &text, qreal x, qreal y, bool fill) |
void | scale (qreal x, qreal y) |
void | rotate (qreal angle) |
void | shear (qreal h, qreal v) |
void | translate (qreal x, qreal y) |
void | transform (qreal a, qreal b, qreal c, qreal d, qreal e, qreal f) |
void | setTransform (qreal a, qreal b, qreal c, qreal d, qreal e, qreal f) |
void | beginPath () |
void | closePath () |
void | moveTo (qreal x, qreal y) |
void | lineTo (qreal x, qreal y) |
void | quadraticCurveTo (qreal cpx, qreal cpy, qreal x, qreal y) |
void | bezierCurveTo (qreal cp1x, qreal cp1y, qreal cp2x, qreal cp2y, qreal x, qreal y) |
void | arcTo (qreal x1, qreal y1, qreal x2, qreal y2, qreal radius) |
void | rect (qreal x, qreal y, qreal w, qreal h) |
void | roundedRect (qreal x, qreal y, qreal w, qreal h, qreal xr, qreal yr) |
void | ellipse (qreal x, qreal y, qreal w, qreal h) |
void | text (const QString &str, qreal x, qreal y) |
void | arc (qreal x, qreal y, qreal radius, qreal startAngle, qreal endAngle, bool anticlockwise) |
void | addArcTo (const QPointF &p1, const QPointF &p2, qreal radius) |
bool | isPointInPath (qreal x, qreal y) const |
QPainterPath | createTextGlyphs (qreal x, qreal y, const QString &text) |
QQmlRefPointer< QQuickCanvasPixmap > | createPixmap (const QUrl &url, QSizeF sourceSize=QSizeF()) |
QSurface * | surface () const |
void | setGrabbedImage (const QImage &grab) |
Public Member Functions inherited from QQuickCanvasContext | |
QQuickCanvasContext (QObject *parent=nullptr) | |
~QQuickCanvasContext () | |
Public Member Functions inherited from QObject | |
Q_INVOKABLE | QObject (QObject *parent=nullptr) |
Constructs an object with parent object parent. | |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. | |
virtual bool | event (QEvent *event) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. | |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
Filters events if this object has been installed as an event filter for the watched object. | |
QString | objectName () const |
Q_WEAK_OVERLOAD void | setObjectName (const QString &name) |
Sets the object's name to name. | |
void | setObjectName (QAnyStringView name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QBindable< QString > | bindableObjectName () |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false . | |
bool | isWindowType () const |
Returns true if the object is a window; otherwise returns false . | |
bool | isQuickItemType () const |
Returns true if the object is a QQuickItem; otherwise returns false . | |
bool | isQmlObjectType () const |
Returns whether the object has been created by the QML engine or ownership has been explicitly set via QJSEngine::setObjectOwnership(). | |
bool | signalsBlocked () const noexcept |
Returns true if signals are blocked; otherwise returns false . | |
bool | blockSignals (bool b) noexcept |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). | |
QThread * | thread () const |
Returns the thread in which the object lives. | |
bool | moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL) |
Changes the thread affinity for this object and its children and returns true on success. | |
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 milliseconds. | |
int | startTimer (std::chrono::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer) |
void | killTimer (int id) |
Kills the timer with timer identifier, id. | |
void | killTimer (Qt::TimerId id) |
template<typename T> | |
T | findChild (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object. | |
template<typename T> | |
QList< T > | findChildren (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. | |
template<typename T> | |
T | findChild (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename T> | |
QList< T > | findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const QObjectList & | children () const |
Returns a list of child objects. | |
void | setParent (QObject *parent) |
Makes the object a child of parent. | |
void | installEventFilter (QObject *filterObj) |
Installs an event filter filterObj on this object. | |
void | removeEventFilter (QObject *obj) |
Removes an event filter object obj from this object. | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const |
bool | disconnect (const QObject *receiver, const char *member=nullptr) const |
void | dumpObjectTree () const |
Dumps a tree of children to the debug output. | |
void | dumpObjectInfo () const |
Dumps information about signal connections, etc. | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. | |
bool | setProperty (const char *name, QVariant &&value) |
QVariant | property (const char *name) const |
Returns the value of the object's name property. | |
QList< QByteArray > | dynamicPropertyNames () const |
QBindingStorage * | bindingStorage () |
const QBindingStorage * | bindingStorage () const |
QObject * | parent () const |
Returns a pointer to the parent object. | |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false . |
Static Public Attributes | |
static QMutex | mutex |
Additional Inherited Members | |
Public Slots inherited from QObject | |
void | deleteLater () |
\threadsafe | |
Signals inherited from QQuickCanvasContext | |
void | textureChanged () |
Signals inherited from QObject | |
void | destroyed (QObject *=nullptr) |
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked. | |
void | objectNameChanged (const QString &objectName, QPrivateSignal) |
This signal is emitted after the object's name has been changed. | |
Static Public Member Functions inherited from QObject | |
static QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
\threadsafe | |
static QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1, typename Func2> | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1, typename Func2> | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
\threadsafe | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static bool | disconnect (const QMetaObject::Connection &) |
Disconnect a connection. | |
template<typename Func1, typename Func2> | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot) |
template<typename Func1> | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero) |
Protected Member Functions inherited from QObject | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr. | |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. | |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
This event handler can be reimplemented in a subclass to receive timer events for the object. | |
virtual void | childEvent (QChildEvent *event) |
This event handler can be reimplemented in a subclass to receive child events. | |
virtual void | customEvent (QEvent *event) |
This event handler can be reimplemented in a subclass to receive custom events. | |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
Protected Attributes inherited from QObject | |
QScopedPointer< QObjectData > | d_ptr |
Properties inherited from QObject | |
QString | objectName |
the name of this object | |
Related Symbols inherited from QObject | |
template< class T > T | qobject_cast (const QObject *object) |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr. | |
template< typename T > T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
template< typename T > QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QObjectList | |
\macro Q_CLASSINFO(Name, Value) |
Definition at line 55 of file qquickcontext2d_p.h.
Definition at line 64 of file qquickcontext2d_p.h.
Enumerator | |
---|---|
Start | |
End | |
Left | |
Right | |
Center |
Definition at line 63 of file qquickcontext2d_p.h.
Enumerator | |
---|---|
Alphabetic | |
Top | |
Middle | |
Bottom | |
Hanging |
Definition at line 62 of file qquickcontext2d_p.h.
QQuickContext2D::QQuickContext2D | ( | QObject * | parent = nullptr | ) |
Definition at line 4239 of file qquickcontext2d.cpp.
References QQuickContext2D(), m_buffer, m_grabbed, and m_v4engine.
Referenced by QQuickContext2D().
QQuickContext2D::~QQuickContext2D | ( | ) |
Definition at line 4249 of file qquickcontext2d.cpp.
Definition at line 3924 of file qquickcontext2d.cpp.
void QQuickContext2D::arc | ( | qreal | x, |
qreal | y, | ||
qreal | radius, | ||
qreal | startAngle, | ||
qreal | endAngle, | ||
bool | anticlockwise ) |
Definition at line 4056 of file qquickcontext2d.cpp.
Definition at line 3977 of file qquickcontext2d.cpp.
void QQuickContext2D::beginPath | ( | ) |
Definition at line 3854 of file qquickcontext2d.cpp.
void QQuickContext2D::bezierCurveTo | ( | qreal | cp1x, |
qreal | cp1y, | ||
qreal | cp2x, | ||
qreal | cp2y, | ||
qreal | x, | ||
qreal | y ) |
Definition at line 3909 of file qquickcontext2d.cpp.
|
inline |
Definition at line 172 of file qquickcontext2d_p.h.
References m_buffer.
Referenced by clearRect(), drawText(), fillRect(), popState(), and strokeRect().
|
inline |
Definition at line 174 of file qquickcontext2d_p.h.
References m_buffer.
|
inline |
Definition at line 171 of file qquickcontext2d_p.h.
Definition at line 3827 of file qquickcontext2d.cpp.
References buffer().
void QQuickContext2D::clip | ( | ) |
Definition at line 3778 of file qquickcontext2d.cpp.
void QQuickContext2D::closePath | ( | ) |
Definition at line 3861 of file qquickcontext2d.cpp.
|
overridevirtual |
Implements QQuickCanvasContext.
Definition at line 4264 of file qquickcontext2d.cpp.
QQmlRefPointer< QQuickCanvasPixmap > QQuickContext2D::createPixmap | ( | const QUrl & | url, |
QSizeF | sourceSize = QSizeF() ) |
Definition at line 4164 of file qquickcontext2d.cpp.
QPainterPath QQuickContext2D::createTextGlyphs | ( | qreal | x, |
qreal | y, | ||
const QString & | text ) |
Definition at line 4169 of file qquickcontext2d.cpp.
Definition at line 3838 of file qquickcontext2d.cpp.
References buffer().
Definition at line 4029 of file qquickcontext2d.cpp.
void QQuickContext2D::fill | ( | ) |
Definition at line 3766 of file qquickcontext2d.cpp.
Definition at line 3805 of file qquickcontext2d.cpp.
References buffer().
|
overridevirtual |
Reimplemented from QQuickCanvasContext.
Definition at line 4326 of file qquickcontext2d.cpp.
References QQuickContext2DCommandBuffer::QQuickContext2DCommandBuffer(), m_buffer, and m_texture.
Referenced by testing.tools.encode_pdf_filter._SinkPdfStream::close(), and toImage().
|
overridevirtual |
Implements QQuickCanvasContext.
Definition at line 4269 of file qquickcontext2d.cpp.
References QQuickContext2DRenderThread::instance(), m_texture, and reset().
Definition at line 4193 of file qquickcontext2d.cpp.
Definition at line 3882 of file qquickcontext2d.cpp.
Definition at line 3873 of file qquickcontext2d.cpp.
void QQuickContext2D::popState | ( | ) |
Definition at line 4405 of file qquickcontext2d.cpp.
References buffer(), and QQuickContext2D::State::clip.
Referenced by reset().
|
overridevirtual |
Reimplemented from QQuickCanvasContext.
Definition at line 4311 of file qquickcontext2d.cpp.
References m_texture.
void QQuickContext2D::pushState | ( | ) |
Definition at line 4461 of file qquickcontext2d.cpp.
Definition at line 3895 of file qquickcontext2d.cpp.
Definition at line 3998 of file qquickcontext2d.cpp.
void QQuickContext2D::reset | ( | ) |
Definition at line 4466 of file qquickcontext2d.cpp.
References popState().
Referenced by init().
Definition at line 3668 of file qquickcontext2d.cpp.
Definition at line 4012 of file qquickcontext2d.cpp.
Definition at line 3647 of file qquickcontext2d.cpp.
Definition at line 4158 of file qquickcontext2d.cpp.
References m_grabbed.
Definition at line 3751 of file qquickcontext2d.cpp.
|
overridevirtual |
Implements QQuickCanvasContext.
Definition at line 4485 of file qquickcontext2d.cpp.
References m_v4engine.
Definition at line 3689 of file qquickcontext2d.cpp.
void QQuickContext2D::stroke | ( | ) |
Definition at line 3794 of file qquickcontext2d.cpp.
Definition at line 3816 of file qquickcontext2d.cpp.
References buffer().
|
inline |
Definition at line 218 of file qquickcontext2d_p.h.
void QQuickContext2D::sync | ( | ) |
Definition at line 4046 of file qquickcontext2d.cpp.
QQuickContext2DTexture * QQuickContext2D::texture | ( | ) | const |
Definition at line 4337 of file qquickcontext2d.cpp.
References m_texture.
|
inline |
Definition at line 163 of file qquickcontext2d_p.h.
Implements QQuickCanvasContext.
Definition at line 4342 of file qquickcontext2d.cpp.
References flush(), m_grabbed, and m_texture.
Definition at line 3731 of file qquickcontext2d.cpp.
Definition at line 3710 of file qquickcontext2d.cpp.
|
overridevirtual |
Implements QQuickCanvasContext.
Definition at line 4480 of file qquickcontext2d.cpp.
References m_v4engine.
|
overridevirtual |
Implements QQuickCanvasContext.
Definition at line 4259 of file qquickcontext2d.cpp.
QQuickContext2DCommandBuffer* QQuickContext2D::m_buffer |
Definition at line 224 of file qquickcontext2d_p.h.
Referenced by QQuickContext2D(), ~QQuickContext2D(), buffer(), bufferValid(), and flush().
QQueue<QQuickContext2DCommandBuffer*> QQuickContext2D::m_bufferQueue |
Definition at line 235 of file qquickcontext2d_p.h.
QQuickCanvasItem* QQuickContext2D::m_canvas |
Definition at line 223 of file qquickcontext2d_p.h.
QV4::PersistentValue QQuickContext2D::m_fillStyle |
Definition at line 226 of file qquickcontext2d_p.h.
bool QQuickContext2D::m_grabbed |
Definition at line 238 of file qquickcontext2d_p.h.
Referenced by QQuickContext2D(), setGrabbedImage(), and toImage().
QImage QQuickContext2D::m_grabbedImage |
Definition at line 237 of file qquickcontext2d_p.h.
QPainterPath QQuickContext2D::m_path |
Definition at line 225 of file qquickcontext2d_p.h.
QQuickCanvasItem::RenderStrategy QQuickContext2D::m_renderStrategy |
Definition at line 234 of file qquickcontext2d_p.h.
QQuickCanvasItem::RenderTarget QQuickContext2D::m_renderTarget |
Definition at line 233 of file qquickcontext2d_p.h.
QStack<QQuickContext2D::State> QQuickContext2D::m_stateStack |
Definition at line 222 of file qquickcontext2d_p.h.
QV4::PersistentValue QQuickContext2D::m_strokeStyle |
Definition at line 227 of file qquickcontext2d_p.h.
QScopedPointer<QOffscreenSurface> QQuickContext2D::m_surface |
Definition at line 230 of file qquickcontext2d_p.h.
QQuickContext2DTexture* QQuickContext2D::m_texture |
Definition at line 232 of file qquickcontext2d_p.h.
Referenced by ~QQuickContext2D(), flush(), init(), prepare(), texture(), and toImage().
QThread* QQuickContext2D::m_thread |
Definition at line 236 of file qquickcontext2d_p.h.
QV4::ExecutionEngine* QQuickContext2D::m_v4engine |
Definition at line 229 of file qquickcontext2d_p.h.
Referenced by QQuickContext2D(), setV4Engine(), and v4Engine().
QV4::PersistentValue QQuickContext2D::m_v4path |
Definition at line 228 of file qquickcontext2d_p.h.
QV4::PersistentValue QQuickContext2D::m_v4value |
Definition at line 231 of file qquickcontext2d_p.h.
|
static |
Definition at line 240 of file qquickcontext2d_p.h.
State QQuickContext2D::state |
Definition at line 221 of file qquickcontext2d_p.h.