PDA

View Full Version : smal, non-rectangular interactive widget approaches



jcbikeski
15th August 2011, 22:06
I have an application where I want to add some user settable bookmarks big, scrollable plot. I'll have some vertical, transparent lines but above these I thought I'd have downward pointing triangles as handles for the user to move. I figured I could make these triangle markers not be widgets at all and have the containing bookmark area widget handle mouse interactions and check which bookmark the mouse may be over seeing if it's in a QRegion for the bookmark handle image. But given other desires for interaction I thought I'd check if there was a good way to leverage a QWidget for such objects. They may partially overlap each other at times and so the notion of being over the triangle rather than just the enclosing rectangle is important. Any thoughts?

Thanks
John

Added after 1 57 minutes:

guess the answer is using QWidget::setMask. I didn't notice before that it also affected mouse clicks. Now to discover if widgets behind but visible will get those clicks.

wysota
15th August 2011, 22:53
I don't know what your application is supposed to do but consider using Graphics View instead of QWidget approach for your system.