PyQt icon indicating copy to clipboard operation
PyQt copied to clipboard

widget.setMask multiple rects in pyQt5

Open upmanager opened this issue 3 years ago • 2 comments

https://stackoverflow.com/questions/72833464/widget-setmask-multiple-rects-in-pyqt5

upmanager avatar Jul 01 '22 18:07 upmanager

maybe you can use paintEvent

like:

class PaintWidget(QWidget):

    def paintEvent(self, event):
        painter = QPainter(self)
        painter.setPen(QPen(1, Qt.black))
        painter.fillRect(self.rect(), Qt.yellow)

892768447 avatar Jul 02 '22 01:07 892768447

I want make mask for yellow area. So, Hope to show only yellow area on widget, and other side want to hide.

upmanager avatar Jul 03 '22 19:07 upmanager