Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QGraphicsProxyWidget Class

The QGraphicsProxyWidget class provides a proxy layer for embedding a QWidget in a QGraphicsScene. More...

 #include <QGraphicsProxyWidget>

Inherits: QGraphicsWidget.

Inherited by:

This class was introduced in Qt 4.4.

Public Types

enum CacheMode { NoCache, ItemCoordinateCache, DeviceCoordinateCache }
enum GraphicsItemChange { ItemEnabledChange, ItemEnabledHasChanged, ItemMatrixChange, ItemPositionChange, ..., ItemScenePositionHasChanged }
enum GraphicsItemFlag { ItemIsMovable, ItemIsSelectable, ItemIsFocusable, ItemClipsToShape, ..., ItemSendsScenePositionChanges }
flags GraphicsItemFlags
enum PanelModality { NonModal, PanelModal, SceneModal }

Public Functions

QGraphicsItem(QGraphicsItem * parent = 0)
QGraphicsLayoutItem(QGraphicsLayoutItem * parent = 0, bool isLayout = false)
QGraphicsProxyWidget(QGraphicsItem * parent = 0, Qt::WindowFlags wFlags = 0)
virtual ~QGraphicsItem()
virtual ~QGraphicsLayoutItem()
~QGraphicsProxyWidget()
bool acceptDrops() const
bool acceptHoverEvents() const
bool acceptTouchEvents() const
Qt::MouseButtons acceptedMouseButtons() const
virtual void advance(int phase)
virtual QRectF boundingRect() const = 0
QRegion boundingRegion(const QTransform & itemToDeviceTransform) const
qreal boundingRegionGranularity() const
CacheMode cacheMode() const
QList<QGraphicsItem *> childItems() const
QRectF childrenBoundingRect() const
void clearFocus()
QPainterPath clipPath() const
virtual bool collidesWithItem(const QGraphicsItem * other, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const
virtual bool collidesWithPath(const QPainterPath & path, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const
QList<QGraphicsItem *> collidingItems(Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const
QGraphicsItem * commonAncestorItem(const QGraphicsItem * other) const
virtual bool contains(const QPointF & point) const
QRectF contentsRect() const
QGraphicsProxyWidget * createProxyForChildWidget(QWidget * child)
QCursor cursor() const
QVariant data(int key) const
QTransform deviceTransform(const QTransform & viewportTransform) const
qreal effectiveOpacity() const
QSizeF effectiveSizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF()) const
void ensureVisible(const QRectF & rect = QRectF(), int xmargin = 50, int ymargin = 50)
void ensureVisible(qreal x, qreal y, qreal w, qreal h, int xmargin = 50, int ymargin = 50)
bool filtersChildEvents() const
GraphicsItemFlags flags() const
QGraphicsItem * focusItem() const
QGraphicsItem * focusProxy() const
QRectF geometry() const
virtual void getContentsMargins(qreal * left, qreal * top, qreal * right, qreal * bottom) const
void grabKeyboard()
void grabMouse()
QGraphicsEffect * graphicsEffect() const
QGraphicsItem * graphicsItem() const
QGraphicsItemGroup * group() const
bool hasCursor() const
bool hasFocus() const
void hide()
Qt::InputMethodHints inputMethodHints() const
void installSceneEventFilter(QGraphicsItem * filterItem)
bool isActive() const
bool isAncestorOf(const QGraphicsItem * child) const
bool isBlockedByModalPanel(QGraphicsItem ** blockingPanel = 0) const
bool isClipped() const
bool isEnabled() const
bool isLayout() const
bool isObscured() const
bool isObscured(qreal x, qreal y, qreal w, qreal h) const
bool isObscured(const QRectF & rect) const
virtual bool isObscuredBy(const QGraphicsItem * item) const
bool isPanel() const
bool isSelected() const
bool isUnderMouse() const
bool isVisible() const
bool isVisibleTo(const QGraphicsItem * parent) const
bool isWidget() const
bool isWindow() const
QTransform itemTransform(const QGraphicsItem * other, bool * ok = 0) const
QPointF mapFromItem(const QGraphicsItem * item, const QPointF & point) const
QPolygonF mapFromItem(const QGraphicsItem * item, const QRectF & rect) const
QPolygonF mapFromItem(const QGraphicsItem * item, const QPolygonF & polygon) const
QPainterPath mapFromItem(const QGraphicsItem * item, const QPainterPath & path) const
QPolygonF mapFromItem(const QGraphicsItem * item, qreal x, qreal y, qreal w, qreal h) const
QPointF mapFromItem(const QGraphicsItem * item, qreal x, qreal y) const
QPointF mapFromParent(const QPointF & point) const
QPolygonF mapFromParent(const QRectF & rect) const
QPolygonF mapFromParent(const QPolygonF & polygon) const
QPainterPath mapFromParent(const QPainterPath & path) const
QPolygonF mapFromParent(qreal x, qreal y, qreal w, qreal h) const
QPointF mapFromParent(qreal x, qreal y) const
QPointF mapFromScene(const QPointF & point) const
QPolygonF mapFromScene(const QRectF & rect) const
QPolygonF mapFromScene(const QPolygonF & polygon) const
QPainterPath mapFromScene(const QPainterPath & path) const
QPolygonF mapFromScene(qreal x, qreal y, qreal w, qreal h) const
QPointF mapFromScene(qreal x, qreal y) const
QRectF mapRectFromItem(const QGraphicsItem * item, const QRectF & rect) const
QRectF mapRectFromItem(const QGraphicsItem * item, qreal x, qreal y, qreal w, qreal h) const
QRectF mapRectFromParent(const QRectF & rect) const
QRectF mapRectFromParent(qreal x, qreal y, qreal w, qreal h) const
QRectF mapRectFromScene(const QRectF & rect) const
QRectF mapRectFromScene(qreal x, qreal y, qreal w, qreal h) const
QRectF mapRectToItem(const QGraphicsItem * item, const QRectF & rect) const
QRectF mapRectToItem(const QGraphicsItem * item, qreal x, qreal y, qreal w, qreal h) const
QRectF mapRectToParent(const QRectF & rect) const
QRectF mapRectToParent(qreal x, qreal y, qreal w, qreal h) const
QRectF mapRectToScene(const QRectF & rect) const
QRectF mapRectToScene(qreal x, qreal y, qreal w, qreal h) const
QPointF mapToItem(const QGraphicsItem * item, const QPointF & point) const
QPolygonF mapToItem(const QGraphicsItem * item, const QRectF & rect) const
QPolygonF mapToItem(const QGraphicsItem * item, const QPolygonF & polygon) const
QPainterPath mapToItem(const QGraphicsItem * item, const QPainterPath & path) const
QPolygonF mapToItem(const QGraphicsItem * item, qreal x, qreal y, qreal w, qreal h) const
QPointF mapToItem(const QGraphicsItem * item, qreal x, qreal y) const
QPointF mapToParent(const QPointF & point) const
QPolygonF mapToParent(const QRectF & rect) const
QPolygonF mapToParent(const QPolygonF & polygon) const
QPainterPath mapToParent(const QPainterPath & path) const
QPolygonF mapToParent(qreal x, qreal y, qreal w, qreal h) const
QPointF mapToParent(qreal x, qreal y) const
QPointF mapToScene(const QPointF & point) const
QPolygonF mapToScene(const QRectF & rect) const
QPolygonF mapToScene(const QPolygonF & polygon) const
QPainterPath mapToScene(const QPainterPath & path) const
QPolygonF mapToScene(qreal x, qreal y, qreal w, qreal h) const
QPointF mapToScene(qreal x, qreal y) const
qreal maximumHeight() const
QSizeF maximumSize() const
qreal maximumWidth() const
qreal minimumHeight() const
QSizeF minimumSize() const
qreal minimumWidth() const
void moveBy(qreal dx, qreal dy)
qreal opacity() const
virtual QPainterPath opaqueArea() const
bool ownedByLayout() const
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0) = 0
QGraphicsItem * panel() const
PanelModality panelModality() const
QGraphicsItem * parentItem() const
QGraphicsLayoutItem * parentLayoutItem() const
QGraphicsObject * parentObject() const
QGraphicsWidget * parentWidget() const
QPointF pos() const
qreal preferredHeight() const
QSizeF preferredSize() const
qreal preferredWidth() const
void removeSceneEventFilter(QGraphicsItem * filterItem)
void resetTransform()
qreal rotation() const
qreal scale() const
QGraphicsScene * scene() const
QRectF sceneBoundingRect() const
QPointF scenePos() const
QTransform sceneTransform() const
void scroll(qreal dx, qreal dy, const QRectF & rect = QRectF())
void setAcceptDrops(bool on)
void setAcceptHoverEvents(bool enabled)
void setAcceptTouchEvents(bool enabled)
void setAcceptedMouseButtons(Qt::MouseButtons buttons)
void setActive(bool active)
void setBoundingRegionGranularity(qreal granularity)
void setCacheMode(CacheMode mode, const QSize & logicalCacheSize = QSize())
void setCursor(const QCursor & cursor)
void setData(int key, const QVariant & value)
void setEnabled(bool enabled)
void setFiltersChildEvents(bool enabled)
void setFlag(GraphicsItemFlag flag, bool enabled = true)
void setFlags(GraphicsItemFlags flags)
void setFocus(Qt::FocusReason focusReason = Qt::OtherFocusReason)
void setFocusProxy(QGraphicsItem * item)
virtual void setGeometry(const QRectF & rect)
void setGraphicsEffect(QGraphicsEffect * effect)
void setGroup(QGraphicsItemGroup * group)
void setInputMethodHints(Qt::InputMethodHints hints)
void setMaximumHeight(qreal height)
void setMaximumSize(const QSizeF & size)
void setMaximumSize(qreal w, qreal h)
void setMaximumWidth(qreal width)
void setMinimumHeight(qreal height)
void setMinimumSize(const QSizeF & size)
void setMinimumSize(qreal w, qreal h)
void setMinimumWidth(qreal width)
void setOpacity(qreal opacity)
void setPanelModality(PanelModality panelModality)
void setParentItem(QGraphicsItem * newParent)
void setParentLayoutItem(QGraphicsLayoutItem * parent)
void setPos(const QPointF & pos)
void setPos(qreal x, qreal y)
void setPreferredHeight(qreal height)
void setPreferredSize(const QSizeF & size)
void setPreferredSize(qreal w, qreal h)
void setPreferredWidth(qreal width)
void setRotation(qreal angle)
void setScale(qreal factor)
void setSelected(bool selected)
void setSizePolicy(const QSizePolicy & policy)
void setSizePolicy(QSizePolicy::Policy hPolicy, QSizePolicy::Policy vPolicy, QSizePolicy::ControlType controlType = QSizePolicy::DefaultType)
void setToolTip(const QString & toolTip)
void setTransform(const QTransform & matrix, bool combine = false)
void setTransformOriginPoint(const QPointF & origin)
void setTransformOriginPoint(qreal x, qreal y)
void setTransformations(const QList<QGraphicsTransform *> & transformations)
void setVisible(bool visible)
void setWidget(QWidget * widget)
void setX(qreal x)
void setY(qreal y)
void setZValue(qreal z)
virtual QPainterPath shape() const
void show()
QSizePolicy sizePolicy() const
void stackBefore(const QGraphicsItem * sibling)
QRectF subWidgetRect(const QWidget * widget) const
QGraphicsObject * toGraphicsObject()
const QGraphicsObject * toGraphicsObject() const
QString toolTip() const
QGraphicsItem * topLevelItem() const
QGraphicsWidget * topLevelWidget() const
QTransform transform() const
QPointF transformOriginPoint() const
QList<QGraphicsTransform *> transformations() const
virtual int type() const
void ungrabKeyboard()
void ungrabMouse()
void unsetCursor()
void update(const QRectF & rect = QRectF())
void update(qreal x, qreal y, qreal width, qreal height)
virtual void updateGeometry()
QWidget * widget() const
QGraphicsWidget * window() const
qreal x() const
qreal y() const
qreal zValue() const

Reimplemented Public Functions

virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget)
virtual void setGeometry(const QRectF & rect)
virtual int type() const

