QtBase
v6.3.1
|
Static Public Attributes | |
static bool | dead |
Definition at line 5138 of file tst_qgraphicsitem.cpp.
|
inline |
Definition at line 5141 of file tst_qgraphicsitem.cpp.
|
inlineoverridevirtual |
This virtual function is called twice for all items by the QGraphicsScene::advance() slot. In the first phase, all items are called with phase == 0, indicating that items on the scene are about to advance, and then all items are called with phase == 1. Reimplement this function to update your item if you need simple scene-controlled animation.
The default implementation does nothing.
This function is intended for animations. An alternative is to multiple-inherit from QObject and QGraphicsItem and use the \l{The Animation Framework}{Animation Framework}.
Reimplemented from QGraphicsItem.
Definition at line 5159 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This event handler can be reimplemented in a subclass to process context menu events. The event parameter contains details about the event to be handled.
If you ignore the event (i.e., by calling QEvent::ignore()), event will propagate to any item beneath this item. If no items accept the event, it will be ignored by the scene and propagate to the view.
It's common to open a QMenu in response to receiving a context menu event. Example:
The default implementation ignores the event.
Reimplemented from QGraphicsItem.
Definition at line 5176 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This event handler, for event event, can be reimplemented to receive drag enter events for this item. Drag enter events are generated as the cursor enters the item's area.
By accepting the event (i.e., by calling QEvent::accept()), the item will accept drop events, in addition to receiving drag move and drag leave. Otherwise, the event will be ignored and propagate to the item beneath. If the event is accepted, the item will receive a drag move event before control goes back to the event loop.
A common implementation of dragEnterEvent accepts or ignores event depending on the associated mime data in event. Example:
Items do not receive drag and drop events by default; to enable this feature, call setAcceptDrops(true)
.
The default implementation does nothing.
Reimplemented from QGraphicsItem.
Definition at line 5185 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This event handler, for event event, can be reimplemented to receive drag leave events for this item. Drag leave events are generated as the cursor leaves the item's area. Most often you will not need to reimplement this function, but it can be useful for resetting state in your item (e.g., highlighting).
Calling QEvent::ignore() or QEvent::accept() on event has no effect.
Items do not receive drag and drop events by default; to enable this feature, call setAcceptDrops(true)
.
The default implementation does nothing.
Reimplemented from QGraphicsItem.
Definition at line 5191 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This event handler, for event event, can be reimplemented to receive drag move events for this item. Drag move events are generated as the cursor moves around inside the item's area. Most often you will not need to reimplement this function; it is used to indicate that only parts of the item can accept drops.
Calling QEvent::ignore() or QEvent::accept() on event toggles whether or not the item will accept drops at the position from the event. By default, event is accepted, indicating that the item allows drops at the specified position.
Items do not receive drag and drop events by default; to enable this feature, call setAcceptDrops(true)
.
The default implementation does nothing.
Reimplemented from QGraphicsItem.
Definition at line 5197 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This event handler, for event event, can be reimplemented to receive drop events for this item. Items can only receive drop events if the last drag move event was accepted.
Calling QEvent::ignore() or QEvent::accept() on event has no effect.
Items do not receive drag and drop events by default; to enable this feature, call setAcceptDrops(true)
.
The default implementation does nothing.
Reimplemented from QGraphicsItem.
Definition at line 5203 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This event handler, for event event, can be reimplemented to receive focus in events for this item. The default implementation calls ensureVisible().
Reimplemented from QGraphicsItem.
Definition at line 5209 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This event handler, for event event, can be reimplemented to receive focus out events for this item. The default implementation does nothing.
Reimplemented from QGraphicsItem.
Definition at line 5217 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This event handler, for event event, can be reimplemented to receive hover enter events for this item. The default implementation calls update(); otherwise it does nothing.
Calling QEvent::ignore() or QEvent::accept() on event has no effect.
Reimplemented from QGraphicsItem.
Definition at line 5225 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This event handler, for event event, can be reimplemented to receive hover leave events for this item. The default implementation calls update(); otherwise it does nothing.
Calling QEvent::ignore() or QEvent::accept() on event has no effect.
Reimplemented from QGraphicsItem.
Definition at line 5233 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This event handler, for event event, can be reimplemented to receive hover move events for this item. The default implementation does nothing.
Calling QEvent::ignore() or QEvent::accept() on event has no effect.
Reimplemented from QGraphicsItem.
Definition at line 5241 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This event handler, for event event, can be reimplemented to receive input method events for this item. The default implementation ignores the event.
Reimplemented from QGraphicsItem.
Definition at line 5249 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This method is only relevant for input items. It is used by the input method to query a set of properties of the item to be able to support complex input method operations, such as support for surrounding text and reconversions. query specifies which property is queried.
Reimplemented from QGraphicsItem.
Definition at line 5255 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This virtual function is called by QGraphicsItem to notify custom items that some part of the item's state changes. By reimplementing this function, you can react to a change, and in some cases (depending on change), adjustments can be made.
change is the parameter of the item that is changing. value is the new value; the type of the value depends on change.
Example:
The default implementation does nothing, and returns value.
Note: Certain QGraphicsItem functions cannot be called in a reimplementation of this function; see the GraphicsItemChange documentation for details.
Reimplemented from QGraphicsItem.
Definition at line 5261 of file tst_qgraphicsitem.cpp.
This event handler, for event event, can be reimplemented to receive key press events for this item. The default implementation ignores the event. If you reimplement this handler, the event will by default be accepted.
Note that key events are only received for items that set the ItemIsFocusable flag, and that have keyboard input focus.
Reimplemented from QGraphicsItem.
Definition at line 5267 of file tst_qgraphicsitem.cpp.
This event handler, for event event, can be reimplemented to receive key release events for this item. The default implementation ignores the event. If you reimplement this handler, the event will by default be accepted.
Note that key events are only received for items that set the ItemIsFocusable flag, and that have keyboard input focus.
Reimplemented from QGraphicsItem.
Definition at line 5275 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This event handler, for event event, can be reimplemented to receive mouse double-click events for this item.
When doubleclicking an item, the item will first receive a mouse press event, followed by a release event (i.e., a click), then a double-click event, and finally a release event.
Calling QEvent::ignore() or QEvent::accept() on event has no effect.
The default implementation calls mousePressEvent(). If you want to keep the base implementation when reimplementing this function, call QGraphicsItem::mouseDoubleClickEvent() in your reimplementation.
Note that an item will not receive double click events if it is neither \l {QGraphicsItem::ItemIsSelectable}{selectable} nor \l{QGraphicsItem::ItemIsMovable}{movable} (single mouse clicks are ignored in this case, and that stops the generation of double clicks).
Reimplemented from QGraphicsItem.
Definition at line 5283 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This event handler, for event event, can be reimplemented to receive mouse move events for this item. If you do receive this event, you can be certain that this item also received a mouse press event, and that this item is the current mouse grabber.
Calling QEvent::ignore() or QEvent::accept() on event has no effect.
The default implementation handles basic item interaction, such as selection and moving. If you want to keep the base implementation when reimplementing this function, call QGraphicsItem::mouseMoveEvent() in your reimplementation.
Please note that mousePressEvent() decides which graphics item it is that receives mouse events. See the mousePressEvent() description for details.
Reimplemented from QGraphicsItem.
Definition at line 5291 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This event handler, for event event, can be reimplemented to receive mouse press events for this item. Mouse press events are only delivered to items that accept the mouse button that is pressed. By default, an item accepts all mouse buttons, but you can change this by calling setAcceptedMouseButtons().
The mouse press event decides which item should become the mouse grabber (see QGraphicsScene::mouseGrabberItem()). If you do not reimplement this function, the press event will propagate to any topmost item beneath this item, and no other mouse events will be delivered to this item.
If you do reimplement this function, event will by default be accepted (see QEvent::accept()), and this item is then the mouse grabber. This allows the item to receive future move, release and double-click events. If you call QEvent::ignore() on event, this item will lose the mouse grab, and event will propagate to any topmost item beneath. No further mouse events will be delivered to this item unless a new mouse press event is received.
The default implementation handles basic item interaction, such as selection and moving. If you want to keep the base implementation when reimplementing this function, call QGraphicsItem::mousePressEvent() in your reimplementation.
The event is \l{QEvent::ignore()}d for items that are neither \l{QGraphicsItem::ItemIsMovable}{movable} nor \l{QGraphicsItem::ItemIsSelectable}{selectable}.
Reimplemented from QGraphicsItem.
Definition at line 5299 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This event handler, for event event, can be reimplemented to receive mouse release events for this item.
Calling QEvent::ignore() or QEvent::accept() on event has no effect.
The default implementation handles basic item interaction, such as selection and moving. If you want to keep the base implementation when reimplementing this function, call QGraphicsItem::mouseReleaseEvent() in your reimplementation.
Please note that mousePressEvent() decides which graphics item it is that receives mouse events. See the mousePressEvent() description for details.
Reimplemented from QGraphicsItem.
Definition at line 5307 of file tst_qgraphicsitem.cpp.
|
inlineoverridevirtual |
\reimp
Reimplemented from QGraphicsRectItem.
Definition at line 5147 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This virtual function receives events to this item. Reimplement this function to intercept events before they are dispatched to the specialized event handlers contextMenuEvent(), focusInEvent(), focusOutEvent(), hoverEnterEvent(), hoverMoveEvent(), hoverLeaveEvent(), keyPressEvent(), keyReleaseEvent(), mousePressEvent(), mouseReleaseEvent(), mouseMoveEvent(), and mouseDoubleClickEvent().
Returns true
if the event was recognized and handled; otherwise, (e.g., if the event type was not recognized,) false is returned.
event is the intercepted event.
Reimplemented from QGraphicsItem.
Definition at line 5315 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
Filters events for the item watched. event is the filtered event.
Reimplementing this function in a subclass makes it possible for the item to be used as an event filter for other items, intercepting all the events sent to those items before they are able to respond.
Reimplementations must return true to prevent further processing of a given event, ensuring that it will not be delivered to the watched item, or return false to indicate that the event should be propagated further by the event system.
Reimplemented from QGraphicsItem.
Definition at line 5321 of file tst_qgraphicsitem.cpp.
|
inlineoverrideprotectedvirtual |
This event handler, for event event, can be reimplemented to receive wheel events for this item. If you reimplement this function, event will be accepted by default.
If you ignore the event, (i.e., by calling QEvent::ignore(),) it will propagate to any item beneath this item. If no items accept the event, it will be ignored by the scene, and propagate to the view (e.g., the view's vertical scroll bar).
The default implementation ignores the event.
Reimplemented from QGraphicsItem.
Definition at line 5327 of file tst_qgraphicsitem.cpp.
|
static |
Definition at line 5145 of file tst_qgraphicsitem.cpp.