Don't use an array. Use QVector or QList as Radek said. Both of them don't need initial size.