1
#include <qapplication.h>
2
#include <qmainwindow.h>
3
#include <qwt_counter.h>
9
class MainWindow: public QMainWindow
14
QToolBar *toolBar = new QToolBar(this);
15
toolBar->setFixedHeight(80);
17
#if QT_VERSION < 0x040000
18
setDockEnabled(TornOff, true);
19
setRightJustification(true);
21
toolBar->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea);
23
QWidget *hBox = new QWidget(toolBar);
24
QLabel *label = new QLabel("Timer Interval", hBox);
25
QwtCounter *counter = new QwtCounter(hBox);
26
counter->setRange(-1.0, 100.0, 1.0);
28
QHBoxLayout *layout = new QHBoxLayout(hBox);
29
layout->addWidget(label);
30
layout->addWidget(counter);
31
layout->addWidget(new QWidget(hBox), 10); // spacer);
33
#if QT_VERSION >= 0x040000
34
toolBar->addWidget(hBox);
39
DataPlot *plot = new DataPlot(this);
40
setCentralWidget(plot);
42
connect(counter, SIGNAL(valueChanged(double)),
43
plot, SLOT(setTimerInterval(double)) );
45
counter->setValue(20.0);
49
int main(int argc, char **argv)
51
QApplication a(argc, argv);
53
MainWindow mainWindow;
54
#if QT_VERSION < 0x040000
55
a.setMainWidget(&mainWindow);
58
mainWindow.resize(600,400);