canvas() {
curve
->setPen
(QPen(Qt
::lightGray));
curve->attach(this);
// Create the Canvas
// Make a grid
// Create a Picker
...
}
Plot::Plot(QWidget *parent): QwtPlot(parent),
canvas() {
curve = new QwtPlotCurve;
curve->setPen(QPen(Qt::lightGray));
curve->attach(this);
// Create the Canvas
// Make a grid
// Create a Picker
...
}
To copy to clipboard, switch view to plain text mode
void MainWindow::on_actionAudio_Signal_triggered() {
QString filename
= QFileDialog::getOpenFileName(this, tr
("Open Audio"),
"", tr
("Audio Files (*.wav *.3gp *.mp4)"));
DataSamples(filename);
ui->WavePlotL->moveToThread(thread);
ui->WavePlotR->moveToThread(thread);
connect(this->thread(),SIGNAL(started()),ui->WavePlotL,SLOT(SetData(DataSamples(left);
connect(ui->WavePlotL,SIGNAL(finished()), this->thread(),SLOT(quit()));
connect(ui->WavePlotL,SIGNAL(finished()), ui->WavePlotL,SLOT(deleteLater()));
connect(this->thread(),SIGNAL(finished()), this->thread(),SLOT(deleteLater()));
connect(this->thread(),SIGNAL(started()) , ui->WavePlotR,SLOT(SetData(DataSamples(right));
connect(ui->WavePlotR,SIGNAL(finished()), this->thread(),SLOT(quit()));
connect(ui->WavePlotR,SIGNAL(finished()), ui->WavePlotR,SLOT(deleteLater()));
connect(this->thread(),SIGNAL(finished()), this->thread(),SLOT(deleteLater()));
thread->start();
void MainWindow::on_actionAudio_Signal_triggered() {
QString filename = QFileDialog::getOpenFileName(this, tr("Open Audio"), "", tr("Audio Files (*.wav *.3gp *.mp4)"));
DataSamples(filename);
QThread* thread = new QThread;
ui->WavePlotL->moveToThread(thread);
ui->WavePlotR->moveToThread(thread);
connect(this->thread(),SIGNAL(started()),ui->WavePlotL,SLOT(SetData(DataSamples(left);
connect(ui->WavePlotL,SIGNAL(finished()), this->thread(),SLOT(quit()));
connect(ui->WavePlotL,SIGNAL(finished()), ui->WavePlotL,SLOT(deleteLater()));
connect(this->thread(),SIGNAL(finished()), this->thread(),SLOT(deleteLater()));
connect(this->thread(),SIGNAL(started()) , ui->WavePlotR,SLOT(SetData(DataSamples(right));
connect(ui->WavePlotR,SIGNAL(finished()), this->thread(),SLOT(quit()));
connect(ui->WavePlotR,SIGNAL(finished()), ui->WavePlotR,SLOT(deleteLater()));
connect(this->thread(),SIGNAL(finished()), this->thread(),SLOT(deleteLater()));
thread->start();
To copy to clipboard, switch view to plain text mode
Bookmarks