// Add plots and connect their signals
// The "clicked()" signal is not actually doing anything
void MainWindow::add_plots()
{
for (int i=0; i<m_num_rows; i++) {
for (int j=0; j<m_num_cols; j++) {
int index = i*m_num_cols+j;
m_plots[index] = new QRealtimePlot(m_plots_frame);
m_plots_layout->addWidget(m_plots[index], i, j);
m_plots[index]->setMargin(4);
connect(d_clearAction, SIGNAL(triggered()), m_plots[index], SLOT(clear()));
connect(m_plots[index], SIGNAL(running(bool)), this, SLOT(showRunning(bool)));
connect(m_plots[index], SIGNAL(clicked()), m_signal_mapper, SLOT(map()));
m_signal_mapper->setMapping(m_plots[index], index);
}
}
connect(m_signal_mapper, SIGNAL(mapped(int)), this, SLOT(slot_plot_clicked(int)));
}
// Add plots and connect their signals
// The "clicked()" signal is not actually doing anything
void MainWindow::add_plots()
{
for (int i=0; i<m_num_rows; i++) {
for (int j=0; j<m_num_cols; j++) {
int index = i*m_num_cols+j;
m_plots[index] = new QRealtimePlot(m_plots_frame);
m_plots_layout->addWidget(m_plots[index], i, j);
m_plots[index]->setMargin(4);
connect(d_clearAction, SIGNAL(triggered()), m_plots[index], SLOT(clear()));
connect(m_plots[index], SIGNAL(running(bool)), this, SLOT(showRunning(bool)));
connect(m_plots[index], SIGNAL(clicked()), m_signal_mapper, SLOT(map()));
m_signal_mapper->setMapping(m_plots[index], index);
}
}
connect(m_signal_mapper, SIGNAL(mapped(int)), this, SLOT(slot_plot_clicked(int)));
}
To copy to clipboard, switch view to plain text mode
Bookmarks