#include <QApplication>
#include<QHBoxLayout>
#include<QSlider>
#include<QSpinBox>
int main(int argc, char *argv[])
{
QApplication myapp(argc, argv);
QWidget *w=new QWidget;
w->setWindowTitle("H_Layout");
QSpinBox *spb=new QSpinBox;
QSlider *sld=new QSlider(Qt::Horizontal);
spb->setRange(0,100);
sld->setRange(0,100);
QObject::connect(spb,SIGNAL(valueChanged(int)),sld,SLOT(setValue(int)));
QObject::connect(sld,SIGNAL(valueChanged(int)),spb,SLOT(setValue(int)));
spb->setValue(50);
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget((spb));
layout->addWidget(sld);
w->setLayout(layout);
#include<QHBoxLayout>
#include<QSlider>
#include<QSpinBox>
int main(int argc, char *argv[])
{
QApplication myapp(argc, argv);
QWidget *w=new QWidget;
w->setWindowTitle("H_Layout");
QSpinBox *spb=new QSpinBox;
QSlider *sld=new QSlider(Qt::Horizontal);
spb->setRange(0,100);
sld->setRange(0,100);
QObject::connect(spb,SIGNAL(valueChanged(int)),sld,SLOT(setValue(int)));
QObject::connect(sld,SIGNAL(valueChanged(int)),spb,SLOT(setValue(int)));
spb->setValue(50);
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget((spb));
layout->addWidget(sld);
w->setLayout(layout);