• ChannelPayload
  • ChannelPayload Class

    Represents the metadata for a public chat channel. More...

    Header: #include <ChannelPayload>

    Properties

    Public Functions

    ChannelPayload(const QJsonObject &json)
    QString description() const
    int id() const
    QString name() const
    void setDescription(const QString &description)
    void setId(int id)
    void setName(const QString &name)
    void setSortOrder(int order)
    int sortOrder() const
    bool operator<(const ChannelPayload &other) const
    bool operator==(const ChannelPayload &other) const

    Detailed Description

    ChannelPayload is a simple value type used to represent individual public channels. It provides identifiers, descriptions, and sorting metadata. Instances can be constructed from JSON objects and are used to populate channel-related models.

    See also ChannelModel.

    Property Documentation

    description : QString

    Returns the description of the channel.

    Access functions:

    QString description() const
    void setDescription(const QString &description)

    id : int

    Returns the channel ID.

    Access functions:

    int id() const
    void setId(int id)

    name : QString

    Returns the name of the channel.

    Access functions:

    QString name() const
    void setName(const QString &name)

    sortOrder : int

    Returns the sort order used to organize channels.

    Access functions:

    int sortOrder() const
    void setSortOrder(int order)

    Member Function Documentation

    [explicit] ChannelPayload::ChannelPayload(const QJsonObject &json)

    Constructs a ChannelPayload by parsing a json object.

    Extracts values for id, name, description, and sort_order if present.

    void ChannelPayload::setDescription(const QString &description)

    Sets the channel description to description.

    Note: Setter function for property description.

    See also description().

    void ChannelPayload::setId(int id)

    Sets the channel ID to id.

    Note: Setter function for property id.

    See also id().

    void ChannelPayload::setName(const QString &name)

    Sets the name of the channel to name.

    Note: Setter function for property name.

    See also name().

    void ChannelPayload::setSortOrder(int order)

    Sets the channel's sort order to order.

    Note: Setter function for property sortOrder.

    See also sortOrder().

    bool ChannelPayload::operator<(const ChannelPayload &other) const

    Returns true if this channel should be ordered before other based on sort order.

    bool ChannelPayload::operator==(const ChannelPayload &other) const

    Returns true if this payload represents the same channel as other.