Placeholder in qt

Viewed 8695

I want to set a placeholder text in a QLineEdit. I am using the below code to do so:

QLineEdit *q = new QLineEdit;
q->setPlaceholderText("Enter number");

But on executing, the placeholder does not set. What may be the problem here?

1 Answers
Related