diff options
author | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-08-16 17:04:32 +0200 |
---|---|---|
committer | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-08-16 17:04:32 +0200 |
commit | 2deadc6cfbf71e06908963fb1bae628cfe370f9d (patch) | |
tree | d737d2e1e9cfde305840179680610d015f5dbf0e /taglistmodel.cpp | |
parent | 752f270cf81bc8c88cb4bf428e5aceb51405c06a (diff) | |
download | numberator-2deadc6cfbf71e06908963fb1bae628cfe370f9d.tar.gz numberator-2deadc6cfbf71e06908963fb1bae628cfe370f9d.tar.bz2 numberator-2deadc6cfbf71e06908963fb1bae628cfe370f9d.zip |
Basic model/view action works
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
|