laurapons
laurapons

Reputation: 1103

QLineEdit: Change clearButton

When I set clearButtonEnabled= true, clearButton looks blurry. Is there any way to change the size of clearButton or to customize it with another icon?

Upvotes: 1

Views: 1209

Answers (1)

laurapons
laurapons

Reputation: 1103

For anyone interested, I found this workaround:

QHBoxLayout *pSearchLayout = new QHBoxLayout();
pSearchLayout->addStretch();
pSearchLayout->addWidget(ui->pushButton);
pSearchLayout->setSpacing(0);
pSearchLayout->setContentsMargins(0, 0, 0, 0);
ui->lineEditSearch->setLayout(pSearchLayout);

Upvotes: 1

Related Questions