I do with a vector like this:

Qt Code:
  1. QLabel *lbArr[SIZE];
  2.  
  3. for (int i = 0; i < SIZE; ++i)
  4. lbArr[i] = new QLabel(this);
  5.  
  6.  
  7. for (int i = 0; i < SIZE; ++i)
  8. lbArr[i]->setText( tr("Label n. %1").arg(i) );
To copy to clipboard, switch view to plain text mode