diff options
author | Fabien Freling <fabien.freling@nokia.com> | 2011-04-18 12:00:40 (GMT) |
---|---|---|
committer | Fabien Freling <fabien.freling@nokia.com> | 2011-04-18 12:00:40 (GMT) |
commit | bbb9fa9ccb7432f146a395eca1f8a634a4dfd3d0 (patch) | |
tree | e3f0b23105b3ade96328314c6b59457068ebe8db /tests/arthur/common/paintcommands.cpp | |
parent | a4d33d8c3cd206b982962014323abb673f5c64e3 (diff) | |
parent | e004701bd7ba9e4a7cd5ac1bf784829feae16cae (diff) | |
download | Qt-bbb9fa9ccb7432f146a395eca1f8a634a4dfd3d0.zip Qt-bbb9fa9ccb7432f146a395eca1f8a634a4dfd3d0.tar.gz Qt-bbb9fa9ccb7432f146a395eca1f8a634a4dfd3d0.tar.bz2 |
Merge remote branch 'fire/master'
Diffstat (limited to 'tests/arthur/common/paintcommands.cpp')
-rw-r--r-- | tests/arthur/common/paintcommands.cpp | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/tests/arthur/common/paintcommands.cpp b/tests/arthur/common/paintcommands.cpp index 7a018e3..9273142 100644 --- a/tests/arthur/common/paintcommands.cpp +++ b/tests/arthur/common/paintcommands.cpp @@ -346,8 +346,12 @@ void PaintCommands::staticInit() "gradient_setLinear 1.0 1.0 2.0 2.0"); DECL_PAINTCOMMAND("gradient_setRadial", command_gradient_setRadial, "^gradient_setRadial\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)\\s?([\\w.]*)\\s?([\\w.]*)$", - "gradient_setRadial <cx> <cy> <rad> <fx> <fy>\n - C is the center\n - rad is the angle in degrees\n - F is the focal point", + "gradient_setRadial <cx> <cy> <rad> <fx> <fy>\n - C is the center\n - rad is the radius\n - F is the focal point", "gradient_setRadial 1.0 1.0 45.0 2.0 2.0"); + DECL_PAINTCOMMAND("gradient_setRadialExtended", command_gradient_setRadialExtended, + "^gradient_setRadialExtended\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)\\s?([\\w.]*)\\s?([\\w.]*)\\s?([\\w.]*)$", + "gradient_setRadialExtended <cx> <cy> <rad> <fx> <fy> <frad>\n - C is the center\n - rad is the center radius\n - F is the focal point\n - frad is the focal radius", + "gradient_setRadialExtended 1.0 1.0 45.0 2.0 2.0 45.0"); DECL_PAINTCOMMAND("gradient_setLinearPen", command_gradient_setLinearPen, "^gradient_setLinearPen\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)$", "gradient_setLinearPen <x1> <y1> <x2> <y2>", @@ -2400,7 +2404,7 @@ void PaintCommands::command_gradient_setRadial(QRegExp re) double fy = convertToDouble(caps.at(5)); if (m_verboseMode) - printf(" -(lance) gradient_setRadial center=(%.2f, %.2f), radius=%.2f focal=(%.2f, %.2f), " + printf(" -(lance) gradient_setRadial center=(%.2f, %.2f), radius=%.2f, focal=(%.2f, %.2f), " "spread=%d\n", cx, cy, rad, fx, fy, m_gradientSpread); @@ -2415,6 +2419,32 @@ void PaintCommands::command_gradient_setRadial(QRegExp re) } /***************************************************************************************************/ +void PaintCommands::command_gradient_setRadialExtended(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double cx = convertToDouble(caps.at(1)); + double cy = convertToDouble(caps.at(2)); + double rad = convertToDouble(caps.at(3)); + double fx = convertToDouble(caps.at(4)); + double fy = convertToDouble(caps.at(5)); + double frad = convertToDouble(caps.at(6)); + + if (m_verboseMode) + printf(" -(lance) gradient_setRadialExtended center=(%.2f, %.2f), radius=%.2f, focal=(%.2f, %.2f), " + "focal radius=%.2f, spread=%d\n", + cx, cy, rad, fx, fy, frad, m_gradientSpread); + + QRadialGradient rg(QPointF(cx, cy), rad, QPointF(fx, fy), frad); + rg.setStops(m_gradientStops); + rg.setSpread(m_gradientSpread); + rg.setCoordinateMode(m_gradientCoordinate); + QBrush brush(rg); + QTransform brush_matrix = m_painter->brush().transform(); + brush.setTransform(brush_matrix); + m_painter->setBrush(brush); +} + +/***************************************************************************************************/ void PaintCommands::command_gradient_setConical(QRegExp re) { QStringList caps = re.capturedTexts(); |