diff options
author | Benjamin Poulain <benjamin.poulain@nokia.com> | 2009-11-25 14:01:13 (GMT) |
---|---|---|
committer | Benjamin Poulain <benjamin.poulain@nokia.com> | 2009-11-25 16:03:33 (GMT) |
commit | aaae24808654d54bf8aca04f825c6aa786fe342f (patch) | |
tree | 230f47a5ad8640f6e1cdd4849c0e4812ad97dfc9 /examples/widgets/tablet/tabletcanvas.h | |
parent | dddd3e5fc9658ebbb5f94b343e7c7c0cd27eb7f2 (diff) | |
download | Qt-aaae24808654d54bf8aca04f825c6aa786fe342f.zip Qt-aaae24808654d54bf8aca04f825c6aa786fe342f.tar.gz Qt-aaae24808654d54bf8aca04f825c6aa786fe342f.tar.bz2 |
Use a pixmap instead of an image in the tablet example
The transformations QImage->QPixmap are killing the performance of the
tablet example. This is noticeable because of the number of events sent
by the tablet (painting MUST be fast in tabletEvent()).
Reviewed-by: David Boddie
Diffstat (limited to 'examples/widgets/tablet/tabletcanvas.h')
-rw-r--r-- | examples/widgets/tablet/tabletcanvas.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/widgets/tablet/tabletcanvas.h b/examples/widgets/tablet/tabletcanvas.h index 02b8794..5a2fb1d 100644 --- a/examples/widgets/tablet/tabletcanvas.h +++ b/examples/widgets/tablet/tabletcanvas.h @@ -43,7 +43,7 @@ #define TABLETCANVAS_H #include <QWidget> -#include <QImage> +#include <QPixmap> #include <QPoint> #include <QTabletEvent> #include <QColor> @@ -92,8 +92,8 @@ protected: void resizeEvent(QResizeEvent *event); private: - void initImage(); - void paintImage(QPainter &painter, QTabletEvent *event); + void initPixmap(); + void paintPixmap(QPainter &painter, QTabletEvent *event); Qt::BrushStyle brushPattern(qreal value); void updateBrush(QTabletEvent *event); @@ -104,7 +104,7 @@ private: QTabletEvent::TabletDevice myTabletDevice; QColor myColor; - QImage image; + QPixmap pixmap; QBrush myBrush; QPen myPen; bool deviceDown; |