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
QGenericItemModel::MultiColumn< T > Class Template Reference

Represents the wrapped type {T} as multiple columns in a QGenericItemModel. More...

#include <qgenericitemmodel.h>

+ Collaboration diagram for QGenericItemModel::MultiColumn< T >:

Public Types

using type = std::remove_pointer_t<T>
 
template<typename X>
using if_get_matches
 

Public Member Functions

template<typename V = T, std::enable_if_t< QGenericItemModelDetails::is_validatable< V >::value, bool > = true>
constexpr operator bool () const noexcept
 

Public Attributes

data {}
 

Friends

template<std::size_t I, typename V, if_get_matches< V > = true>
decltype(auto) get (V &&multiColumn)
 

Detailed Description

template<typename T>
class QGenericItemModel::MultiColumn< T >

Represents the wrapped type {T} as multiple columns in a QGenericItemModel.

\inmodule QtCore

Since
6.10

Use this type to disambiguate when the type {T} has both a metaobject, and implements \l{the C++ tuple protocol}. The type will be represented as multiple columns, and the individual values will be accessed through the tuple protocol.

{
Q_PROPERTY(QString display MEMBER m_colorName)
Q_PROPERTY(QString toolTip READ toolTip)
public:
ColorEntry(const QString &color = {})
: m_colorName(color)
{}
QColor decoration() const
{
return QColor::fromString(m_colorName);
}
QString toolTip() const
{
return QColor::fromString(m_colorName).name();
}
private:
QString m_colorName;
};
namespace std {
template <> struct tuple_size<ColorEntry> : integral_constant<size_t, 3> {};
// ...
}
// ...
};
QGenericItemModel(Range &&range, QObject *parent=nullptr)
Definition qlist.h:80
static QT_BEGIN_NAMESPACE const QRgb colors[][14]

To represent the type a single column value with multiple roles, use QGenericItemModel::SingleColumn instead.

See also
QGenericItemModel::SingleColumn

Definition at line 19 of file qgenericitemmodel.h.

Member Typedef Documentation

◆ if_get_matches

template<typename T>
template<typename X>
using QGenericItemModel::MultiColumn< T >::if_get_matches
Initial value:
std::enable_if_t<std::is_same_v<q20::remove_cvref_t<X>,
Represents the wrapped type {T} as multiple columns in a QGenericItemModel.

Definition at line 24 of file qgenericitemmodel.h.

◆ type

template<typename T>
using QGenericItemModel::MultiColumn< T >::type = std::remove_pointer_t<T>

Definition at line 21 of file qgenericitemmodel.h.

Member Function Documentation

◆ operator bool()

template<typename T>
template<typename V = T, std::enable_if_t< QGenericItemModelDetails::is_validatable< V >::value, bool > = true>
QGenericItemModel::MultiColumn< T >::operator bool ( ) const
inlineexplicitconstexprnoexcept

Definition at line 29 of file qgenericitemmodel.h.

Friends And Related Symbol Documentation

◆ get

template<typename T>
template<std::size_t I, typename V, if_get_matches< V > = true>
decltype(auto) get ( V && multiColumn)
friend

Definition at line 33 of file qgenericitemmodel.h.

Member Data Documentation

◆ data

template<typename T>
T QGenericItemModel::MultiColumn< T >::data {}

Definition at line 22 of file qgenericitemmodel.h.


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