summaryrefslogtreecommitdiffstats
path: root/tests/manual/corelib/tools/customtypesending/message.h
blob: b16c92f177c43df048fd750b05c230b2f3d542df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#ifndef MESSAGE_H
#define MESSAGE_H

#include <QMetaType>
#include <QStringList>

//! [custom type definition]
class Message
{
public:
    Message() = default;
    ~Message() = default;
    Message(const Message &) = default;
    Message &operator=(const Message &) = default;

    Message(const QString &body, const QStringList &headers);

    QString body() const;
    QStringList headers() const;

private:
    QString m_body;
    QStringList m_headers;
};
//! [custom type definition]

//! [custom type meta-type declaration]
Q_DECLARE_METATYPE(Message);
//! [custom type meta-type declaration]

#endif