Example from class QStyle's detailed description showing how to draw focus rect doesn't work
Unsolved
General and Desktop
-
macOS 13.2.1
Qt 6.4.2MyWidget::MyWidget() : QWidget() { setFocusPolicy(Qt::StrongFocus); setAttribute(Qt::WA_MacShowFocusRect); } void MyWidget::paintEvent(QPaintEvent *event) { QStylePainter painter(this); QStyleOptionFocusRect option; option.initFrom(this); option.backgroundColor = Qt::darkCyan; painter.drawPrimitive(QStyle::PE_FrameFocusRect, option); }
-
Looks like you may have unearthed a bug.
You should check the bug report system to see if there's something already about it and if not please open a new ticket providing your findings.