QGraphicsPixmapItem Class ReferenceThe QGraphicsPixmapItem class provides a pixmap item that you can add to a QGraphicsScene. More... #include <QGraphicsPixmapItem> Inherits QGraphicsItem. This class was introduced in Qt 4.2. Public Types
Public Functions
Reimplemented Public Functions
Additional Inherited Members
Detailed DescriptionThe QGraphicsPixmapItem class provides a pixmap item that you can add to a QGraphicsScene. To set the item's pixmap, pass a QPixmap to QGraphicsPixmapItem's constructor, or call the setPixmap() function. The pixmap() function returns the current pixmap. QGraphicsPixmapItem uses pixmap's optional alpha mask to provide a reasonable implementation of boundingRect(), shape(), and contains(). The pixmap is drawn at the item's (0, 0) coordinate, as returned by offset(). You can change the drawing offset by calling setOffset(). You can set the pixmap's transformation mode by calling setTransformationMode(). By default, Qt::FastTransformation is used, which provides fast, non-smooth scaling. Qt::SmoothTransformation enables QPainter::SmoothPixmapTransform on the painter, and the quality depends on the platform and viewport. The result is usually not as good as calling QPixmap::scale() directly. Call transformationMode() to get the current transformation mode for the item. See also QGraphicsPathItem, QGraphicsRectItem, QGraphicsEllipseItem, QGraphicsTextItem, QGraphicsPolygonItem, QGraphicsLineItem, and Graphics View Framework. Member Type Documentationenum QGraphicsPixmapItem::ShapeModeThis enum describes how QGraphicsPixmapItem calculates its shape and opaque area. The default value is MaskShape.
Member Function DocumentationQGraphicsPixmapItem::QGraphicsPixmapItem ( QGraphicsItem * parent = 0 )Constructs a QGraphicsPixmapItem. parent is passed to QGraphicsItem's constructor. See also QGraphicsScene::addItem(). QGraphicsPixmapItem::QGraphicsPixmapItem ( const QPixmap & pixmap, QGraphicsItem * parent = 0 )Constructs a QGraphicsPixmapItem, using pixmap as the default pixmap. parent is passed to QGraphicsItem's constructor. See also QGraphicsScene::addItem(). QGraphicsPixmapItem::~QGraphicsPixmapItem ()Destroys the QGraphicsPixmapItem. QRectF QGraphicsPixmapItem::boundingRect () const [virtual]Reimplemented from QGraphicsItem::boundingRect(). bool QGraphicsPixmapItem::contains ( const QPointF & point ) const [virtual]Reimplemented from QGraphicsItem::contains(). bool QGraphicsPixmapItem::isObscuredBy ( const QGraphicsItem * item ) const [virtual]Reimplemented from QGraphicsItem::isObscuredBy(). QPointF QGraphicsPixmapItem::offset () constReturns the pixmap item's offset, which defines the point of the top-left corner of the pixmap, in local coordinates. See also setOffset(). QPainterPath QGraphicsPixmapItem::opaqueArea () const [virtual]Reimplemented from QGraphicsItem::opaqueArea(). void QGraphicsPixmapItem::paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget ) [virtual]Reimplemented from QGraphicsItem::paint(). QPixmap QGraphicsPixmapItem::pixmap () constReturns the item's pixmap, or an invalid QPixmap if no pixmap has been set. See also setPixmap(). void QGraphicsPixmapItem::setOffset ( const QPointF & offset )Sets the pixmap item's offset to offset. QGraphicsPixmapItem will draw its pixmap using offset for its top-left corner. See also offset(). void QGraphicsPixmapItem::setOffset ( qreal x, qreal y )This convenience function is equivalent to calling setOffset(QPointF(x, y)). This function was introduced in Qt 4.3. void QGraphicsPixmapItem::setPixmap ( const QPixmap & pixmap )Sets the item's pixmap to pixmap. See also pixmap(). void QGraphicsPixmapItem::setShapeMode ( ShapeMode mode )Sets the item's shape mode to mode. The shape mode describes how QGraphicsPixmapItem calculates its shape. The default mode is MaskShape. See also shapeMode() and ShapeMode. void QGraphicsPixmapItem::setTransformationMode ( Qt::TransformationMode mode )Sets the pixmap item's transformation mode to mode, and toggles an update of the item. The default mode is Qt::FastTransformation, which provides quick transformation with no smoothing. Qt::SmoothTransformation enables QPainter::SmoothPixmapTransform on the painter, and the quality depends on the platform and viewport. The result is usually not as good as calling QPixmap::scale() directly. See also transformationMode(). QPainterPath QGraphicsPixmapItem::shape () const [virtual]Reimplemented from QGraphicsItem::shape(). ShapeMode QGraphicsPixmapItem::shapeMode () constReturns the item's shape mode. The shape mode describes how QGraphicsPixmapItem calculates its shape. The default mode is MaskShape. See also setShapeMode() and ShapeMode. Qt::TransformationMode QGraphicsPixmapItem::transformationMode () constReturns the transformation mode of the pixmap. The default mode is Qt::FastTransformation, which provides quick transformation with no smoothing. See also setTransformationMode(). int QGraphicsPixmapItem::type () const [virtual]Reimplemented from QGraphicsItem::type(). X
|
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |