1 | /* |
2 | SPDX-FileCopyrightText: 2006-2007 Kevin Ottens <ervin@kde.org> |
3 | |
4 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
5 | */ |
6 | |
7 | #ifndef SOLID_SOLIDDEFS_P_H |
8 | #define SOLID_SOLIDDEFS_P_H |
9 | |
10 | // clang-format off |
11 | |
12 | #define return_SOLID_CALL(Type, Object, Default, Method) \ |
13 | Type t = qobject_cast<Type>(Object); \ |
14 | if (t!=nullptr) \ |
15 | { \ |
16 | return t->Method; \ |
17 | } \ |
18 | else \ |
19 | { \ |
20 | return Default; \ |
21 | } |
22 | |
23 | #define SOLID_CALL(Type, Object, Method) \ |
24 | Type t = qobject_cast<Type>(Object); \ |
25 | if (t!=nullptr) \ |
26 | { \ |
27 | t->Method; \ |
28 | } |
29 | |
30 | #endif |
31 | |