Show main.cpp syntax highlighted
#include <qapplication.h>
#include <qmainwindow.h>
#include <qwt_counter.h>
#include <qtoolbar.h>
#include <qlabel.h>
#include <qlayout.h>
#include "data_plot.h"
class MainWindow: public QMainWindow
{
public:
MainWindow()
{
QToolBar *toolBar = new QToolBar(this);
toolBar->setFixedHeight(80);
#if QT_VERSION < 0x040000
setDockEnabled(TornOff, true);
setRightJustification(true);
#else
toolBar->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea);
#endif
QWidget *hBox = new QWidget(toolBar);
QLabel *label = new QLabel("Timer Interval", hBox);
QwtCounter *counter = new QwtCounter(hBox);
counter->setRange(-1.0, 100.0, 1.0);
QHBoxLayout *layout = new QHBoxLayout(hBox);
layout->addWidget(label);
layout->addWidget(counter);
layout->addWidget(new QWidget(hBox), 10); // spacer);
#if QT_VERSION >= 0x040000
toolBar->addWidget(hBox);
#endif
addToolBar(toolBar);
DataPlot *plot = new DataPlot(this);
setCentralWidget(plot);
connect(counter, SIGNAL(valueChanged(double)),
plot, SLOT(setTimerInterval(double)) );
counter->setValue(20.0);
}
};
int main(int argc, char **argv)
{
QApplication a(argc, argv);
MainWindow mainWindow;
#if QT_VERSION < 0x040000
a.setMainWidget(&mainWindow);
#endif
mainWindow.resize(600,400);
mainWindow.show();
return a.exec();
}
See more files for this project here
Marsyas (Music Analysis, Retrieval and Synthesis for Audio Signals) is a framework for developing systems for audio processing. It provides an general architecture for connecting audio, soundfiles, signal processing blocks and machine learning.
Project homepage:
http://sourceforge.net/projects/marsyas
Programming language(s): C++
License: other
data_plot.cpp
data_plot.h
data_plot.pro
main.cpp