summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorJeremy Katz <jeremy.katz@nokia.com>2009-12-08 10:54:00 (GMT)
committerJeremy Katz <jeremy.katz@nokia.com>2009-12-08 10:54:00 (GMT)
commit426334321319054fedf8993bba6482ce90a2c4ee (patch)
tree2274f672a390a60368e11cee7f3473c6e72fa3de /src/plugins
parent52613f91fe4c8bb4faa93c50cc3fab2d8082fc30 (diff)
downloadQt-426334321319054fedf8993bba6482ce90a2c4ee.zip
Qt-426334321319054fedf8993bba6482ce90a2c4ee.tar.gz
Qt-426334321319054fedf8993bba6482ce90a2c4ee.tar.bz2
fix application supplied image cursors
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/graphicssystems/fb_base/fb_base.cpp9
-rw-r--r--src/plugins/graphicssystems/fb_base/fb_base.h1
2 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/graphicssystems/fb_base/fb_base.cpp b/src/plugins/graphicssystems/fb_base/fb_base.cpp
index 27cb8a4..f9ea97f 100644
--- a/src/plugins/graphicssystems/fb_base/fb_base.cpp
+++ b/src/plugins/graphicssystems/fb_base/fb_base.cpp
@@ -54,6 +54,11 @@ void QGraphicsSystemSoftwareCursor::setCursor(Qt::CursorShape shape)
graphic->set(shape);
}
+void QGraphicsSystemSoftwareCursor::setCursor(const QImage * image, int hotx, int hoty)
+{
+ graphic->set(image, hotx, hoty);
+}
+
void QGraphicsSystemSoftwareCursor::setCursor(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY)
{
graphic->set(data, mask, width, height, hotX, hotY);
@@ -66,10 +71,8 @@ void QGraphicsSystemSoftwareCursor::changeCursor(QCursor * widgetCursor, QWidget
if (shape == Qt::BitmapCursor) {
// application supplied cursor
- const QBitmap * map = widgetCursor->bitmap();
- const QBitmap * mask = widgetCursor->mask();
QPoint spot = widgetCursor->hotSpot();
- setCursor(map->toImage().bits(), mask->toImage().bits(), map->width(), map->height(), spot.x(), spot.y());
+ setCursor(&widgetCursor->pixmap().toImage(), spot.x(), spot.y());
} else {
// system cursor
setCursor(shape);
diff --git a/src/plugins/graphicssystems/fb_base/fb_base.h b/src/plugins/graphicssystems/fb_base/fb_base.h
index 9abd5d0..58f340d 100644
--- a/src/plugins/graphicssystems/fb_base/fb_base.h
+++ b/src/plugins/graphicssystems/fb_base/fb_base.h
@@ -34,6 +34,7 @@ protected:
private:
void setCursor(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY);
void setCursor(Qt::CursorShape shape);
+ void setCursor(const QImage * image, int hotx, int hoty);
QRect currentRect; // next place to draw the cursor
QRect prevRect; // last place the cursor was drawn
QRect getCurrentRect();