user174084
user174084

Reputation: 1107

Qt LineEdit boundires

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()

Upvotes: 1

Views: 158

Answers (2)

arne
arne

Reputation: 4674

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

Upvotes: 0

bmeric
bmeric

Reputation: 1132

You can use QLineEdit StyleSheet property.

padding-left: 10px;
padding-right: 10px;

Upvotes: 1

Related Questions