Drawing points on QPixmap on QWidget (pyqt5)
I have a QWidget with a QLayout on which there is a QLabel. I set a QPixmap on the label. Wherever the user clicks on the image, I want to draw a point. I defined mouseReleaseEvent (which works) and paintEvent (but no points are drawn). I've read all similar questions and none of the solutions worked for me. Any help? My relevant code: class ImageScroller(QtWidgets.QWidget): def __init__(self, img): QtWidgets.QWidget.__init__(self) main_layout = QtWidgets.QVBoxLayout() self._image_label = QtWidgets.QLabel() self._set_image(img) main_layout.addWidget(self._image_label) main_layout.addStretch()