Tuesday, July 6, 2010

Slider and SpinBox

Slider and SpinBox


#include <QtGui>

int main(int argc, char* argv[])
{
QApplication app(argc, argv);

QWidget* mainwindow = new QWidget();
QVBoxLayout* mainlayout = new QVBoxLayout();

QSlider* slider = new QSlider(Qt::Horizontal, mainwindow);
slider->setRange(0, 100);

QSpinBox* spinBox = new QSpinBox(mainwindow);
spinBox->setRange(0, 100);


mainlayout->addWidget(slider);
mainlayout->addWidget(spinBox);

mainwindow->setLayout(mainlayout);
mainwindow->show();
return app.exec();
}