Raffael
21st September 2011, 23:14
Hello,
I was wondering what would be the smallest and fastest 2-dimensional QT container?
I’m looking for something that will hold arrays of 60×60 up to 200×200 elements.
The values stored in the array would be 0,1,2 or I could split one big array to two same size arrays holding 0 and 1.
I’ve thought about using QVector< QVector<short> > or two QBitArrays.
The problem with
QVector< QVector<short> >
is that I don’t know how to set it’s size as normally it would go like
QVector<short> vect(100)
Next problem is how to access elements. First thing that comes to my mind is:
vect.at(X).at(Y)
As for the QBitArray I couldn’t find any way to make it 2 dimensional.
All I need is reading/writing and maybe filling whole array.
Thank You for all responses.
I was wondering what would be the smallest and fastest 2-dimensional QT container?
I’m looking for something that will hold arrays of 60×60 up to 200×200 elements.
The values stored in the array would be 0,1,2 or I could split one big array to two same size arrays holding 0 and 1.
I’ve thought about using QVector< QVector<short> > or two QBitArrays.
The problem with
QVector< QVector<short> >
is that I don’t know how to set it’s size as normally it would go like
QVector<short> vect(100)
Next problem is how to access elements. First thing that comes to my mind is:
vect.at(X).at(Y)
As for the QBitArray I couldn’t find any way to make it 2 dimensional.
All I need is reading/writing and maybe filling whole array.
Thank You for all responses.