KLayout 0.29.8 (2024-10-28 63dd591e5) [master]

API reference - Class QGraphicsRectItem

Notation used in Ruby API documentation

Module: QtGui

Description: Binding of QGraphicsRectItem

Class hierarchy: QGraphicsRectItem » QAbstractGraphicsShapeItem » QGraphicsItem

Public constructors

new QGraphicsRectItemnew(QGraphicsItem ptr parent = 0,
QGraphicsScene ptr scene = 0)
Constructor QGraphicsRectItem::QGraphicsRectItem(QGraphicsItem *parent, QGraphicsScene *scene)
new QGraphicsRectItemnew(const QRectF rect,
QGraphicsItem ptr parent = 0,
QGraphicsScene ptr scene = 0)
Constructor QGraphicsRectItem::QGraphicsRectItem(const QRectF &rect, QGraphicsItem *parent, QGraphicsScene *scene)
new QGraphicsRectItemnew(double x,
double y,
double w,
double h,
QGraphicsItem ptr parent = 0,
QGraphicsScene ptr scene = 0)
Constructor QGraphicsRectItem::QGraphicsRectItem(double x, double y, double w, double h, QGraphicsItem *parent, QGraphicsScene *scene)

Public methods

[const]QGraphicsRectItem ptr_const_castReturns a non-const reference to self.
void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
voidadvance(int phase)Virtual method void QGraphicsRectItem::advance(int phase)
[const]QRectFboundingRectVirtual method QRectF QGraphicsRectItem::boundingRect()
[const]boolcollidesWithItem(const QGraphicsItem ptr other,
const Qt_ItemSelectionMode mode)
Virtual method bool QGraphicsRectItem::collidesWithItem(const QGraphicsItem *other, Qt::ItemSelectionMode mode)
[const]boolcollidesWithPath(const QPainterPath path,
const Qt_ItemSelectionMode mode)
Virtual method bool QGraphicsRectItem::collidesWithPath(const QPainterPath &path, Qt::ItemSelectionMode mode)
[const]boolcontains(const QPointF point)Virtual method bool QGraphicsRectItem::contains(const QPointF &point)
[const]boolisObscuredBy(const QGraphicsItem ptr item)Virtual method bool QGraphicsRectItem::isObscuredBy(const QGraphicsItem *item)
[const]boolisObscuredBy?(const QGraphicsItem ptr item)Method bool QGraphicsRectItem::isObscuredBy(const QGraphicsItem *item)
[const]QPainterPathopaqueAreaVirtual method QPainterPath QGraphicsRectItem::opaqueArea()
voidpaint(QPainter ptr painter,
const QStyleOptionGraphicsItem ptr option,
QWidget ptr widget)
Virtual method void QGraphicsRectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
[const]QRectFrectMethod QRectF QGraphicsRectItem::rect()
voidrect=(const QRectF rect)Method void QGraphicsRectItem::setRect(const QRectF &rect)
voidsetRect(const QRectF rect)Method void QGraphicsRectItem::setRect(const QRectF &rect)
voidsetRect(double x,
double y,
double w,
double h)
Method void QGraphicsRectItem::setRect(double x, double y, double w, double h)
[const]QPainterPathshapeVirtual method QPainterPath QGraphicsRectItem::shape()
[const]inttypeVirtual method int QGraphicsRectItem::type()

Protected methods (static, non-static and constructors)

voidaddToIndexMethod void QGraphicsRectItem::addToIndex()
voidcontextMenuEvent(QGraphicsSceneContextMenuEvent ptr event)Virtual method void QGraphicsRectItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
voiddragEnterEvent(QGraphicsSceneDragDropEvent ptr event)Virtual method void QGraphicsRectItem::dragEnterEvent(QGraphicsSceneDragDropEvent *event)
voiddragLeaveEvent(QGraphicsSceneDragDropEvent ptr event)Virtual method void QGraphicsRectItem::dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
voiddragMoveEvent(QGraphicsSceneDragDropEvent ptr event)Virtual method void QGraphicsRectItem::dragMoveEvent(QGraphicsSceneDragDropEvent *event)
voiddropEvent(QGraphicsSceneDragDropEvent ptr event)Virtual method void QGraphicsRectItem::dropEvent(QGraphicsSceneDragDropEvent *event)
[const]variantextension(variant variant)Virtual method QVariant QGraphicsRectItem::extension(const QVariant &variant)
voidfocusInEvent(QFocusEvent ptr event)Virtual method void QGraphicsRectItem::focusInEvent(QFocusEvent *event)
voidfocusOutEvent(QFocusEvent ptr event)Virtual method void QGraphicsRectItem::focusOutEvent(QFocusEvent *event)
voidhoverEnterEvent(QGraphicsSceneHoverEvent ptr event)Virtual method void QGraphicsRectItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
voidhoverLeaveEvent(QGraphicsSceneHoverEvent ptr event)Virtual method void QGraphicsRectItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
voidhoverMoveEvent(QGraphicsSceneHoverEvent ptr event)Virtual method void QGraphicsRectItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
voidinputMethodEvent(QInputMethodEvent ptr event)Virtual method void QGraphicsRectItem::inputMethodEvent(QInputMethodEvent *event)
[const]variantinputMethodQuery(const Qt_InputMethodQuery query)Virtual method QVariant QGraphicsRectItem::inputMethodQuery(Qt::InputMethodQuery query)
variantitemChange(const QGraphicsItem_GraphicsItemChange change,
variant value)
Virtual method QVariant QGraphicsRectItem::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
voidkeyPressEvent(QKeyEvent ptr event)Virtual method void QGraphicsRectItem::keyPressEvent(QKeyEvent *event)
voidkeyReleaseEvent(QKeyEvent ptr event)Virtual method void QGraphicsRectItem::keyReleaseEvent(QKeyEvent *event)
voidmouseDoubleClickEvent(QGraphicsSceneMouseEvent ptr event)Virtual method void QGraphicsRectItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
voidmouseMoveEvent(QGraphicsSceneMouseEvent ptr event)Virtual method void QGraphicsRectItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
voidmousePressEvent(QGraphicsSceneMouseEvent ptr event)Virtual method void QGraphicsRectItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
voidmouseReleaseEvent(QGraphicsSceneMouseEvent ptr event)Virtual method void QGraphicsRectItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
voidprepareGeometryChangeMethod void QGraphicsRectItem::prepareGeometryChange()
voidremoveFromIndexMethod void QGraphicsRectItem::removeFromIndex()
boolsceneEvent(QEvent ptr event)Virtual method bool QGraphicsRectItem::sceneEvent(QEvent *event)
boolsceneEventFilter(QGraphicsItem ptr watched,
QEvent ptr event)
Virtual method bool QGraphicsRectItem::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
voidsetExtension(unsigned int extension,
variant variant)
Virtual method void QGraphicsRectItem::setExtension(QGraphicsItem::Extension extension, const QVariant &variant)
[const]boolsupportsExtension(unsigned int extension)Virtual method bool QGraphicsRectItem::supportsExtension(QGraphicsItem::Extension extension)
voidwheelEvent(QGraphicsSceneWheelEvent ptr event)Virtual method void QGraphicsRectItem::wheelEvent(QGraphicsSceneWheelEvent *event)

Detailed description

_const_cast

Signature: [const] QGraphicsRectItem ptr _const_cast

Description: Returns a non-const reference to self.

Basically, this method allows turning a const object reference to a non-const one. This method is provided as last resort to remove the constness from an object. Usually there is a good reason for a const object reference, so using this method may have undesired side effects.

This method has been introduced in version 0.29.6.

_create

Signature: void _create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

_destroy

Signature: void _destroy

Description: Explicitly destroys the object

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

_destroyed?

Signature: [const] bool _destroyed?

Description: Returns a value indicating whether the object was already destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

_is_const_object?

Signature: [const] bool _is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

_manage

Signature: void _manage

Description: Marks the object as managed by the script side.

After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required.

Usually it's not required to call this method. It has been introduced in version 0.24.

_unmanage

Signature: void _unmanage

Description: Marks the object as no longer owned by the script side.

Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur.

Usually it's not required to call this method. It has been introduced in version 0.24.

addToIndex

Signature: void addToIndex

Description: Method void QGraphicsRectItem::addToIndex()

This method is protected and can only be called from inside a derived class.

advance

Signature: void advance (int phase)

Description: Virtual method void QGraphicsRectItem::advance(int phase)

This method can be reimplemented in a derived class.

boundingRect

Signature: [const] QRectF boundingRect

Description: Virtual method QRectF QGraphicsRectItem::boundingRect()

This method can be reimplemented in a derived class.

collidesWithItem

Signature: [const] bool collidesWithItem (const QGraphicsItem ptr other, const Qt_ItemSelectionMode mode)

Description: Virtual method bool QGraphicsRectItem::collidesWithItem(const QGraphicsItem *other, Qt::ItemSelectionMode mode)

This method can be reimplemented in a derived class.

collidesWithPath

Signature: [const] bool collidesWithPath (const QPainterPath path, const Qt_ItemSelectionMode mode)

Description: Virtual method bool QGraphicsRectItem::collidesWithPath(const QPainterPath &path, Qt::ItemSelectionMode mode)

This method can be reimplemented in a derived class.

contains

Signature: [const] bool contains (const QPointF point)

Description: Virtual method bool QGraphicsRectItem::contains(const QPointF &point)

This method can be reimplemented in a derived class.

contextMenuEvent

Signature: void contextMenuEvent (QGraphicsSceneContextMenuEvent ptr event)

Description: Virtual method void QGraphicsRectItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)

This method can be reimplemented in a derived class.

dragEnterEvent

Signature: void dragEnterEvent (QGraphicsSceneDragDropEvent ptr event)

Description: Virtual method void QGraphicsRectItem::dragEnterEvent(QGraphicsSceneDragDropEvent *event)

This method can be reimplemented in a derived class.

dragLeaveEvent

Signature: void dragLeaveEvent (QGraphicsSceneDragDropEvent ptr event)

Description: Virtual method void QGraphicsRectItem::dragLeaveEvent(QGraphicsSceneDragDropEvent *event)

This method can be reimplemented in a derived class.

dragMoveEvent

Signature: void dragMoveEvent (QGraphicsSceneDragDropEvent ptr event)

Description: Virtual method void QGraphicsRectItem::dragMoveEvent(QGraphicsSceneDragDropEvent *event)

This method can be reimplemented in a derived class.

dropEvent

Signature: void dropEvent (QGraphicsSceneDragDropEvent ptr event)

Description: Virtual method void QGraphicsRectItem::dropEvent(QGraphicsSceneDragDropEvent *event)

This method can be reimplemented in a derived class.

extension

Signature: [const] variant extension (variant variant)

Description: Virtual method QVariant QGraphicsRectItem::extension(const QVariant &variant)

This method can be reimplemented in a derived class.

focusInEvent

Signature: void focusInEvent (QFocusEvent ptr event)

Description: Virtual method void QGraphicsRectItem::focusInEvent(QFocusEvent *event)

This method can be reimplemented in a derived class.

focusOutEvent

Signature: void focusOutEvent (QFocusEvent ptr event)

Description: Virtual method void QGraphicsRectItem::focusOutEvent(QFocusEvent *event)

This method can be reimplemented in a derived class.

hoverEnterEvent

Signature: void hoverEnterEvent (QGraphicsSceneHoverEvent ptr event)

Description: Virtual method void QGraphicsRectItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)

This method can be reimplemented in a derived class.

hoverLeaveEvent

Signature: void hoverLeaveEvent (QGraphicsSceneHoverEvent ptr event)

Description: Virtual method void QGraphicsRectItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)

This method can be reimplemented in a derived class.

hoverMoveEvent

Signature: void hoverMoveEvent (QGraphicsSceneHoverEvent ptr event)

Description: Virtual method void QGraphicsRectItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event)

This method can be reimplemented in a derived class.

inputMethodEvent

Signature: void inputMethodEvent (QInputMethodEvent ptr event)

Description: Virtual method void QGraphicsRectItem::inputMethodEvent(QInputMethodEvent *event)

This method can be reimplemented in a derived class.

inputMethodQuery

Signature: [const] variant inputMethodQuery (const Qt_InputMethodQuery query)

Description: Virtual method QVariant QGraphicsRectItem::inputMethodQuery(Qt::InputMethodQuery query)

This method can be reimplemented in a derived class.

isObscuredBy

Signature: [const] bool isObscuredBy (const QGraphicsItem ptr item)

Description: Virtual method bool QGraphicsRectItem::isObscuredBy(const QGraphicsItem *item)

This method can be reimplemented in a derived class.

isObscuredBy?

Signature: [const] bool isObscuredBy? (const QGraphicsItem ptr item)

Description: Method bool QGraphicsRectItem::isObscuredBy(const QGraphicsItem *item)

This is a reimplementation of QAbstractGraphicsShapeItem::isObscuredBy

itemChange

Signature: variant itemChange (const QGraphicsItem_GraphicsItemChange change, variant value)

Description: Virtual method QVariant QGraphicsRectItem::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)

This method can be reimplemented in a derived class.

keyPressEvent

Signature: void keyPressEvent (QKeyEvent ptr event)

Description: Virtual method void QGraphicsRectItem::keyPressEvent(QKeyEvent *event)

This method can be reimplemented in a derived class.

keyReleaseEvent

Signature: void keyReleaseEvent (QKeyEvent ptr event)

Description: Virtual method void QGraphicsRectItem::keyReleaseEvent(QKeyEvent *event)

This method can be reimplemented in a derived class.

mouseDoubleClickEvent

Signature: void mouseDoubleClickEvent (QGraphicsSceneMouseEvent ptr event)

Description: Virtual method void QGraphicsRectItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)

This method can be reimplemented in a derived class.

mouseMoveEvent

Signature: void mouseMoveEvent (QGraphicsSceneMouseEvent ptr event)

Description: Virtual method void QGraphicsRectItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)

This method can be reimplemented in a derived class.

mousePressEvent

Signature: void mousePressEvent (QGraphicsSceneMouseEvent ptr event)

Description: Virtual method void QGraphicsRectItem::mousePressEvent(QGraphicsSceneMouseEvent *event)

This method can be reimplemented in a derived class.

mouseReleaseEvent

Signature: void mouseReleaseEvent (QGraphicsSceneMouseEvent ptr event)

Description: Virtual method void QGraphicsRectItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)

This method can be reimplemented in a derived class.

new

(1) Signature: [static] new QGraphicsRectItem new (QGraphicsItem ptr parent = 0, QGraphicsScene ptr scene = 0)

Description: Constructor QGraphicsRectItem::QGraphicsRectItem(QGraphicsItem *parent, QGraphicsScene *scene)

This method creates an object of class QGraphicsRectItem.

Python specific notes:
This method is the default initializer of the object.

(2) Signature: [static] new QGraphicsRectItem new (const QRectF rect, QGraphicsItem ptr parent = 0, QGraphicsScene ptr scene = 0)

Description: Constructor QGraphicsRectItem::QGraphicsRectItem(const QRectF &rect, QGraphicsItem *parent, QGraphicsScene *scene)

This method creates an object of class QGraphicsRectItem.

Python specific notes:
This method is the default initializer of the object.

(3) Signature: [static] new QGraphicsRectItem new (double x, double y, double w, double h, QGraphicsItem ptr parent = 0, QGraphicsScene ptr scene = 0)

Description: Constructor QGraphicsRectItem::QGraphicsRectItem(double x, double y, double w, double h, QGraphicsItem *parent, QGraphicsScene *scene)

This method creates an object of class QGraphicsRectItem.

Python specific notes:
This method is the default initializer of the object.

opaqueArea

Signature: [const] QPainterPath opaqueArea

Description: Virtual method QPainterPath QGraphicsRectItem::opaqueArea()

This method can be reimplemented in a derived class.

paint

Signature: void paint (QPainter ptr painter, const QStyleOptionGraphicsItem ptr option, QWidget ptr widget)

Description: Virtual method void QGraphicsRectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)

This method can be reimplemented in a derived class.

prepareGeometryChange

Signature: void prepareGeometryChange

Description: Method void QGraphicsRectItem::prepareGeometryChange()

This method is protected and can only be called from inside a derived class.

rect

Signature: [const] QRectF rect

Description: Method QRectF QGraphicsRectItem::rect()

Python specific notes:
The object exposes a readable attribute 'rect'. This is the getter.

rect=

Signature: void rect= (const QRectF rect)

Description: Method void QGraphicsRectItem::setRect(const QRectF &rect)

Python specific notes:
The object exposes a writable attribute 'rect'. This is the setter.

removeFromIndex

Signature: void removeFromIndex

Description: Method void QGraphicsRectItem::removeFromIndex()

This method is protected and can only be called from inside a derived class.

sceneEvent

Signature: bool sceneEvent (QEvent ptr event)

Description: Virtual method bool QGraphicsRectItem::sceneEvent(QEvent *event)

This method can be reimplemented in a derived class.

sceneEventFilter

Signature: bool sceneEventFilter (QGraphicsItem ptr watched, QEvent ptr event)

Description: Virtual method bool QGraphicsRectItem::sceneEventFilter(QGraphicsItem *watched, QEvent *event)

This method can be reimplemented in a derived class.

setExtension

Signature: void setExtension (unsigned int extension, variant variant)

Description: Virtual method void QGraphicsRectItem::setExtension(QGraphicsItem::Extension extension, const QVariant &variant)

This method can be reimplemented in a derived class.

setRect

(1) Signature: void setRect (const QRectF rect)

Description: Method void QGraphicsRectItem::setRect(const QRectF &rect)

Python specific notes:
The object exposes a writable attribute 'rect'. This is the setter.

(2) Signature: void setRect (double x, double y, double w, double h)

Description: Method void QGraphicsRectItem::setRect(double x, double y, double w, double h)

shape

Signature: [const] QPainterPath shape

Description: Virtual method QPainterPath QGraphicsRectItem::shape()

This method can be reimplemented in a derived class.

supportsExtension

Signature: [const] bool supportsExtension (unsigned int extension)

Description: Virtual method bool QGraphicsRectItem::supportsExtension(QGraphicsItem::Extension extension)

This method can be reimplemented in a derived class.

type

Signature: [const] int type

Description: Virtual method int QGraphicsRectItem::type()

This method can be reimplemented in a derived class.

wheelEvent

Signature: void wheelEvent (QGraphicsSceneWheelEvent ptr event)

Description: Virtual method void QGraphicsRectItem::wheelEvent(QGraphicsSceneWheelEvent *event)

This method can be reimplemented in a derived class.