Static Public Members

const int Type
const int UserType

Protected Functions

virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent * event)
virtual void dragEnterEvent(QGraphicsSceneDragDropEvent * event)
virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent * event)
virtual void dragMoveEvent(QGraphicsSceneDragDropEvent * event)
virtual void dropEvent(QGraphicsSceneDragDropEvent * event)
virtual void focusInEvent(QFocusEvent * event)
virtual void focusOutEvent(QFocusEvent * event)
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent * event)
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent * event)
virtual void hoverMoveEvent(QGraphicsSceneHoverEvent * event)
virtual void inputMethodEvent(QInputMethodEvent * event)
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const
virtual QVariant itemChange(GraphicsItemChange change, const QVariant & value)
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)
void prepareGeometryChange()
virtual bool sceneEvent(QEvent * event)
virtual bool sceneEventFilter(QGraphicsItem * watched, QEvent * event)
void setGraphicsItem(QGraphicsItem * item)
void setOwnedByLayout(bool ownership)
virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF()) const = 0
void updateMicroFocus()
virtual void wheelEvent(QGraphicsSceneWheelEvent * event)

Reimplemented Protected Functions

virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent * event)
virtual void dragEnterEvent(QGraphicsSceneDragDropEvent * event)
virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent * event)
virtual void dragMoveEvent(QGraphicsSceneDragDropEvent * event)
virtual void dropEvent(QGraphicsSceneDragDropEvent * event)
virtual bool event(QEvent * event)
virtual bool eventFilter(QObject * object, QEvent * event)
virtual void focusInEvent(QFocusEvent * event)
virtual bool focusNextPrevChild(bool next)
virtual void focusOutEvent(QFocusEvent * event)
virtual void grabMouseEvent(QEvent * event)
virtual void hideEvent(QHideEvent * event)
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent * event)
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent * event)
virtual void hoverMoveEvent(QGraphicsSceneHoverEvent * event)
virtual void inputMethodEvent(QInputMethodEvent * event)
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const
virtual QVariant itemChange(GraphicsItemChange change, const QVariant & value)
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 resizeEvent(QGraphicsSceneResizeEvent * event)
virtual void showEvent(QShowEvent * event)
virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF()) const
virtual void ungrabMouseEvent(QEvent * event)
virtual void wheelEvent(QGraphicsSceneWheelEvent * event)

