2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2014-01-17 12:49:41 +00:00
|
|
|
|
|
|
|
#ifndef FUNCTION_WITH_ATTRIBUTES_H
|
|
|
|
#define FUNCTION_WITH_ATTRIBUTES_H
|
2012-10-01 09:57:53 +00:00
|
|
|
#include <qobject.h>
|
|
|
|
|
|
|
|
// test support for gcc attributes with functions
|
|
|
|
|
|
|
|
#if defined(Q_CC_GNU) || defined(Q_MOC_RUN)
|
2013-09-23 19:28:54 +00:00
|
|
|
#define DEPRECATED1 __attribute__ ((__deprecated__))
|
2012-10-01 09:57:53 +00:00
|
|
|
#else
|
2013-09-23 19:28:54 +00:00
|
|
|
#define DEPRECATED1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Q_CC_MSVC) || defined(Q_MOC_RUN)
|
|
|
|
#define DEPRECATED2 __declspec(deprecated)
|
|
|
|
#else
|
|
|
|
#define DEPRECATED2
|
2012-10-01 09:57:53 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
class FunctionWithAttributes : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public slots:
|
2013-09-23 19:28:54 +00:00
|
|
|
DEPRECATED1 void test1() {}
|
|
|
|
DEPRECATED2 void test2() {}
|
2012-10-01 09:57:53 +00:00
|
|
|
|
|
|
|
};
|
2014-01-17 12:49:41 +00:00
|
|
|
#endif // FUNCTION_WITH_ATTRIBUTES_H
|