30 #include "valgrind/callgrind.h"
86 int main(
int argc,
char *argv[])
95 clipItem->
setData(0,
"clipItem");
101 scrollItem->
setData(0,
"scrollItem");
103 for (
int y = 0;
y < 25; ++
y) {
104 for (
int x = 0;
x < 25; ++
x) {
106 rect->setParentItem(scrollItem);
107 rect->setPos(
x * 95,
y * 25);
127 view.setSceneRect(-25, -25, 150, 150);
128 view.resize(300, 300);
#define CALLGRIND_START_INSTRUMENTATION
#define CALLGRIND_STOP_INSTRUMENTATION
QPainterPath shape() const
ClipItem(qreal x, qreal y, qreal w, qreal h, const QPen &pen, const QBrush &brush)
void paintEvent(QPaintEvent *event)
ItemMover(QGraphicsItem *item)
void timerEvent(QTimerEvent *event)
void setPen(const QPen &pen)
void setBrush(const QBrush &brush)
The QApplication class manages the GUI application's control flow and main settings.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
The QGraphicsEllipseItem class provides an ellipse item that you can add to a QGraphicsScene.
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
void setData(int key, const QVariant &value)
void moveBy(qreal dx, qreal dy)
@ ItemClipsChildrenToShape
void setParentItem(QGraphicsItem *parent)
QRectF childrenBoundingRect() const
void setFlag(GraphicsItemFlag flag, bool enabled=true)
The QGraphicsRectItem class provides a rectangle item that you can add to a QGraphicsScene.
void setRect(const QRectF &rect)
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items.
void addItem(QGraphicsItem *item)
void setItemIndexMethod(ItemIndexMethod method)
QGraphicsRectItem * addRect(const QRectF &rect, const QPen &pen=QPen(), const QBrush &brush=QBrush())
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
void paintEvent(QPaintEvent *event) override
The QObject class is the base class of all Qt objects.
int startTimer(int interval, Qt::TimerType timerType=Qt::CoarseTimer)
The QPaintEvent class contains event parameters for paint events. \inmodule QtGui.
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
The QPen class defines how a QPainter should draw lines and outlines of shapes.
The QTimerEvent class contains parameters that describe a timer event.
int main(int argc, char **argv)
QT_END_INCLUDE_NAMESPACE typedef double qreal
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLfloat GLfloat GLfloat GLfloat h
GLsizei const GLchar *const * path
QGraphicsEllipseItem * ellipse
QApplication app(argc, argv)
[0]