andre@722: /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik andre@722: * Software engineering by Intevation GmbH andre@722: * andre@722: * This file is Free Software under the GNU GPL (v>=2) andre@722: * and comes with ABSOLUTELY NO WARRANTY! andre@722: * See LICENSE.txt for details. andre@722: */ andre@722: andre@722: #include andre@722: #include andre@722: #include andre@722: #include andre@722: andre@722: #include andre@722: andre@722: #include "textoverlaybutton.h" andre@722: andre@722: void TextOverlayButton::paintEvent(QPaintEvent *e) andre@722: { andre@722: QToolButton::paintEvent(e); andre@722: QPainter painter(this); andre@722: QFont font; andre@722: QRect myRect = e->rect().translated(0, 10); andre@722: andre@722: //font.setFamily("Comic Sans MS"); andre@722: andre@722: font.setPixelSize(14); andre@722: font.setWeight(QFont::DemiBold); andre@722: painter.setFont(font); andre@722: andre@722: //painter.setPen(Qt::white); andre@722: //painter.drawText(myRect.translated(1,1), Qt::AlignCenter, "20"); andre@722: painter.setPen(qApp->palette().color(QPalette::ButtonText)); andre@722: painter.drawText(myRect, Qt::AlignCenter | Qt::AlignVCenter, mOverlay); andre@722: andre@722: return; andre@722: }