0
I have an image and I need it to occupy 100%, will be the background of my program, how to proceed?
from PyQt5 import QtWidgets, QtGui
import sys
class Hello_World(QtWidgets.QWidget):
def __init__(self):
super(Hello_World, self).__init__()
self.setWindowTitle("Olá mundo!")
self.setGeometry(200,200,700,500)
self.setStyleSheet("Background-Color: #d9b3ff;")
self.texto = QtWidgets.QLabel(self)
self.texto.setPixmap(QtGui.QPixmap("Imagens/fundo.jpg"))
if __name__=="__main__":
app = QtWidgets.QApplication(sys.argv)
janela = Hello_World()
janela.show()
sys.exit(app.exec_())
I forgot to comment, but I wanted to adjust this background to grow when I click the maximize button.. thanks for the answer
– Luiz Henrique
It’s the same thing, only you instead of by fixed size, use the window size. I updated the answer.
– Bacco
looks good, I’ll test, thank you very much
– Luiz Henrique