2021-02-08 Fred Gleason <fredg@paravelsystems.com>

* Refactored the library list in the 'Edit Event' dialog in
	rdlogmanger(1) to use the model based API.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2021-02-08 09:39:12 -05:00
parent 3762d6b4f1
commit 33aa5bfb07
17 changed files with 183 additions and 286 deletions

View File

@@ -168,6 +168,25 @@ QString RDGroupListModel::groupName(const QModelIndex &row) const
}
QStringList RDGroupListModel::allGroupNames() const
{
QStringList ret;
if(d_show_all) {
for(int i=1;i<d_texts.size();i++) {
ret.push_back(d_texts.at(i).at(0).toString());
}
}
else {
for(int i=0;i<d_texts.size();i++) {
ret.push_back(d_texts.at(i).at(0).toString());
}
}
return ret;
}
QModelIndex RDGroupListModel::addGroup(const QString &grpname)
{
//

View File

@@ -44,6 +44,7 @@ class RDGroupListModel : public QAbstractTableModel
int role=Qt::DisplayRole) const;
QVariant data(const QModelIndex &index,int role=Qt::DisplayRole) const;
QString groupName(const QModelIndex &row) const;
QStringList allGroupNames() const;
QModelIndex addGroup(const QString &name);
QModelIndex renameGroup(const QString &oldname,const QString &newname);
void removeGroup(const QModelIndex &row);