|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.gui.QAbstractGraphicsShapeItem
com.trolltech.qt.gui.QGraphicsRectItem
public class QGraphicsRectItem
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. QGraphicsPathItem
, QGraphicsEllipseItem
, QGraphicsPolygonItem
, QGraphicsTextItem
, QGraphicsLineItem
, QGraphicsPixmapItem
, and The Graphics View Framework.
Nested Class Summary | |
---|---|
static class |
QGraphicsRectItem.enum_1
|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary |
---|
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
Constructor Summary | |
---|---|
QGraphicsRectItem()
Constructs a QGraphicsRectItem . |
|
QGraphicsRectItem(double x,
double y,
double w,
double h)
Creates a new QGraphicsRectItem of which top-left corner is (x, y), width is w, and height is h. |
|
QGraphicsRectItem(double x,
double y,
double w,
double h,
QGraphicsItemInterface parent)
Creates a new QGraphicsRectItem of which top-left corner is (x, y), width is w, and height is h. |
|
QGraphicsRectItem(double x,
double y,
double w,
double h,
QGraphicsItemInterface parent,
QGraphicsScene scene)
Creates a new QGraphicsRectItem of which top-left corner is (x, y), width is w, and height is h. |
|
QGraphicsRectItem(QGraphicsItemInterface parent)
Constructs a QGraphicsRectItem . |
|
QGraphicsRectItem(QGraphicsItemInterface parent,
QGraphicsScene scene)
Constructs a QGraphicsRectItem . |
|
QGraphicsRectItem(QRectF rect)
Creates a new QGraphicsRectItem with the specified bounds rect. |
|
QGraphicsRectItem(QRectF rect,
QGraphicsItemInterface parent)
Creates a new QGraphicsRectItem with the specified bounds rect and parent. |
|
QGraphicsRectItem(QRectF rect,
QGraphicsItemInterface parent,
QGraphicsScene scene)
Creates a new QGraphicsRectItem with the specified bounds rect, parent, and then adds it to scene. |
Method Summary | |
---|---|
QRectF |
rect()
Returns the item's rectangle. |
void |
setRect(double x,
double y,
double w,
double h)
Sets the item's rectangle to the rectangle defined by (x, y) and the given width and height. |
void |
setRect(QRectF rect)
Sets the item's rectangle to be the given rectangle. |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QGraphicsRectItem(QGraphicsItemInterface parent)
QGraphicsRectItem
. parent is passed to QAbstractGraphicsShapeItem
's constructor.The item is added to the scene. QGraphicsScene::addItem()
.
public QGraphicsRectItem()
QGraphicsRectItem
. parent is passed to QAbstractGraphicsShapeItem
's constructor.The item is added to the scene. QGraphicsScene::addItem()
.
public QGraphicsRectItem(QGraphicsItemInterface parent, QGraphicsScene scene)
QGraphicsRectItem
. parent is passed to QAbstractGraphicsShapeItem
's constructor.The item is added to the scene. QGraphicsScene::addItem()
.
public QGraphicsRectItem(QRectF rect, QGraphicsItemInterface parent)
public QGraphicsRectItem(QRectF rect)
public QGraphicsRectItem(QRectF rect, QGraphicsItemInterface parent, QGraphicsScene scene)
public QGraphicsRectItem(double x, double y, double w, double h, QGraphicsItemInterface parent)
public QGraphicsRectItem(double x, double y, double w, double h)
public QGraphicsRectItem(double x, double y, double w, double h, QGraphicsItemInterface parent, QGraphicsScene scene)
Method Detail |
---|
public final QRectF rect()
setRect()
.
public final void setRect(QRectF rect)
rect()
.
public final void setRect(double x, double y, double w, double h)
This convenience function is equivalent to calling setRect(QRectF(x, y, width, height))
rect()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |