Results 1 to 4 of 4

Thread: QGraphicsItem and signals

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: QGraphicsItem and signals

    Thanks...

    How about just using QGraphicsScene::selectedItems()?
    Well I am not selecting the items based on rubberbanding... just need to pick item from mouse press... so i guess items() will also do isnt it ?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QGraphicsItem and signals

    Quote Originally Posted by aamer4yu View Post
    Well I am not selecting the items based on rubberbanding... just need to pick item from mouse press... so i guess items() will also do isnt it ?
    Yes, but is it worth it? I'd simply make items selectable using QGraphicsItem::ItemIsSelectable and then query for items selected - you'll get a much shorter list resulting in a faster application. But maybe you can simply use QGraphicsItem::mousePressEvent() and handle the interaction there? It would be best this way... There is no need to call either items(), selectedItems() nor a mouse press from the scene then.

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
  •  
Qt is a trademark of The Qt Company.