brush(brush)
{
if(embeddedWidget){
proxyWidget = new QGraphicsProxyWidget(this);
proxyWidget->setFocusPolicy(Qt::StrongFocus);
proxyWidget->setWidget(embeddedWidget);
proxyWidget->setPos(5, 5);
}
}
{
painter->setPen(Qt::NoPen);
painter
->setBrush
(QColor(0,
0,
0,
65));
painter->drawRoundRect(rect().translated(2, 2));
painter
->setPen
(QPen(Qt
::black,
1));
painter->setBrush(brush);
painter->drawRect(rect());
}
CentralItem::CentralItem(const QRectF &rect, const QBrush &brush, QWidget *embeddedWidget)
: QGraphicsRectItem(rect),
brush(brush)
{
if(embeddedWidget){
proxyWidget = new QGraphicsProxyWidget(this);
proxyWidget->setFocusPolicy(Qt::StrongFocus);
proxyWidget->setWidget(embeddedWidget);
proxyWidget->setPos(5, 5);
}
}
void CentralItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
{
painter->setPen(Qt::NoPen);
painter->setBrush(QColor(0, 0, 0, 65));
painter->drawRoundRect(rect().translated(2, 2));
painter->setPen(QPen(Qt::black, 1));
painter->setBrush(brush);
painter->drawRect(rect());
}
To copy to clipboard, switch view to plain text mode
Bookmarks