example: Add some helper code to debug focus

This commit is contained in:
Sergio Martins
2020-08-08 16:39:41 +01:00
committed by Sergio Martins
parent 0b4c017f22
commit c9468bef8a
3 changed files with 19 additions and 2 deletions

View File

@@ -39,8 +39,9 @@ public:
{
QPainter p(this);
QPen pen(Qt::black);
//QBrush brush(isFocused() ? QColor(0xff, 0x80, 0) : Qt::yellow); // Uncomment to color differently if dock widget is focused
QBrush brush(Qt::yellow);
const QColor focusedBackgroundColor = Qt::yellow;
const QColor backgroundColor = focusedBackgroundColor.darker(115);
QBrush brush(isFocused() ? focusedBackgroundColor : backgroundColor);
pen.setWidth(4);
p.setPen(pen);
p.setBrush(brush);