Protected Slots

QGraphicsProxyWidget * newProxyWidget(const QWidget * child)

Additional Inherited Members

Detailed Description

The QGraphicsProxyWidget class provides a proxy layer for embedding a QWidget in a QGraphicsScene.

QGraphicsProxyWidget embeds QWidget-based widgets, for example, a QPushButton, QFontComboBox, or even QFileDialog, into QGraphicsScene. It forwards events between the two objects and translates between QWidget's integer-based geometry and QGraphicsWidget's qreal-based geometry. QGraphicsProxyWidget supports all core features of QWidget, including tab focus, keyboard input, Drag & Drop, and popups. You can also embed complex widgets, e.g., widgets with subwidgets.

Example:

 int main(int argc, char **argv)
 {
     QApplication app(argc, argv);

     QTabWidget *tabWidget = new QTabWidget;

     QGraphicsScene scene;
     QGraphicsProxyWidget *proxy = scene.addWidget(tabWidget);

     QGraphicsView view(&scene);
     view.show();

     return app.exec();
 }

QGraphicsProxyWidget takes care of automatically embedding popup children of embedded widgets through creating a child proxy for each popup. This means that when an embedded QComboBox shows its popup list, a new QGraphicsProxyWidget is created automatically, embedding the popup, and positioning it correctly. This only works if the popup is child of the embedded widget (for example QToolButton::setMenu() requires the QMenu instance to be child of the QToolButton).

