[Interest] Questions about QGraphicsWidget

BRM bm_witness at yahoo.com
Thu Aug 9 16:54:31 CEST 2012


> From: Bo Thorsen <bo at fioniasoftware.dk>

> Subject: Re: [Interest] Questions about QGraphicsWidget
> Den 08-08-2012 15:54, BRM skrev:
>>>  From: Bo Thorsen <bo at fioniasoftware.dk>
>>>  Subject: Re: [Interest] Questions about QGraphicsWidget
>>>  Den 07-08-2012 18:59, Bill Crocker skrev:
>>>>    On 08/07/2012 12:36 PM, BRM wrote:
>>>>>    I'm working on a QGraphicsWidget version of something I already
>>>>>  have a QWidget version of; namely because I need to add some features where I
>>>>>  need to overlay items, lines, and text in a way that QWidget does not support
>>>>    You can also overlay your existing widget with another widget
>>>>    on which you draw arbitrary text and lines.
>>>>    Set the overlay widget as transparent to mouse events.
>>>  This was exactly what I was about to answer. Going to QGW is the wrong
>>>  approach for this problem. Unless of course there are other reasons for
>>>  doing it. But it sounds like the OP is only converting to QGW to do this
>>>  one thing.
>>  Besides picking up the additional performance? Updating to the new APIs?
>>  Being able to eventually move to integrating with QML (if and when QML becomes an option)?
>>  Yes there are other reasons for doing the conversion. This is just
>>  the only aspect that I've had trouble with.
> 
> As I said, if there are other reason, then go ahead with the conversion. 
> My point was that you shouldn't do it just to achieve the overlay.

As should be the case. If there's a simpler way to do things that requires less effort and achieve the same outcome, then why not?
 
> I've never been fond of the widgets on QGW. Maybe that's a reason 
> I'm showing the way to avoid it.

I'm about split at the moment. I see a number of benefits coming through QGW; but it seems to be about even with QWigdet overall.
In part, there's just so much richness to what is available with QWidget that is simply lacking in QGW, and QGW seems to be getting a little ignored that way as focus is more on QML.
That said, it does seem to provide a nice transition from QWidget to QML too.

Now if I can just get the overlay to the right coordinates...

Ben




More information about the Interest mailing list