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_) {
} 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_)
void View::on_table_item_double_clicked(const QModelIndex& index)
{
- const Annotation* ann = static_cast<const Annotation*>(index.internalPointer());
+ const QModelIndex src_idx = filter_proxy_model_->mapToSource(index);
+
+ const Annotation* ann = static_cast<const Annotation*>(src_idx.internalPointer());
+ assert(ann);
shared_ptr<views::ViewBase> main_view = session_.main_view();
for (int i = 0; i < table_view_->horizontalHeader()->count(); i++) {
int column = table_view_->horizontalHeader()->logicalIndex(i);
- const QString title = model_->headerData(column, Qt::Horizontal, Qt::DisplayRole).toString();
+ const QString title =
+ filter_proxy_model_->headerData(column, Qt::Horizontal, Qt::DisplayRole).toString();
QAction* action = new QAction(title, this);
action->setCheckable(true);
const QModelIndex idx = filter_proxy_model_->mapFromSource(first_highlighted_idx);
table_view_->scrollTo(idx, QAbstractItemView::EnsureVisible);
}
+
+ // Force repaint, otherwise the table doesn't immediately update for some reason
+ table_view_->viewport()->update();
}
}
}