Well this proves I'm a noob at coding! I've looked everywhere and still can't get this right. This should be pretty simple.
I have been trying this:
int i;
for(i=0;i<16;i++)
{
QChar q = QChar(memblock[i]);
QString s = QString(q);
QTableWidgetItem *item = new QTableWidgetItem(s);
ui->tableWidget->setItem(rowCount, colCount, item);
}
So I'm making table items from each string. That's because I also couldn't figure out how to make table items from just a QChar, or plain char.
But each cell ends up with:
Ý
Whereas when I add in:
cout << memblock[i];
It properly shows:
RIFFd2 WAVEfmt
Here is the code that reads in the raw data:
ifstream file (text, ios::in|ios::binary|ios::ate);
if (file.is_open())
{
size = file.tellg();
memblock = new char [size];
file.seekg(0, ios::beg);
file.read(memblock, size);
file.close();
}
Also, when I do cout << &memblock[i]
, for i from 0 to 4 I get:
RIFFd2
IFFd2
FFd2
Fd2
And so on.