ScatterPlotWidget::ScatterPlotWidget(QWidget *parent) : QWidget(parent), ui(new Ui::ScatterPlotWidget), selectedTrips(NULL), selectionGraph(NULL) { ui->setupUi(this); attrib1 = getAttrib(ui->comboBox->currentText()); attrib2 = getAttrib(ui->comboBox_2->currentText()); // Global* global = Global::getInstance(); int numExtraFields = global->numExtraFields(); for(int i = 0 ; i < numExtraFields ; ++i){ ExtraField field = global->getExtraField(i); if(field.active){ ui->comboBox->addItem(field.screenName); ui->comboBox_2->addItem(field.screenName); } } // connect slots that takes care that when an axis is selected, only that direction can be dragged and zoomed: connect(ui->customPlot, SIGNAL(mousePress(QMouseEvent*)), this, SLOT(mousePress())); connect(ui->customPlot, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(mouseWheel())); // updatePlot(); }