diff options
Diffstat (limited to 'taglistmodel.cpp')
-rw-r--r-- | taglistmodel.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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
|