I have x, y variables that are constantly changing
Only when user clicks a button will the x, y variable at that time be stored in array

Created button & linking to function ->no problem

not sure how to go about the array part
this is my code:
.h
Qt Code:
  1. private:
  2. QList<int> ArrayX;
  3. QList<int> ArrayY;
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. void my_qlabel::transferValues()
  2. {
  3. //counter initialised to 0 in constructor
  4. Counter += 1;
  5. ArrayX[Counter] = x;
  6. ArrayY[Counter] = y;
  7. }
To copy to clipboard, switch view to plain text mode 

Is the array Declared properly (array Has to be dynamic as it can increase as many time user pushes button)
Do I have to use the .append???

please provide me with sample code on qlist if possible?

Thanks