Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QRangeModelImpl< Structure, Range, Protocol >::Compare Struct Reference

#include <qrangemodel_impl.h>

Collaboration diagram for QRangeModelImpl< Structure, Range, Protocol >::Compare:

Public Types

template<typename C, typename LessThan>
using sortMember_test = decltype(std::declval<C&>().sort(std::declval<LessThan &&>()))
template<typename Stringish>
using collatedCompare_test

Public Member Functions

 Compare (const QRangeModelImpl *impl, int column, Qt::SortOrder order)
template<typename Item>
auto operator() (const Item &lhs, const Item &rhs) const
template<typename Item>
auto compare (const Item &lhs, const Item &rhs) const
bool checkComparable () const

Static Public Member Functions

template<typename Item>
static std::optional< bool > compareInvalid (const Item &lhs, const Item &rhs)

Public Attributes

const QRangeModelImpl *const that
const QModelIndex m_index
const QCollator *const collator
const Qt::SortOrder m_order
const int m_sortRole

Static Public Attributes

static constexpr bool hasSortMember = qxp::is_detected_v<sortMember_test, range_type, Compare>
template<typename Stringish>
static constexpr bool hasCollatedCompare

Detailed Description

template<typename Structure, typename Range, typename Protocol = QRangeModelDetails::table_protocol_t<Range>>
struct QRangeModelImpl< Structure, Range, Protocol >::Compare

Definition at line 1965 of file qrangemodel_impl.h.

Member Typedef Documentation

◆ collatedCompare_test

template<typename Structure, typename Range, typename Protocol = QRangeModelDetails::table_protocol_t<Range>>
template<typename Stringish>
using QRangeModelImpl< Structure, Range, Protocol >::Compare::collatedCompare_test
Initial value:
decltype(
std::declval<const QCollator&>().compare(std::declval<const Stringish&>(),
std::declval<const Stringish&>())
)

Definition at line 1972 of file qrangemodel_impl.h.

◆ sortMember_test

template<typename Structure, typename Range, typename Protocol = QRangeModelDetails::table_protocol_t<Range>>
template<typename C, typename LessThan>
using QRangeModelImpl< Structure, Range, Protocol >::Compare::sortMember_test = decltype(std::declval<C&>().sort(std::declval<LessThan &&>()))

Definition at line 1968 of file qrangemodel_impl.h.

Constructor & Destructor Documentation

◆ Compare()

template<typename Structure, typename Range, typename Protocol = QRangeModelDetails::table_protocol_t<Range>>
QRangeModelImpl< Structure, Range, Protocol >::Compare::Compare ( const QRangeModelImpl * impl,
int column,
Qt::SortOrder order )
inline

Definition at line 1981 of file qrangemodel_impl.h.

References Compare(), m_sortRole, and that.

Referenced by Compare().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ checkComparable()

template<typename Structure, typename Range, typename Protocol = QRangeModelDetails::table_protocol_t<Range>>
bool QRangeModelImpl< Structure, Range, Protocol >::Compare::checkComparable ( ) const
inline

Definition at line 2037 of file qrangemodel_impl.h.

References that.

◆ compare()

template<typename Structure, typename Range, typename Protocol = QRangeModelDetails::table_protocol_t<Range>>
template<typename Item>
auto QRangeModelImpl< Structure, Range, Protocol >::Compare::compare ( const Item & lhs,
const Item & rhs ) const
inline

Definition at line 1995 of file qrangemodel_impl.h.

References m_sortRole.

◆ compareInvalid()

template<typename Structure, typename Range, typename Protocol = QRangeModelDetails::table_protocol_t<Range>>
template<typename Item>
std::optional< bool > QRangeModelImpl< Structure, Range, Protocol >::Compare::compareInvalid ( const Item & lhs,
const Item & rhs )
inlinestatic

Definition at line 2061 of file qrangemodel_impl.h.

◆ operator()()

template<typename Structure, typename Range, typename Protocol = QRangeModelDetails::table_protocol_t<Range>>
template<typename Item>
auto QRangeModelImpl< Structure, Range, Protocol >::Compare::operator() ( const Item & lhs,
const Item & rhs ) const
inline

Definition at line 1988 of file qrangemodel_impl.h.

Member Data Documentation

◆ collator

template<typename Structure, typename Range, typename Protocol = QRangeModelDetails::table_protocol_t<Range>>
const QCollator* const QRangeModelImpl< Structure, Range, Protocol >::Compare::collator

Definition at line 2073 of file qrangemodel_impl.h.

◆ hasCollatedCompare

template<typename Structure, typename Range, typename Protocol = QRangeModelDetails::table_protocol_t<Range>>
template<typename Stringish>
bool QRangeModelImpl< Structure, Range, Protocol >::Compare::hasCollatedCompare
staticconstexpr
Initial value:
Stringish>
constexpr bool is_detected_v
decltype( std::declval< const QCollator & >().compare(std::declval< const Stringish & >(), std::declval< const Stringish & >())) collatedCompare_test

Definition at line 1977 of file qrangemodel_impl.h.

◆ hasSortMember

template<typename Structure, typename Range, typename Protocol = QRangeModelDetails::table_protocol_t<Range>>
bool QRangeModelImpl< Structure, Range, Protocol >::Compare::hasSortMember = qxp::is_detected_v<sortMember_test, range_type, Compare>
staticconstexpr

Definition at line 1969 of file qrangemodel_impl.h.

◆ m_index

template<typename Structure, typename Range, typename Protocol = QRangeModelDetails::table_protocol_t<Range>>
const QModelIndex QRangeModelImpl< Structure, Range, Protocol >::Compare::m_index

Definition at line 2072 of file qrangemodel_impl.h.

◆ m_order

template<typename Structure, typename Range, typename Protocol = QRangeModelDetails::table_protocol_t<Range>>
const Qt::SortOrder QRangeModelImpl< Structure, Range, Protocol >::Compare::m_order

Definition at line 2074 of file qrangemodel_impl.h.

◆ m_sortRole

template<typename Structure, typename Range, typename Protocol = QRangeModelDetails::table_protocol_t<Range>>
const int QRangeModelImpl< Structure, Range, Protocol >::Compare::m_sortRole

Definition at line 2075 of file qrangemodel_impl.h.

Referenced by Compare(), and compare().

◆ that

template<typename Structure, typename Range, typename Protocol = QRangeModelDetails::table_protocol_t<Range>>
const QRangeModelImpl* const QRangeModelImpl< Structure, Range, Protocol >::Compare::that

Definition at line 2071 of file qrangemodel_impl.h.

Referenced by Compare(), and checkComparable().


The documentation for this struct was generated from the following file: