diff --git a/src/snapshotmanager.cpp b/src/snapshotmanager.cpp --- a/src/snapshotmanager.cpp +++ b/src/snapshotmanager.cpp @@ -147,7 +147,8 @@ void SnapshotManager::loadSnapshotFromFi // read first row as headlines and determine number of channels auto headLine = QString(file.readLine()); - unsigned numOfChannels = headLine.split(',').size(); + QStringList channelNames = headLine.split(','); + unsigned numOfChannels = channelNames.size(); // read data QVector> data(numOfChannels); @@ -185,6 +186,7 @@ void SnapshotManager::loadSnapshotFromFi auto snapshot = new Snapshot(_mainWindow, QFileInfo(fileName).baseName()); snapshot->data = data; + snapshot->setChannelNames(channelNames); addSnapshot(snapshot, false); }