KeysFiles: fix WalletKeysFilesModel, should be instantiable QML type

This commit is contained in:
xiphon
2020-07-14 01:45:34 +00:00
parent c137a6ea36
commit 13ee9b1f26
4 changed files with 19 additions and 17 deletions

View File

@@ -56,6 +56,8 @@ private:
class WalletKeysFilesModel : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(QSortFilterProxyModel *proxyModel READ proxyModel NOTIFY proxyModelChanged)
public:
enum KeysFilesRoles {
FileNameRole = Qt::UserRole + 1,
@@ -74,16 +76,20 @@ public:
void addWalletKeysFile(const WalletKeysFiles &walletKeysFile);
int rowCount(const QModelIndex & parent = QModelIndex()) const;
QSortFilterProxyModel &proxyModel();
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
QHash<int, QByteArray> roleNames() const;
private:
QSortFilterProxyModel *proxyModel();
protected:
signals:
void proxyModelChanged() const;
private:
QList<WalletKeysFiles> m_walletKeyFiles;
QAbstractItemModel *m_walletKeysFilesItemModel;
QSortFilterProxyModel m_walletKeysFilesModelProxy;
};