I'm trying to insert different QCPItemtexts at different graphs, but SetClipAxisRect is only functioning at first graph. What is the problem?


          QCPAxisRect* r = new QCPAxisRect(ui->customPlot);
                    ui->customPlot->plotLayout()->addElement(p+1, k, r);

                    if (show_par == 1){
                        for (int j=0; j < var_pares[i].length();j++){
                            QCPItemText *pares_texto = new QCPItemText(ui->customPlot);
                            pares_texto->setClipToAxisRect(true);
                            pares_texto->setClipAxisRect(r);
                            pares_texto->position->setAxisRect(r);
                            pares_texto->position->
                            pares_texto->position->setType(QCPItemPosition::ptPlotCoords);
                            pares_texto->position->setCoords(v_lags[i][j],(v_continuidades[i][j]+0.5));
                            pares_texto->setRotation(-40);
                            pares_texto->setText(QString::number(var_pares[i][j]));
                            pares_texto->setFont(QFont(font().family(), 10));
                        }
                    }