Qt:Документация 4.3.2/qgraphicsrectitem
Материал из Wiki.crossplatform.ru
![]() | Внимание: Актуальная версия перевода документации находится здесь |
__NOTOC__
Главная · Все классы · Основные классы · Классы по группам · Модули · Функции |
QGraphicsRectItem Class Reference
[модуль QtGui ]
The QGraphicsRectItem class provides a rectangle item that you can add to a QGraphicsScene. Далее...
#include <QGraphicsRectItem>
Inherits QAbstractGraphicsShapeItem.
Класс был добавлен в Qt 4.2.
Открытые функции
- QGraphicsRectItem ( QGraphicsItem * parent = 0 )
- QGraphicsRectItem ( const QRectF & rect, QGraphicsItem * parent = 0 )
- QGraphicsRectItem ( qreal x, qreal y, qreal width, qreal height, QGraphicsItem * parent = 0 )
- ~QGraphicsRectItem ()
- QRectF rect () const
- void setRect ( const QRectF & rectangle )
- void setRect ( qreal x, qreal y, qreal width, qreal height )
- 4 public functions inherited from QAbstractGraphicsShapeItem
- 114 public functions inherited from QGraphicsItem
Дополнительные унаследованные члены
- 1 static public member inherited from QGraphicsItem
- 23 protected functions inherited from QGraphicsItem
Подробное описание
The QGraphicsRectItem class provides a rectangle item that you can add to a QGraphicsScene.
To set the item's rectangle, pass a QRectF to QGraphicsRectItem's constructor, or call the setRect() function. The rect() function returns the current rectangle.
QGraphicsRectItem uses the rectangle and the pen width to provide a reasonable implementation of boundingRect(), shape(), and contains(). The paint() function draws the rectangle using the item's associated pen and brush, which you can set by calling the setPen() and setBrush() functions.
See also QGraphicsPathItem, QGraphicsEllipseItem, QGraphicsPolygonItem, QGraphicsTextItem, QGraphicsLineItem, QGraphicsPixmapItem, and The Graphics View Framework.
Описание функций-членов
QGraphicsRectItem::QGraphicsRectItem ( QGraphicsItem * parent = 0 )
Constructs a QGraphicsRectItem. parent is passed to QAbstractGraphicsShapeItem's constructor.
See also QGraphicsScene::addItem().
QGraphicsRectItem::QGraphicsRectItem ( const QRectF & rect, QGraphicsItem * parent = 0 )
Constructs a QGraphicsRectItem, using rect as the default rectangle. parent is passed to QAbstractGraphicsShapeItem's constructor.
See also QGraphicsScene::addItem().
QGraphicsRectItem::QGraphicsRectItem ( qreal x, qreal y, qreal width, qreal height, QGraphicsItem * parent = 0 )
Constructs a QGraphicsRectItem with a default rectangle defined by (x, y) and the given width and height.
parent is passed to QAbstractGraphicsShapeItem's constructor.
See also QGraphicsScene::addItem().
QGraphicsRectItem::~QGraphicsRectItem ()
Destroys the QGraphicsRectItem.
QRectF QGraphicsRectItem::rect () const
Returns the item's rectangle.
See also setRect().
void QGraphicsRectItem::setRect ( const QRectF & rectangle )
Sets the item's rectangle to be the given rectangle.
See also rect().
void QGraphicsRectItem::setRect ( qreal x, qreal y, qreal width, qreal height )
Эта перегруженная функция предоставлена для удобства.
Sets the item's rectangle to the rectangle defined by (x, y) and the given width and height.
This convenience function is equivalent to calling setRect(QRectF(x, y, width, height))
See also rect().
Copyright © 2007 Trolltech | Trademarks | Qt 4.3.2
|