void AnnotationCollectionModel::set_signal_and_segment(data::DecodeSignal* signal, uint32_t current_segment)
{
+ layoutAboutToBeChanged();
+
if (!signal) {
all_annotations_ = nullptr;
dataset_ = nullptr;
void AnnotationCollectionModel::set_hide_hidden(bool hide_hidden)
{
+ layoutAboutToBeChanged();
+
hide_hidden_ = hide_hidden;
if (hide_hidden_) {
// we would need to highlight - only then do we do so
QModelIndex index = first;
do {
- const Annotation* ann =
- static_cast<const Annotation*>(index.internalPointer());
- assert(ann);
+ const Annotation* ann = static_cast<const Annotation*>(index.internalPointer());
+ if (!ann) // Can happen if the table is being modified at this exact time
+ return result;
if (((int64_t)ann->start_sample() <= sample_num) &&
((int64_t)ann->end_sample() >= sample_num)) {
} while (index != last);
}
- if (has_highlight || had_highlight_before_) {
+ if (has_highlight || had_highlight_before_)
dataChanged(first, last);
- layoutChanged();
- }
had_highlight_before_ = has_highlight;
if (!hide_hidden_)
return;
+ layoutAboutToBeChanged();
+
update_annotations_without_hidden();
if (dataset_)