PDA

View Full Version : QLineEdit padding



bunjee
17th September 2008, 23:43
Hey there,

I've subclassed QLineEdit and I'm doing the following to get a padding and a custom background color :


q->setStyleSheet("padding-left: 24px;");
QPalette p = palette();
p.setColor(QPalette::Text, palette().color(QPalette::HighlightedText));
p.setColor(QPalette::Base, Qt::black);
setPalette(p);

For some reason:
- when applying my style sheet my QLineEdit background goes blank, even if I force it to black.

- If I remove the padding line, everything works.

Why ?