[Interest] Mapping floating point screen coordinates to QGraphicsScene

Ch'Gans chgans at gna.org
Sun Mar 19 04:56:55 CET 2017


On 19 March 2017 at 15:59, Patrick Stinson <patrickkidd at gmail.com> wrote:
> UITouch coordinates are floating point on iOS, for example for the Apple Pencil. Is there a way to map this? Seems like this would be easy to implement based on the QPoint version…
>

In which coordinate system are the UITouch points expressed in? Seems
odd to use floating point for a pixel based CS, unless half pixels
exist (high res display?)

Chris

> // pks: apple pencil
> QPointF QGraphicsView::mapToScene(const QPointF &point) const
> {
>     Q_D(const QGraphicsView);
>     QPointF p = point;
>     p.rx() += d->horizontalScroll();
>     p.ry() += d->verticalScroll();
>     return d->identityMatrix ? p : d->matrix.inverted().map(p);
> }
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list