Home > other >  Questions about use QLabel display picture
Questions about use QLabel display picture

Time:01-23

The code shown below: QPixmap pixmap (" :/newPrefix/UI/login. PNG ");//a small icon label - & gt; SetPixmap (pixmap); The ICONS shown but it is very big, how to make the size of the icon to adapt himself to the QLabel controls

CodePudding user response:

You mean the scaling of the picture?

CodePudding user response:

QPixmap pixmap (" :/newPrefix/UI/login. The PNG "); Pixmap=pixmap. Scaled (label - & gt; The size ());//add the label - & gt; SetPixmap (pixmap);

CodePudding user response:

The size of the icon to adapt himself to the QLabel controls in Python is this command QLabel setScaledContents (True)
  • Related