T
T
tfaders2021-11-20 22:22:57
PyQt
tfaders, 2021-11-20 22:22:57

Hiding a widget in PyQt5, how to hide a picture?

Faced the problem of hiding the QPixmap widget in PyQt5, I tried using self.img.close () gives an error, are there any other ways to do this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ronald McDonald, 2021-11-20
@Zoominger

Change to gray background.
Either use .hide()

B
bbkmzzzz, 2021-11-20
@bbkmzzzz

619953cc750c5692669410.jpeg
1) names. pix != pix1
2) In your case, the QPixmap is displayed on a QLabel, hide the QLabel
QWidget.hide()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question