Embedding a Widget with QGraphicsProxyWidget

There are two ways to embed a widget using QGraphicsProxyWidget. The most common way is to pass a widget pointer to QGraphicsScene::addWidget() together with any relevant Qt::WindowFlags. This function returns a pointer to a QGraphicsProxyWidget. You can then choose to reparent or position either the proxy, or the embedded widget itself.

For example, in the code snippet below, we embed a group box into the proxy:

 QGroupBox *groupBox = new QGroupBox("Contact Details");
 QLabel *numberLabel = new QLabel("Telephone number");
 QLineEdit *numberEdit = new QLineEdit;

 QFormLayout *layout = new QFormLayout;
 layout->addRow(numberLabel, numberEdit);
 groupBox->setLayout(layout);

 QGraphicsScene scene;
 QGraphicsProxyWidget *proxy = scene.addWidget(groupBox);

 QGraphicsView view(&scene);
 view.show();

The image below is the output obtained with its contents margin and contents rect labeled.

Alternatively, you can start by creating a new QGraphicsProxyWidget item, and then call setWidget() to embed a QWidget later. The widget() function returns a pointer to the embedded widget. QGraphicsProxyWidget shares ownership with QWidget, so if either of the two widgets are destroyed, the other widget will be automatically destroyed as well.

Synchronizing Widget States

