I would like to change the position of the lineEdit (or even a PushButton if it's not possible with the lineEdit) from my Qt application, according to the input given. So let's say that I want the x position to be 150 pixels, then I would insert 150 into the lineEdit. Is there any way to do this?
I've already tried this:
void DrawTest::on_lineEdit_returnPressed()
{
QString x = ui->lineEdit->text();
qDebug() << "x: " << x;
QString style = "QLineEdit {"
":" +ui->lineEdit->text()+ "px;"
"background-color: #FF00FF;"
"};";
qDebug() << "Style: " << style;
ui->lineEdit->setStyleSheet(style);
}