| 35 | } |
| 36 | |
| 37 | void RectKey::paint(QPainter &painter) const { |
| 38 | Key::paint(painter); |
| 39 | painter.setFont(mLabelFont); |
| 40 | painter.setPen(mTextColor); |
| 41 | painter.drawText(keyGeometry(), mLabelAlign, mLabelText); |
| 42 | if (!mSecondText.isEmpty()) { |
| 43 | painter.setPen(mSecondColor); |
| 44 | painter.setFont(mSecondFont); |
| 45 | painter.drawText(textGeometry(), mSecondAlign, mSecondText); |
| 46 | } |
| 47 | if (!mAlphaText.isEmpty()) { |
| 48 | painter.setPen(mAlphaColor); |
| 49 | painter.setFont(mAlphaFont); |
| 50 | painter.drawText(textGeometry(), mAlphaAlign, mAlphaText); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | bool RectKey::isUnder(const QPainterPath &area) const { |
| 55 | return mKeyShape.intersects(area); |