| 145 | // 高性能阴影 |
| 146 | eTheme->drawEffectShadow(&painter, rect(), d->_shadowBorderWidth, d->_borderRadius); |
| 147 | |
| 148 | // 背景和图标绘制 |
| 149 | painter.save(); |
| 150 | d->_drawBackground(&painter); |
| 151 | // 文字绘制 |
| 152 | // 标题 |
| 153 | QFont font = this->font(); |
| 154 | font.setWeight(QFont::Bold); |
| 155 | font.setPixelSize(fontPixelSize); |
| 156 | painter.setFont(font); |
| 157 | int titleTextWidth = painter.fontMetrics().horizontalAdvance(d->_title) + 1; |
| 158 | if (titleTextWidth > 100) |
| 159 | { |
| 160 | titleTextWidth = 100; |
| 161 | } |
| 162 | int textFlags = Qt::AlignLeft | Qt::AlignVCenter | Qt::TextWordWrap | Qt::TextWrapAnywhere; |
| 163 | painter.drawText(QRect(d->_leftPadding + d->_titleLeftSpacing, -1, titleTextWidth, height()), textFlags, d->_title); |
| 164 | // 正文 |
| 165 | font.setWeight(QFont::Light); |
| 166 | painter.setFont(font); |
| 167 | painter.drawText(QRect(d->_leftPadding + d->_titleLeftSpacing + titleTextWidth + d->_textLeftSpacing, 0, width() - (d->_leftPadding + d->_titleLeftSpacing + titleTextWidth + d->_textLeftSpacing + d->_closeButtonWidth + d->_closeButtonLeftRightMargin / 2), height() - d->_timePercentHeight), textFlags, d->_text); |
| 168 | painter.restore(); |
| 169 | } |
nothing calls this directly
no outgoing calls
no test coverage detected