Hello everyone,
I am trying to create a button which is next to a slider,or a spinbox (or any other widgets) when this button is clicked a textbox widgets would popup and user could enter his values in it (which then affects the silder)
In order to get this done, I declared a QLineEdit object with its parent set to null, so that I can show up alone, next to the slider which it is going to change its value.
Now I am stuck where how I am supposed to set the qlinedits location.
auto loc =ui->toolButton->geometry();
spinbox->setGeometry(loc.x(),loc.y(),loc.width()+10,loc.height()+10);
spinbox->setWindowTitle("change your preference");
ui
->txtInfo
->append
(QString::number(loc.
x())+" "+QString::number(loc.
y()));
spinbox->move(this->geometry().topLeft().rx()+loc.x(),this->geometry().topLeft().ry()+loc.y());
spinbox->show();
auto loc =ui->toolButton->geometry();
spinbox->setGeometry(loc.x(),loc.y(),loc.width()+10,loc.height()+10);
spinbox->setWindowTitle("change your preference");
ui->txtInfo->append(QString::number(loc.x())+" "+QString::number(loc.y()));
spinbox->move(this->geometry().topLeft().rx()+loc.x(),this->geometry().topLeft().ry()+loc.y());
spinbox->show();
To copy to clipboard, switch view to plain text mode
Here I am trying to pop up a spinbox near the toolbutton,none of these work!
I appreciate any help
Thanks in advance
Bookmarks