add Qt::TextShowMnemonic when painting text

svn path=/trunk/KDE/kdelibs/; revision=1164885
This commit is contained in:
Marco Martin 2010-08-17 21:04:52 +00:00
parent 9dffd9dd77
commit 0d6a38b954

View File

@ -457,12 +457,12 @@ void PushButton::paint(QPainter *painter,
if (option->direction == Qt::LeftToRight) {
alphaGradient.setColorAt(0, QColor(0, 0, 0, 255));
alphaGradient.setColorAt(1, QColor(0, 0, 0, 0));
p.drawText(bufferPixmap.rect(), Qt::AlignLeft|Qt::AlignVCenter,
p.drawText(bufferPixmap.rect(), Qt::AlignLeft|Qt::AlignVCenter|Qt::TextShowMnemonic,
nativeWidget()->text());
} else {
alphaGradient.setColorAt(0, QColor(0, 0, 0, 0));
alphaGradient.setColorAt(1, QColor(0, 0, 0, 255));
p.drawText(bufferPixmap.rect(), Qt::AlignRight|Qt::AlignVCenter,
p.drawText(bufferPixmap.rect(), Qt::AlignRight|Qt::AlignVCenter|Qt::TextShowMnemonic,
nativeWidget()->text());
}
@ -472,7 +472,7 @@ void PushButton::paint(QPainter *painter,
painter->drawPixmap(rect.topLeft(), bufferPixmap);
} else {
painter->setFont(widgetFont);
painter->drawText(rect, Qt::AlignCenter, nativeWidget()->text());
painter->drawText(rect, Qt::AlignCenter|Qt::TextShowMnemonic, nativeWidget()->text());
}
}