Connect QSpinBox with QTimer
Solved
General and Desktop
-
Hey everyone,
I think my Problem is a pretty small one for most of you, but I don't get any solution yet, it's my first Qt Programm.What I want to do:
In Qt Designer I added a QSpinBox. The user can choose a value between 1 and 10. This value should get connected to a QTimer, so that I get something liketimer->start(Value of the QSpinBox)
Any Tipps or Solution? Thanks a lot!
Screenshot::Screenshot(QWidget *parent) : QMainWindow(parent), ui(new Ui::Screenshot) { ui->setupUi(this); timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(timerSlot())); connect(ui->spinBox, SIGNAL(valueChanged(int value)), this, SLOT(spinBoxSlot(int value))); } Screenshot::~Screenshot() { delete ui; } void Screenshot::IntervallSpinBox() { timer->start(int value); }
-
Hi
connect without using parameter name, just type connect(ui->spinBox, SIGNAL(valueChanged(int )), this, SLOT(spinBoxSlot(int ))); and use the value in slot void Screenshot::IntervallSpinBox(int value) { timer->start(value); }