Fix for a warning that was happening

This commit is contained in:
Collin Kidder
2018-07-24 22:12:10 -04:00
parent ec6d716ae3
commit 693e29141c
2 changed files with 6 additions and 2 deletions
+2 -2
View File
@@ -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();
}
+4
View File
@@ -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