PySide.QtDeclarative.QDeclarativeItem class provides the most basic of all visual items in QML.
All visual items in Qt Declarative inherit from PySide.QtDeclarative.QDeclarativeItem . Although PySide.QtDeclarative.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 PySide.QtDeclarative.QDeclarativeItem to provide your own custom visual item that inherits these features. Note that, because it does not draw anything, PySide.QtDeclarative.QDeclarativeItem sets the QGraphicsItem.ItemHasNoContents flag. If you subclass PySide.QtDeclarative.QDeclarativeItem to create a visual item, you will need to unset this flag.
参数: | parent – PySide.QtDeclarative.QDeclarativeItem |
---|
构造 PySide.QtDeclarative.QDeclarativeItem with the given parent .
Controls the point about which simple transforms like scale apply.
常量 | 描述 |
---|---|
QDeclarativeItem.TopLeft | The top-left corner of the item. |
QDeclarativeItem.Top | The center point of the top of the item. |
QDeclarativeItem.TopRight | The top-right corner of the item. |
QDeclarativeItem.Left | The left most point of the vertical middle. |
QDeclarativeItem.Center | The center of the item. |
QDeclarativeItem.Right | The right most point of the vertical middle. |
QDeclarativeItem.BottomLeft | The bottom-left corner of the item. |
QDeclarativeItem.Bottom | The center point of the bottom of the item. |
QDeclarativeItem.BottomRight | The bottom-right corner of the item. |
参数: | arg__1 – PySide.QtCore.bool |
---|
返回类型: | PySide.QtCore.qreal |
---|
参数: | arg__1 – PySide.QtCore.qreal |
---|
参数: |
|
---|---|
返回类型: |
返回类型: | PySide.QtCore.QRectF |
---|
参数: | arg__1 – PySide.QtCore.QRectF |
---|
返回类型: | PySide.QtCore.bool |
---|
参数: | arg__1 – PySide.QtCore.bool |
---|
参数: | arg__1 – PySide.QtCore.bool |
---|
参数: |
|
---|
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.
返回类型: | PySide.QtCore.bool |
---|
返回类型: | PySide.QtCore.qreal |
---|
Return the height of the item
返回类型: | PySide.QtCore.bool |
---|
Returns whether the height property has been set explicitly.
返回类型: | PySide.QtCore.qreal |
---|
Returns the height of the item that is implied by other properties that determine the content.
返回类型: | PySide.QtCore.qreal |
---|
Returns the width of the item that is implied by other properties that determine the content.
参数: | arg__1 – PySide.QtGui.QInputMethodEvent |
---|
返回类型: | PySide.QtCore.bool |
---|
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.
另请参阅
PySide.QtDeclarative.QDeclarativeItem.componentComplete()
返回类型: | PySide.QtCore.bool |
---|
Returns a value indicating whether mouse input should remain with this item exclusively.
参数: | arg__1 – PySide.QtGui.QKeyEvent |
---|
参数: | arg__1 – PySide.QtGui.QKeyEvent |
---|
参数: |
|
---|---|
返回类型: |
参数: |
|
---|---|
返回类型: |
参数: | arg__1 – PySide.QtDeclarative.QDeclarativeItem |
---|
Reset the height of the item
Reset the width of the item
参数: | arg__1 – PySide.QtCore.qreal |
---|
参数: | arg__1 – PySide.QtCore.bool |
---|
参数: | arg__1 – PySide.QtCore.bool |
---|
参数: | arg__1 – PySide.QtCore.qreal |
---|
Set the height of the item
参数: | arg__1 – PySide.QtCore.qreal |
---|
Sets the implied height of the item to h . This is the height implied by other properties that determine the content.
参数: | arg__1 – PySide.QtCore.qreal |
---|
Sets the implied width of the item to w . This is the width implied by other properties that determine the content.
参数: | arg__1 – PySide.QtCore.bool |
---|
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.
参数: | parent – PySide.QtDeclarative.QDeclarativeItem |
---|
另请参阅
PySide.QtDeclarative.QDeclarativeItem.parentItem()
参数: | size – PySide.QtCore.QSizeF |
---|
参数: | arg__1 – PySide.QtCore.bool |
---|
Sets whether the item should be drawn with antialiasing and smooth pixmap filtering to smooth .
参数: | arg__1 – PySide.QtDeclarative.QDeclarativeItem.TransformOrigin |
---|
Set the transform origin .
参数: | arg__1 – PySide.QtCore.qreal |
---|
Set the width of the item
返回类型: | PySide.QtCore.bool |
---|
Returns true if the item should be drawn with antialiasing and smooth pixmap filtering, false otherwise.
默认为 false。
参数: | arg__1 – PySide.QtCore.bool |
---|
参数: | arg__1 – unicode |
---|
返回类型: | PySide.QtDeclarative.QDeclarativeItem.TransformOrigin |
---|
Returns the current transform origin.
参数: | arg__1 – PySide.QtDeclarative.QDeclarativeItem.TransformOrigin |
---|
返回类型: | PySide.QtCore.qreal |
---|
Return the width of the item
返回类型: | PySide.QtCore.bool |
---|
Returns whether the width property has been set explicitly.