QGraphicsView::itemAt(QPoint) or QGraphicsView::items(QPoint) will tell me the item or items at the given point.
I have items that are dots: tiny QGraphicsRectItems. I would like the user to be able to click near a dot to designate it, rather have to click exactly on top of it. So I would like to find the nearest item, within a given halo around the item.
I miss Tk's find_closest() function, which did exactly this. I could just iterate through all my items and calculate the distance: there are less than a hundred, usually. Or I could overlay my dots with larger transparent QGraphicsItems that define the selection halo I want.
Any other suggestions? Am I missing some functionality that already exists in the Qt graphics world?
Thanks,
Dan
Bookmarks