QDrawRect::QDrawRect()
{
setFlag(QDrawRect::ItemIsMovable);
setFlag(QDrawRect::ItemIsSelectable);
drawData.boundsRect = boundingRect();
drawData.shape = RECTSHAPE;
}
{
painter
->setRenderHint
(QPainter::Antialiasing, itsWorksheet
->wkAntiAliasing
);
setBrush
(QBrush(drawData.
color));
paintHandles(this, painter);
}
//
// JSL - updatePosAndBounds updates the position and bounds based on the drawData
//
void QDrawRect::updatePosAndBounds()
{
qreal x, y, w, h;
x = drawData.boundsRect.left();
y = drawData.boundsRect.top();
w = drawData.boundsRect.right() - drawData.boundsRect.left();
h = drawData.boundsRect.bottom() - drawData.boundsRect.top();
setRect(x, y, w, h);
setPos(drawData.pos.x(), drawData.pos.y());
}
QDrawRect::QDrawRect()
{
setFlag(QDrawRect::ItemIsMovable);
setFlag(QDrawRect::ItemIsSelectable);
drawData.boundsRect = boundingRect();
drawData.shape = RECTSHAPE;
}
void QDrawRect::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
QRectF joe = boundingRect();
painter->setRenderHint(QPainter::Antialiasing, itsWorksheet->wkAntiAliasing);
setBrush(QBrush(drawData.color));
QGraphicsRectItem::paint(painter, option, widget);
paintHandles(this, painter);
}
//
// JSL - updatePosAndBounds updates the position and bounds based on the drawData
//
void QDrawRect::updatePosAndBounds()
{
qreal x, y, w, h;
x = drawData.boundsRect.left();
y = drawData.boundsRect.top();
w = drawData.boundsRect.right() - drawData.boundsRect.left();
h = drawData.boundsRect.bottom() - drawData.boundsRect.top();
setRect(x, y, w, h);
setPos(drawData.pos.x(), drawData.pos.y());
}
To copy to clipboard, switch view to plain text mode
Bookmarks