Why doesn't work?
This code
void Widget::on_openFileButton_clicked()
{
this,
tr ("Open File"),
".",
tr ("Executable files (*exe)"));
if (!fileName.isEmpty ()) {
const int SIZE = 100;
int readSize;
readSize = (f.size () > SIZE)? SIZE: f.size ();
ui->rawDataEdit->setPlainText (ba);
ui->hexDataEdit->setPlainText (ba.toHex ());
}
}
void Widget::on_openFileButton_clicked()
{
QString fileName = QFileDialog::getOpenFileName (
this,
tr ("Open File"),
".",
tr ("Executable files (*exe)"));
if (!fileName.isEmpty ()) {
QFile f (fileName);
const int SIZE = 100;
int readSize;
f.open (QIODevice::ReadOnly);
readSize = (f.size () > SIZE)? SIZE: f.size ();
QByteArray ba = f.read (readSize);
ui->rawDataEdit->setPlainText (ba);
ui->hexDataEdit->setPlainText (ba.toHex ());
}
}
To copy to clipboard, switch view to plain text mode
shows this output when I select a EXE file
imagine1.JPG
Bookmarks