#include <QApplication>
#include <QHBoxLayout>
#include <QSlider>
#include <QSpinBox>
int main(int argc,char* argv[])
{
QApplication app(argc,argv);
QWidget *window = new QWidget;
window->setWindowTitle("Enter your age");
QSpinBox *spinbox = new QSpinBox();
QSlider *sliber = new QSlider(Qt::Horizontal);
spinbox->setRange(0,130);
sliber->setRange(0,130);
QObject::connect(spinbox, SIGNAL(valueChanged(int)),
sliber, SLOT(setValue(int)));
QObject::connect(sliber, SIGNAL(valueChanged(int)),
spinbox, SLOT(setValue(int)));
spinbox->setValue(24);
QHBoxLayout *HlayoutBox = new QHBoxLayout;
HlayoutBox->addWidget(spinbox);
HlayoutBox->addWidget(sliber);
window->setLayout(HlayoutBox);
window->show();
return app.exec();
}