Skip to content

Commit

Permalink
Add support for Qt smart pointers (myint#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
christarazi authored and myint committed Mar 4, 2018
1 parent 935aeef commit 4bb45d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cpp/find_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ def _add_template_use(name, types, namespace, reference=False):
# These are things like auto_ptr which do
# not require the class definition, only decl.
_add_reference(cls.name, namespace)
elif name.startswith('Q') and name.endswith("Pointer"):
# Special case templated classes from the Qt framework.
_add_reference(cls.name, namespace)
else:
_add_use(cls.name, namespace)
_add_template_use(cls.name, cls.templated_types,
Expand Down
10 changes: 10 additions & 0 deletions test/qt.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class QSomeClass;

class QSomeOtherClass {
QPointer<QSomeClass> ptr1;
QSharedDataPointer<QSomeClass> ptr2;
QSharedPointer<QSomeClass> ptr3;
QWeakPointer<QSomeClass> ptr4;
QScopedPointer<QSomeClass> ptr5;
QScopedArrayPointer<QSomeClass> ptr6;
};

0 comments on commit 4bb45d6

Please sign in to comment.