The QDeclarativeItem class provides the most basic of all visual items in QML. 更多...
继承 QGraphicsObject and QDeclarativeParserStatus .
The QDeclarativeItem class provides the most basic of all visual items in QML.
All visual items in Qt Declarative inherit from QDeclarativeItem. Although QDeclarativeItem has no visual appearance, it defines all the properties that are common across visual items - such as the x and y position, the width and height, anchoring and key handling.
You can subclass QDeclarativeItem to provide your own custom visual item that inherits these features. Note that, because it does not draw anything, QDeclarativeItem sets the QGraphicsItem.ItemHasNoContents flag. If you subclass QDeclarativeItem to create a visual item, you will need to unset this flag.
Controls the point about which simple transforms like scale apply.
| 常量 | 值 | 描述 |
|---|---|---|
| QDeclarativeItem.TopLeft | 0 | The top-left corner of the item. |
| QDeclarativeItem.Top | 1 | The center point of the top of the item. |
| QDeclarativeItem.TopRight | 2 | The top-right corner of the item. |
| QDeclarativeItem.Left | 3 | The left most point of the vertical middle. |
| QDeclarativeItem.Center | 4 | The center of the item. |
| QDeclarativeItem.Right | 5 | The right most point of the vertical middle. |
| QDeclarativeItem.BottomLeft | 6 | The bottom-left corner of the item. |
| QDeclarativeItem.Bottom | 7 | The center point of the bottom of the 项。 |
| QDeclarativeItem.BottomRight | 8 | The bottom-right corner of the item. |
parent argument, if not None, causes self to be owned by Qt instead of PyQt.
构造 QDeclarativeItem with the given parent .
This function is called to handle this item's changes in geometry from oldGeometry to newGeometry . If the two geometries are the same, it doesn't do anything.
Returns whether the height property has been set explicitly.
Returns true if construction of the QML component is complete; otherwise returns false.
It is often desirable to delay some processing until the component is completed.
另请参阅 componentComplete ().
Returns a value indicating whether mouse input should remain with this item exclusively.
另请参阅 setKeepMouseGrab ().
Sets the implied height of the item to h . This is the height implied by other properties that determine the content.
另请参阅 implicitHeight ().
Sets the implied width of the item to w . This is the width implied by other properties that determine the content.
另请参阅 implicitWidth ().
The flag indicating whether the mouse should remain with this item is set to keep .
This is useful for items that wish to grab and keep mouse interaction following a predefined gesture. For example, an item that is interested in horizontal mouse movement may set keepMouseGrab to true once a threshold has been exceeded. Once keepMouseGrab has been set to true, filtering items will not react to mouse events.
If the item does not indicate that it wishes to retain mouse grab, a filtering item may steal the grab. For example, Flickable may attempt to steal a mouse grab if it detects that the user has begun to move the viewport.
另请参阅 keepMouseGrab ().
parent argument, if not None, causes self to be owned by Qt instead of PyQt.
Set the transform origin .
另请参阅 transformOrigin ().
Returns the current transform origin.
另请参阅 setTransformOrigin ().
Returns whether the width property has been set explicitly.