Qt 4.8
Public Functions | Protected Functions | List of all members
QDeclarativeScene Class Reference
Inheritance diagram for QDeclarativeScene:
QGraphicsScene QObject

Public Functions

 QDeclarativeScene (QObject *parent=0)
 
- Public Functions inherited from QGraphicsScene
QGraphicsItemactivePanel () const
 Returns the current active panel, or 0 if no panel is currently active. More...
 
QGraphicsWidgetactiveWindow () const
 Returns the current active window, or 0 if no window is currently active. More...
 
QGraphicsEllipseItemaddEllipse (const QRectF &rect, const QPen &pen=QPen(), const QBrush &brush=QBrush())
 Creates and adds an ellipse item to the scene, and returns the item pointer. More...
 
QGraphicsEllipseItemaddEllipse (qreal x, qreal y, qreal w, qreal h, const QPen &pen=QPen(), const QBrush &brush=QBrush())
 
void addItem (QGraphicsItem *item)
 Adds or moves the item and all its childen to this scene. More...
 
QGraphicsLineItemaddLine (const QLineF &line, const QPen &pen=QPen())
 Creates and adds a line item to the scene, and returns the item pointer. More...
 
QGraphicsLineItemaddLine (qreal x1, qreal y1, qreal x2, qreal y2, const QPen &pen=QPen())
 
QGraphicsPathItemaddPath (const QPainterPath &path, const QPen &pen=QPen(), const QBrush &brush=QBrush())
 Creates and adds a path item to the scene, and returns the item pointer. More...
 
QGraphicsPixmapItemaddPixmap (const QPixmap &pixmap)
 Creates and adds a pixmap item to the scene, and returns the item pointer. More...
 
QGraphicsPolygonItemaddPolygon (const QPolygonF &polygon, const QPen &pen=QPen(), const QBrush &brush=QBrush())
 Creates and adds a polygon item to the scene, and returns the item pointer. More...
 
QGraphicsRectItemaddRect (const QRectF &rect, const QPen &pen=QPen(), const QBrush &brush=QBrush())
 Creates and adds a rectangle item to the scene, and returns the item pointer. More...
 
QGraphicsRectItemaddRect (qreal x, qreal y, qreal w, qreal h, const QPen &pen=QPen(), const QBrush &brush=QBrush())
 
QGraphicsSimpleTextItemaddSimpleText (const QString &text, const QFont &font=QFont())
 Creates and adds a QGraphicsSimpleTextItem to the scene, and returns the item pointer. More...
 
QGraphicsTextItemaddText (const QString &text, const QFont &font=QFont())
 Creates and adds a text item to the scene, and returns the item pointer. More...
 
QGraphicsProxyWidgetaddWidget (QWidget *widget, Qt::WindowFlags wFlags=0)
 Creates a new QGraphicsProxyWidget for widget, adds it to the scene, and returns a pointer to the proxy. More...
 
QBrush backgroundBrush () const
 
int bspTreeDepth () const
 
void clearFocus ()
 Clears focus from the scene. More...
 