QGraphicsProxyWidget keeps its state in sync with the embedded widget. For example, if the proxy is hidden or disabled, the embedded widget will be hidden or disabled as well, and vice versa. When the widget is embedded by calling addWidget(), QGraphicsProxyWidget copies the state from the widget into the proxy, and after that, the two will stay synchronized where possible. By default, when you embed a widget into a proxy, both the widget and the proxy will be visible because a QGraphicsWidget is visible when created (you do not have to call show()). If you explicitly hide the embedded widget, the proxy will also become invisible.

Example:

 QGraphicsScene scene;

 QLineEdit *edit = new QLineEdit;
 QGraphicsProxyWidget *proxy = scene.addWidget(edit);

 edit->isVisible();  // returns true
 proxy->isVisible(); // also returns true

 edit->hide();

 edit->isVisible();  // returns false
 proxy->isVisible(); // also returns false

QGraphicsProxyWidget maintains symmetry for the following states:

QWidget stateQGraphicsProxyWidget stateNotes
QWidget::enabledQGraphicsProxyWidget::enabled
QWidget::visibleQGraphicsProxyWidget::visibleThe explicit state is also symmetric.
QWidget::geometryQGraphicsProxyWidget::geometryGeometry is only guaranteed to be symmetric while the embedded widget is visible.
QWidget::layoutDirectionQGraphicsProxyWidget::layoutDirection
QWidget::styleQGraphicsProxyWidget::style
QWidget::paletteQGraphicsProxyWidget::palette
QWidget::fontQGraphicsProxyWidget::font
QWidget::cursorQGraphicsProxyWidget::cursorThe embedded widget overrides the proxy widget cursor. The proxy cursor changes depending on which embedded subwidget is currently under the mouse.
QWidget::sizeHint()QGraphicsProxyWidget::sizeHint()All size hint functionality from the embedded widget is forwarded by the proxy.
QWidget::getContentsMargins()QGraphicsProxyWidget::getContentsMargins()Updated once by setWidget().
QWidget::windowTitleQGraphicsProxyWidget::windowTitleUpdated once by setWidget().

Note: QGraphicsScene keeps the embedded widget in a special state that prevents it from disturbing other widgets (both embedded and not embedded) while the widget is embedded. In this state, the widget may differ slightly in behavior from when it is not embedded.

Warning: This class is provided for convenience when bridging QWidgets and QGraphicsItems, it should not be used for high-performance scenarios.

See also QGraphicsScene::addWidget() and QGraphicsWidget.

Member Function Documentation

QGraphicsProxyWidget::QGraphicsProxyWidget(QGraphicsItem * parent = 0, Qt::WindowFlags wFlags = 0)

Constructs a new QGraphicsProxy widget. parent and wFlags are passed to QGraphicsItem's constructor.

QGraphicsProxyWidget::~QGraphicsProxyWidget()

