Qt:Документация 4.3.2/qgraphicssceneevent

Материал из Wiki.crossplatform.ru

Версия от 09:24, 29 января 2009; Root (Обсуждение | вклад)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

Содержание

[править] QGraphicsSceneEvent Class Reference
[модуль QtGui ]

The QGraphicsSceneEvent class provides a base class for all graphics view related events. Далее...

 #include <QGraphicsSceneEvent>

Inherits QEvent.

Inherited by QGraphicsSceneContextMenuEvent, QGraphicsSceneDragDropEvent, QGraphicsSceneHelpEvent, QGraphicsSceneHoverEvent, QGraphicsSceneMouseEvent, and QGraphicsSceneWheelEvent.

Класс был добавлен в Qt 4.2.

[править] Открытые функции

  • 6 public functions inherited from QEvent

[править] Дополнительные унаследованные члены


[править] Подробное описание

The QGraphicsSceneEvent class provides a base class for all graphics view related events.

When a QGraphicsView receives Qt mouse, keyboard, and drag and drop events ( QMouseEvent, QKeyEvent, QDragEvent, etc.), it translates them into instances of QGraphicsSceneEvent subclasses and forwards them to the QGraphicsScene it displays. The scene then forwards the events to the relevant items.

For example, when a QGraphicsView receives a QMouseEvent of type MousePress as a response to a user click, the view sends a QGraphicsSceneMouseEvent of type GraphicsSceneMousePress to the underlying QGraphicsScene through its mousePressEvent() function. The default QGraphicsScene::mousePressEvent() implementation determines which item was clicked and forwards the event to QGraphicsItem::mousePressEvent().

Subclasses such as QGraphicsSceneMouseEvent and QGraphicsSceneContextMenuEvent provide the coordinates from the original QEvent in screen, scene, and item coordinates (see screenPos(), scenePos(), and pos()). The item coordinates are set by the QGraphicsScene before it forwards the event to the event to a QGraphicsItem. The mouse events also add the possibility to retrieve the coordinates from the last event received by the view (see lastScreenPos(), lastScenePos(), and lastPos()).

See also QEvent.


[править] Описание функций-членов

[править]
QGraphicsSceneEvent::~QGraphicsSceneEvent ()

Destroys the event.

[править]
QWidget * QGraphicsSceneEvent::widget () const

Returns the widget where the event originated, or 0 if the event originates from another application.



Copyright © 2007 Trolltech Trademarks
Qt 4.3.2