[RQt-devel] meaning of qstrWidth() in qtpaint

Michael Lawrence lawrence.michael at gene.com
Fri Sep 3 23:34:53 CEST 2010


On Fri, Sep 3, 2010 at 2:05 PM, Yihui Xie <xie at yihui.name> wrote:

> Hi all,
>
> What is the 'frame of reference' when we calculating the width of a
> string using qstrWidth()?


It only returns a width in item (data) coordinates. There is no concept of
position. But if you did draw it at (1,1) with horizontal centering, then
the right X boundary would be 2.


> For example, if the string "Hello World" is
> centered at (1,1) with width 2 while the limits of the corresponding
> layer are qrect(0, 0, 20, 10) (I mean the 'limits' argument in
> qlayer(); not geometry), what is the x-coordinate of the point which
> lies exactly on the right edge of that string? Thanks!
>
> Regards,
> Yihui
> --
> Yihui Xie <xieyihui at gmail.com>
> Phone: 515-294-2465 Web: http://yihui.name
> Department of Statistics, Iowa State University
> 2215 Snedecor Hall, Ames, IA
> _______________________________________________
> Qtinterfaces-devel mailing list
> Qtinterfaces-devel at lists.r-forge.r-project.org
>
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/qtinterfaces-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/qtinterfaces-devel/attachments/20100903/8c1f6136/attachment.htm>


More information about the Qtinterfaces-devel mailing list