I put four qlabel in a gridlayout below, Stretch is 1:1, then one map QFileInfo the fileInfo (" d:/1. PNG "); If (the fileInfo isFile ()) {QPixmap img (" d:/1. PNG "); Img. Scaled (UI. LabPic_1 - & gt; The size (), Qt: : IgnoreAspectRatio, Qt: : SmoothTransformation); UI. LabPic_1 - & gt; SetPixmap (img); } after proportion is like this, label1 map after amplification,
images: QQ picture 20180313113238. The PNG but put 3 label or 4 percentage is normal,
setStretch used also have no reaction, and the great god can help us see how can you post a picture when the proportion of the fixed layout?
CodePudding user response:
Set the label drawing strategy, setSizePolicy (QSizePolicy: : Ignored, QSizePolicy: : Ignored).
CodePudding user response:
Hello, would you solve it,