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
QQuickJSContext2DPrototype Struct Reference
+ Inheritance diagram for QQuickJSContext2DPrototype:
+ Collaboration diagram for QQuickJSContext2DPrototype:

Static Public Member Functions

static QV4::Heap::QQuickJSContext2DPrototypecreate (QV4::ExecutionEngine *engine)
 
static QV4::ReturnedValue method_get_canvas (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlproperty QtQuick::Canvas QtQuick::Context2D::canvas Holds the canvas item that the context paints on.
 
static QV4::ReturnedValue method_restore (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::restore() Pops the top state on the stack, restoring the context to that state.
 
static QV4::ReturnedValue method_reset (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::reset() Resets the context state and properties to the default values.
 
static QV4::ReturnedValue method_save (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::save() Pushes the current state onto the state stack.
 
static QV4::ReturnedValue method_rotate (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::rotate(real angle) Rotate the canvas around the current origin by angle in radians and clockwise direction.
 
static QV4::ReturnedValue method_scale (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::scale(real x, real y)
 
static QV4::ReturnedValue method_translate (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::translate(real x, real y)
 
static QV4::ReturnedValue method_setTransform (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::setTransform(real a, real b, real c, real d, real e, real f)
 
static QV4::ReturnedValue method_transform (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::transform(real a, real b, real c, real d, real e, real f)
 
static QV4::ReturnedValue method_resetTransform (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::resetTransform()
 
static QV4::ReturnedValue method_shear (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::shear(real sh, real sv)
 
static QV4::ReturnedValue method_createLinearGradient (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::createLinearGradient(real x0, real y0, real x1, real y1) Returns a CanvasGradient object that represents a linear gradient that transitions the color along a line between the start point (x0, y0) and the end point (x1, y1).
 
static QV4::ReturnedValue method_createRadialGradient (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::createRadialGradient(real x0, real y0, real r0, real x1, real y1, real r1)
 
static QV4::ReturnedValue method_createConicalGradient (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::createConicalGradient(real x, real y, real angle)
 
static QV4::ReturnedValue method_createPattern (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod variant QtQuick::Context2D::createPattern(color color, enumeration patternMode) This is an overloaded function.
 
static QV4::ReturnedValue method_clearRect (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::clearRect(real x, real y, real w, real h)
 
static QV4::ReturnedValue method_fillRect (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::fillRect(real x, real y, real w, real h)
 
static QV4::ReturnedValue method_strokeRect (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::strokeRect(real x, real y, real w, real h)
 
static QV4::ReturnedValue method_arc (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::arc(real x, real y, real radius, real startAngle, real endAngle, bool anticlockwise)
 
static QV4::ReturnedValue method_arcTo (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::arcTo(real x1, real y1, real x2, real y2, real radius)
 
static QV4::ReturnedValue method_beginPath (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::beginPath()
 
static QV4::ReturnedValue method_bezierCurveTo (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::bezierCurveTo(real cp1x, real cp1y, real cp2x, real cp2y, real x, real y)
 
static QV4::ReturnedValue method_clip (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::clip()
 
static QV4::ReturnedValue method_closePath (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::closePath() Closes the current subpath by drawing a line to the beginning of the subpath, automatically starting a new path.
 
static QV4::ReturnedValue method_fill (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::fill()
 
static QV4::ReturnedValue method_lineTo (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::lineTo(real x, real y)
 
static QV4::ReturnedValue method_moveTo (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::moveTo(real x, real y)
 
static QV4::ReturnedValue method_quadraticCurveTo (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::quadraticCurveTo(real cpx, real cpy, real x, real y)
 
static QV4::ReturnedValue method_rect (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::rect(real x, real y, real w, real h)
 
static QV4::ReturnedValue method_roundedRect (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::roundedRect(real x, real y, real w, real h, real xRadius, real yRadius)
 
static QV4::ReturnedValue method_ellipse (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::ellipse(real x, real y, real w, real h)
 
static QV4::ReturnedValue method_text (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::text(string text, real x, real y)
 
static QV4::ReturnedValue method_stroke (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::stroke()
 
static QV4::ReturnedValue method_isPointInPath (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::isPointInPath(real x, real y)
 
static QV4::ReturnedValue method_drawFocusRing (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 
static QV4::ReturnedValue method_setCaretSelectionRect (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 
static QV4::ReturnedValue method_caretBlinkRate (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 
static QV4::ReturnedValue method_fillText (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::fillText(text, x, y)
 
static QV4::ReturnedValue method_strokeText (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::strokeText(text, x, y)
 
static QV4::ReturnedValue method_measureText (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::measureText(text)
 
static QV4::ReturnedValue method_drawImage (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod QtQuick::Context2D::drawImage(variant image, real dx, real dy) Draws the given image on the canvas at position (dx, dy).
 
static QV4::ReturnedValue method_createImageData (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod CanvasImageData QtQuick::Context2D::createImageData(real sw, real sh)
 
static QV4::ReturnedValue method_getImageData (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod CanvasImageData QtQuick::Context2D::getImageData(real x, real y, real w, real h)
 
static QV4::ReturnedValue method_putImageData (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod object QtQuick::Context2D::putImageData(CanvasImageData imageData, real dx, real dy, real dirtyX, real dirtyY, real dirtyWidth, real dirtyHeight)
 
static QV4::ReturnedValue method_setLineDash (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod QtQuick::Context2D::setLineDash(array pattern)
 
static QV4::ReturnedValue method_getLineDash (const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
 \qmlmethod array QtQuick::Context2D::getLineDash()
 
- Static Public Member Functions inherited from QV4::Object
static ReturnedValue getValue (const Value *thisObject, const Value &v, PropertyAttributes attrs)
 
static ReturnedValue getValueAccessor (const Value *thisObject, const Value &v, PropertyAttributes attrs)
 
static ReturnedValue checkedInstanceOf (ExecutionEngine *engine, const FunctionObject *typeObject, const Value &var)
 
- Static Public Member Functions inherited from QV4::Value
static constexpr Value fromStaticValue (StaticValue staticValue)
 
static Value fromHeapObject (HeapBasePtr m)
 
static bool toBooleanImpl (Value val)
 
static double toNumberImpl (Value v)
 
static Heap::StringtoString (ExecutionEngine *e, Value val)
 
static Heap::Object * toObject (ExecutionEngine *e, Value val)
 
static constexpr Value fromReturnedValue (ReturnedValue val)
 
static double toInteger (double d)
 
static int toInt32 (double d)
 
static unsigned int toUInt32 (double d)
 
static constexpr Value emptyValue ()
 
static constexpr Value fromBoolean (bool b)
 
static constexpr Value fromInt32 (int i)
 
static constexpr Value undefinedValue ()
 
static constexpr Value nullValue ()
 
static Value fromDouble (double d)
 
static Value fromUInt32 (uint i)
 
- Static Public Member Functions inherited from QV4::StaticValue
static int valueOffset ()
 
static int tagOffset ()
 
static constexpr quint64 tagValue (quint32 tag, quint32 value)
 
static constexpr quint64 tagBitMask (TagBit bit)
 
static bool integerCompatible (StaticValue a, StaticValue b)
 
static bool bothDouble (StaticValue a, StaticValue b)
 
static QV4_NEARLY_ALWAYS_INLINE bool isInt32 (double d)
 
static constexpr StaticValue fromReturnedValue (ReturnedValue val)
 
static constexpr StaticValue emptyValue ()
 
static constexpr StaticValue fromBoolean (bool b)
 
static constexpr StaticValue fromInt32 (int i)
 
static constexpr StaticValue undefinedValue ()
 
static constexpr StaticValue nullValue ()
 
static StaticValue fromDouble (double d)
 
static StaticValue fromUInt32 (uint i)
 
static double toInteger (double d)
 
static int toInt32 (double d)
 
static unsigned int toUInt32 (double d)
 

Additional Inherited Members

- Public Types inherited from QV4::Object
enum  { NInlineProperties = 2 }
 
enum  { IsObject = true , GetterOffset = 0 , SetterOffset = 1 }
 
enum  ThrowOnFailure { DoThrowOnRejection , DoNotThrow }
 
- Public Types inherited from QV4::Managed
enum  {
  IsExecutionContext = false , IsString = false , IsStringOrSymbol = false , IsObject = false ,
  IsFunctionObject = false , IsErrorObject = false , IsArrayData = false
}
 
enum  { NInlineProperties = 0 }
 
enum  Type {
  Type_Invalid , Type_String , Type_Object , Type_Symbol ,
  Type_ArrayObject , Type_FunctionObject , Type_GeneratorObject , Type_BooleanObject ,
  Type_NumberObject , Type_StringObject , Type_SymbolObject , Type_DateObject ,
  Type_RegExpObject , Type_ErrorObject , Type_ArgumentsObject , Type_JsonObject ,
  Type_MathObject , Type_ProxyObject , Type_UrlObject , Type_UrlSearchParamsObject ,
  Type_ExecutionContext , Type_InternalClass , Type_SetIteratorObject , Type_MapIteratorObject ,
  Type_ArrayIteratorObject , Type_StringIteratorObject , Type_ForInIterator , Type_RegExp ,
  Type_V4Sequence , Type_QmlListProperty
}
 
- Public Types inherited from QV4::Value
using ManagedPtr = Managed *
 
- Public Types inherited from QV4::StaticValue
enum class  TagBit {
  SpecialNegative = 0b10000000000000000000 << 12 , SpecialQNaN = 0b00000000000010000000 << 12 , Special = 0b00000000000001000000 << 12 , IntCompat = 0b00000000000000100000 << 12 ,
  Unmanaged = 0b00000000000000010000 << 12 , IntOrBool = 0b00000000000000001000 << 12 , Number = 0b00000000000000000100 << 12
}
 
enum  Type {
  Managed_Type = 0 , Double_Type = 1 , Undefined_Type = 2 , Empty_Type = quint32(TagBit::Unmanaged) ,
  Null_Type = Empty_Type | quint32(TagBit::IntCompat) , Boolean_Type = Null_Type | quint32(TagBit::IntOrBool) , Integer_Type = Boolean_Type | quint32(TagBit::Number)
}
 
enum  {
  Tag_Shift = 32 , IsIntegerConvertible_Shift = 48 , IsIntegerConvertible_Value = 3 , IsIntegerOrBool_Shift = 47 ,
  IsIntegerOrBool_Value = 7
}
 
enum class  QuickType : quint32 {
  Managed = Managed_Type , Empty = Empty_Type , Null = Null_Type , Boolean = Boolean_Type ,
  Integer = Integer_Type , PlusInf = quint32(TagBit::Number) | quint32(TagBit::Special) | quint32(TagBit::Unmanaged) , MinusInf = PlusInf | quint32(TagBit::SpecialNegative) , NaN = PlusInf | quint32(TagBit::SpecialQNaN) ,
  MinusNaN = NaN | quint32(TagBit::SpecialNegative)
}
 
enum  {
  QT_Empty = Empty_Type , QT_Null = Null_Type , QT_Bool = Boolean_Type , QT_Int = Integer_Type ,
  QuickType_Shift = Tag_Shift
}
 
using HeapBasePtr = Heap::Base *
 
using ValueTypeInternal = QuickType
 
- Public Member Functions inherited from QV4::Object
void setInternalClass (Heap::InternalClass *ic)
 
const ValuepropertyData (uint index) const
 
Heap::ArrayData * arrayData () const
 
void setArrayData (ArrayData *a)
 
void getProperty (const InternalClassEntry &entry, Property *p) const
 
void setProperty (const InternalClassEntry &entry, const Property *p)
 
void setProperty (uint index, Value v) const
 
void setProperty (uint index, Heap::Base *b) const
 
void setProperty (ExecutionEngine *engine, uint index, Value v) const
 
void setProperty (ExecutionEngine *engine, uint index, Heap::Base *b) const
 
const VTablevtable () const
 
PropertyAttributes getOwnProperty (PropertyKey id, Property *p=nullptr) const
 
PropertyIndex getValueOrSetter (PropertyKey id, PropertyAttributes *attrs)
 
bool hasProperty (PropertyKey id) const
 
bool defineOwnProperty (PropertyKey id, const Property *p, PropertyAttributes attrs)
 
ReturnedValue getValue (const Value &v, PropertyAttributes attrs) const
 
ReturnedValue getValueByIndex (uint propertyIndex) const
 
bool putValue (uint memberIndex, PropertyAttributes attrs, const Value &value)
 
void defineDefaultProperty (StringOrSymbol *name, const Value &value, PropertyAttributes attributes=Attr_Data|Attr_NotEnumerable)
 
void defineDefaultProperty (const QString &name, const Value &value, PropertyAttributes attributes=Attr_Data|Attr_NotEnumerable)
 
void defineDefaultProperty (const QString &name, VTable::Call code, int argumentCount=0, PropertyAttributes attributes=Attr_Data|Attr_NotEnumerable)
 
void defineDefaultProperty (StringOrSymbol *name, VTable::Call code, int argumentCount=0, PropertyAttributes attributes=Attr_Data|Attr_NotEnumerable)
 
void defineAccessorProperty (const QString &name, VTable::Call getter, VTable::Call setter)
 
void defineAccessorProperty (StringOrSymbol *name, VTable::Call getter, VTable::Call setter)
 
void defineReadonlyProperty (const QString &name, const Value &value)
 
void defineReadonlyProperty (String *name, const Value &value)
 
void defineReadonlyConfigurableProperty (const QString &name, const Value &value)
 
void defineReadonlyConfigurableProperty (StringOrSymbol *name, const Value &value)
 
void addSymbolSpecies ()
 
void insertMember (StringOrSymbol *s, const Value &v, PropertyAttributes attributes=Attr_Data)
 
void insertMember (StringOrSymbol *s, const Property *p, PropertyAttributes attributes)
 
bool isExtensible () const
 
bool preventExtensions ()
 
Heap::Object * getPrototypeOf () const
 
bool setPrototypeOf (const Object *p)
 
void setPrototypeUnchecked (const Object *p)
 
void copyArrayData (Object *other)
 
bool setArrayLength (uint newLen)
 
void setArrayLengthUnchecked (uint l)
 
void arraySet (uint index, const Property *p, PropertyAttributes attributes=Attr_Data)
 
void arraySet (uint index, const Value &value)
 
bool arrayPut (uint index, const Value &value)
 
bool arrayPut (uint index, const Value *values, uint n)
 
void setArrayAttributes (uint i, PropertyAttributes a)
 
void push_back (const Value &v)
 
ArrayData::Type arrayType () const
 
void setArrayType (ArrayData::Type t)
 
void arrayReserve (uint n)
 
void arrayCreate ()
 
void initSparseArray ()
 
SparseArrayNodesparseBegin () const
 
SparseArrayNodesparseEnd () const
 
bool protoHasArray ()
 
ReturnedValue get (StringOrSymbol *name, bool *hasProperty=nullptr, const Value *receiver=nullptr) const
 
ReturnedValue get (uint idx, bool *hasProperty=nullptr, const Value *receiver=nullptr) const
 
QT_DEPRECATED ReturnedValue getIndexed (uint idx, bool *hasProperty=nullptr) const
 
ReturnedValue get (PropertyKey id, const Value *receiver=nullptr, bool *hasProperty=nullptr) const
 
bool put (StringOrSymbol *name, const Value &v, Value *receiver=nullptr)
 
bool put (uint idx, const Value &v, Value *receiver=nullptr)
 
QT_DEPRECATED bool putIndexed (uint idx, const Value &v)
 
bool put (PropertyKey id, const Value &v, Value *receiver=nullptr)
 
bool setIndexed (uint idx, const Value &v, ThrowOnFailure shouldThrow)
 
bool set (StringOrSymbol *name, const Value &v, ThrowOnFailure shouldThrow)
 
bool deleteProperty (PropertyKey id)
 
OwnPropertyKeyIteratorownPropertyKeys (Value *target) const
 
qint64 getLength () const
 
ReturnedValue instanceOf (const Value &var) const
 
bool isConcatSpreadable () const
 
bool isArray () const
 
const FunctionObjectspeciesConstructor (Scope &scope, const FunctionObject *defaultConstructor) const
 
bool setProtoFromNewTarget (const Value *newTarget)
 
ReturnedValue resolveLookupGetter (ExecutionEngine *engine, Lookup *lookup) const
 
ReturnedValue resolveLookupSetter (ExecutionEngine *engine, Lookup *lookup, const Value &value)
 
int metacall (QMetaObject::Call call, int index, void **a)
 
- Public Member Functions inherited from QV4::Managed
Heap::InternalClassinternalClass () const
 
const VTablevtable () const
 
ExecutionEngineengine () const
 
bool isV4SequenceType () const
 
bool isQmlListPropertyType () const
 
bool isArrayLike () const
 
bool isArrayObject () const
 
bool isStringObject () const
 
bool isSymbolObject () const
 
QString className () const
 
bool isEqualTo (const Managed *other) const
 
bool inUse () const
 
bool markBit () const
 
void mark (MarkStack *markStack)
 
Q_ALWAYS_INLINE Heap::BaseheapObject () const
 
template<typename T >
T * cast ()
 
template<typename T >
const T * cast () const
 
- Public Member Functions inherited from QV4::Value
 Value ()=default
 
constexpr Value (quint64 val)
 
bool isString () const
 
bool isStringOrSymbol () const
 
bool isSymbol () const
 
bool isObject () const
 
bool isFunctionObject () const
 
QML_NEARLY_ALWAYS_INLINE StringstringValue () const
 
QML_NEARLY_ALWAYS_INLINE StringOrSymbolstringOrSymbolValue () const
 
QML_NEARLY_ALWAYS_INLINE SymbolsymbolValue () const
 
QML_NEARLY_ALWAYS_INLINE ObjectobjectValue () const
 
QML_NEARLY_ALWAYS_INLINE ManagedPtr managed () const
 
QML_NEARLY_ALWAYS_INLINE Value::HeapBasePtr heapObject () const
 
int toUInt16 () const
 
int toInt32 () const
 
unsigned int toUInt32 () const
 
qint64 toLength () const
 
qint64 toIndex () const
 
bool toBoolean () const
 
double toInteger () const
 
ReturnedValue convertedToNumber () const
 
double toNumber () const
 
double toNumberImpl () const
 
QString toQStringNoThrow () const
 
QString toQString () const
 
QString toQString (bool *ok) const
 
Heap::StringtoString (ExecutionEngine *e) const
 
QV4::PropertyKey toPropertyKey (ExecutionEngine *e) const
 
Heap::Object * toObject (ExecutionEngine *e) const
 
bool isPrimitive () const
 
template<typename T >
const T * as () const
 
template<typename T >
T * as ()
 
template<typename T >
T * cast ()
 
template<typename T >
const T * cast () const
 
uint asArrayLength (bool *ok) const
 
bool sameValue (Value other) const
 
bool sameValueZero (Value other) const
 
void mark (MarkStack *markStack)
 
Valueoperator= (const ScopedValue &v)
 
Valueoperator= (ReturnedValue v)
 
Valueoperator= (ManagedPtr m)
 
Valueoperator= (HeapBasePtr o)
 
template<typename T >
Valueoperator= (const Scoped< T > &t)
 
template<>
const DateObjectas () const
 
template<>
const ErrorObjectas () const
 
template<>
const FunctionObjectas () const
 
template<>
const Managedas () const
 
template<>
const Objectas () const
 
template<>
const ArrayObjectas () const
 
template<>
const StringOrSymbolas () const
 
template<>
const Stringas () const
 
template<>
const UrlObjectas () const
 
template<>
const UrlSearchParamsObjectas () const
 
- Public Member Functions inherited from QV4::StaticValue
 StaticValue ()=default
 
constexpr StaticValue (quint64 val)
 
StaticValueoperator= (ReturnedValue v)
 
template<typename Value >
StaticValueoperator= (const Value &)
 
template<typename Value >
const ValueasValue () const
 
template<typename Value >
ValueasValue ()
 
QV4_NEARLY_ALWAYS_INLINE constexpr quint64rawValueRef ()
 
QV4_NEARLY_ALWAYS_INLINE constexpr quint64 rawValue () const
 
QV4_NEARLY_ALWAYS_INLINE constexpr void setRawValue (quint64 raw)
 
QV4_NEARLY_ALWAYS_INLINE constexpr void setTagValue (quint32 tag, quint32 value)
 
QV4_NEARLY_ALWAYS_INLINE constexpr quint32 value () const
 
QV4_NEARLY_ALWAYS_INLINE constexpr quint32 tag () const
 
QV4_NEARLY_ALWAYS_INLINE constexpr void setTag (quint32 tag)
 
QV4_NEARLY_ALWAYS_INLINE constexpr int int_32 () const
 
QV4_NEARLY_ALWAYS_INLINE constexpr void setInt_32 (int i)
 
QV4_NEARLY_ALWAYS_INLINE uint uint_32 () const
 
QV4_NEARLY_ALWAYS_INLINE constexpr void setEmpty ()
 
Type type () const
 
quint64 quickType () const
 
bool isEmpty () const
 
bool isNull () const
 
bool isBoolean () const
 
bool isInteger () const
 
bool isNullOrUndefined () const
 
bool isUndefined () const
 
bool isDouble () const
 
bool isNumber () const
 
bool isManagedOrUndefined () const
 
bool isManaged () const
 
bool isIntOrBool () const
 
bool integerCompatible () const
 
bool isNaN () const
 
bool isPositiveInt () const
 
QV4_NEARLY_ALWAYS_INLINE double doubleValue () const
 
QV4_NEARLY_ALWAYS_INLINE void setDouble (double d)
 
bool isInt32 ()
 
double asDouble () const
 
bool booleanValue () const
 
int integerValue () const
 
bool tryIntegerConversion ()
 
bool toBoolean () const
 
int toInt32 () const
 
ReturnedValuedata_ptr ()
 
constexpr ReturnedValue asReturnedValue () const
 
template<>
StaticValueoperator= (const Value &value)
 
template<typename Managed >
StaticValueoperator= (const Managed &m)
 
template<>
ValueasValue ()
 
template<>
const ValueasValue () const
 
- Public Attributes inherited from QV4::StaticValue
quint64 _val
 
- Static Public Attributes inherited from QV4::StaticValue
static constexpr quint64 ExponentMask = 0b0111111111110000ull << 48
 
static constexpr quint64 Top1Mask = 0b1000000000000000ull << 48
 
static constexpr quint64 Upper3Mask = 0b0000000000001110ull << 48
 
static constexpr quint64 Lower5Mask = 0b0000000000011111ull
 
static constexpr quint64 ManagedMask = ExponentMask | quint64(TagBit::Unmanaged) << Tag_Shift
 
static constexpr quint64 DoubleMask = ManagedMask | quint64(TagBit::Special) << Tag_Shift
 
static constexpr quint64 NumberMask = ManagedMask | quint64(TagBit::Number) << Tag_Shift
 
static constexpr quint64 IntOrBoolMask = ManagedMask | quint64(TagBit::IntOrBool) << Tag_Shift
 
static constexpr quint64 IntCompatMask = ManagedMask | quint64(TagBit::IntCompat) << Tag_Shift
 
static constexpr quint64 EncodeMask = DoubleMask | NumberMask
 
static constexpr quint64 DoubleDiscriminator = ((quint64(TagBit::Unmanaged) | quint64(TagBit::Special)) << Tag_Shift)
 
static constexpr quint64 NumberDiscriminator = ((quint64(TagBit::Unmanaged) | quint64(TagBit::Number)) << Tag_Shift)
 
- Static Protected Member Functions inherited from QV4::Object
static ReturnedValue virtualGet (const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty)
 
static bool virtualPut (Managed *m, PropertyKey id, const Value &value, Value *receiver)
 
static bool virtualDeleteProperty (Managed *m, PropertyKey id)
 
static bool virtualHasProperty (const Managed *m, PropertyKey id)
 
static PropertyAttributes virtualGetOwnProperty (const Managed *m, PropertyKey id, Property *p)
 
static bool virtualDefineOwnProperty (Managed *m, PropertyKey id, const Property *p, PropertyAttributes attrs)
 
static bool virtualIsExtensible (const Managed *m)
 
static bool virtualPreventExtensions (Managed *)
 
static Heap::Object * virtualGetPrototypeOf (const Managed *)
 
static bool virtualSetPrototypeOf (Managed *, const Object *)
 
static OwnPropertyKeyIteratorvirtualOwnPropertyKeys (const Object *m, Value *target)
 
static qint64 virtualGetLength (const Managed *m)
 
static ReturnedValue virtualInstanceOf (const Object *typeObject, const Value &var)
 
static ReturnedValue virtualResolveLookupGetter (const Object *object, ExecutionEngine *engine, Lookup *lookup)
 
static bool virtualResolveLookupSetter (Object *object, ExecutionEngine *engine, Lookup *lookup, const Value &value)
 
static int virtualMetacall (Object *object, QMetaObject::Call call, int index, void **a)
 
- Static Protected Member Functions inherited from QV4::Managed
static bool virtualIsEqualTo (Managed *m, Managed *other)
 
- Static Protected Attributes inherited from QV4::VTableBase
static constexpr VTable::Destroy virtualDestroy = nullptr
 
static constexpr VTable::IsEqualTo virtualIsEqualTo = nullptr
 
static constexpr VTable::Get virtualGet = nullptr
 
static constexpr VTable::Put virtualPut = nullptr
 
static constexpr VTable::DeleteProperty virtualDeleteProperty = nullptr
 
static constexpr VTable::HasProperty virtualHasProperty = nullptr
 
static constexpr VTable::GetOwnProperty virtualGetOwnProperty = nullptr
 
static constexpr VTable::DefineOwnProperty virtualDefineOwnProperty = nullptr
 
static constexpr VTable::IsExtensible virtualIsExtensible = nullptr
 
static constexpr VTable::PreventExtensions virtualPreventExtensions = nullptr
 
static constexpr VTable::GetPrototypeOf virtualGetPrototypeOf = nullptr
 
static constexpr VTable::SetPrototypeOf virtualSetPrototypeOf = nullptr
 
static constexpr VTable::GetLength virtualGetLength = nullptr
 
static constexpr VTable::OwnPropertyKeys virtualOwnPropertyKeys = nullptr
 
static constexpr VTable::InstanceOf virtualInstanceOf = nullptr
 
static constexpr VTable::Call virtualCall = nullptr
 
static constexpr VTable::CallAsConstructor virtualCallAsConstructor = nullptr
 
static constexpr VTable::CallWithMetaTypes virtualCallWithMetaTypes = nullptr
 
static constexpr VTable::ResolveLookupGetter virtualResolveLookupGetter = nullptr
 
static constexpr VTable::ResolveLookupSetter virtualResolveLookupSetter = nullptr
 
static constexpr VTable::Metacall virtualMetacall = nullptr
 

Detailed Description

Definition at line 572 of file qquickcontext2d.cpp.

Member Function Documentation

◆ create()

static QV4::Heap::QQuickJSContext2DPrototype * QQuickJSContext2DPrototype::create ( QV4::ExecutionEngine * engine)
inlinestatic

◆ method_arc()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_arc ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::arc(real x, real y, real radius, real startAngle, real endAngle, bool anticlockwise)

Adds an arc to the current subpath that lies on the circumference of the circle whose center is at the point (x, y) and whose radius is radius.

Both startAngle and endAngle are measured from the x-axis in radians.

The anticlockwise parameter is false for each arc in the figure above because they are all drawn in the clockwise direction.

See also
arcTo, {http://www.w3.org/TR/2dcontext/#dom-context-2d-arc}{W3C's 2D Context Standard for arc()}

Definition at line 2380 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, DOMEXCEPTION_INDEX_SIZE_ERR, qt_is_finite(), RETURN_RESULT, THROW_DOM, QV4::Value::toBoolean(), and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_arcTo()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_arcTo ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::arcTo(real x1, real y1, real x2, real y2, real radius)

Adds an arc with the given control points and radius to the current subpath, connected to the previous point by a straight line. To draw an arc, you begin with the same steps you followed to create a line:

\list

  • Call the beginPath() method to set a new path.
  • Call the moveTo(x, y) method to set your starting position on the canvas at the point (x, y).
  • To draw an arc or circle, call the arcTo(x1, y1, x2, y2, radius) method. This adds an arc with starting point (x1, y1), ending point (x2, y2), and radius to the current subpath and connects it to the previous subpath by a straight line. \endlist
See also
arc, {http://www.w3.org/TR/2dcontext/#dom-context-2d-arcto}{W3C's 2D Context Standard for arcTo()}

Definition at line 2432 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, DOMEXCEPTION_INDEX_SIZE_ERR, qt_is_finite(), RETURN_RESULT, THROW_DOM, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_beginPath()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_beginPath ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::beginPath()

Resets the current path to a new path.

Definition at line 2460 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, and RETURN_RESULT.

Referenced by create().

+ Here is the caller graph for this function:

◆ method_bezierCurveTo()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_bezierCurveTo ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::bezierCurveTo(real cp1x, real cp1y, real cp2x, real cp2y, real x, real y)

Adds a cubic bezier curve between the current position and the given endPoint using the control points specified by ({cp1x}, {cp1y}), and ({cp2x}, {cp2y}). After the curve is added, the current position is updated to be at the end point ({x}, {y}) of the curve. The following code produces the path shown below:

ctx.strokeStyle = Qt.rgba(0, 0, 0, 1);
ctx.lineWidth = 1;
ctx.beginPath();
ctx.moveTo(20, 0);//start point
ctx.bezierCurveTo(-10, 90, 210, 90, 180, 0);
ctx.stroke();
EGLContext ctx
Definition qcompare.h:63
See also
{http://www.w3.org/TR/2dcontext/#dom-context-2d-beziercurveto}{W3C 2d context standard for bezierCurveTo}
{https://web.archive.org/web/20130505222636if_/http://www.openrise.com/lab/FlowerPower/}{The beautiful flower demo by using bezierCurveTo}

Definition at line 2494 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, qt_is_finite(), RETURN_RESULT, RETURN_UNDEFINED, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_caretBlinkRate()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_caretBlinkRate ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

Definition at line 2803 of file qquickcontext2d.cpp.

References DOMEXCEPTION_NOT_SUPPORTED_ERR, and THROW_DOM.

Referenced by create().

+ Here is the caller graph for this function:

◆ method_clearRect()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_clearRect ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::clearRect(real x, real y, real w, real h)

Clears all pixels on the canvas in the rectangle specified by (x, y, w, h) to transparent black.

Definition at line 2303 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, RETURN_RESULT, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_clip()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_clip ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::clip()

Creates the clipping region from the current path. Any parts of the shape outside the clipping path are not displayed. To create a complex shape using the clip() method:

\list 1

  • Call the {context.beginPath()} method to set the clipping path.
  • Define the clipping path by calling any combination of the {lineTo}, {arcTo}, {arc}, {moveTo}, etc and {closePath} methods.
  • Call the {context.clip()} method. \endlist

The new shape displays. The following shows how a clipping path can modify how an image displays:

See also
beginPath()
closePath()
stroke()
fill()
{http://www.w3.org/TR/2dcontext/#dom-context-2d-clip}{W3C 2d context standard for clip}

Definition at line 2540 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, and RETURN_RESULT.

Referenced by create().

+ Here is the caller graph for this function:

◆ method_closePath()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_closePath ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::closePath() Closes the current subpath by drawing a line to the beginning of the subpath, automatically starting a new path.

The current point of the new path is the previous subpath's first point.

See also
{http://www.w3.org/TR/2dcontext/#dom-context-2d-closepath}{W3C 2d context standard for closePath}

Definition at line 2557 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, and RETURN_RESULT.

Referenced by create().

+ Here is the caller graph for this function:

◆ method_createConicalGradient()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_createConicalGradient ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::createConicalGradient(real x, real y, real angle)

Returns a CanvasGradient object that represents a conical gradient that interpolates colors counter-clockwise around a center point (x, y) with a start angle angle in units of radians.

See also
CanvasGradient::addColorStop()
createLinearGradient()
createRadialGradient()
createPattern()
fillStyle
strokeStyle

Definition at line 1714 of file qquickcontext2d.cpp.

References QV4::MemoryManager::allocate(), QV4::Value::as(), CHECK_CONTEXT, DOMEXCEPTION_INDEX_SIZE_ERR, DOMEXCEPTION_NOT_SUPPORTED_ERR, QV4::Scope::engine, QV4::EngineBase::memoryManager, qRadiansToDegrees(), qt_is_finite(), RETURN_RESULT, THROW_DOM, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_createImageData()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_createImageData ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod CanvasImageData QtQuick::Context2D::createImageData(real sw, real sh)

Creates a CanvasImageData object with the given dimensions(sw, sh).

\qmlmethod CanvasImageData QtQuick::Context2D::createImageData(CanvasImageData imageData)

Creates a CanvasImageData object with the same dimensions as the imageData argument.

\qmlmethod CanvasImageData QtQuick::Context2D::createImageData(Url imageUrl)

Creates a CanvasImageData object with the given image loaded from imageUrl.

Note
The imageUrl must be already loaded before this function call, otherwise an empty CanvasImageData obect will be returned.
See also
Canvas::loadImage(), QtQuick::Canvas::unloadImage(), QtQuick::Canvas::isImageLoaded

Definition at line 3428 of file qquickcontext2d.cpp.

References QV4::Value::as(), CHECK_CONTEXT, DOMEXCEPTION_INDEX_SIZE_ERR, DOMEXCEPTION_NOT_SUPPORTED_ERR, QV4::Scope::engine, qt_create_image_data(), qt_is_finite(), RETURN_RESULT, RETURN_UNDEFINED, THROW_DOM, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_createLinearGradient()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_createLinearGradient ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::createLinearGradient(real x0, real y0, real x1, real y1) Returns a CanvasGradient object that represents a linear gradient that transitions the color along a line between the start point (x0, y0) and the end point (x1, y1).

A gradient is a smooth transition between colors. There are two types of gradients: linear and radial. Gradients must have two or more color stops, representing color shifts positioned from 0 to 1 between to the gradient's starting and end points or circles.

See also
CanvasGradient::addColorStop()
createRadialGradient()
createConicalGradient()
createPattern()
fillStyle
strokeStyle

Definition at line 1613 of file qquickcontext2d.cpp.

References QV4::MemoryManager::allocate(), QV4::Value::as(), CHECK_CONTEXT, DOMEXCEPTION_NOT_SUPPORTED_ERR, QV4::Scope::engine, QV4::EngineBase::memoryManager, qt_is_finite(), RETURN_RESULT, THROW_DOM, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_createPattern()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_createPattern ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod variant QtQuick::Context2D::createPattern(color color, enumeration patternMode) This is an overloaded function.

Returns a CanvasPattern object that uses the given color and patternMode. The valid pattern modes are:

\value Qt.SolidPattern Qt::SolidPattern \value Qt.Dense1Pattern Qt::Dense1Pattern \value Qt.Dense2Pattern Qt::Dense2Pattern \value Qt.Dense3Pattern Qt::Dense3Pattern \value Qt.Dense4Pattern Qt::Dense4Pattern \value Qt.Dense5Pattern Qt::Dense5Pattern \value Qt.Dense6Pattern Qt::Dense6Pattern \value Qt.Dense7Pattern Qt::Dense7Pattern \value Qt.HorPattern Qt::HorPattern \value Qt.VerPattern Qt::VerPattern \value Qt.CrossPattern Qt::CrossPattern \value Qt.BDiagPattern Qt::BDiagPattern \value Qt.FDiagPattern Qt::FDiagPattern \value Qt.DiagCrossPattern Qt::DiagCrossPattern

See also
Qt::BrushStyle

\qmlmethod variant QtQuick::Context2D::createPattern(Image image, string repetition) Returns a CanvasPattern object that uses the given image and repeats in the direction(s) given by the repetition argument.

The image parameter must be a valid Image item, a valid CanvasImageData object or loaded image url. If there is no image data, thus function throws an INVALID_STATE_ERR exception.

The allowed values for repetition are:

\value "repeat" both directions \value "repeat-x horizontal only \value "repeat-y" vertical only \value "no-repeat" neither If the repetition argument is empty or null, the value "repeat" is used.

See also
strokeStyle
fillStyle

Definition at line 1788 of file qquickcontext2d.cpp.

References QV4::MemoryManager::allocate(), CHECK_CONTEXT, QV4::Scope::engine, QLatin1StringView::isEmpty(), Qt::LinearGradientPattern, QV4::EngineBase::memoryManager, QV4::ExecutionEngine::newString(), o, QStringLiteral, RETURN_RESULT, RETURN_UNDEFINED, Qt::SolidPattern, QV4::Value::toInt32(), QV4::Value::toQStringNoThrow(), and QV4::ExecutionEngine::toVariant().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_createRadialGradient()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_createRadialGradient ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::createRadialGradient(real x0, real y0, real r0, real x1, real y1, real r1)

Returns a CanvasGradient object that represents a radial gradient that paints along the cone given by the start circle with origin (x0, y0) and radius r0, and the end circle with origin (x1, y1) and radius r1.

See also
CanvasGradient::addColorStop()
createLinearGradient()
createConicalGradient()
createPattern()
fillStyle
strokeStyle

Definition at line 1660 of file qquickcontext2d.cpp.

References QV4::MemoryManager::allocate(), QV4::Value::as(), CHECK_CONTEXT, DOMEXCEPTION_INDEX_SIZE_ERR, DOMEXCEPTION_NOT_SUPPORTED_ERR, QV4::Scope::engine, QV4::EngineBase::memoryManager, qt_is_finite(), r1, RETURN_RESULT, THROW_DOM, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_drawFocusRing()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_drawFocusRing ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

Definition at line 2791 of file qquickcontext2d.cpp.

References DOMEXCEPTION_NOT_SUPPORTED_ERR, and THROW_DOM.

Referenced by create().

+ Here is the caller graph for this function:

◆ method_drawImage()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_drawImage ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod QtQuick::Context2D::drawImage(variant image, real dx, real dy) Draws the given image on the canvas at position (dx, dy).

Note: The image type can be an Image item, an image url or a CanvasImageData object. When given as Image item, if the image isn't fully loaded, this method draws nothing. When given as url string, the image should be loaded by calling Canvas item's Canvas::loadImage() method first. This image been drawing is subject to the current context clip path, even the given image is a CanvasImageData object.

See also
CanvasImageData
Image
Canvas::loadImage
Canvas::isImageLoaded
Canvas::imageLoaded
{http://www.w3.org/TR/2dcontext/#dom-context-2d-drawimage}{W3C 2d context standard for drawImage}

\qmlmethod QtQuick::Context2D::drawImage(variant image, real dx, real dy, real dw, real dh) This is an overloaded function. Draws the given item as image onto the canvas at point (dx, dy) and with width dw, height dh.

Note: The image type can be an Image item, an image url or a CanvasImageData object. When given as Image item, if the image isn't fully loaded, this method draws nothing. When given as url string, the image should be loaded by calling Canvas item's Canvas::loadImage() method first. This image been drawing is subject to the current context clip path, even the given image is a CanvasImageData object.

See also
CanvasImageData
Image
Canvas::loadImage()
Canvas::isImageLoaded
Canvas::imageLoaded
{http://www.w3.org/TR/2dcontext/#dom-context-2d-drawimage}{W3C 2d context standard for drawImage}

\qmlmethod QtQuick::Context2D::drawImage(variant image, real sx, real sy, real sw, real sh, real dx, real dy, real dw, real dh) This is an overloaded function. Draws the given item as image from source point (sx, sy) and source width sw, source height sh onto the canvas at point (dx, dy) and with width dw, height dh.

Note: The image type can be an Image or Canvas item, an image url or a CanvasImageData object. When given as Image item, if the image isn't fully loaded, this method draws nothing. When given as url string, the image should be loaded by calling Canvas item's Canvas::loadImage() method first. This image been drawing is subject to the current context clip path, even the given image is a CanvasImageData object.

See also
CanvasImageData
Image
Canvas::loadImage()
Canvas::isImageLoaded
Canvas::imageLoaded
{http://www.w3.org/TR/2dcontext/#dom-context-2d-drawimage}{W3C 2d context standard for drawImage}

Definition at line 3123 of file qquickcontext2d.cpp.

References arg, CHECK_CONTEXT, DOMEXCEPTION_INDEX_SIZE_ERR, DOMEXCEPTION_TYPE_MISMATCH_ERR, imageData, QPixmap::isNull(), QUrl::isValid(), pix, pixmap, qt_is_finite(), RETURN_RESULT, RETURN_UNDEFINED, THROW_DOM, QV4::Value::toNumber(), and url.

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_ellipse()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_ellipse ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::ellipse(real x, real y, real w, real h)

Creates an ellipse within the bounding rectangle defined by its top-left corner at (x, y), width w and height h, and adds it to the path as a closed subpath.

The ellipse is composed of a clockwise curve, starting and finishing at zero degrees (the 3 o'clock position).

Definition at line 2714 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, RETURN_RESULT, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_fill()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_fill ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::fill()

Fills the subpaths with the current fill style.

See also
{http://www.w3.org/TR/2dcontext/#dom-context-2d-fill}{W3C 2d context standard for fill}
fillStyle

Definition at line 2577 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, and RETURN_RESULT.

Referenced by create().

+ Here is the caller graph for this function:

◆ method_fillRect()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_fillRect ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::fillRect(real x, real y, real w, real h)

Paints a rectangular area specified by (x, y, w, h) using fillStyle.

See also
fillStyle

Definition at line 2326 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, RETURN_RESULT, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_fillText()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_fillText ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::fillText(text, x, y)

Fills the specified text at the given position (x, y).

See also
font
textAlign
textBaseline
strokeText

Definition at line 3001 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, qt_is_finite(), RETURN_RESULT, RETURN_UNDEFINED, QV4::Value::toNumber(), and QV4::Value::toQStringNoThrow().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_get_canvas()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_get_canvas ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlproperty QtQuick::Canvas QtQuick::Context2D::canvas Holds the canvas item that the context paints on.

This property is read only.

Definition at line 967 of file qquickcontext2d.cpp.

References QV4::Value::as(), CHECK_CONTEXT, QV4::Scope::engine, RETURN_RESULT, and QV4::QObjectWrapper::wrap().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_getImageData()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_getImageData ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod CanvasImageData QtQuick::Context2D::getImageData(real x, real y, real w, real h)

Returns an CanvasImageData object containing the image data for the canvas rectangle specified by (x, y, w, h).

Definition at line 3469 of file qquickcontext2d.cpp.

References QV4::Value::as(), CHECK_CONTEXT, DOMEXCEPTION_INDEX_SIZE_ERR, DOMEXCEPTION_NOT_SUPPORTED_ERR, QV4::Scope::engine, QV4::Encode::null(), qt_create_image_data(), qt_is_finite(), RETURN_RESULT, THROW_DOM, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_getLineDash()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_getLineDash ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod array QtQuick::Context2D::getLineDash()

Since
QtQuick 2.11 Returns an array of qreals representing the dash pattern of the line.
See also
setLineDash(), lineDashOffset

Definition at line 2037 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, QV4::Scope::engine, QV4::Value::fromDouble(), i, QV4::ExecutionEngine::newArrayObject(), and RETURN_RESULT.

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_isPointInPath()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_isPointInPath ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::isPointInPath(real x, real y)

Returns true if the point (x, y) is in the current path.

See also
{http://www.w3.org/TR/2dcontext/#dom-context-2d-ispointinpath}{W3C 2d context standard for isPointInPath}

Definition at line 2779 of file qquickcontext2d.cpp.

References QV4::StaticValue::asReturnedValue(), CHECK_CONTEXT, QV4::Value::fromBoolean(), RETURN_RESULT, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_lineTo()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_lineTo ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::lineTo(real x, real y)

Draws a line from the current position to the point at (x, y).

Definition at line 2591 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, qt_is_finite(), RETURN_RESULT, RETURN_UNDEFINED, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_measureText()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_measureText ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::measureText(text)

Returns an object with a width property, whose value is equivalent to calling QFontMetrics::horizontalAdvance() with the given text in the current font.

Definition at line 3047 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, QV4::Scope::engine, QV4::Value::fromDouble(), QV4::ExecutionEngine::newIdentifier(), QV4::ExecutionEngine::newObject(), QV4::Object::put(), QStringLiteral, RETURN_RESULT, RETURN_UNDEFINED, and QV4::Value::toQStringNoThrow().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_moveTo()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_moveTo ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::moveTo(real x, real y)

Creates a new subpath with a point at (x, y).

Definition at line 2615 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, qt_is_finite(), RETURN_RESULT, RETURN_UNDEFINED, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_putImageData()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_putImageData ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::putImageData(CanvasImageData imageData, real dx, real dy, real dirtyX, real dirtyY, real dirtyWidth, real dirtyHeight)

Paints the data from the given imageData object onto the canvas at (dx, dy).

If a dirty rectangle (dirtyX, dirtyY, dirtyWidth, dirtyHeight) is provided, only the pixels from that rectangle are painted.

Definition at line 3501 of file qquickcontext2d.cpp.

References QV4::Value::as(), CHECK_CONTEXT, DOMEXCEPTION_NOT_SUPPORTED_ERR, DOMEXCEPTION_TYPE_MISMATCH_ERR, imageData, qt_is_finite(), RETURN_RESULT, RETURN_UNDEFINED, THROW_DOM, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_quadraticCurveTo()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_quadraticCurveTo ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::quadraticCurveTo(real cpx, real cpy, real x, real y)

Adds a quadratic bezier curve between the current point and the endpoint (x, y) with the control point specified by (cpx, cpy).

See also
{http://www.w3.org/TR/2dcontext/#dom-context-2d-quadraticcurveto}{W3C 2d context standard for quadraticCurveTo}

Definition at line 2641 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, qt_is_finite(), RETURN_RESULT, RETURN_UNDEFINED, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_rect()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_rect ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::rect(real x, real y, real w, real h)

Adds a rectangle at position (x, y), with the given width w and height h, as a closed subpath.

Definition at line 2668 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, RETURN_RESULT, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_reset()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_reset ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::reset() Resets the context state and properties to the default values.

Definition at line 996 of file qquickcontext2d.cpp.

References QV4::Value::as(), QV4::StaticValue::asReturnedValue(), CHECK_CONTEXT, and RETURN_RESULT.

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_resetTransform()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_resetTransform ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::resetTransform()

Reset the transformation matrix to the default value (equivalent to calling setTransform(1, 0, 0, 1, 0, 0)).

See also
transform(), setTransform(), reset()

Definition at line 1224 of file qquickcontext2d.cpp.

References QV4::Value::as(), CHECK_CONTEXT, and RETURN_RESULT.

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_restore()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_restore ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::restore() Pops the top state on the stack, restoring the context to that state.

See also
save()

Definition at line 982 of file qquickcontext2d.cpp.

References QV4::Value::as(), QV4::StaticValue::asReturnedValue(), CHECK_CONTEXT, and RETURN_RESULT.

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_rotate()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_rotate ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::rotate(real angle) Rotate the canvas around the current origin by angle in radians and clockwise direction.

ctx.rotate(Math.PI/2);

The rotation transformation matrix is as follows:

where the angle of rotation is in radians.

Definition at line 1066 of file qquickcontext2d.cpp.

References QV4::Value::as(), CHECK_CONTEXT, RETURN_RESULT, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_roundedRect()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_roundedRect ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::roundedRect(real x, real y, real w, real h, real xRadius, real yRadius)

Adds a rounded-corner rectangle, specified by (x, y, w, h), to the path. The xRadius and yRadius arguments specify the radius of the ellipses defining the corners of the rounded rectangle.

Definition at line 2687 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, RETURN_RESULT, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_save()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_save ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::save() Pushes the current state onto the state stack.

Before changing any state attributes, you should save the current state for future reference. The context maintains a stack of drawing states. Each state consists of the current transformation matrix, clipping region, and values of the following attributes: \list

  • strokeStyle
  • fillStyle
  • fillRule
  • globalAlpha
  • lineWidth
  • lineCap
  • lineJoin
  • miterLimit
  • shadowOffsetX
  • shadowOffsetY
  • shadowBlur
  • shadowColor
  • globalCompositeOperation
  • \l font
  • textAlign
  • textBaseline \endlist

The current path is NOT part of the drawing state. The path can be reset by invoking the beginPath() method.

Definition at line 1037 of file qquickcontext2d.cpp.

References QV4::Value::as(), CHECK_CONTEXT, and RETURN_RESULT.

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_scale()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_scale ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::scale(real x, real y)

Increases or decreases the size of each unit in the canvas grid by multiplying the scale factors to the current tranform matrix. x is the scale factor in the horizontal direction and y is the scale factor in the vertical direction.

The following code doubles the horizontal size of an object drawn on the canvas and halves its vertical size:

ctx.scale(2.0, 0.5);

Definition at line 1094 of file qquickcontext2d.cpp.

References QV4::Value::as(), CHECK_CONTEXT, RETURN_RESULT, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_setCaretSelectionRect()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_setCaretSelectionRect ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

Definition at line 2797 of file qquickcontext2d.cpp.

References DOMEXCEPTION_NOT_SUPPORTED_ERR, and THROW_DOM.

Referenced by create().

+ Here is the caller graph for this function:

◆ method_setLineDash()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_setLineDash ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod QtQuick::Context2D::setLineDash(array pattern)

Since
QtQuick 2.11 Sets the dash pattern to the given pattern.

pattern a list of numbers that specifies distances to alternately draw a line and a gap.

If the number of elements in the array is odd, the elements of the array get copied and concatenated. For example, [5, 15, 25] will become [5, 15, 25, 5, 15, 25].

\table 100% \row

See also
getLineDash(), lineDashOffset

Definition at line 2078 of file qquickcontext2d.cpp.

References arrayLength(), CHECK_CONTEXT_SETTER, i, number, qt_is_finite(), and RETURN_UNDEFINED.

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_setTransform()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_setTransform ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::setTransform(real a, real b, real c, real d, real e, real f)

Changes the transformation matrix to the matrix given by the arguments as described below.

Modifying the transformation matrix directly enables you to perform scaling, rotating, and translating transformations in a single step.

Each point on the canvas is multiplied by the matrix before anything is drawn. The \l{http://www.w3.org/TR/2dcontext/#transformations}{HTML Canvas 2D Context specification} defines the transformation matrix as:

where: \list

  • {a} is the scale factor in the horizontal (x) direction
  • {c} is the skew factor in the x direction
  • {e} is the translation in the x direction
  • {b} is the skew factor in the y (vertical) direction
  • {d} is the scale factor in the y direction
  • {f} is the translation in the y direction
  • the last row remains constant \endlist

The scale factors and skew factors are multiples; {e} and {f} are coordinate space units, just like the units in the translate(x,y) method.

See also
transform()

Definition at line 1143 of file qquickcontext2d.cpp.

References QV4::Value::as(), CHECK_CONTEXT, RETURN_RESULT, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_shear()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_shear ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::shear(real sh, real sv)

Shears the transformation matrix by sh in the horizontal direction and sv in the vertical direction.

Definition at line 1243 of file qquickcontext2d.cpp.

References QV4::Value::as(), CHECK_CONTEXT, RETURN_RESULT, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_stroke()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_stroke ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::stroke()

Strokes the subpaths with the current stroke style.

See also
strokeStyle, {http://www.w3.org/TR/2dcontext/#dom-context-2d-stroke}{W3C 2d context standard for stroke}

Definition at line 2761 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, and RETURN_RESULT.

Referenced by create().

+ Here is the caller graph for this function:

◆ method_strokeRect()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_strokeRect ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::strokeRect(real x, real y, real w, real h)

Strokes the path of the rectangle specified by (x, y, w, h) using strokeStyle, lineWidth, lineJoin, and (if appropriate) miterLimit attributes.

See also
strokeStyle, lineWidth, lineJoin, miterLimit

Definition at line 2346 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, RETURN_RESULT, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_strokeText()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_strokeText ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::strokeText(text, x, y)

Strokes the given text at a position specified by (x, y).

See also
font
textAlign
textBaseline
fillText

Definition at line 3028 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, RETURN_RESULT, QV4::Value::toNumber(), and QV4::Value::toQStringNoThrow().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_text()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_text ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::text(string text, real x, real y)

Adds the given text to the path as a set of closed subpaths created from the current context font supplied.

The subpaths are positioned so that the left end of the text's baseline lies at the point specified by (x, y).

Definition at line 2736 of file qquickcontext2d.cpp.

References CHECK_CONTEXT, qt_is_finite(), RETURN_RESULT, RETURN_UNDEFINED, QV4::Value::toNumber(), and QV4::Value::toQStringNoThrow().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_transform()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_transform ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::transform(real a, real b, real c, real d, real e, real f)

This method is very similar to setTransform(), but instead of replacing the old transform matrix, this method applies the given tranform matrix to the current matrix by multiplying to it.

The setTransform(a, b, c, d, e, f) method actually resets the current transform to the identity matrix, and then invokes the transform(a, b, c, d, e, f) method with the same arguments.

See also
setTransform()

Definition at line 1176 of file qquickcontext2d.cpp.

References QV4::Value::as(), CHECK_CONTEXT, RETURN_RESULT, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ method_translate()

QV4::ReturnedValue QQuickJSContext2DPrototype::method_translate ( const QV4::FunctionObject * b,
const QV4::Value * thisObject,
const QV4::Value * argv,
int argc )
static

\qmlmethod object QtQuick::Context2D::translate(real x, real y)

Translates the origin of the canvas by a horizontal distance of x, and a vertical distance of y, in coordinate space units.

Translating the origin enables you to draw patterns of different objects on the canvas without having to measure the coordinates manually for each shape.

Definition at line 1203 of file qquickcontext2d.cpp.

References QV4::Value::as(), CHECK_CONTEXT, RETURN_RESULT, and QV4::Value::toNumber().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this struct was generated from the following file: