1 | /**************************************************************************** |
2 | * Copyright (C) 2012-2016 Woboq GmbH |
3 | * Olivier Goffart <contact at woboq.com> |
4 | * https://woboq.com/codebrowser.html |
5 | * |
6 | * This file is part of the Woboq Code Browser. |
7 | * |
8 | * Commercial License Usage: |
9 | * Licensees holding valid commercial licenses provided by Woboq may use |
10 | * this file in accordance with the terms contained in a written agreement |
11 | * between the licensee and Woboq. |
12 | * For further information see https://woboq.com/codebrowser.html |
13 | * |
14 | * Alternatively, this work may be used under a Creative Commons |
15 | * Attribution-NonCommercial-ShareAlike 3.0 (CC-BY-NC-SA 3.0) License. |
16 | * http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_US |
17 | * This license does not allow you to use the code browser to assist the |
18 | * development of your commercial software. If you intent to do so, consider |
19 | * purchasing a commercial licence. |
20 | ****************************************************************************/ |
21 | |
22 | #pragma once |
23 | |
24 | namespace clang { |
25 | class CallExpr; |
26 | class NamedDecl; |
27 | class Expr; |
28 | class CXXConstructExpr; |
29 | } |
30 | class Annotator; |
31 | |
32 | |
33 | /** |
34 | * Handle the SIGNAL and SLOT macro within calls to QObject::connect or the like |
35 | * |
36 | * Recognize calls to QObject::connect, QObject::disconnect, QTimer::singleShot |
37 | */ |
38 | struct QtSupport { |
39 | Annotator &annotator; |
40 | clang::NamedDecl *currentContext; |
41 | |
42 | void visitCallExpr(clang::CallExpr *e); |
43 | void visitCXXConstructExpr(clang::CXXConstructExpr* e); |
44 | |
45 | private: |
46 | void handleSignalOrSlot(clang::Expr *obj, clang::Expr *method); |
47 | void handleInvokeMethod(clang::Expr *obj, clang::Expr *method); |
48 | }; |
49 | |