int main(int argc, char *argv[]) { QApplication a(argc, argv); Widget mainWindow; QDial *newDial = new QDial; QProgressBar *newProgressBar = new QProgressBar; newDial->setRange(0,100); newDial->setNotchTarget(5); newDial->setNotchesVisible(true); newDial->setPageStep(20); QObject::connect(newDial,SIGNAL(valueChanged(int)),newProgressBar,SLOT(setValue(int))); QBoxLayout *boxLayout = new QBoxLayout(QBoxLayout::TopToBottom); boxLayout->addWidget(newDial); boxLayout->addWidget(newProgressBar); mainWindow.setWindowTitle("Dial Change"); mainWindow.setLayout(boxLayout); mainWindow.setGeometry(430,330,200,200); mainWindow.show(); return a.exec(); }