From 693e29141cb1dd333451541d4d15ab95053ec002 Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Tue, 24 Jul 2018 22:12:10 -0400 Subject: [PATCH] Fix for a warning that was happening --- canframemodel.cpp | 4 ++-- mainwindow.cpp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) 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