From 69f3ab019d4ef9e28d0c7e3c4ce3a609a6ff0a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 18 Sep 2016 22:53:37 +0200 Subject: NOISSUE delete dead code --- api/dead/src/resources/ResourceProxyModel.h | 39 ----------------------------- 1 file changed, 39 deletions(-) delete mode 100644 api/dead/src/resources/ResourceProxyModel.h (limited to 'api/dead/src/resources/ResourceProxyModel.h') diff --git a/api/dead/src/resources/ResourceProxyModel.h b/api/dead/src/resources/ResourceProxyModel.h deleted file mode 100644 index 98a3dbd1..00000000 --- a/api/dead/src/resources/ResourceProxyModel.h +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -#include -#include - -#include "multimc_logic_export.h" - -/// Convenience proxy model that transforms resource identifiers (strings) for Qt::DecorationRole into other types. -class MULTIMC_LOGIC_EXPORT ResourceProxyModel : public QIdentityProxyModel -{ - Q_OBJECT -public: - // resultTypeId is found using qMetaTypeId() - explicit ResourceProxyModel(const int resultTypeId, QObject *parent = nullptr); - - enum - { - // provide this role from your model if you want to show a placeholder - PlaceholderRole = Qt::UserRole + 0xabc // some random offset to not collide with other stuff - }; - - QVariant data(const QModelIndex &proxyIndex, int role) const override; - void setSourceModel(QAbstractItemModel *model) override; - - /// Helper function, usage: m_view->setModel(ResourceProxyModel::mixin(m_model)); - template - static QAbstractItemModel *mixin(QAbstractItemModel *model) - { - ResourceProxyModel *proxy = new ResourceProxyModel(qMetaTypeId(), model); - proxy->setSourceModel(model); - return proxy; - } - -private: - // mutable because it needs to be available from the const data() - mutable QMap> m_resources; - - const int m_resultTypeId; -}; -- cgit v1.2.3