[Qt-interest] Signals emitted by QSceneView

Christian Gagneraud cgagneraud at techworks.ie
Mon Nov 29 19:02:58 CET 2010


On 11/29/2010 05:48 PM, Brian McKinnon wrote:
> I think I have found a solution.
[...]
> Does anyone have an opinion about calling "delete this;"?  I have seen
> it used before... but I feel unease about using it.

I have no clue if it's safe or not. Would QObject::DeleteLater() be safer?
http://doc.qt.nokia.com/4.7/qobject.html#deleteLater

Chris


>
> On Mon, Nov 29, 2010 at 11:32 AM, Christian Gagneraud
> <cgagneraud at techworks.ie <mailto:cgagneraud at techworks.ie>> wrote:
>
>     On 11/29/2010 03:16 PM, Brian McKinnon wrote:
>      > I set the sceneRect and now the scroll bars don't come up, but
>     I'm still
>
>     Perhaps the size of your view is bigger than the scene's size
>     multiplied by the zoom factor. Hence no need for scrollbar.
>     Anyway you can force scrollbars to be always displayed:
>     http://doc.qt.nokia.com/4.7/qt.html#ScrollBarPolicy-enum
>     As QGraphicsView is derived from QAbstractScrollArea.
>
>     My 2 cents,
>     Chris
>
>
>      > not getting any leave event.  It looks like I may just need to
>     initiate
>      > a drag event when I click on an item.  If that is the case I can
>      > probably still move the object around the scene using the drag event
>      > slots to move the item... but this seems sort of hacky.  Does anyone
>      > know if any signal is sent when a selected object is moved out of the
>      > scene or view?
>      >
>      > On Fri, Nov 26, 2010 at 12:57 PM, Sean Harmer
>      > <sean.harmer at maps-technology.com
>     <mailto:sean.harmer at maps-technology.com>
>      > <mailto:sean.harmer at maps-technology.com
>     <mailto:sean.harmer at maps-technology.com>>> wrote:
>      >
>      >     Hi,
>      >
>      >     On Friday 26 November 2010 16:49:14 Oliver.Knoll at comit.ch
>     <mailto:Oliver.Knoll at comit.ch>
>      > <mailto:Oliver.Knoll at comit.ch <mailto:Oliver.Knoll at comit.ch>> wrote:
>      > > On 2010-11-26 Brian Brian McKinnon wrote:
>      > > > ...  I've been trying to overload the leaveEvent,
>      > > > mouseLeaveEvent, ... well pretty much any leave event in
>     either the
>      > > > view, scene, or item that I can find with no luck.  Is there a
>      > > > notification that gets set out when a mouse leaves a view while
>      >     dragging
>      > > > an item in the scene?
>      > >
>      > > I am just doing my first steps with QGraphicsScene/View, hence I
>      >     do not
>      > > have much experience with that.
>      > >
>      > > In my case I observed that the QGraphicsScene "bounding box"
>      >     seems to be
>      > > enlarged once I move an item out "into the invisible". I notice
>     this
>      > > because scrollbars appear and the scrollable area becomes bigger.
>      > >
>      > > I don't think QGraphicsView/Scene would emit a "mouse leave"
>      >     event while
>      > > dragging, because enlarging the area seems to be the intended
>     action.
>      >
>      >     Not sure if it helps here, but you can prevent that behaviour by
>      >     explicitly
>      >     setting a sceneRect on your scene.
>      >
>      >     Sean
>      >     _______________________________________________
>      >     Qt-interest mailing list
>      > Qt-interest at trolltech.com <mailto:Qt-interest at trolltech.com>
>     <mailto:Qt-interest at trolltech.com <mailto:Qt-interest at trolltech.com>>
>      > http://lists.trolltech.com/mailman/listinfo/qt-interest
>      >
>      >
>      >
>      >
>      > _______________________________________________
>      > Qt-interest mailing list
>      > Qt-interest at trolltech.com <mailto:Qt-interest at trolltech.com>
>      > http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
>     --
>     Christian Gagneraud,
>     Electronics and software engineer
>
>     TechWorks Marine Ltd
>     4a, Park Lane
>     Dun Laoghaire, Co Dublin
>     Ireland
>
>     Tel: + 353 1 2365990
>     Fax: + 353 1 2365992
>     Web: www.techworks.ie <http://www.techworks.ie>
>
>
>     _______________________________________________
>     Qt-interest mailing list
>     Qt-interest at trolltech.com <mailto:Qt-interest at trolltech.com>
>     http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest


-- 
Christian Gagneraud,
Electronics and software engineer

TechWorks Marine Ltd
4a, Park Lane
Dun Laoghaire, Co Dublin
Ireland

Tel: + 353 1 2365990
Fax: + 353 1 2365992
Web: www.techworks.ie





More information about the Qt-interest-old mailing list