There is no option to change the default selection outline. Only way out is to create a custom item and re-implement paint() and while painting draw the selection outline as you like.
For more information have a look at implementation of QGraphicsPathItem::paint(). This is how it looks like
{
Q_UNUSED(widget);
painter->setPen(d->pen);
painter->setBrush(d->brush);
painter->drawPath(d->path);
if (option
->state
& QStyle::State_Selected) qt_graphicsItem_highlightSelected(this, painter, option); // Replace this with your own outline painting in custom item
}
void QGraphicsPathItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget)
{
Q_D(QGraphicsPathItem);
Q_UNUSED(widget);
painter->setPen(d->pen);
painter->setBrush(d->brush);
painter->drawPath(d->path);
if (option->state & QStyle::State_Selected)
qt_graphicsItem_highlightSelected(this, painter, option); // Replace this with your own outline painting in custom item
}
To copy to clipboard, switch view to plain text mode
Bookmarks