summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2010-02-03 11:47:34 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2010-02-03 11:48:30 (GMT)
commitcc585886ba9da17064a7fc858f5d717967da6e85 (patch)
tree8fe69b0467799848eb961c158e8ba5fedf843b0c
parentd53315d30b38352db11063096ee3867a40bdc234 (diff)
downloadQt-cc585886ba9da17064a7fc858f5d717967da6e85.zip
Qt-cc585886ba9da17064a7fc858f5d717967da6e85.tar.gz
Qt-cc585886ba9da17064a7fc858f5d717967da6e85.tar.bz2
QStyleSheetStyle: Fix combinaison of border-image and border-radius
Regression since b4d642e639eabde5d72a4 Task-number: QTBUG-7737 Reviewed-by: Gabriel
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp2
-rw-r--r--tests/auto/uiloader/baseline/css_qtbug7737_borderimageradius.ui44
2 files changed, 46 insertions, 0 deletions
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index 498313b..b36294a 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -1125,6 +1125,7 @@ void QRenderRule::fixupBorder(int nativeWidth)
void QRenderRule::drawBorderImage(QPainter *p, const QRect& rect)
{
+ setClip(p, rect);
static const Qt::TileRule tileMode2TileRule[] = {
Qt::StretchTile, Qt::RoundTile, Qt::StretchTile, Qt::RepeatTile, Qt::StretchTile };
@@ -1142,6 +1143,7 @@ void QRenderRule::drawBorderImage(QPainter *p, const QRect& rect)
QRect(QPoint(), borderImageData->pixmap.size()), sourceMargins,
QTileRules(tileMode2TileRule[borderImageData->horizStretch], tileMode2TileRule[borderImageData->vertStretch]));
p->setRenderHint(QPainter::SmoothPixmapTransform, wasSmoothPixmapTransform);
+ unsetClip(p);
}
QRect QRenderRule::originRect(const QRect &rect, Origin origin) const
diff --git a/tests/auto/uiloader/baseline/css_qtbug7737_borderimageradius.ui b/tests/auto/uiloader/baseline/css_qtbug7737_borderimageradius.ui
new file mode 100644
index 0000000..089cb76
--- /dev/null
+++ b/tests/auto/uiloader/baseline/css_qtbug7737_borderimageradius.ui
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>207</width>
+ <height>69</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">QPushButton { border-image: url(&quot;images/pushbutton.png&quot;) 5 5 5 5; border-radius:8px; }</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QPushButton" name="pushButton">
+ <property name="text">
+ <string>Border image and radius</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>