Results 1 to 5 of 5

Thread: find the item

  1. #1
    Join Date
    Oct 2009
    Location
    China
    Posts
    20
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Question find the item

    hello,
    there are several items in the scene.
    when the mouse above one item, how to enlarge the item to full screen.
    I want to reimplement the QGraphicsScene::xxxEvent().
    I nearly can't move the items.I'm so confused.I want know the scene how to know the item that under my mouse.
    I'm a newcomer.Thanks !

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: find the item

    Did you go through the Qt Demos ?
    Have a look Qt Embedded Dialogs under Demonstrations in Qt Demos..you will get an idea.
    Also if u want to show an item fullscreen on mouse over, also think of how u want to get back to normal view again..

  3. The following user says thank you to aamer4yu for this useful post:

    ensky_cy (2nd December 2009)

  4. #3
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: find the item

    you just need to reimplement mouseMoveEvent() or hoverEnterEvent(). But don't forget to put setAcceptHoverEvents(true) in order to implement your custom things when the cursor is on the item.

  5. The following user says thank you to zgulser for this useful post:

    ensky_cy (2nd December 2009)

  6. #4
    Join Date
    Oct 2009
    Location
    China
    Posts
    20
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: find the item

    Thanks all.
    embeded demo is about QGraphicsProxywidget.there is only QGraphicsItem,QGraphicsItem doesn't have signal and slot,it's hard to bring out animate.If I reimplement QGraphicsItem's fuctions,how to program them(eg.hoverLeaveEvent).
    scale()fuction,it isn't work.
    Thanks !

  7. #5
    Join Date
    Sep 2009
    Posts
    140
    Thanks
    4
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: find the item

    Quote Originally Posted by ensky_cy View Post
    hello,
    when the mouse above one item, how to enlarge the item to full screen.
    What do you mean by that? Changing item position and size? are you sure?

    I see two points:
    1. When the item need to be enlarged and reduced?
    Either you listen to mouse move of the view(or scene) or the item. Not same thing in design since the second one need a link from your item to object processor that will enlarge it.

    2.Enlarge and reduce Item
    Lots of way to do it. Your approach is to change the scene. But then the hoverLeave will be trigger on modified item that is bigger and not for real coordinates of the scene.
    You can also use a unique top level item whose content is changed depending on item hovered by mouse. Or you can add an overlapped view with a copy of the item displayed at another scale but it is tricky.

  8. The following user says thank you to scascio for this useful post:

    ensky_cy (2nd December 2009)

Similar Threads

  1. QTreeView: Find nearest item to mouse pointer
    By squidge in forum Qt Programming
    Replies: 3
    Last Post: 31st October 2009, 20:24
  2. Qt and VC++ instalation problem
    By gui.br in forum Installation and Deployment
    Replies: 6
    Last Post: 21st July 2009, 07:13
  3. Find item in table
    By JohnToddSr in forum Qt Programming
    Replies: 1
    Last Post: 3rd July 2009, 16:24
  4. problems installing Qt opensource with msvc2008 support
    By odin1985 in forum Installation and Deployment
    Replies: 6
    Last Post: 24th May 2008, 09:06
  5. Replies: 17
    Last Post: 31st March 2006, 05:57

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.