QRangeModel::RowOptions Struct

template <typename T> struct QRangeModel::RowOptions

RowOptions 模板提供了一个自定义点,用于控制QRangeModel 如何表示用作行的类型。更多

此结构在 Qt 6.10 中引入。

详细说明

为您的 range 中使用的类型专门化此模板,并添加相关成员。

成员
static constexprRowCategory rowCategoryRowCategory
class ColorEntry
{
    Q_GADGET
    Q_PROPERTY(QString display MEMBER m_colorName)
    Q_PROPERTY(QColor decoration READ decoration)
    Q_PROPERTY(QString toolTip READ toolTip)
public:
    ...
};
template <>
struct QRangeModel::RowOptions<ColorEntry>
{
    static constexpr auto rowCategory = QRangeModel::RowCategory::MultiRoleItem;
};

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.