PythonQtWrapper_QGraphicsScene.h
199 lines
| 14.2 KiB
| text/x-c
|
CLexer
florianlink
|
r13 | #ifndef PYTHONQTWRAPPER_QGRAPHICSSCENE_H | ||
#define PYTHONQTWRAPPER_QGRAPHICSSCENE_H | ||||
#include <qgraphicsscene.h> | ||||
#include <QObject> | ||||
florianlink
|
r24 | #include <PythonQt.h> | ||
florianlink
|
r13 | #include <QVarLengthArray> | ||
#include <QVariant> | ||||
#include <qbrush.h> | ||||
#include <qbytearray.h> | ||||
#include <qcoreevent.h> | ||||
#include <qevent.h> | ||||
#include <qfont.h> | ||||
#include <qgraphicsitem.h> | ||||
#include <qgraphicsproxywidget.h> | ||||
#include <qgraphicsscene.h> | ||||
#include <qgraphicssceneevent.h> | ||||
#include <qgraphicsview.h> | ||||
#include <qgraphicswidget.h> | ||||
#include <qline.h> | ||||
#include <qlist.h> | ||||
#include <qobject.h> | ||||
#include <qpainter.h> | ||||
#include <qpainterpath.h> | ||||
#include <qpalette.h> | ||||
#include <qpen.h> | ||||
#include <qpixmap.h> | ||||
#include <qpoint.h> | ||||
#include <qpolygon.h> | ||||
#include <qrect.h> | ||||
#include <qstyle.h> | ||||
#include <qstyleoption.h> | ||||
#include <qwidget.h> | ||||
florianlink
|
r24 | 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: | ||||
florianlink
|
r28 | inline void promoted_dragMoveEvent(QGraphicsSceneDragDropEvent* event) { QGraphicsScene::dragMoveEvent(event); } | ||
florianlink
|
r73 | inline void promoted_focusOutEvent(QFocusEvent* event) { QGraphicsScene::focusOutEvent(event); } | ||
inline void promoted_dragLeaveEvent(QGraphicsSceneDragDropEvent* event) { QGraphicsScene::dragLeaveEvent(event); } | ||||
florianlink
|
r28 | inline void promoted_keyReleaseEvent(QKeyEvent* event) { QGraphicsScene::keyReleaseEvent(event); } | ||
florianlink
|
r73 | inline void promoted_dropEvent(QGraphicsSceneDragDropEvent* event) { QGraphicsScene::dropEvent(event); } | ||
florianlink
|
r28 | inline void promoted_mousePressEvent(QGraphicsSceneMouseEvent* event) { QGraphicsScene::mousePressEvent(event); } | ||
florianlink
|
r73 | inline bool promoted_event(QEvent* event) { return QGraphicsScene::event(event); } | ||
inline void promoted_dragEnterEvent(QGraphicsSceneDragDropEvent* event) { QGraphicsScene::dragEnterEvent(event); } | ||||
florianlink
|
r28 | inline bool promoted_eventFilter(QObject* watched, QEvent* event) { return QGraphicsScene::eventFilter(watched, event); } | ||
florianlink
|
r73 | inline void promoted_mouseMoveEvent(QGraphicsSceneMouseEvent* event) { QGraphicsScene::mouseMoveEvent(event); } | ||
florianlink
|
r28 | inline void promoted_inputMethodEvent(QInputMethodEvent* event) { QGraphicsScene::inputMethodEvent(event); } | ||
florianlink
|
r73 | 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); } | ||||
florianlink
|
r28 | 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); } | ||||
florianlink
|
r73 | 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); } | ||||
florianlink
|
r24 | }; | ||
florianlink
|
r13 | class PythonQtWrapper_QGraphicsScene : public QObject | ||
{ Q_OBJECT | ||||
public: | ||||
Q_ENUMS(SceneLayer ItemIndexMethod ) | ||||
florianlink
|
r73 | Q_FLAGS(SceneLayers ) | ||
florianlink
|
r13 | enum SceneLayer{ | ||
ItemLayer = QGraphicsScene::ItemLayer, BackgroundLayer = QGraphicsScene::BackgroundLayer, ForegroundLayer = QGraphicsScene::ForegroundLayer, AllLayers = QGraphicsScene::AllLayers}; | ||||
enum ItemIndexMethod{ | ||||
BspTreeIndex = QGraphicsScene::BspTreeIndex, NoIndex = QGraphicsScene::NoIndex}; | ||||
florianlink
|
r73 | Q_DECLARE_FLAGS(SceneLayers, SceneLayer) | ||
florianlink
|
r13 | 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; } | ||||
florianlink
|
r73 | QRectF sceneRect(QGraphicsScene* theWrappedObject) const; | ||
QPalette palette(QGraphicsScene* theWrappedObject) const; | ||||
QGraphicsProxyWidget* addWidget(QGraphicsScene* theWrappedObject, QWidget* widget, Qt::WindowFlags wFlags = 0); | ||||
florianlink
|
r28 | void dragMoveEvent(QGraphicsScene* theWrappedObject, QGraphicsSceneDragDropEvent* event); | ||
florianlink
|
r73 | void focusOutEvent(QGraphicsScene* theWrappedObject, QFocusEvent* event); | ||
florianlink
|
r28 | void render(QGraphicsScene* theWrappedObject, QPainter* painter, const QRectF& target = QRectF(), const QRectF& source = QRectF(), Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio); | ||
florianlink
|
r73 | QList<QGraphicsItem* > selectedItems(QGraphicsScene* theWrappedObject) const; | ||
florianlink
|
r28 | qreal width(QGraphicsScene* theWrappedObject) const; | ||
void update(QGraphicsScene* theWrappedObject, qreal x, qreal y, qreal w, qreal h); | ||||
florianlink
|
r73 | 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); | ||||
florianlink
|
r28 | int bspTreeDepth(QGraphicsScene* theWrappedObject) const; | ||
florianlink
|
r73 | 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<QGraphicsItem* > 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); | ||||
florianlink
|
r28 | void dragEnterEvent(QGraphicsScene* theWrappedObject, QGraphicsSceneDragDropEvent* event); | ||
florianlink
|
r73 | QGraphicsItemGroup* createItemGroup(QGraphicsScene* theWrappedObject, const QList<QGraphicsItem* >& items); | ||
florianlink
|
r24 | QGraphicsEllipseItem* addEllipse(QGraphicsScene* theWrappedObject, const QRectF& rect, const QPen& pen = QPen(), const QBrush& brush = QBrush()); | ||
florianlink
|
r73 | 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<QGraphicsItem* > 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; | ||||
florianlink
|
r28 | QRectF itemsBoundingRect(QGraphicsScene* theWrappedObject) const; | ||
florianlink
|
r73 | QList<QGraphicsView* > 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<QGraphicsItem* > 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); | ||||
florianlink
|
r24 | QGraphicsLineItem* addLine(QGraphicsScene* theWrappedObject, const QLineF& line, const QPen& pen = QPen()); | ||
florianlink
|
r73 | void keyPressEvent(QGraphicsScene* theWrappedObject, QKeyEvent* event); | ||
void drawForeground(QGraphicsScene* theWrappedObject, QPainter* painter, const QRectF& rect); | ||||
QStyle* style(QGraphicsScene* theWrappedObject) const; | ||||
florianlink
|
r28 | qreal height(QGraphicsScene* theWrappedObject) const; | ||
void wheelEvent(QGraphicsScene* theWrappedObject, QGraphicsSceneWheelEvent* event); | ||||
florianlink
|
r73 | 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()); | ||||
florianlink
|
r28 | QGraphicsWidget* activeWindow(QGraphicsScene* theWrappedObject) const; | ||
florianlink
|
r73 | QList<QGraphicsItem* > collidingItems(QGraphicsScene* theWrappedObject, const QGraphicsItem* item, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const; | ||
florianlink
|
r28 | void addItem(QGraphicsScene* theWrappedObject, QGraphicsItem* item); | ||
void setPalette(QGraphicsScene* theWrappedObject, const QPalette& palette); | ||||
florianlink
|
r73 | QList<QGraphicsItem* > 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); | ||||
florianlink
|
r28 | QList<QGraphicsItem* > items(QGraphicsScene* theWrappedObject, const QPointF& pos) const; | ||
florianlink
|
r73 | 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<QGraphicsItem* > items(QGraphicsScene* theWrappedObject, const QPainterPath& path, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const; | ||||
void mouseDoubleClickEvent(QGraphicsScene* theWrappedObject, QGraphicsSceneMouseEvent* event); | ||||
florianlink
|
r13 | }; | ||
#endif // PYTHONQTWRAPPER_QGRAPHICSSCENE_H | ||||