The
QFile
constructor expects a
QString
argument and not a
QStringList
.
You may only allow selection of a single file in the
QFileDialog
and get that as
QString
using
QFileDialog::getOpenFileName()
(note the missing 's' at the end).
Also your code will not compile here:
void MainWindow::readtxtfile(QStringList txtfileName)
{
QFile logfile(loggerfileName);
}
because
loggerfileName
is probably undefined.
[EDIT]
A tip when you got such errors:
Look up the function definition online (
http://doc.qt.io/qt-5/qfile.html[
^]) or by pressing F1 inside QtCreator when the cursor is on the function name. For a quick check move the mouse over the function name to get a popup with the function definition.