examples/widgets/tablet/tabletcanvas.h
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    41 
    41 
    42 #ifndef TABLETCANVAS_H
    42 #ifndef TABLETCANVAS_H
    43 #define TABLETCANVAS_H
    43 #define TABLETCANVAS_H
    44 
    44 
    45 #include <QWidget>
    45 #include <QWidget>
    46 #include <QImage>
    46 #include <QPixmap>
    47 #include <QPoint>
    47 #include <QPoint>
    48 #include <QTabletEvent>
    48 #include <QTabletEvent>
    49 #include <QColor>
    49 #include <QColor>
    50 #include <QBrush>
    50 #include <QBrush>
    51 #include <QPen>
    51 #include <QPen>
    90     void tabletEvent(QTabletEvent *event);
    90     void tabletEvent(QTabletEvent *event);
    91     void paintEvent(QPaintEvent *event);
    91     void paintEvent(QPaintEvent *event);
    92     void resizeEvent(QResizeEvent *event);
    92     void resizeEvent(QResizeEvent *event);
    93 
    93 
    94 private:
    94 private:
    95     void initImage();
    95     void initPixmap();
    96     void paintImage(QPainter &painter, QTabletEvent *event);
    96     void paintPixmap(QPainter &painter, QTabletEvent *event);
    97     Qt::BrushStyle brushPattern(qreal value);
    97     Qt::BrushStyle brushPattern(qreal value);
    98     void updateBrush(QTabletEvent *event);
    98     void updateBrush(QTabletEvent *event);
    99 
    99 
   100     AlphaChannelType alphaChannelType;
   100     AlphaChannelType alphaChannelType;
   101     ColorSaturationType colorSaturationType;
   101     ColorSaturationType colorSaturationType;
   102     LineWidthType lineWidthType;
   102     LineWidthType lineWidthType;
   103     QTabletEvent::PointerType pointerType;
   103     QTabletEvent::PointerType pointerType;
   104     QTabletEvent::TabletDevice myTabletDevice;
   104     QTabletEvent::TabletDevice myTabletDevice;
   105     QColor myColor;
   105     QColor myColor;
   106 
   106 
   107     QImage image;
   107     QPixmap pixmap;
   108     QBrush myBrush;
   108     QBrush myBrush;
   109     QPen myPen;
   109     QPen myPen;
   110     bool deviceDown;
   110     bool deviceDown;
   111     QPoint polyLine[3];
   111     QPoint polyLine[3];
   112 };
   112 };