I have a flowlayout that shows movie thumbnails (subclassed qwidgets). When I click a thumbnail, it’s marked as selected by setting a stylesheet to it (css border). What I want to do is, if I 1) click another thumbnail, or 2) click the widget that holds the flowlayout, it should be marked as unselected.
I’ve currently implemented the mousePressEvent(QMouseEvent *) method to draw the border when the thumbnail is clicked. I’m not sure how to proceed with marking it as unselected. Thanks.
You can store link to currently selected widget somewhere and unselect it when selecting some other.
Something like this:
in
mousePressEventin YoursubclassedQWidgetYou simplyemit iAmClicked()