* @brief Draws an image scaled to (w, h) at (x, y). */
| 1393 | * @brief Draws an image scaled to (w, h) at (x, y). |
| 1394 | */ |
| 1395 | void Widgets::PainterContext::drawImageScaled( |
| 1396 | const QString& src, qreal x, qreal y, qreal w, qreal h) |
| 1397 | { |
| 1398 | if (!active() || w <= 0.0 || h <= 0.0) |
| 1399 | return; |
| 1400 | |
| 1401 | const QString resolved = resolveImagePath(src); |
| 1402 | if (resolved.isEmpty()) |
| 1403 | return; |
| 1404 | |
| 1405 | const QImage img(resolved); |
| 1406 | if (img.isNull()) |
| 1407 | return; |
| 1408 | |
| 1409 | m_painter->drawImage(QRectF(x, y, w, h), img); |
| 1410 | } |
| 1411 | |
| 1412 | //-------------------------------------------------------------------------------------------------- |
| 1413 | // Line dashes |