QDeclarativeItem

Synopsis

Functions

Virtual functions

Signals

Detailed Description

The 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.

class PySide.QtDeclarative.QDeclarativeItem([parent=None])
Parameters:parentPySide.QtDeclarative.QDeclarativeItem

Constructs a PySide.QtDeclarative.QDeclarativeItem with the given parent .

PySide.QtDeclarative.QDeclarativeItem.TransformOrigin

Controls the point about which simple transforms like scale apply.

Constant Description
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.
PySide.QtDeclarative.QDeclarativeItem.activeFocusChanged(arg__1)
Parameters:arg__1PySide.QtCore.bool
PySide.QtDeclarative.QDeclarativeItem.baselineOffset()
Return type:PySide.QtCore.qreal
PySide.QtDeclarative.QDeclarativeItem.baselineOffsetChanged(arg__1)
Parameters:arg__1PySide.QtCore.qreal
PySide.QtDeclarative.QDeclarativeItem.childAt(x, y)
Parameters:
  • xPySide.QtCore.qreal
  • yPySide.QtCore.qreal
Return type:

PySide.QtDeclarative.QDeclarativeItem

PySide.QtDeclarative.QDeclarativeItem.childrenRect()
Return type:PySide.QtCore.QRectF
PySide.QtDeclarative.QDeclarativeItem.childrenRectChanged(arg__1)
Parameters:arg__1PySide.QtCore.QRectF
PySide.QtDeclarative.QDeclarativeItem.clip()
Return type:PySide.QtCore.bool
PySide.QtDeclarative.QDeclarativeItem.clipChanged(arg__1)
Parameters:arg__1PySide.QtCore.bool
PySide.QtDeclarative.QDeclarativeItem.focusChanged(arg__1)
Parameters:arg__1PySide.QtCore.bool
PySide.QtDeclarative.QDeclarativeItem.forceActiveFocus()
PySide.QtDeclarative.QDeclarativeItem.geometryChanged(newGeometry, oldGeometry)
Parameters:

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.QtDeclarative.QDeclarativeItem.hasActiveFocus()
Return type:PySide.QtCore.bool
PySide.QtDeclarative.QDeclarativeItem.height()
Return type:PySide.QtCore.qreal

Return the height of the item

PySide.QtDeclarative.QDeclarativeItem.heightValid()
Return type:PySide.QtCore.bool

Returns whether the height property has been set explicitly.

PySide.QtDeclarative.QDeclarativeItem.implicitHeight()
Return type:PySide.QtCore.qreal

Returns the height of the item that is implied by other properties that determine the content.

PySide.QtDeclarative.QDeclarativeItem.implicitHeightChanged()
PySide.QtDeclarative.QDeclarativeItem.implicitWidth()
Return type:PySide.QtCore.qreal

Returns the width of the item that is implied by other properties that determine the content.

PySide.QtDeclarative.QDeclarativeItem.implicitWidthChanged()
PySide.QtDeclarative.QDeclarativeItem.inputMethodPreHandler(arg__1)
Parameters:arg__1PySide.QtGui.QInputMethodEvent
PySide.QtDeclarative.QDeclarativeItem.isComponentComplete()
Return type: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.

See also

PySide.QtDeclarative.QDeclarativeItem.componentComplete()

PySide.QtDeclarative.QDeclarativeItem.keepMouseGrab()
Return type:PySide.QtCore.bool

Returns a value indicating whether mouse input should remain with this item exclusively.

PySide.QtDeclarative.QDeclarativeItem.keyPressPreHandler(arg__1)
Parameters:arg__1PySide.QtGui.QKeyEvent
PySide.QtDeclarative.QDeclarativeItem.keyReleasePreHandler(arg__1)
Parameters:arg__1PySide.QtGui.QKeyEvent
PySide.QtDeclarative.QDeclarativeItem.mapFromItem(item, x, y)
Parameters:
Return type:

PySide.QtScript.QScriptValue

PySide.QtDeclarative.QDeclarativeItem.mapToItem(item, x, y)
Parameters:
Return type:

PySide.QtScript.QScriptValue

PySide.QtDeclarative.QDeclarativeItem.parentChanged(arg__1)
Parameters:arg__1PySide.QtDeclarative.QDeclarativeItem
PySide.QtDeclarative.QDeclarativeItem.resetHeight()

Reset the height of the item

PySide.QtDeclarative.QDeclarativeItem.resetWidth()

Reset the width of the item

PySide.QtDeclarative.QDeclarativeItem.setBaselineOffset(arg__1)
Parameters:arg__1PySide.QtCore.qreal
PySide.QtDeclarative.QDeclarativeItem.setClip(arg__1)
Parameters:arg__1PySide.QtCore.bool
PySide.QtDeclarative.QDeclarativeItem.setFocus(arg__1)
Parameters:arg__1PySide.QtCore.bool
PySide.QtDeclarative.QDeclarativeItem.setHeight(arg__1)
Parameters:arg__1PySide.QtCore.qreal

Set the height of the item

PySide.QtDeclarative.QDeclarativeItem.setImplicitHeight(arg__1)
Parameters:arg__1PySide.QtCore.qreal

Sets the implied height of the item to h . This is the height implied by other properties that determine the content.

PySide.QtDeclarative.QDeclarativeItem.setImplicitWidth(arg__1)
Parameters:arg__1PySide.QtCore.qreal

Sets the implied width of the item to w . This is the width implied by other properties that determine the content.

PySide.QtDeclarative.QDeclarativeItem.setKeepMouseGrab(arg__1)
Parameters:arg__1PySide.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.

PySide.QtDeclarative.QDeclarativeItem.setParentItem(parent)
Parameters:parentPySide.QtDeclarative.QDeclarativeItem

See also

PySide.QtDeclarative.QDeclarativeItem.parentItem()

PySide.QtDeclarative.QDeclarativeItem.setSize(size)
Parameters:sizePySide.QtCore.QSizeF
PySide.QtDeclarative.QDeclarativeItem.setSmooth(arg__1)
Parameters:arg__1PySide.QtCore.bool

Sets whether the item should be drawn with antialiasing and smooth pixmap filtering to smooth .

PySide.QtDeclarative.QDeclarativeItem.setTransformOrigin(arg__1)
Parameters:arg__1PySide.QtDeclarative.QDeclarativeItem.TransformOrigin

Set the transform origin .

PySide.QtDeclarative.QDeclarativeItem.setWidth(arg__1)
Parameters:arg__1PySide.QtCore.qreal

Set the width of the item

PySide.QtDeclarative.QDeclarativeItem.smooth()
Return type:PySide.QtCore.bool

Returns true if the item should be drawn with antialiasing and smooth pixmap filtering, false otherwise.

The default is false.

PySide.QtDeclarative.QDeclarativeItem.smoothChanged(arg__1)
Parameters:arg__1PySide.QtCore.bool
PySide.QtDeclarative.QDeclarativeItem.stateChanged(arg__1)
Parameters:arg__1 – unicode
PySide.QtDeclarative.QDeclarativeItem.transformOrigin()
Return type:PySide.QtDeclarative.QDeclarativeItem.TransformOrigin

Returns the current transform origin.

PySide.QtDeclarative.QDeclarativeItem.transformOriginChanged(arg__1)
Parameters:arg__1PySide.QtDeclarative.QDeclarativeItem.TransformOrigin
PySide.QtDeclarative.QDeclarativeItem.width()
Return type:PySide.QtCore.qreal

Return the width of the item

PySide.QtDeclarative.QDeclarativeItem.widthValid()
Return type:PySide.QtCore.bool

Returns whether the width property has been set explicitly.