Bonjour,

J'ai intégré dans mon GUI une image, mais le problème est qu'elle est fixe et non dynamique (ne s'adapte pas en temps réel à la taille de la fenêtre).

Auriez-vous des suggestions?

Voici mon code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QHBoxLayout, QGroupBox, QDialog, QVBoxLayout, QLabel
from PyQt5.QtCore import QSettings
import sys
from PyQt5.QtGui import QIcon, QPixmap
 
class Example(QWidget):
 
    def __init__(self):
        super().__init__()      
        self.initUI()
 
    def initUI(self):      
        settings=QSettings('ini/application.ini',QSettings.IniFormat);
        APPLICATION_NAME=settings.value("GLOBAL_PARAMETERS/APPLICATION_NAME")
        self.setWindowIcon(QIcon('ini/graph.ico'))
 
        LabelForBandeau = QLabel(self)
        BandeauPicture = QPixmap('ini/bandeau.jpg')
        LabelForBandeau.setPixmap(BandeauPicture)
 
        self.setWindowTitle(APPLICATION_NAME)
        self.showMaximized()
 
if __name__ == '__main__':
 
    app = QApplication(sys.argv)
    app.setStyle('Fusion')
    ex = Example()
    sys.exit(app.exec_())
Merci par avance pour vos retour.