diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2015-07-27 12:02:06 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@theqtcompany.com> | 2015-07-31 04:33:20 +0000 |
commit | 6a991f9cce9da6057c4a053e52e5956284805eea (patch) | |
tree | dd6b2fb68016c8723728ea9114f05b603196bfe9 /examples/widgets/widgets/tablet/tabletcanvas.h | |
parent | ad4d25589fcd5efd4faa3074c19928d195f615bb (diff) |
Tablet example: smoother, rotation stylus, better airbrush
The drawing is antialiased and with rounded caps and joins.
Rotation stylus acts like a felt marker.
Airbrush sprays a radial gradient of color, and its alpha can
depend on the tangential pressure if so chosen.
Task-number: QTBUG-46694
Change-Id: I4fb16eb621707e3c56a75aa302dd0d3bf418a745
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Diffstat (limited to 'examples/widgets/widgets/tablet/tabletcanvas.h')
-rw-r--r-- | examples/widgets/widgets/tablet/tabletcanvas.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/widgets/widgets/tablet/tabletcanvas.h b/examples/widgets/widgets/tablet/tabletcanvas.h index 873f3a7ab0..06090a9052 100644 --- a/examples/widgets/widgets/tablet/tabletcanvas.h +++ b/examples/widgets/widgets/tablet/tabletcanvas.h @@ -61,7 +61,7 @@ class TabletCanvas : public QWidget Q_OBJECT public: - enum AlphaChannelType { AlphaPressure, AlphaTilt, NoAlpha }; + enum AlphaChannelType { AlphaPressure, AlphaTangentialPressure, AlphaTilt, NoAlpha }; enum ColorSaturationType { SaturationVTilt, SaturationHTilt, SaturationPressure, NoSaturation }; enum LineWidthType { LineWidthPressure, LineWidthTilt, NoLineWidth }; @@ -107,7 +107,11 @@ private: QBrush myBrush; QPen myPen; bool deviceDown; - QPoint polyLine[3]; + + struct Point { + QPointF pos; + qreal rotation; + } lastPoint; }; //! [0] |