Home > Mobile >  QT [for] button icon scaling problems
QT [for] button icon scaling problems

Time:09-16

Qpushbutton icon attribute set of ICONS and its size, the icon file for the vector icon file, within the designer to see the effect of normal, don't know why little a lot of actual runtime;
Results, as shown on the left is running, on the right is the design drawings;

Pray for god to reassure

CodePudding user response:

Squeeze HorizontalSpacer will button on the right position on the left, three methods:
1/will HorizontalSpacer take out, leave enough space to the right;
2/set the HorizontalLayout controls space scale, make the space of the button is not affected;
3/to fix the width of the button, you simply set the size of the Icon Icon, not the button size;
Satisfaction and post, thank you!

CodePudding user response:

See if call autoFillBackground function

CodePudding user response:

You first set the pushbutton into a fixed size, the size of the button will not because the layout is changed

CodePudding user response:

The QPushButton setIconSize method is used to adjust the size of the Icon
  •  Tags:  
  • Qt
  • Related