#include #include #include #include void test(QListWidget *l, QString name) { QFile f(QCoreApplication::applicationDirPath() + "/" + name); if(!f.open(QIODevice::ReadOnly)) { qDebug() << "ERR: " << name << " failed to open"; return; } while(!f.atEnd()) { QByteArray b = QByteArray::fromHex(f.readLine().replace('\n', "")); // No Crash //l->insertItem(0, b); // Crash l->insertItem(0, QString::fromUtf8(b)); } } int main(int argc, char *argv[]) { QApplication a(argc, argv); QListWidget *l = new QListWidget; l->resize(800, 300); l->show(); test(l, "users.50.txt"); return a.exec(); }