[Qt-interest] Layers in Graphics Framework ( Solved)
AK
qtbond007 at gmail.com
Thu Apr 28 12:31:56 CEST 2011
I was able to achieve the mentioned effect by
- Overriding QGraphicsItem to keep its view indices
- Overriding View to keep its view indices
- View on paint filters the items which doesnt match its view indices
- On mouse handling routines it
- first hit-test the items and hides whose view indices doesnt match
with its own
- then passes the event to scene. BSP will not return the invisible
items.
- sets the items visible again
On Wed, Apr 27, 2011 at 11:36 AM, AK <qtbond007 at gmail.com> wrote:
> Jason,
>
> I will have to keep these proxies in a scene. So why not duplicate the
> whole scene except for the items whose layers mismatch. And keep the
> Original scene in sync with the duplicated ones.
>
>
> On Tue, Apr 26, 2011 at 7:47 PM, Jason H <scorp1us at yahoo.com> wrote:
>
>> You'd need a proxy class that maintains a pointer to the actual item. Your
>> layer would be an array of these proxy class instances. Then just use the
>> proxy items as normal items.
>>
>> The proxy's events and signals, would map to the actual, so
>> ProxyItem::paint(..) { realItem->paint(..); }
>>
>>
>>
>> ------------------------------
>> *From:* AK <qtbond007 at gmail.com>
>> *To:* qt-interest at qt.nokia.com
>> *Sent:* Tue, April 26, 2011 6:31:00 AM
>> *Subject:* [Qt-interest] Layers in Graphics Framework
>>
>> Hello,
>>
>> I am trying to implement layers support for my app.
>>
>> - A item can be in one or more layer.
>> - A view displays one / more layer
>> - If current display view doesn't display a layer assigned to an items,
>> that item is not shown. Also its not available to hit-testing methods (
>> items( QPoint etc.).
>>
>> Off course, I would not like to replicate the scene, keeping them in sync
>> could be costly.
>>
>> What will be the best approach to achieve it???
>>
>> AK
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110428/afbe6a83/attachment.html
More information about the Qt-interest-old
mailing list