X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fviews%2Ftabular_decoder%2Fmodel.cpp;h=28467de4a3424db932b06c5f32243e91b663cc4d;hb=593ea025f22372ed6761d0cb300f0873fa1a47e7;hp=1d4d839e4757be2ad20169c09b621f04044013b1;hpb=86d4b8e3e52a422fe3a6956d6bbef27f1859717b;p=pulseview.git diff --git a/pv/views/tabular_decoder/model.cpp b/pv/views/tabular_decoder/model.cpp index 1d4d839e..28467de4 100644 --- a/pv/views/tabular_decoder/model.cpp +++ b/pv/views/tabular_decoder/model.cpp @@ -130,10 +130,9 @@ QModelIndex AnnotationCollectionModel::index(int row, int column, const QModelIndex& parent_idx) const { (void)parent_idx; - assert(row >= 0); assert(column >= 0); - if (!dataset_) + if (!dataset_ || (row < 0)) return QModelIndex(); QModelIndex idx; @@ -202,8 +201,7 @@ void AnnotationCollectionModel::set_signal_and_segment(data::DecodeSignal* signa } else { // Force the view associated with this model to update when we have more annotations if (prev_last_row_ < new_row_count) { - dataChanged(index(prev_last_row_, 0, QModelIndex()), - index(new_row_count, 0, QModelIndex())); + dataChanged(index(prev_last_row_, 0), index(new_row_count, 0)); layoutChanged(); } } @@ -246,7 +244,7 @@ void AnnotationCollectionModel::update_annotations_without_hidden() all_annotations_without_hidden_.resize(count); - dataChanged(index(0, 0, QModelIndex()), index(count, 0, QModelIndex())); + dataChanged(index(0, 0), index(count, 0)); layoutChanged(); }