QList< QGraphicsItem * > collidingItems (const QGraphicsItem *item, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
 Returns a list of all items that collide with item. More...
 
QGraphicsItemGroupcreateItemGroup (const QList< QGraphicsItem *> &items)
 Groups all items in items into a new QGraphicsItemGroup, and returns a pointer to the group. More...
 
void destroyItemGroup (QGraphicsItemGroup *group)
 Reparents all items in group to group's parent item, then removes group from the scene, and finally deletes it. More...
 
QGraphicsItemfocusItem () const
 When the scene is active, this functions returns the scene's current focus item, or 0 if no item currently has focus. More...
 
QFont font () const
 
QBrush foregroundBrush () const
 
bool hasFocus () const
 Returns true if the scene has focus; otherwise returns false. More...
 
qreal height () const
 This convenience function is equivalent to calling sceneRect(). More...
 
virtual QVariant inputMethodQuery (Qt::InputMethodQuery query) const
 This method is used by input methods to query a set of properties of the scene to be able to support complex input method operations as support for surrounding text and reconversions. More...
 
void invalidate (qreal x, qreal y, qreal w, qreal h, SceneLayers layers=AllLayers)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
bool isActive () const
 Returns true if the scene is active (e. More...
 
bool isSortCacheEnabled () const
 
QGraphicsItemitemAt (const QPointF &pos) const
 Returns the topmost visible item at the specified position, or 0 if there are no items at this position. More...
 
QGraphicsItemitemAt (const QPointF &pos, const QTransform &deviceTransform) const
 Returns the topmost visible item at the specified position, or 0 if there are no items at this position. More...
 
QGraphicsItemitemAt (qreal x, qreal y) const
 Returns the topmost item at the position specified by (x, y), or 0 if there are no items at this position. More...
 
QGraphicsItemitemAt (qreal x, qreal y, const QTransform &deviceTransform) const
 Returns the topmost item at the position specified by (x, y), or 0 if there are no items at this position. More...
 
ItemIndexMethod itemIndexMethod () const
 
QList< QGraphicsItem * > items () const
 Returns a list of all items in the scene in descending stacking order. More...
 
QList< QGraphicsItem * > items (Qt::SortOrder order) const
 Returns an ordered list of all items on the scene. More...
 
QList< QGraphicsItem * > items (const QPointF &pos, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform=QTransform()) const
 Returns all visible items that, depending on mode, are at the specified pos in a list sorted using order. More...
 
QList< QGraphicsItem * > items (const QRectF &rect, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform=QTransform()) const
 Returns all visible items that, depending on mode, are either inside or intersect with the specified rect and return a list sorted using order. More...
 
QList< QGraphicsItem * > items (const QPolygonF &polygon, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform=QTransform()) const
 Returns all visible items that, depending on mode, are either inside or intersect with the specified polygon and return a list sorted using order. More...
 
QList< QGraphicsItem * > items (const QPainterPath &path, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform=QTransform()) const
 Returns all visible items that, depending on mode, are either inside or intersect with the specified path and return a list sorted using order. More...
 
QList< QGraphicsItem * > items (const QPointF &pos) const
 Returns all visible items at position pos in the scene. More...
 
QList< QGraphicsItem * > items (const QRectF &rect, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
 Returns all visible items that, depending on mode, are either inside or intersect with the specified rectangle. More...
 
QList< QGraphicsItem * > items (const QPolygonF &polygon, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
QList< QGraphicsItem * > items (const QPainterPath &path, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
QList< QGraphicsItem * > items (qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
 
QList< QGraphicsItem * > items (qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform=QTransform()) const
 Returns all visible items that, depending on mode, are either inside or intersect with the rectangle defined by x, y,. More...
 
QRectF itemsBoundingRect () const
 Calculates and returns the bounding rect of all items on the scene. More...
 
QGraphicsItemmouseGrabberItem () const
 Returns the current mouse grabber item, or 0 if no item is currently grabbing the mouse. More...
 
QPalette palette () const
 
 QGraphicsScene (QObject *parent=0)
 Constructs a QGraphicsScene object. More...
 
 QGraphicsScene (const QRectF &sceneRect, QObject *parent=0)
 Constructs a QGraphicsScene object, using sceneRect for its scene rectangle. More...
 
 QGraphicsScene (qreal x, qreal y, qreal width, qreal height, QObject *parent=0)
 Constructs a QGraphicsScene object, using the rectangle specified by (x, y), and the given width and height for its scene rectangle. More...
 
void removeItem (QGraphicsItem *item)
 Removes the item item and all its children from the scene. More...
 
void render (QPainter *painter, const QRectF &target=QRectF(), const QRectF &source=QRectF(), Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio)
 Renders the source rect from scene into target, using painter. More...
 
QRectF sceneRect () const
 
QList< QGraphicsItem * > selectedItems () const
 Returns a list of all currently selected items. More...
 
QPainterPath selectionArea () const
 Returns the selection area that was previously set with setSelectionArea(), or an empty QPainterPath if no selection area has been set. More...
 
bool sendEvent (QGraphicsItem *item, QEvent *event)
 Sends event event to item item through possible event filters. More...
 
void setActivePanel (QGraphicsItem *item)
 Activates item, which must be an item in this scene. More...
 
void setActiveWindow (QGraphicsWidget *widget)
 Activates widget, which must be a widget in this scene. More...
 
void setBackgroundBrush (const QBrush &brush)
 
void setBspTreeDepth (int depth)
 
void setFocus (Qt::FocusReason focusReason=Qt::OtherFocusReason)
 Sets focus on the scene by sending a QFocusEvent to the scene, passing focusReason as the reason. More...
 
void setFocusItem (QGraphicsItem *item, Qt::FocusReason focusReason=Qt::OtherFocusReason)
 Sets the scene's focus item to item, with the focus reason focusReason, after removing focus from any previous item that may have had focus. More...
 
void setFont (const QFont &font)
 
void setForegroundBrush (const QBrush &brush)
 
void setItemIndexMethod (ItemIndexMethod method)
 
void setPalette (const QPalette &palette)
 
void setSceneRect (const QRectF &rect)
 
void setSceneRect (qreal x, qreal y, qreal w, qreal h)
 
void setSelectionArea (const QPainterPath &path)
 Sets the selection area to path. More...
 
void setSelectionArea (const QPainterPath &path, const QTransform &deviceTransform)
 Sets the selection area to path. More...
 
void setSelectionArea (const QPainterPath &path, Qt::ItemSelectionMode mode)
 Sets the selection area to path using mode to determine if items are included in the selection area. More...
 
void setSelectionArea (const QPainterPath &path, Qt::ItemSelectionMode mode, const QTransform &deviceTransform)
 Sets the selection area to path using mode to determine if items are included in the selection area. More...
 
void setSortCacheEnabled (bool enabled)
 
void setStickyFocus (bool enabled)
 
void setStyle (QStyle *style)
 Sets or replaces the style of the scene to style, and reparents the style to this scene. More...
 
bool stickyFocus () const
 
QStylestyle () const
 Returns the scene's style, or the same as QApplication::style() if the scene has not been explicitly assigned a style. More...
 
void update (qreal x, qreal y, qreal w, qreal h)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
QList< QGraphicsView * > views () const
 Returns a list of all the views that display this scene. More...
 
qreal width () const
 This convenience function is equivalent to calling sceneRect(). More...
 
virtual ~QGraphicsScene ()
 Removes and deletes all items from the scene object before destroying the scene object. More...
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 

Protected Functions

virtual void keyPressEvent (QKeyEvent *)
 This event handler, for event keyEvent, can be reimplemented in a subclass to receive keypress events. More...
 
virtual void keyReleaseEvent (QKeyEvent *)
 This event handler, for event keyEvent, can be reimplemented in a subclass to receive key release events. More...
 
virtual void mouseMoveEvent (QGraphicsSceneMouseEvent *)
 This event handler, for event mouseEvent, can be reimplemented in a subclass to receive mouse move events for the scene. More...
 
virtual void mousePressEvent (QGraphicsSceneMouseEvent *)
 This event handler, for event mouseEvent, can be reimplemented in a subclass to receive mouse press events for the scene. More...
 
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *)
 This event handler, for event mouseEvent, can be reimplemented in a subclass to receive mouse release events for the scene. More...
 
- Protected Functions inherited from QGraphicsScene
virtual void contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
 This event handler, for event contextMenuEvent, can be reimplemented in a subclass to receive context menu events. More...
 
virtual void dragEnterEvent (QGraphicsSceneDragDropEvent *event)
 This event handler, for event event, can be reimplemented in a subclass to receive drag enter events for the scene. More...
 
virtual void dragLeaveEvent (QGraphicsSceneDragDropEvent *event)
 This event handler, for event event, can be reimplemented in a subclass to receive drag leave events for the scene. More...
 
virtual void dragMoveEvent (QGraphicsSceneDragDropEvent *event)
 This event handler, for event event, can be reimplemented in a subclass to receive drag move events for the scene. More...
 
virtual void drawBackground (QPainter *painter, const QRectF &rect)
 Draws the background of the scene using painter, before any items and the foreground are drawn. More...
 
virtual void drawForeground (QPainter *painter, const QRectF &rect)
 Draws the foreground of the scene using painter, after the background and all items have been drawn. More...
 
virtual void drawItems (QPainter *painter, int numItems, QGraphicsItem *items[], const QStyleOptionGraphicsItem options[], QWidget *widget=0)
 Paints the given items using the provided painter, after the background has been drawn, and before the foreground has been drawn. More...
 
virtual void dropEvent (QGraphicsSceneDragDropEvent *event)
 This event handler, for event event, can be reimplemented in a subclass to receive drop events for the scene. More...
 
bool event (QEvent *event)
 Processes the event event, and dispatches it to the respective event handlers. More...
 
bool eventFilter (QObject *watched, QEvent *event)
 QGraphicsScene filters QApplication's events to detect palette and font changes. More...
 
virtual void focusInEvent (QFocusEvent *event)
 This event handler, for event focusEvent, can be reimplemented in a subclass to receive focus in events. More...
 
virtual void focusOutEvent (QFocusEvent *event)
 This event handler, for event focusEvent, can be reimplemented in a subclass to receive focus out events. More...
 
virtual void helpEvent (QGraphicsSceneHelpEvent *event)
 This event handler, for event helpEvent, can be reimplemented in a subclass to receive help events. More...
 
virtual void inputMethodEvent (QInputMethodEvent *event)
 This event handler, for event event, can be reimplemented in a subclass to receive input method events for the scene. More...
 
virtual void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event)
 This event handler, for event mouseEvent, can be reimplemented in a subclass to receive mouse doubleclick events for the scene. More...
 
virtual void wheelEvent (QGraphicsSceneWheelEvent *event)
 This event handler, for event wheelEvent, can be reimplemented in a subclass to receive mouse wheel events for the scene. More...
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 

Additional Inherited Members

- Public Types inherited from QGraphicsScene
enum  ItemIndexMethod { BspTreeIndex, NoIndex = -1 }
 This enum describes the indexing algorithms QGraphicsScene provides for managing positional information about items on the scene. More...
 
enum  SceneLayer { ItemLayer = 0x1, BackgroundLayer = 0x2, ForegroundLayer = 0x4, AllLayers = 0xffff }
 This enum describes the rendering layers in a QGraphicsScene. More...
 
- Public Slots inherited from QGraphicsScene
void advance ()
 This slot advances the scene by one step, by calling QGraphicsItem::advance() for all items on the scene. More...
 
void clear ()
 Removes and deletes all items from the scene, but otherwise leaves the state of the scene unchanged. More...
 
void clearSelection ()
 Clears the current selection. More...
 
void invalidate (const QRectF &rect=QRectF(), SceneLayers layers=AllLayers)
 Invalidates and schedules a redraw of the layers in rect on the scene. More...
 
void update (const QRectF &rect=QRectF())
 Schedules a redraw of the area rect on the scene. More...
 
- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Signals inherited from QGraphicsScene
void changed (const QList< QRectF > &region)
 This signal is emitted by QGraphicsScene when control reaches the event loop, if the scene content changes. More...
 
void sceneRectChanged (const QRectF &rect)
 This signal is emitted by QGraphicsScene whenever the scene rect changes. More...
 
void selectionChanged ()
 This signal is emitted by QGraphicsScene whenever the selection changes. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Slots inherited from QGraphicsScene
bool focusNextPrevChild (bool next)
 Finds a new widget to give the keyboard focus to, as appropriate for Tab and Shift+Tab, and returns true if it can find a new widget, or false if it cannot. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 77 of file qdeclarativeview.cpp.

Constructors and Destructors

◆ QDeclarativeScene()

QDeclarativeScene::QDeclarativeScene ( QObject parent = 0)

Definition at line 91 of file qdeclarativeview.cpp.

91  : QGraphicsScene(parent)
92 {
93 }
QGraphicsScene(QObject *parent=0)
Constructs a QGraphicsScene object.

Functions

◆ keyPressEvent()

void QDeclarativeScene::keyPressEvent ( QKeyEvent keyEvent)
protectedvirtual

This event handler, for event keyEvent, can be reimplemented in a subclass to receive keypress events.

The default implementation forwards the event to current focus item.

See also
QGraphicsItem::keyPressEvent(), focusItem()

Reimplemented from QGraphicsScene.

Definition at line 95 of file qdeclarativeview.cpp.

96 {
98 
100 }
static void addEvent(EventType)
virtual void keyPressEvent(QKeyEvent *event)
This event handler, for event keyEvent, can be reimplemented in a subclass to receive keypress events...

◆ keyReleaseEvent()

void QDeclarativeScene::keyReleaseEvent ( QKeyEvent keyEvent)
protectedvirtual

This event handler, for event keyEvent, can be reimplemented in a subclass to receive key release events.

The default implementation forwards the event to current focus item.

See also
QGraphicsItem::keyReleaseEvent(), focusItem()

Reimplemented from QGraphicsScene.

Definition at line 102 of file qdeclarativeview.cpp.

103 {
105 
107 }
static void addEvent(EventType)
virtual void keyReleaseEvent(QKeyEvent *event)
This event handler, for event keyEvent, can be reimplemented in a subclass to receive key release eve...

◆ mouseMoveEvent()

void QDeclarativeScene::mouseMoveEvent ( QGraphicsSceneMouseEvent mouseEvent)
protectedvirtual

This event handler, for event mouseEvent, can be reimplemented in a subclass to receive mouse move events for the scene.

The default implementation depends on the mouse grabber state. If there is a mouse grabber item, the event is sent to the mouse grabber. If there are any items that accept hover events at the current position, the event is translated into a hover event and accepted; otherwise it's ignored.

See also
QGraphicsItem::mousePressEvent(), QGraphicsItem::mouseReleaseEvent(), QGraphicsItem::mouseDoubleClickEvent(), QGraphicsItem::setAcceptedMouseButtons()

Reimplemented from QGraphicsScene.

Definition at line 109 of file qdeclarativeview.cpp.

110 {
112 
114 }
static void addEvent(EventType)
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event mouseEvent, can be reimplemented in a subclass to receive mouse move ev...

◆ mousePressEvent()

void QDeclarativeScene::mousePressEvent ( QGraphicsSceneMouseEvent mouseEvent)
protectedvirtual

This event handler, for event mouseEvent, can be reimplemented in a subclass to receive mouse press events for the scene.

The default implementation depends on the state of the scene. If there is a mouse grabber item, then the event is sent to the mouse grabber. Otherwise, it is forwarded to the topmost item that accepts mouse events at the scene position from the event, and that item promptly becomes the mouse grabber item.

If there is no item at the given position on the scene, the selection area is reset, any focus item loses its input focus, and the event is then ignored.

See also
QGraphicsItem::mousePressEvent(), QGraphicsItem::setAcceptedMouseButtons()

Reimplemented from QGraphicsScene.

Definition at line 116 of file qdeclarativeview.cpp.

117 {
119 
121 }
static void addEvent(EventType)
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event mouseEvent, can be reimplemented in a subclass to receive mouse press e...

◆ mouseReleaseEvent()

void QDeclarativeScene::mouseReleaseEvent ( QGraphicsSceneMouseEvent mouseEvent)
protectedvirtual

This event handler, for event mouseEvent, can be reimplemented in a subclass to receive mouse release events for the scene.

The default implementation depends on the mouse grabber state. If there is no mouse grabber, the event is ignored. Otherwise, if there is a mouse grabber item, the event is sent to the mouse grabber. If this mouse release represents the last pressed button on the mouse, the mouse grabber item then loses the mouse grab.

See also
QGraphicsItem::mousePressEvent(), QGraphicsItem::mouseMoveEvent(), QGraphicsItem::mouseDoubleClickEvent(), QGraphicsItem::setAcceptedMouseButtons()

Reimplemented from QGraphicsScene.

Definition at line 123 of file qdeclarativeview.cpp.

124 {
126 
128 }
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event mouseEvent, can be reimplemented in a subclass to receive mouse release...
static void addEvent(EventType)

The documentation for this class was generated from the following file: