BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ModelView::DataRole Class Reference

Represents pair of data,role for SessionItemData. More...

Public Member Functions

 DataRole (Variant data=Variant(), int role=-1)
 
bool operator== (const DataRole &other) const
 

Public Attributes

Variant m_data
 
int m_role
 

Detailed Description

Represents pair of data,role for SessionItemData.

Definition at line 25 of file datarole.h.

Constructor & Destructor Documentation

◆ DataRole()

DataRole::DataRole ( Variant  data = Variant(),
int  role = -1 
)

Definition at line 20 of file datarole.cpp.

20 : m_data(std::move(data)), m_role(role) {}

Member Function Documentation

◆ operator==()

bool DataRole::operator== ( const DataRole other) const

Definition at line 22 of file datarole.cpp.

23 {
24  return m_role == other.m_role && Utils::IsTheSame(m_data, other.m_data);
25 }
MVVM_MODEL_EXPORT bool IsTheSame(const Variant &var1, const Variant &var2)
Returns true if given variants have same type and value.

References ModelView::Utils::IsTheSame(), m_data, and m_role.

Here is the call graph for this function:

Member Data Documentation

◆ m_data

Variant ModelView::DataRole::m_data

Definition at line 28 of file datarole.h.

Referenced by operator==().

◆ m_role

int ModelView::DataRole::m_role

Definition at line 29 of file datarole.h.

Referenced by operator==().


The documentation for this class was generated from the following files: