|
|
#ifndef PYTHONQTWRAPPER_QGRAPHICSITEM_H
|
|
|
#define PYTHONQTWRAPPER_QGRAPHICSITEM_H
|
|
|
|
|
|
#include <qgraphicsitem.h>
|
|
|
#include <QObject>
|
|
|
|
|
|
#include <QVariant>
|
|
|
#include <qcoreevent.h>
|
|
|
#include <qcursor.h>
|
|
|
#include <qevent.h>
|
|
|
#include <qgraphicsitem.h>
|
|
|
#include <qgraphicsscene.h>
|
|
|
#include <qgraphicssceneevent.h>
|
|
|
#include <qgraphicswidget.h>
|
|
|
#include <qlist.h>
|
|
|
#include <qpainter.h>
|
|
|
#include <qpainterpath.h>
|
|
|
#include <qpoint.h>
|
|
|
#include <qpolygon.h>
|
|
|
#include <qrect.h>
|
|
|
#include <qregion.h>
|
|
|
#include <qsize.h>
|
|
|
#include <qstyleoption.h>
|
|
|
#include <qtransform.h>
|
|
|
#include <qwidget.h>
|
|
|
|
|
|
class PythonQtWrapper_QGraphicsItem : public QObject
|
|
|
{ Q_OBJECT
|
|
|
public:
|
|
|
Q_ENUMS(CacheMode enum_1 GraphicsItemFlag GraphicsItemChange )
|
|
|
enum CacheMode{
|
|
|
NoCache = QGraphicsItem::NoCache, ItemCoordinateCache = QGraphicsItem::ItemCoordinateCache, DeviceCoordinateCache = QGraphicsItem::DeviceCoordinateCache};
|
|
|
enum enum_1{
|
|
|
Type = QGraphicsItem::Type, UserType = QGraphicsItem::UserType};
|
|
|
enum GraphicsItemFlag{
|
|
|
ItemIsMovable = QGraphicsItem::ItemIsMovable, ItemIsSelectable = QGraphicsItem::ItemIsSelectable, ItemIsFocusable = QGraphicsItem::ItemIsFocusable, ItemClipsToShape = QGraphicsItem::ItemClipsToShape, ItemClipsChildrenToShape = QGraphicsItem::ItemClipsChildrenToShape, ItemIgnoresTransformations = QGraphicsItem::ItemIgnoresTransformations};
|
|
|
enum GraphicsItemChange{
|
|
|
ItemPositionChange = QGraphicsItem::ItemPositionChange, ItemMatrixChange = QGraphicsItem::ItemMatrixChange, ItemVisibleChange = QGraphicsItem::ItemVisibleChange, ItemEnabledChange = QGraphicsItem::ItemEnabledChange, ItemSelectedChange = QGraphicsItem::ItemSelectedChange, ItemParentChange = QGraphicsItem::ItemParentChange, ItemChildAddedChange = QGraphicsItem::ItemChildAddedChange, ItemChildRemovedChange = QGraphicsItem::ItemChildRemovedChange, ItemTransformChange = QGraphicsItem::ItemTransformChange, ItemPositionHasChanged = QGraphicsItem::ItemPositionHasChanged, ItemTransformHasChanged = QGraphicsItem::ItemTransformHasChanged, ItemSceneChange = QGraphicsItem::ItemSceneChange, ItemVisibleHasChanged = QGraphicsItem::ItemVisibleHasChanged, ItemEnabledHasChanged = QGraphicsItem::ItemEnabledHasChanged, ItemSelectedHasChanged = QGraphicsItem::ItemSelectedHasChanged, ItemParentHasChanged = QGraphicsItem::ItemParentHasChanged, ItemSceneHasChanged = QGraphicsItem::ItemSceneHasChanged, ItemCursorChange = QGraphicsItem::ItemCursorChange, ItemCursorHasChanged = QGraphicsItem::ItemCursorHasChanged, ItemToolTipChange = QGraphicsItem::ItemToolTipChange, ItemToolTipHasChanged = QGraphicsItem::ItemToolTipHasChanged, ItemFlagsChange = QGraphicsItem::ItemFlagsChange, ItemFlagsHaveChanged = QGraphicsItem::ItemFlagsHaveChanged, ItemZValueChange = QGraphicsItem::ItemZValueChange, ItemZValueHasChanged = QGraphicsItem::ItemZValueHasChanged};
|
|
|
public slots:
|
|
|
bool hasOwner(QGraphicsItem* theWrappedObject) { return theWrappedObject->scene()!=NULL || theWrappedObject->parentItem()!=NULL; }
|
|
|
|
|
|
void delete_QGraphicsItem(QGraphicsItem* obj) { delete obj; }
|
|
|
bool acceptDrops(QGraphicsItem* theWrappedObject) const;
|
|
|
bool acceptHoverEvents(QGraphicsItem* theWrappedObject) const;
|
|
|
Qt::MouseButtons acceptedMouseButtons(QGraphicsItem* theWrappedObject) const;
|
|
|
bool acceptsHoverEvents(QGraphicsItem* theWrappedObject) const;
|
|
|
void advance(QGraphicsItem* theWrappedObject, int phase);
|
|
|
QRectF boundingRect(QGraphicsItem* theWrappedObject) const;
|
|
|
QRegion boundingRegion(QGraphicsItem* theWrappedObject, const QTransform& itemToDeviceTransform) const;
|
|
|
qreal boundingRegionGranularity(QGraphicsItem* theWrappedObject) const;
|
|
|
QGraphicsItem::CacheMode cacheMode(QGraphicsItem* theWrappedObject) const;
|
|
|
QList<QGraphicsItem* > childItems(QGraphicsItem* theWrappedObject) const;
|
|
|
QRectF childrenBoundingRect(QGraphicsItem* theWrappedObject) const;
|
|
|
void clearFocus(QGraphicsItem* theWrappedObject);
|
|
|
bool collidesWithItem(QGraphicsItem* theWrappedObject, const QGraphicsItem* other, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const;
|
|
|
bool collidesWithPath(QGraphicsItem* theWrappedObject, const QPainterPath& path, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const;
|
|
|
QList<QGraphicsItem* > collidingItems(QGraphicsItem* theWrappedObject, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const;
|
|
|
QGraphicsItem* commonAncestorItem(QGraphicsItem* theWrappedObject, const QGraphicsItem* other) const;
|
|
|
bool contains(QGraphicsItem* theWrappedObject, const QPointF& point) const;
|
|
|
QCursor cursor(QGraphicsItem* theWrappedObject) const;
|
|
|
QVariant data(QGraphicsItem* theWrappedObject, int key) const;
|
|
|
QTransform deviceTransform(QGraphicsItem* theWrappedObject, const QTransform& viewportTransform) const;
|
|
|
void ensureVisible(QGraphicsItem* theWrappedObject, const QRectF& rect = QRectF(), int xmargin = 50, int ymargin = 50);
|
|
|
void ensureVisible(QGraphicsItem* theWrappedObject, qreal x, qreal y, qreal w, qreal h, int xmargin = 50, int ymargin = 50);
|
|
|
QGraphicsItem::GraphicsItemFlags flags(QGraphicsItem* theWrappedObject) const;
|
|
|
void grabKeyboard(QGraphicsItem* theWrappedObject);
|
|
|
void grabMouse(QGraphicsItem* theWrappedObject);
|
|
|
QGraphicsItemGroup* group(QGraphicsItem* theWrappedObject) const;
|
|
|
bool handlesChildEvents(QGraphicsItem* theWrappedObject) const;
|
|
|
bool hasCursor(QGraphicsItem* theWrappedObject) const;
|
|
|
bool hasFocus(QGraphicsItem* theWrappedObject) const;
|
|
|
void hide(QGraphicsItem* theWrappedObject);
|
|
|
void installSceneEventFilter(QGraphicsItem* theWrappedObject, QGraphicsItem* filterItem);
|
|
|
bool isAncestorOf(QGraphicsItem* theWrappedObject, const QGraphicsItem* child) const;
|
|
|
bool isEnabled(QGraphicsItem* theWrappedObject) const;
|
|
|
bool isObscured(QGraphicsItem* theWrappedObject) const;
|
|
|
bool isObscured(QGraphicsItem* theWrappedObject, const QRectF& rect) const;
|
|
|
bool isObscured(QGraphicsItem* theWrappedObject, qreal x, qreal y, qreal w, qreal h) const;
|
|
|
bool isObscuredBy(QGraphicsItem* theWrappedObject, const QGraphicsItem* item) const;
|
|
|
bool isSelected(QGraphicsItem* theWrappedObject) const;
|
|
|
bool isUnderMouse(QGraphicsItem* theWrappedObject) const;
|
|
|
bool isVisible(QGraphicsItem* theWrappedObject) const;
|
|
|
bool isVisibleTo(QGraphicsItem* theWrappedObject, const QGraphicsItem* parent) const;
|
|
|
bool isWidget(QGraphicsItem* theWrappedObject) const;
|
|
|
bool isWindow(QGraphicsItem* theWrappedObject) const;
|
|
|
QPainterPath mapFromItem(QGraphicsItem* theWrappedObject, const QGraphicsItem* item, const QPainterPath& path) const;
|
|
|
QPointF mapFromItem(QGraphicsItem* theWrappedObject, const QGraphicsItem* item, const QPointF& point) const;
|
|
|
QPolygonF mapFromItem(QGraphicsItem* theWrappedObject, const QGraphicsItem* item, const QPolygonF& polygon) const;
|
|
|
QPolygonF mapFromItem(QGraphicsItem* theWrappedObject, const QGraphicsItem* item, const QRectF& rect) const;
|
|
|
QPointF mapFromItem(QGraphicsItem* theWrappedObject, const QGraphicsItem* item, qreal x, qreal y) const;
|
|
|
QPolygonF mapFromItem(QGraphicsItem* theWrappedObject, const QGraphicsItem* item, qreal x, qreal y, qreal w, qreal h) const;
|
|
|
QPainterPath mapFromParent(QGraphicsItem* theWrappedObject, const QPainterPath& path) const;
|
|
|
QPointF mapFromParent(QGraphicsItem* theWrappedObject, const QPointF& point) const;
|
|
|
QPolygonF mapFromParent(QGraphicsItem* theWrappedObject, const QPolygonF& polygon) const;
|
|
|
QPolygonF mapFromParent(QGraphicsItem* theWrappedObject, const QRectF& rect) const;
|
|
|
QPointF mapFromParent(QGraphicsItem* theWrappedObject, qreal x, qreal y) const;
|
|
|
QPolygonF mapFromParent(QGraphicsItem* theWrappedObject, qreal x, qreal y, qreal w, qreal h) const;
|
|
|
QPainterPath mapFromScene(QGraphicsItem* theWrappedObject, const QPainterPath& path) const;
|
|
|
QPointF mapFromScene(QGraphicsItem* theWrappedObject, const QPointF& point) const;
|
|
|
QPolygonF mapFromScene(QGraphicsItem* theWrappedObject, const QPolygonF& polygon) const;
|
|
|
QPolygonF mapFromScene(QGraphicsItem* theWrappedObject, const QRectF& rect) const;
|
|
|
QPointF mapFromScene(QGraphicsItem* theWrappedObject, qreal x, qreal y) const;
|
|
|
QPolygonF mapFromScene(QGraphicsItem* theWrappedObject, qreal x, qreal y, qreal w, qreal h) const;
|
|
|
QPainterPath mapToItem(QGraphicsItem* theWrappedObject, const QGraphicsItem* item, const QPainterPath& path) const;
|
|
|
QPointF mapToItem(QGraphicsItem* theWrappedObject, const QGraphicsItem* item, const QPointF& point) const;
|
|
|
QPolygonF mapToItem(QGraphicsItem* theWrappedObject, const QGraphicsItem* item, const QPolygonF& polygon) const;
|
|
|
QPolygonF mapToItem(QGraphicsItem* theWrappedObject, const QGraphicsItem* item, const QRectF& rect) const;
|
|
|
QPointF mapToItem(QGraphicsItem* theWrappedObject, const QGraphicsItem* item, qreal x, qreal y) const;
|
|
|
QPolygonF mapToItem(QGraphicsItem* theWrappedObject, const QGraphicsItem* item, qreal x, qreal y, qreal w, qreal h) const;
|
|
|
QPainterPath mapToParent(QGraphicsItem* theWrappedObject, const QPainterPath& path) const;
|
|
|
QPointF mapToParent(QGraphicsItem* theWrappedObject, const QPointF& point) const;
|
|
|
QPolygonF mapToParent(QGraphicsItem* theWrappedObject, const QPolygonF& polygon) const;
|
|
|
QPolygonF mapToParent(QGraphicsItem* theWrappedObject, const QRectF& rect) const;
|
|
|
QPointF mapToParent(QGraphicsItem* theWrappedObject, qreal x, qreal y) const;
|
|
|
QPolygonF mapToParent(QGraphicsItem* theWrappedObject, qreal x, qreal y, qreal w, qreal h) const;
|
|
|
QPainterPath mapToScene(QGraphicsItem* theWrappedObject, const QPainterPath& path) const;
|
|
|
QPointF mapToScene(QGraphicsItem* theWrappedObject, const QPointF& point) const;
|
|
|
QPolygonF mapToScene(QGraphicsItem* theWrappedObject, const QPolygonF& polygon) const;
|
|
|
QPolygonF mapToScene(QGraphicsItem* theWrappedObject, const QRectF& rect) const;
|
|
|
QPointF mapToScene(QGraphicsItem* theWrappedObject, qreal x, qreal y) const;
|
|
|
QPolygonF mapToScene(QGraphicsItem* theWrappedObject, qreal x, qreal y, qreal w, qreal h) const;
|
|
|
void moveBy(QGraphicsItem* theWrappedObject, qreal dx, qreal dy);
|
|
|
QPainterPath opaqueArea(QGraphicsItem* theWrappedObject) const;
|
|
|
void paint(QGraphicsItem* theWrappedObject, QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
|
|
|
QGraphicsItem* parentItem(QGraphicsItem* theWrappedObject) const;
|
|
|
QGraphicsWidget* parentWidget(QGraphicsItem* theWrappedObject) const;
|
|
|
QPointF pos(QGraphicsItem* theWrappedObject) const;
|
|
|
void removeSceneEventFilter(QGraphicsItem* theWrappedObject, QGraphicsItem* filterItem);
|
|
|
void resetTransform(QGraphicsItem* theWrappedObject);
|
|
|
void rotate(QGraphicsItem* theWrappedObject, qreal angle);
|
|
|
void scale(QGraphicsItem* theWrappedObject, qreal sx, qreal sy);
|
|
|
QGraphicsScene* scene(QGraphicsItem* theWrappedObject) const;
|
|
|
QRectF sceneBoundingRect(QGraphicsItem* theWrappedObject) const;
|
|
|
QPointF scenePos(QGraphicsItem* theWrappedObject) const;
|
|
|
QTransform sceneTransform(QGraphicsItem* theWrappedObject) const;
|
|
|
void scroll(QGraphicsItem* theWrappedObject, qreal dx, qreal dy, const QRectF& rect = QRectF());
|
|
|
void setAcceptDrops(QGraphicsItem* theWrappedObject, bool on);
|
|
|
void setAcceptHoverEvents(QGraphicsItem* theWrappedObject, bool enabled);
|
|
|
void setAcceptedMouseButtons(QGraphicsItem* theWrappedObject, Qt::MouseButtons buttons);
|
|
|
void setAcceptsHoverEvents(QGraphicsItem* theWrappedObject, bool enabled);
|
|
|
void setBoundingRegionGranularity(QGraphicsItem* theWrappedObject, qreal granularity);
|
|
|
void setCacheMode(QGraphicsItem* theWrappedObject, QGraphicsItem::CacheMode mode, const QSize& cacheSize = QSize());
|
|
|
void setCursor(QGraphicsItem* theWrappedObject, const QCursor& cursor);
|
|
|
void setData(QGraphicsItem* theWrappedObject, int key, const QVariant& value);
|
|
|
void setEnabled(QGraphicsItem* theWrappedObject, bool enabled);
|
|
|
void setFlag(QGraphicsItem* theWrappedObject, QGraphicsItem::GraphicsItemFlag flag, bool enabled = true);
|
|
|
void setFlags(QGraphicsItem* theWrappedObject, QGraphicsItem::GraphicsItemFlags flags);
|
|
|
void setFocus(QGraphicsItem* theWrappedObject, Qt::FocusReason focusReason = Qt::OtherFocusReason);
|
|
|
void setGroup(QGraphicsItem* theWrappedObject, QGraphicsItemGroup* group);
|
|
|
void setHandlesChildEvents(QGraphicsItem* theWrappedObject, bool enabled);
|
|
|
void setParentItem(QGraphicsItem* theWrappedObject, QGraphicsItem* parent);
|
|
|
void setPos(QGraphicsItem* theWrappedObject, const QPointF& pos);
|
|
|
void setPos(QGraphicsItem* theWrappedObject, qreal x, qreal y);
|
|
|
void setSelected(QGraphicsItem* theWrappedObject, bool selected);
|
|
|
void setToolTip(QGraphicsItem* theWrappedObject, const QString& toolTip);
|
|
|
void setTransform(QGraphicsItem* theWrappedObject, const QTransform& matrix, bool combine = false);
|
|
|
void setVisible(QGraphicsItem* theWrappedObject, bool visible);
|
|
|
void setZValue(QGraphicsItem* theWrappedObject, qreal z);
|
|
|
QPainterPath shape(QGraphicsItem* theWrappedObject) const;
|
|
|
void shear(QGraphicsItem* theWrappedObject, qreal sh, qreal sv);
|
|
|
void show(QGraphicsItem* theWrappedObject);
|
|
|
QString toolTip(QGraphicsItem* theWrappedObject) const;
|
|
|
QGraphicsItem* topLevelItem(QGraphicsItem* theWrappedObject) const;
|
|
|
QGraphicsWidget* topLevelWidget(QGraphicsItem* theWrappedObject) const;
|
|
|
QTransform transform(QGraphicsItem* theWrappedObject) const;
|
|
|
void translate(QGraphicsItem* theWrappedObject, qreal dx, qreal dy);
|
|
|
int type(QGraphicsItem* theWrappedObject) const;
|
|
|
void ungrabKeyboard(QGraphicsItem* theWrappedObject);
|
|
|
void ungrabMouse(QGraphicsItem* theWrappedObject);
|
|
|
void unsetCursor(QGraphicsItem* theWrappedObject);
|
|
|
void update(QGraphicsItem* theWrappedObject, const QRectF& rect = QRectF());
|
|
|
void update(QGraphicsItem* theWrappedObject, qreal x, qreal y, qreal width, qreal height);
|
|
|
QGraphicsWidget* window(QGraphicsItem* theWrappedObject) const;
|
|
|
qreal x(QGraphicsItem* theWrappedObject) const;
|
|
|
qreal y(QGraphicsItem* theWrappedObject) const;
|
|
|
qreal zValue(QGraphicsItem* theWrappedObject) const;
|
|
|
};
|
|
|
|
|
|
#endif // PYTHONQTWRAPPER_QGRAPHICSITEM_H
|
|
|
|