#ifndef PYTHONQTWRAPPER_QGRAPHICSSCENE_H #define PYTHONQTWRAPPER_QGRAPHICSSCENE_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include class PythonQtShell_QGraphicsScene : public QGraphicsScene { public: PythonQtShell_QGraphicsScene(QObject* parent = 0):QGraphicsScene(parent),_wrapper(NULL) {}; PythonQtShell_QGraphicsScene(const QRectF& sceneRect, QObject* parent = 0):QGraphicsScene(sceneRect, parent),_wrapper(NULL) {}; PythonQtShell_QGraphicsScene(qreal x, qreal y, qreal width, qreal height, QObject* parent = 0):QGraphicsScene(x, y, width, height, parent),_wrapper(NULL) {}; virtual void childEvent(QChildEvent* arg__1); virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent* event); virtual void customEvent(QEvent* arg__1); virtual void dragEnterEvent(QGraphicsSceneDragDropEvent* event); virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent* event); virtual void dragMoveEvent(QGraphicsSceneDragDropEvent* event); virtual void drawBackground(QPainter* painter, const QRectF& rect); virtual void drawForeground(QPainter* painter, const QRectF& rect); virtual void drawItems(QPainter* painter, int numItems, QGraphicsItem** items, const QStyleOptionGraphicsItem* options, QWidget* widget = 0); virtual void dropEvent(QGraphicsSceneDragDropEvent* event); virtual bool event(QEvent* event); virtual bool eventFilter(QObject* watched, QEvent* event); virtual void focusInEvent(QFocusEvent* event); virtual void focusOutEvent(QFocusEvent* event); virtual void helpEvent(QGraphicsSceneHelpEvent* event); virtual void inputMethodEvent(QInputMethodEvent* event); virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const; virtual void keyPressEvent(QKeyEvent* event); virtual void keyReleaseEvent(QKeyEvent* event); virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event); virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* event); virtual void mousePressEvent(QGraphicsSceneMouseEvent* event); virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* event); virtual void timerEvent(QTimerEvent* arg__1); virtual void wheelEvent(QGraphicsSceneWheelEvent* event); PythonQtInstanceWrapper* _wrapper; }; class PythonQtPublicPromoter_QGraphicsScene : public QGraphicsScene { public: inline void promoted_dragMoveEvent(QGraphicsSceneDragDropEvent* event) { QGraphicsScene::dragMoveEvent(event); } inline void promoted_focusOutEvent(QFocusEvent* event) { QGraphicsScene::focusOutEvent(event); } inline void promoted_dragLeaveEvent(QGraphicsSceneDragDropEvent* event) { QGraphicsScene::dragLeaveEvent(event); } inline void promoted_keyReleaseEvent(QKeyEvent* event) { QGraphicsScene::keyReleaseEvent(event); } inline void promoted_dropEvent(QGraphicsSceneDragDropEvent* event) { QGraphicsScene::dropEvent(event); } inline void promoted_mousePressEvent(QGraphicsSceneMouseEvent* event) { QGraphicsScene::mousePressEvent(event); } inline bool promoted_event(QEvent* event) { return QGraphicsScene::event(event); } inline void promoted_dragEnterEvent(QGraphicsSceneDragDropEvent* event) { QGraphicsScene::dragEnterEvent(event); } inline bool promoted_eventFilter(QObject* watched, QEvent* event) { return QGraphicsScene::eventFilter(watched, event); } inline void promoted_mouseMoveEvent(QGraphicsSceneMouseEvent* event) { QGraphicsScene::mouseMoveEvent(event); } inline void promoted_inputMethodEvent(QInputMethodEvent* event) { QGraphicsScene::inputMethodEvent(event); } inline QVariant promoted_inputMethodQuery(Qt::InputMethodQuery query) const { return QGraphicsScene::inputMethodQuery(query); } inline void promoted_drawItems(QPainter* painter, int numItems, QGraphicsItem** items, const QStyleOptionGraphicsItem* options, QWidget* widget = 0) { QGraphicsScene::drawItems(painter, numItems, items, options, widget); } inline void promoted_contextMenuEvent(QGraphicsSceneContextMenuEvent* event) { QGraphicsScene::contextMenuEvent(event); } inline void promoted_keyPressEvent(QKeyEvent* event) { QGraphicsScene::keyPressEvent(event); } inline void promoted_drawForeground(QPainter* painter, const QRectF& rect) { QGraphicsScene::drawForeground(painter, rect); } inline void promoted_wheelEvent(QGraphicsSceneWheelEvent* event) { QGraphicsScene::wheelEvent(event); } inline void promoted_helpEvent(QGraphicsSceneHelpEvent* event) { QGraphicsScene::helpEvent(event); } inline void promoted_mouseReleaseEvent(QGraphicsSceneMouseEvent* event) { QGraphicsScene::mouseReleaseEvent(event); } inline void promoted_drawBackground(QPainter* painter, const QRectF& rect) { QGraphicsScene::drawBackground(painter, rect); } inline void promoted_focusInEvent(QFocusEvent* event) { QGraphicsScene::focusInEvent(event); } inline void promoted_mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) { QGraphicsScene::mouseDoubleClickEvent(event); } }; class PythonQtWrapper_QGraphicsScene : public QObject { Q_OBJECT public: Q_ENUMS(SceneLayer ItemIndexMethod ) Q_FLAGS(SceneLayers ) enum SceneLayer{ ItemLayer = QGraphicsScene::ItemLayer, BackgroundLayer = QGraphicsScene::BackgroundLayer, ForegroundLayer = QGraphicsScene::ForegroundLayer, AllLayers = QGraphicsScene::AllLayers}; enum ItemIndexMethod{ BspTreeIndex = QGraphicsScene::BspTreeIndex, NoIndex = QGraphicsScene::NoIndex}; Q_DECLARE_FLAGS(SceneLayers, SceneLayer) public slots: QGraphicsScene* new_QGraphicsScene(QObject* parent = 0); QGraphicsScene* new_QGraphicsScene(const QRectF& sceneRect, QObject* parent = 0); QGraphicsScene* new_QGraphicsScene(qreal x, qreal y, qreal width, qreal height, QObject* parent = 0); void delete_QGraphicsScene(QGraphicsScene* obj) { delete obj; } QRectF sceneRect(QGraphicsScene* theWrappedObject) const; QPalette palette(QGraphicsScene* theWrappedObject) const; QGraphicsProxyWidget* addWidget(QGraphicsScene* theWrappedObject, QWidget* widget, Qt::WindowFlags wFlags = 0); void dragMoveEvent(QGraphicsScene* theWrappedObject, QGraphicsSceneDragDropEvent* event); void focusOutEvent(QGraphicsScene* theWrappedObject, QFocusEvent* event); void render(QGraphicsScene* theWrappedObject, QPainter* painter, const QRectF& target = QRectF(), const QRectF& source = QRectF(), Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio); QList selectedItems(QGraphicsScene* theWrappedObject) const; qreal width(QGraphicsScene* theWrappedObject) const; void update(QGraphicsScene* theWrappedObject, qreal x, qreal y, qreal w, qreal h); void dragLeaveEvent(QGraphicsScene* theWrappedObject, QGraphicsSceneDragDropEvent* event); QFont font(QGraphicsScene* theWrappedObject) const; void setSelectionArea(QGraphicsScene* theWrappedObject, const QPainterPath& path); void setFont(QGraphicsScene* theWrappedObject, const QFont& font); void setItemIndexMethod(QGraphicsScene* theWrappedObject, QGraphicsScene::ItemIndexMethod method); int bspTreeDepth(QGraphicsScene* theWrappedObject) const; QGraphicsEllipseItem* addEllipse(QGraphicsScene* theWrappedObject, qreal x, qreal y, qreal w, qreal h, const QPen& pen = QPen(), const QBrush& brush = QBrush()); void keyReleaseEvent(QGraphicsScene* theWrappedObject, QKeyEvent* event); void dropEvent(QGraphicsScene* theWrappedObject, QGraphicsSceneDragDropEvent* event); QGraphicsRectItem* addRect(QGraphicsScene* theWrappedObject, qreal x, qreal y, qreal w, qreal h, const QPen& pen = QPen(), const QBrush& brush = QBrush()); void setActiveWindow(QGraphicsScene* theWrappedObject, QGraphicsWidget* widget); void mousePressEvent(QGraphicsScene* theWrappedObject, QGraphicsSceneMouseEvent* event); QList items(QGraphicsScene* theWrappedObject, qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const; QGraphicsItem* focusItem(QGraphicsScene* theWrappedObject) const; bool hasFocus(QGraphicsScene* theWrappedObject) const; bool event(QGraphicsScene* theWrappedObject, QEvent* event); void invalidate(QGraphicsScene* theWrappedObject, qreal x, qreal y, qreal w, qreal h, QGraphicsScene::SceneLayers layers = QGraphicsScene::AllLayers); void dragEnterEvent(QGraphicsScene* theWrappedObject, QGraphicsSceneDragDropEvent* event); QGraphicsItemGroup* createItemGroup(QGraphicsScene* theWrappedObject, const QList& items); QGraphicsEllipseItem* addEllipse(QGraphicsScene* theWrappedObject, const QRectF& rect, const QPen& pen = QPen(), const QBrush& brush = QBrush()); QGraphicsPathItem* addPath(QGraphicsScene* theWrappedObject, const QPainterPath& path, const QPen& pen = QPen(), const QBrush& brush = QBrush()); QGraphicsLineItem* addLine(QGraphicsScene* theWrappedObject, qreal x1, qreal y1, qreal x2, qreal y2, const QPen& pen = QPen()); QGraphicsScene::ItemIndexMethod itemIndexMethod(QGraphicsScene* theWrappedObject) const; void setSceneRect(QGraphicsScene* theWrappedObject, qreal x, qreal y, qreal w, qreal h); bool eventFilter(QGraphicsScene* theWrappedObject, QObject* watched, QEvent* event); void mouseMoveEvent(QGraphicsScene* theWrappedObject, QGraphicsSceneMouseEvent* event); void inputMethodEvent(QGraphicsScene* theWrappedObject, QInputMethodEvent* event); void setBspTreeDepth(QGraphicsScene* theWrappedObject, int depth); QGraphicsItem* mouseGrabberItem(QGraphicsScene* theWrappedObject) const; void destroyItemGroup(QGraphicsScene* theWrappedObject, QGraphicsItemGroup* group); QBrush backgroundBrush(QGraphicsScene* theWrappedObject) const; QList items(QGraphicsScene* theWrappedObject, const QRectF& rect, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const; void setBackgroundBrush(QGraphicsScene* theWrappedObject, const QBrush& brush); void setForegroundBrush(QGraphicsScene* theWrappedObject, const QBrush& brush); QGraphicsItem* itemAt(QGraphicsScene* theWrappedObject, qreal x, qreal y) const; void removeItem(QGraphicsScene* theWrappedObject, QGraphicsItem* item); QVariant inputMethodQuery(QGraphicsScene* theWrappedObject, Qt::InputMethodQuery query) const; QRectF itemsBoundingRect(QGraphicsScene* theWrappedObject) const; QList views(QGraphicsScene* theWrappedObject) const; void drawItems(QGraphicsScene* theWrappedObject, QPainter* painter, int numItems, QGraphicsItem** items, const QStyleOptionGraphicsItem* options, QWidget* widget = 0); void setSelectionArea(QGraphicsScene* theWrappedObject, const QPainterPath& path, Qt::ItemSelectionMode arg__2); void setFocus(QGraphicsScene* theWrappedObject, Qt::FocusReason focusReason = Qt::OtherFocusReason); void setSceneRect(QGraphicsScene* theWrappedObject, const QRectF& rect); QGraphicsPixmapItem* addPixmap(QGraphicsScene* theWrappedObject, const QPixmap& pixmap); QList items(QGraphicsScene* theWrappedObject, const QPolygonF& polygon, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const; QBrush foregroundBrush(QGraphicsScene* theWrappedObject) const; QGraphicsPolygonItem* addPolygon(QGraphicsScene* theWrappedObject, const QPolygonF& polygon, const QPen& pen = QPen(), const QBrush& brush = QBrush()); void contextMenuEvent(QGraphicsScene* theWrappedObject, QGraphicsSceneContextMenuEvent* event); void clearFocus(QGraphicsScene* theWrappedObject); QGraphicsLineItem* addLine(QGraphicsScene* theWrappedObject, const QLineF& line, const QPen& pen = QPen()); void keyPressEvent(QGraphicsScene* theWrappedObject, QKeyEvent* event); void drawForeground(QGraphicsScene* theWrappedObject, QPainter* painter, const QRectF& rect); QStyle* style(QGraphicsScene* theWrappedObject) const; qreal height(QGraphicsScene* theWrappedObject) const; void wheelEvent(QGraphicsScene* theWrappedObject, QGraphicsSceneWheelEvent* event); void helpEvent(QGraphicsScene* theWrappedObject, QGraphicsSceneHelpEvent* event); QGraphicsRectItem* addRect(QGraphicsScene* theWrappedObject, const QRectF& rect, const QPen& pen = QPen(), const QBrush& brush = QBrush()); void mouseReleaseEvent(QGraphicsScene* theWrappedObject, QGraphicsSceneMouseEvent* event); QGraphicsTextItem* addText(QGraphicsScene* theWrappedObject, const QString& text, const QFont& font = QFont()); QGraphicsWidget* activeWindow(QGraphicsScene* theWrappedObject) const; QList collidingItems(QGraphicsScene* theWrappedObject, const QGraphicsItem* item, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const; void addItem(QGraphicsScene* theWrappedObject, QGraphicsItem* item); void setPalette(QGraphicsScene* theWrappedObject, const QPalette& palette); QList items(QGraphicsScene* theWrappedObject) const; void drawBackground(QGraphicsScene* theWrappedObject, QPainter* painter, const QRectF& rect); QGraphicsItem* itemAt(QGraphicsScene* theWrappedObject, const QPointF& pos) const; void setStyle(QGraphicsScene* theWrappedObject, QStyle* style); QList items(QGraphicsScene* theWrappedObject, const QPointF& pos) const; void focusInEvent(QGraphicsScene* theWrappedObject, QFocusEvent* event); void setFocusItem(QGraphicsScene* theWrappedObject, QGraphicsItem* item, Qt::FocusReason focusReason = Qt::OtherFocusReason); QGraphicsSimpleTextItem* addSimpleText(QGraphicsScene* theWrappedObject, const QString& text, const QFont& font = QFont()); QPainterPath selectionArea(QGraphicsScene* theWrappedObject) const; QList items(QGraphicsScene* theWrappedObject, const QPainterPath& path, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const; void mouseDoubleClickEvent(QGraphicsScene* theWrappedObject, QGraphicsSceneMouseEvent* event); }; #endif // PYTHONQTWRAPPER_QGRAPHICSSCENE_H