[Qt-interest] QPainterPath::contains() alternative behaviour
Jonathan Kew
jonathan_kew at sil.org
Sat Apr 4 19:37:01 CEST 2009
On 4 Apr 2009, at 17:47, Ioannis Nousias wrote:
> yes, I've tried that, but contains() didn't trigger at all. Just to
> make sure I'm not doing something wrong, here is what I did:
>
> QPainterPathStroker stroker;
> QPainterPath stroke = stroker.createStroke(path);
>
> bool contains = stroke.contains
> (
> QRectF(event->pos(),event->pos())
> .adjusted(-0.5,-0.5,0.5,0.5)
> );
>
Perhaps you need to set the width of the QPainterPathStroker? The
documentation doesn't seem to mention a default....perhaps it's too
narrow to hit.
JK
>
> Where 'event' is the QMouseEvent. Using the same 'contains'
> expression on the 'path' exhibits the behaviour I described in the
> previous e-mail, but in this version, 'contains' is never set to true.
>
> I've plaid with the fill rules as well, but no luck.
>
> any more ideas?
>
> Ioannis
>
More information about the Qt-interest-old
mailing list