Obsolete Members for QGraphicsSceneThe following class members are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code. Properties
Public Functions
Protected Functions
Property Documentation
|
bool | isSortCacheEnabled () const |
void | setSortCacheEnabled ( bool enabled ) |
Paints the given items using the provided painter, after the background has been drawn, and before the foreground has been drawn. All painting is done in scene coordinates. Before drawing each item, the painter must be transformed using QGraphicsItem::sceneTransform().
The options parameter is the list of style option objects for each item in items. The numItems parameter is the number of items in items and options in options. The widget parameter is optional; if specified, it should point to the widget that is being painted on.
The default implementation prepares the painter matrix, and calls QGraphicsItem::paint() on all items. Reimplement this function to provide custom painting of all items for the scene; gaining complete control over how each item is drawn. In some cases this can increase drawing performance significantly.
Example:
void CustomScene::drawItems(QPainter *painter, int numItems, QGraphicsItem *items[], const QStyleOptionGraphicsItem options[], QWidget *widget) { for (int i = 0; i < numItems; ++i) { // Draw the item painter->save(); painter->setMatrix(items[i]->sceneMatrix(), true); items[i]->paint(painter, &options[i], widget); painter->restore(); } }
Since Qt 4.6, this function is not called anymore unless the QGraphicsView::IndirectPainting flag is given as an Optimization flag.
See also drawBackground() and drawForeground().
This is an overloaded function.
Returns the topmost visible item at the specified position, or 0 if there are no items at this position.
This function is deprecated and returns incorrect results if the scene contains items that ignore transformations. Use the overload that takes a QTransform instead.
See also items(), collidingItems(), and Sorting.
This is an overloaded function.
Returns the topmost item at the position specified by (x, y), or 0 if there are no items at this position.
This convenience function is equivalent to calling itemAt(QPointF(x, y)).
This function is deprecated and returns incorrect results if the scene contains items that ignore transformations. Use the overload that takes a QTransform instead.
Returns all visible items at position pos in the scene. The items are listed in descending stacking order (i.e., the first item in the list is the top-most item, and the last item is the bottom-most item).
This function is deprecated and returns incorrect results if the scene contains items that ignore transformations. Use the overload that takes a QTransform instead.
See also itemAt() and Sorting.
This convenience function is equivalent to calling items(QRectF(x, y, w, h), mode).
This function is deprecated and returns incorrect results if the scene contains items that ignore transformations. Use the overload that takes a QTransform instead.
This function was introduced in Qt 4.3.
This is an overloaded function.
Returns all visible items that, depending on mode, are either inside or intersect with the specified rectangle.
The default value for mode is Qt::IntersectsItemShape; all items whose exact shape intersects with or is contained by rectangle are returned.
This function is deprecated and returns incorrect results if the scene contains items that ignore transformations. Use the overload that takes a QTransform instead.
See also itemAt() and Sorting.
This is an overloaded function.
Returns all visible items that, depending on mode, are either inside or intersect with the polygon polygon.
The default value for mode is Qt::IntersectsItemShape; all items whose exact shape intersects with or is contained by polygon are returned.
This function is deprecated and returns incorrect results if the scene contains items that ignore transformations. Use the overload that takes a QTransform instead.
See also itemAt() and Sorting.
This is an overloaded function.
Returns all visible items that, depending on path, are either inside or intersect with the path path.
The default value for mode is Qt::IntersectsItemShape; all items whose exact shape intersects with or is contained by path are returned.
This function is deprecated and returns incorrect results if the scene contains items that ignore transformations. Use the overload that takes a QTransform instead.
See also itemAt() and Sorting.
This is an overloaded function.
Sets the selection area to path.
This function is deprecated and leads to incorrect results if the scene contains items that ignore transformations. Use the overload that takes a QTransform instead.
This is an overloaded function.
Sets the selection area to path using mode to determine if items are included in the selection area.
This function was introduced in Qt 4.3.
See also clearSelection() and selectionArea().
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 4.8 | |
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 ! |
Copyright © 2000-2012 - www.developpez.com