Destroys the proxy widget and any embedded widget.

void QGraphicsProxyWidget::contextMenuEvent(QGraphicsSceneContextMenuEvent * event) [virtual protected]

Reimplemented from QGraphicsItem::contextMenuEvent().

QGraphicsProxyWidget * QGraphicsProxyWidget::createProxyForChildWidget(QWidget * child)

Creates a proxy widget for the given child of the widget contained in this proxy.

This function makes it possible to acquire proxies for non top-level widgets. For instance, you can embed a dialog, and then transform only one of its widgets.

If the widget is already embedded, return the existing proxy widget.

This function was introduced in Qt 4.5.

See also newProxyWidget() and QGraphicsScene::addWidget().

void QGraphicsProxyWidget::dragEnterEvent(QGraphicsSceneDragDropEvent * event) [virtual protected]

Reimplemented from QGraphicsItem::dragEnterEvent().

void QGraphicsProxyWidget::dragLeaveEvent(QGraphicsSceneDragDropEvent * event) [virtual protected]

Reimplemented from QGraphicsItem::dragLeaveEvent().

void QGraphicsProxyWidget::dragMoveEvent(QGraphicsSceneDragDropEvent * event) [virtual protected]

Reimplemented from QGraphicsItem::dragMoveEvent().

void QGraphicsProxyWidget::dropEvent(QGraphicsSceneDragDropEvent * event) [virtual protected]

Reimplemented from QGraphicsItem::dropEvent().

bool QGraphicsProxyWidget::event(QEvent * event) [virtual protected]

Reimplemented from QObject::event().

bool QGraphicsProxyWidget::eventFilter(QObject * object, QEvent * event) [virtual protected]

Reimplemented from QObject::eventFilter().

void QGraphicsProxyWidget::focusInEvent(QFocusEvent * event) [virtual protected]

Reimplemented from QGraphicsItem::focusInEvent().

bool QGraphicsProxyWidget::focusNextPrevChild(bool next) [virtual protected]

Reimplemented from QGraphicsWidget::focusNextPrevChild().

void QGraphicsProxyWidget::focusOutEvent(QFocusEvent * event) [virtual protected]

Reimplemented from QGraphicsItem::focusOutEvent().

void QGraphicsProxyWidget::grabMouseEvent(QEvent * event) [virtual protected]

Reimplemented from QGraphicsWidget::grabMouseEvent().

void QGraphicsProxyWidget::hideEvent(QHideEvent * event) [virtual protected]

Reimplemented from QGraphicsWidget::hideEvent().

void QGraphicsProxyWidget::hoverEnterEvent(QGraphicsSceneHoverEvent * event) [virtual protected]

Reimplemented from QGraphicsItem::hoverEnterEvent().

void QGraphicsProxyWidget::hoverLeaveEvent(QGraphicsSceneHoverEvent * event) [virtual protected]

Reimplemented from QGraphicsItem::hoverLeaveEvent().

void QGraphicsProxyWidget::hoverMoveEvent(QGraphicsSceneHoverEvent * event) [virtual protected]

Reimplemented from QGraphicsItem::hoverMoveEvent().

void QGraphicsProxyWidget::inputMethodEvent(QInputMethodEvent * event) [virtual protected]

Reimplemented from QGraphicsItem::inputMethodEvent().

QVariant QGraphicsProxyWidget::inputMethodQuery(Qt::InputMethodQuery query) const [virtual protected]

Reimplemented from QGraphicsItem::inputMethodQuery().

QVariant QGraphicsProxyWidget::itemChange(GraphicsItemChange change, const QVariant & value) [virtual protected]

Reimplemented from QGraphicsItem::itemChange().

void QGraphicsProxyWidget::keyPressEvent(QKeyEvent * event) [virtual protected]

Reimplemented from QGraphicsItem::keyPressEvent().

void QGraphicsProxyWidget::keyReleaseEvent(QKeyEvent * event) [virtual protected]

Reimplemented from QGraphicsItem::keyReleaseEvent().

void QGraphicsProxyWidget::mouseDoubleClickEvent(QGraphicsSceneMouseEvent * event) [virtual protected]

