1

I have a QLineEdit which I have place a QPixmap on and at the end of the LineEdit. Is there a way where I can tell the LineEdit where to consider the end of the widget so that text is not drawn on top of the picutre?

All good the answer is setTextMargins()

AAEM
  • 1,837
  • 2
  • 18
  • 26
user174084
  • 1,087
  • 3
  • 14
  • 23

2 Answers2

1

You can use QLineEdit StyleSheet property.

padding-left: 10px;
padding-right: 10px;
bmeric
  • 1,124
  • 1
  • 17
  • 27
0

The LineEdit is a rectangular box - set its size correctly and everything should be fine, otherwise you might want to recheck your layouting.

arne
  • 4,514
  • 1
  • 28
  • 47