Hi, I am currently distinguishing between iRangeDrag and rectSelection as follow.

//This part of code is currently put under an EventFilter of mouseMove event
if(QApplication::keyboardModifiers() & Qt::ControlModifier){
    //rect selecting
    ui->widget_graph2->setSelectionRectMode(QCP::srmSelect);
}else{
    //iRange dragging
    ui->widget_graph2->setSelectionRectMode(QCP::srmNone);
}

I read the documentation that selectionChangedByUser() will be emitted by QCPCustomPlot when a rectSelection is made.

QCPDataSelection selection = ui->widget_graph2->graph(0)->selection();
foreach(QCPDataRange dataRange, selection.dataRanges()){
	QCPGraphDataContainer::const_iterator begin = ui->widget_graph2->graph(0)->data()->at(dataRange.begin());
	QCPGraphDataContainer::const_iterator end = ui->widget_graph2->graph(0)->data()->at(dataRange.end()); 
	for (QCPGraphDataContainer::const_iterator it=begin; it!=end; ++it){
	  //SET all values on the selected y-axis lines to red colour
	}
}

My doubt is how could I handle the selectionChangedByUser signal and perform the above code?