Declare ResourceId Qt metatype in public header so it's QVariant'able

This commit is contained in:
baldurk
2017-11-17 16:30:55 +00:00
parent 25de6726f6
commit 1776b4e6c0
7 changed files with 8 additions and 10 deletions
@@ -34,8 +34,6 @@
#include "PipelineStateViewer.h"
#include "ui_D3D11PipelineStateViewer.h"
Q_DECLARE_METATYPE(ResourceId);
struct D3D11VBIBTag
{
D3D11VBIBTag() { offset = 0; }
@@ -34,8 +34,6 @@
#include "PipelineStateViewer.h"
#include "ui_D3D12PipelineStateViewer.h"
Q_DECLARE_METATYPE(ResourceId);
struct D3D12VBIBTag
{
D3D12VBIBTag() { offset = 0; }
@@ -33,8 +33,6 @@
#include "PipelineStateViewer.h"
#include "ui_GLPipelineStateViewer.h"
Q_DECLARE_METATYPE(ResourceId);
struct GLVBIBTag
{
GLVBIBTag() { offset = 0; }
@@ -33,7 +33,6 @@
#include "PipelineStateViewer.h"
#include "ui_VulkanPipelineStateViewer.h"
Q_DECLARE_METATYPE(ResourceId);
Q_DECLARE_METATYPE(SamplerData);
struct VulkanVBIBTag
-2
View File
@@ -30,8 +30,6 @@
static const int ResourceIdRole = Qt::UserRole;
static const int FilterRole = Qt::UserRole + 1;
Q_DECLARE_METATYPE(ResourceId);
class ResourceListItemModel : public QAbstractItemModel
{
public:
-1
View File
@@ -55,7 +55,6 @@ float aspect(const QSizeF &s)
}
Q_DECLARE_METATYPE(Following);
Q_DECLARE_METATYPE(ResourceId);
const Following Following::Default = Following();
+8
View File
@@ -372,6 +372,10 @@ struct ResourceId
bool operator!=(const ResourceId u) const { return id != u.id; }
DOCUMENT("Compares two ``ResourceId`` objects for less-than.");
bool operator<(const ResourceId u) const { return id < u.id; }
#if defined(RENDERDOC_QT_COMPAT)
operator QVariant() const { return QVariant::fromValue(*this); }
#endif
private:
uint64_t id;
@@ -380,6 +384,10 @@ private:
#endif
};
#if defined(RENDERDOC_QT_COMPAT)
Q_DECLARE_METATYPE(ResourceId);
#endif
DECLARE_REFLECTION_STRUCT(ResourceId);
#include "capture_options.h"