+void TopicWidget::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) {
+ Q_UNUSED(previous);
+ setTopicForIndex(current);
+}
+
+void TopicWidget::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) {
+ QItemSelectionRange changedArea(topLeft, bottomRight);
+ QModelIndex currentIndex = selectionModel()->currentIndex();
+ if(changedArea.contains(currentIndex))
+ setTopicForIndex(currentIndex);
+};
+
+void TopicWidget::setTopicForIndex(const QModelIndex &index) {
+ QModelIndex topicIndex = index.sibling(index.row(), 1);
+ setTopic(topicIndex.data().toString());
+}
+