44 #include "../qdeclarativeviewinspector.h" 45 #include "../qmlinspectorconstants.h" 47 #include <QtGui/QGraphicsPolygonItem> 49 #include <QtCore/QTimer> 50 #include <QtCore/QObject> 51 #include <QtCore/QDebug> 58 highlightedObject(itemToHighlight),
60 highlightPolygonEdge(0)
141 if (!itemToHighlight)
225 QRectF edgeRect = bboxRect;
226 edgeRect.
adjust(-1, -1, 1, 1);
The QColor class provides colors based on RGB, HSV or CMYK values.
QList< BoundingBox *> m_boxes
virtual QRectF boundingRect() const =0
This pure virtual function defines the outer bounds of the item as a rectangle; all painting must be ...
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
void freeBoundingBox(BoundingBox *box)
QGraphicsPolygonItem * highlightPolygon
~BoundingRectHighlighter()
bool isNull() const
Returns true if this object is holding a reference to a null pointer.
The QObject class is the base class of all Qt objects.
The QGraphicsPolygonItem class provides a polygon item that you can add to a QGraphicsScene.
void rotationChanged()
This signal gets emitted whenever the roation of the item changes.
The QPen class defines how a QPainter should draw lines and outlines of shapes.
BoundingBox(QGraphicsObject *itemToHighlight, QGraphicsItem *parentItem, QObject *parent=0)
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
BoundingBoxPolygonItem(QGraphicsItem *item)
void setColor(const QColor &color)
Sets the color of this pen's brush to the given color.
void itemDestroyed(QObject *)
The QRectF class defines a rectangle in the plane using floating point precision. ...
int type() const
Reimplemented Function
void destroyed(QObject *=0)
This signal is emitted immediately before the object obj is destroyed, and can not be blocked...
QRectF mapRectFromScene(const QRectF &rect) const
Maps the rectangle rect, which is in scene coordinates, to this item's coordinate system...
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
BoundingBox * boxFor(QGraphicsObject *item) const
BoundingBox * createBoundingBox(QGraphicsObject *itemToHighlight)
The QPolygonF class provides a vector of points using floating point precision.
void setPen(const QPen &pen)
Sets the pen for this item to pen.
BoundingRectHighlighter(QDeclarativeViewInspector *view)
QRectF adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace)
void qSort(RandomAccessIterator start, RandomAccessIterator end)
QPen pen() const
Returns the item's pen.
QList< BoundingBox *> m_freeBoxes
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
void adjust(qreal x1, qreal y1, qreal x2, qreal y2)
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
void setPolygon(const QPolygonF &polygon)
Sets the item's polygon to be the given polygon.
void hide()
Hides the item.
void yChanged()
This signal gets emitted whenever the y position of the item changes.
void xChanged()
This signal gets emitted whenever the x position of the item changes.
void clear()
Clears this QWeakPointer object, dropping the reference that it may have had to the pointer...
QDeclarativeViewInspector * m_view
QRectF boundingRect() const
This pure virtual function defines the outer bounds of the item as a rectangle; all painting must be ...
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.
void removeBoundingBox(BoundingBox *box)
The QGraphicsObject class provides a base class for all graphics items that require signals...
void setFlag(GraphicsItemFlag flag, bool enabled=true)
If enabled is true, the item flag flag is enabled; otherwise, it is disabled.
QPointF mapToScene(const QPointF &point) const
Maps the point point, which is in this item's coordinate system, to the scene's coordinate system...
QGraphicsPolygonItem * highlightPolygonEdge
void highlight(QList< QGraphicsObject *> items)
The QList class is a template class that provides lists.
void show()
Shows the item.
void setWidth(int width)
Sets the pen width to the given width in pixels with integer precision.
QWeakPointer< QGraphicsObject > highlightedObject