src/gui/painting/qpaintengine_x11.cpp
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
child 37 758a864f9613
--- a/src/gui/painting/qpaintengine_x11.cpp	Tue Jul 06 15:10:48 2010 +0300
+++ b/src/gui/painting/qpaintengine_x11.cpp	Wed Aug 18 10:37:55 2010 +0300
@@ -79,6 +79,8 @@
 #include <private/qtessellator_p.h>
 #endif
 
+#include <private/qstylehelper_p.h>
+
 QT_BEGIN_NAMESPACE
 
 extern Drawable qt_x11Handle(const QPaintDevice *pd);
@@ -224,7 +226,10 @@
 static QPixmap qt_patternForAlpha(uchar alpha, int screen)
 {
     QPixmap pm;
-    QString key = QLatin1String("$qt-alpha-brush$") + QString::number(alpha) + QString::number(screen);
+    QString key = QLatin1Literal("$qt-alpha-brush$")
+                  % HexString<uchar>(alpha)
+                  % HexString<int>(screen);
+
     if (!QPixmapCache::find(key, pm)) {
         // #### why not use a mono image here????
         QImage pattern(DITHER_SIZE, DITHER_SIZE, QImage::Format_ARGB32);
@@ -1448,6 +1453,11 @@
 
 void QX11PaintEngine::drawEllipse(const QRect &rect)
 {
+    if (rect.isEmpty()) {
+        drawRects(&rect, 1);
+        return;
+    }
+
     Q_D(QX11PaintEngine);
     QRect devclip(SHRT_MIN, SHRT_MIN, SHRT_MAX*2 - 1, SHRT_MAX*2 - 1);
     QRect r(rect);