I don't think you can use QStyle for this, you can create all custom widgets (MyLabel, MyMessageBox, MyMenu, MyMenu...) and override the paintEvent() in all of them. In paintEvent() you could do something like this
{
painter.setFont(font);
QRect top_rect
= event
->rect
();
, top_rect.top() + 4
, top_rect.right() + 4
, top_rect.bottom() + 4);
painter.
setPen(QPen(Qt
::yellow));
painter.drawText(bot_rect, text());
painter.
setPen(QPen(Qt
::black));
painter.drawText(top_rect, text());
}
void MyLabel::paintEvent(QPaintEvent * event)
{
QPainter painter(this);
QFont font("Arial", 48, QFont::Normal, true);
painter.setFont(font);
QRect top_rect = event->rect();
QRect bot_rect = QRect(top_rect.left() + 4
, top_rect.top() + 4
, top_rect.right() + 4
, top_rect.bottom() + 4);
painter.setPen(QPen(Qt::yellow));
painter.drawText(bot_rect, text());
painter.setPen(QPen(Qt::black));
painter.drawText(top_rect, text());
}
To copy to clipboard, switch view to plain text mode
Bookmarks