QCustomPlot Discussion and Comments

getter qvector<double>Return to overview

Hello all ! :)

i have a little problem :(

i don't understand why my qvector in the seconde_p3 is empty ?!

//////////////////////////////////////////// ]seconde_p2.h
 //getter
    int get_c() const{return c;}
    QVector<double> get_vector() const{return fer;}
    //setter
    //void set_c(int val);

protected :
    int c=6;
    QVector<double> fer;


//////////////////////////////////////////// ]seconde_p2.cpp
seconde_p2::seconde_p2(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::seconde_p2)
{
    ui->setupUi(this);

    c=3;
    fer={ 1, 2, 3, 4, 5, 6, 7 };


}


and in my seconde_p3.cpp

seconde_p3::seconde_p3(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::seconde_p3)
{
    ui->setupUi(this);

seconde_p2* test = new seconde_p2();
seconde_p2* test1 = new seconde_p2();

test->get_data1();
qDebug()<<"qvector<double> display"<< test->get_vector();

test1->get_c();
qDebug()<<"int display"<< test1->get_c();


}

but in the console i have :
qvector<double> display QVector() // why he is empty ?
int display 3

in the line 10 of seconde_p3.cpp is not get_data1 but get_vector it's a bad drag and drop