Reimplemented from QGraphicsItem::mouseDoubleClickEvent().

void QGraphicsProxyWidget::mouseMoveEvent(QGraphicsSceneMouseEvent * event) [virtual protected]

Reimplemented from QGraphicsItem::mouseMoveEvent().

void QGraphicsProxyWidget::mousePressEvent(QGraphicsSceneMouseEvent * event) [virtual protected]

Reimplemented from QGraphicsItem::mousePressEvent().

void QGraphicsProxyWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent * event) [virtual protected]

Reimplemented from QGraphicsItem::mouseReleaseEvent().

QGraphicsProxyWidget * QGraphicsProxyWidget::newProxyWidget(const QWidget * child) [protected slot]

Creates a proxy widget for the given child of the widget contained in this proxy.

You should not call this function directly; use QGraphicsProxyWidget::createProxyForChildWidget() instead.

This function is a fake virtual slot that you can reimplement in your subclass in order to control how new proxy widgets are created. The default implementation returns a proxy created with the QGraphicsProxyWidget() constructor with this proxy widget as the parent.

This function was introduced in Qt 4.5.

See also createProxyForChildWidget().

void QGraphicsProxyWidget::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) [virtual]

Reimplemented from QGraphicsItem::paint().

void QGraphicsProxyWidget::resizeEvent(QGraphicsSceneResizeEvent * event) [virtual protected]

Reimplemented from QGraphicsWidget::resizeEvent().

void QGraphicsProxyWidget::setGeometry(const QRectF & rect) [virtual]

Reimplemented from QGraphicsLayoutItem::setGeometry().

void QGraphicsProxyWidget::setWidget(QWidget * widget)

Embeds widget into this proxy widget. The embedded widget must reside exclusively either inside or outside of Graphics View. You cannot embed a widget as long as it is is visible elsewhere in the UI, at the same time.

widget must be a top-level widget whose parent is 0.

When the widget is embedded, its state (e.g., visible, enabled, geometry, size hints) is copied into the proxy widget. If the embedded widget is explicitly hidden or disabled, the proxy widget will become explicitly hidden or disabled after embedding is complete. The class documentation has a full overview over the shared state.

QGraphicsProxyWidget's window flags determine whether the widget, after embedding, will be given window decorations or not.

After this function returns, QGraphicsProxyWidget will keep its state synchronized with that of widget whenever possible.

If a widget is already embedded by this proxy when this function is called, that widget will first be automatically unembedded. Passing 0 for the widget argument will only unembed the widget, and the ownership of the currently embedded widget will be passed on to the caller. Every child widget that are embedded will also be embedded and their proxy widget destroyed.

Note that widgets with the Qt::WA_PaintOnScreen widget attribute set and widgets that wrap an external application or controller cannot be embedded. Examples are QGLWidget and QAxWidget.

See also widget().

void QGraphicsProxyWidget::showEvent(QShowEvent * event) [virtual protected]

Reimplemented from QGraphicsWidget::showEvent().

QSizeF QGraphicsProxyWidget::sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF()) const [virtual protected]

Reimplemented from QGraphicsLayoutItem::sizeHint().

QRectF QGraphicsProxyWidget::subWidgetRect(const QWidget * widget) const

Returns the rectangle for widget, which must be a descendant of widget(), or widget() itself, in this proxy item's local coordinates.

If no widget is embedded, widget is 0, or widget is not a descendant of the embedded widget, this function returns an empty QRectF.

See also widget().

int QGraphicsProxyWidget::type() const [virtual]

Reimplemented from QGraphicsItem::type().

void QGraphicsProxyWidget::ungrabMouseEvent(QEvent * event) [virtual protected]

Reimplemented from QGraphicsWidget::ungrabMouseEvent().

void QGraphicsProxyWidget::wheelEvent(QGraphicsSceneWheelEvent * event) [virtual protected]

Reimplemented from QGraphicsItem::wheelEvent().

QWidget * QGraphicsProxyWidget::widget() const

Returns a pointer to the embedded widget.

See also setWidget().

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web