Moving queue contents

I would like to move contents of one queue to another.
When I do it the following way, it does not work

module x;
integer Q1[$] = { 1,2, 3, 5, 6, 7, 8, 9, 10};
integer Q2[$];
initial begin
  for (int idx = 0; idx < Q1.size(); idx++) begin
    Q2.push_back(Q1.pop_front());
  end
  for (int idx = 0; idx < Q2.size(); idx++) begin
    $display ("Q2 ... %d", Q2[idx]);
  end
end
endmodule

The issue with this code is obvious.
I am popping out the contents of Q1 in a loop which progressively reduces the loop size and loop exit condition depends on the queue size.

To handle this, do I need to do this in 2 steps

  1. first transfer contents of Q1 to Q2 without popping the contents
  2. iterate through Q1 and delete the Q1 contents

Any other efficient method?

PS: I see that queue does not support deleting the entire queue…

In reply to verif_learner:

Q2 = Q1;
Q1 = {};

In reply to dave_59:

In reply to verif_learner:

Q2 = Q1;
Q1 = {};

Dave. Thanks.
Q = {}; is a good option for my case.
I can’t use Q2 = Q1 as Q2 may/may not contain elements already.

In reply to verif_learner:
You can use Q2 = Q1; it will construct and copy the aggragate array.

In reply to dave_59:

In reply to verif_learner:
You can use Q2 = Q1; it will construct and copy the aggragate array.

Q2 may have data already. So Q2 = Q1 will overwrite existing entries.
Anyway to append other than doing it procedurally in a loop?

In reply to verif_learner:

In reply to dave_59:
Q2 may have data already. So Q2 = Q1 will overwrite existing entries.
Anyway to append other than doing it procedurally in a loop?

ok, looks like it is possible to do

Q2 = {Q2, Q1}