DRASTIC speed up of file loading by not refreshing until the file load is done. Very fast now.
This commit is contained in:
+7
-1
@@ -98,8 +98,14 @@ QVariant CANFrameModel::headerData(int section, Qt::Orientation orientation,
|
|||||||
|
|
||||||
void CANFrameModel::addFrame(CANFrame &frame)
|
void CANFrameModel::addFrame(CANFrame &frame)
|
||||||
{
|
{
|
||||||
beginInsertRows(QModelIndex(), frames.count() + 1, frames.count() + 1);
|
//beginInsertRows(QModelIndex(), frames.count() + 1, frames.count() + 1);
|
||||||
frames.append(frame);
|
frames.append(frame);
|
||||||
|
//endInsertRows();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CANFrameModel::sendRefresh()
|
||||||
|
{
|
||||||
|
beginInsertRows(QModelIndex(), 0, frames.count());
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ public:
|
|||||||
int CANFrameModel::columnCount(const QModelIndex &) const;
|
int CANFrameModel::columnCount(const QModelIndex &) const;
|
||||||
|
|
||||||
void addFrame(CANFrame &frame);
|
void addFrame(CANFrame &frame);
|
||||||
|
void sendRefresh();
|
||||||
void clearFrames();
|
void clearFrames();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ void MainWindow::loadNativeCSVFile(QString filename)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
inFile->close();
|
inFile->close();
|
||||||
|
model->sendRefresh();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user