diff --git a/canframemodel.cpp b/canframemodel.cpp index 94f0e0a..a0e825e 100644 --- a/canframemodel.cpp +++ b/canframemodel.cpp @@ -410,7 +410,7 @@ void CANFrameModel::addFrame(const CANFrame& frame, bool autoRefresh = false) frames.append(tempFrame); if (filters[tempFrame.ID]) { - if (autoRefresh) beginInsertRows(QModelIndex(), filteredFrames.count() + 1, filteredFrames.count() + 1); + if (autoRefresh) beginInsertRows(QModelIndex(), filteredFrames.count(), filteredFrames.count()); filteredFrames.append(tempFrame); if (autoRefresh) endInsertRows(); } @@ -432,7 +432,7 @@ void CANFrameModel::addFrame(const CANFrame& frame, bool autoRefresh = false) frames.append(tempFrame); if (filters[tempFrame.ID]) { - if (autoRefresh) beginInsertRows(QModelIndex(), filteredFrames.count() + 1, filteredFrames.count() + 1); + if (autoRefresh) beginInsertRows(QModelIndex(), filteredFrames.count(), filteredFrames.count()); filteredFrames.append(tempFrame); if (autoRefresh) endInsertRows(); } diff --git a/mainwindow.cpp b/mainwindow.cpp index 6a34cc2..a0d1573 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -160,6 +160,10 @@ MainWindow::MainWindow(QWidget *parent) : temp.bus = 0; temp.ID = 0x100; temp.len = 0; + temp.extended = false; + temp.isReceived = true; + temp.remote = false; + temp.timestamp = 100000000; model->addFrame(temp, true); qApp->processEvents(); tickGUIUpdate(); //force a GUI refresh so that the row exists to measure