Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, April 2008
qt_graphicsItem_shapeFromPath used for shape()


Message 1 in thread

In trying to find out how how QGraphicsLineItem implements the shape() 
function i noticed the function qt_graphicsItem_shapeFromPath(). This seems 
like a useful function for custom QGraphicsItems but noticed that it is an 
undocumented function. Is there an equivalent users to use? or is there an 
easy way to achieve the same?
-- 
 [ signature omitted ] 

Message 2 in thread

Hi,

kitts wrote:
> In trying to find out how how QGraphicsLineItem implements the shape()
> function i noticed the function qt_graphicsItem_shapeFromPath(). This
> seems like a useful function for custom QGraphicsItems but noticed that it
> is an undocumented function. Is there an equivalent users to use? or is
> there an easy way to achieve the same?

You can use QPainterPathStroker, a public class. The helper function inside
QGraphicsItem uses only public APIs, AFAICT.

-- 
 [ signature omitted ] 

Message 3 in thread

On Monday 07 April 2008 20:03:19 Andreas Aardal Hanssen wrote:
> kitts wrote:
> > In trying to find out how how QGraphicsLineItem implements the shape()
> > function i noticed the function qt_graphicsItem_shapeFromPath(). This
> > seems like a useful function for custom QGraphicsItems but noticed that
> > it is an undocumented function. Is there an equivalent users to use? or
> > is there an easy way to achieve the same?
>
> You can use QPainterPathStroker, a public class. The helper function inside
> QGraphicsItem uses only public APIs, AFAICT.

Thanks. That was easy and the implementation of that function is right up 
there in the same file. Why not make this convenience function available for 
users? Anyway i would recommend a mention of it in the docs as a tip/hint.
-- 
 [ signature omitted ] 

Message 4 in thread

kitts wrote:
>> You can use QPainterPathStroker, a public class. The helper function
>> inside QGraphicsItem uses only public APIs, AFAICT.
> Thanks. That was easy and the implementation of that function is right up
> there in the same file. Why not make this convenience function available
> for users? Anyway i would recommend a mention of it in the docs as a
> tip/hint.

Good point! I'll add a mention to the documentation.

-- 
 [ signature omitted ]