From 2deadc6cfbf71e06908963fb1bae628cfe370f9d Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 16 Aug 2020 17:04:32 +0200 Subject: Basic model/view action works --- taglistmodel.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'taglistmodel.cpp') diff --git a/taglistmodel.cpp b/taglistmodel.cpp index e3ba006..d68fc57 100644 --- a/taglistmodel.cpp +++ b/taglistmodel.cpp @@ -4,6 +4,7 @@ TagListModel::TagListModel(SQLiteSaveFile &backend) : backend(backend) , cached_tags(backend.getAllTags()) { + qDebug() << "connecting TagListModel" << &backend; connect(&backend, &SQLiteSaveFile::tagChange, [=](TagChange change, const Tag &tag) { Q_UNUSED(change); Q_UNUSED(tag); reloadTags(); }); connect(&backend, &SQLiteSaveFile::fileReload, @@ -28,10 +29,11 @@ QVariant TagListModel::data(const QModelIndex &index, int role) const if (!index.isValid()) return QVariant(); - if (role != Qt::DisplayRole) + if (role != Qt::DisplayRole && role != Qt::EditRole) return QVariant(); - return cached_tags.at(index.row()).name; + auto rv = cached_tags.at(index.row()).name; + return rv; } QVariant TagListModel::headerData(int section, Qt::Orientation orientation, int role) const -- cgit